var path="images/"; 
function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		} 	
		return xmlhttp;
} 

function loading(Str){  
var img_str=path+"loading.gif";   
return '<img src='+img_str+' alt="" width="16" height="16" class="Load_AlignMid" hspace="3" />' + '<font class="load_font">'+Str+'</font>'; 
} 
function trimtext(str) {
   var trimmed = str.replace(/^\s+|\s+$/g, '') ;
   return trimmed;
}  
function getContent(url,val,divid,div_tag) {  
		//alert(url);
		//if(val=="") return false;
		var strURL=url+val;  
		div_tag = typeof(div_tag) != 'undefined' ? div_tag : 1;  
		//if(div_tag!="0") window.document.getElementById(divid).innerHTML = loading("Loading..."); 		
		var req = getXMLHTTP();  
		if (req) { 
		 
			req.onreadystatechange = function() {
				if (req.readyState == 4) { 
				     // alert(req.responseText);
					// only if "OK" req.responseText  
					if (req.status == 200) {    
						if(div_tag=="1"){window.document.getElementById(divid).innerHTML=req.responseText;} 
						else{window.document.getElementById(divid).value=trimtext(req.responseText); }
						//tb_init('a.thickbox, area.thickbox, input.thickbox');
						
					} else {
						alert("There was a problem while getting information from server.Please try later.:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
 function popup_file(url,width,height) {
	newwindow=window.open(url,'name','titlebar=no,toolbar=no,resizable=yes,scrollbars=yes,width='+width+',height='+height+',left=400,top=100' );
 }

	
 
