var parameters;
ajaxCaller.shouldDebug = false;
ajaxCaller.shouldEscapeVars = false;
ajaxCaller.shouldMakeHeaderMap = true;

function getXmlData(url,callbackFunction){
	showLoading();
	ajaxCaller.getXML(url, callbackFunction);
}

function postXmlData(url,xmlstring,callbackFunction,isXmlData){
	showLoading();
	ajaxCaller.postForXML(url,xmlstring,callbackFunction,isXmlData);
}
function onXMLResponse(xmlResponse, headers, callingContext){
	var nodes,mySelect,Default,XmlResponseCtrl;	
			
		nodes= xmlResponse.selectNodes(parameters["node"]);
		mySelect = document.getElementById(parameters["controlId"]);
		Default=parameters["Default"]
		XmlResponseCtrl=parameters["XmlResponseCtrl"]
		if (XmlResponseCtrl!="" && XmlResponseCtrl!=null){
			document.getElementById(XmlResponseCtrl).value=xmlResponse.xml;
		}	
		
		mySelect.innerText="";
		if (Default!=""){
			var o = new Option();
			o.text = Default;
			o.value = "-1";				
			mySelect.add(o) ;
		}
		else if(nodes.length>1)
		{
			var o = new Option();
			o.text = "--Select--";
			o.value = "-1";				
			mySelect.add(o) ;
		}
		for (var i=0; i<nodes.length; i++)	{						
			var o = new Option();
			o.text = nodes(i).text;
			o.value = nodes(i).attributes(0).value;	
			mySelect.add(o) ;				
		}
	
	hideLoading();
}		

function showLoading(width, height, left, top){
	var newdiv;
	if (document.getElementById("divLoad")==null)
	{
		newdiv = document.createElement('div');
		newdiv.setAttribute('id', 'divLoad');
		if (width) 
			newdiv.style.width = width;
		else
			newdiv.style.width = 250;
		   
		if (height) 
			newdiv.style.height = height;
		else
			newdiv.style.height = 40;

		if ((left || top) || (left && top)) 
		{
			newdiv.style.position = "absolute";
			if (left){
					newdiv.style.left = left;
				}
			if (top){
					newdiv.style.top = top;
				}
		}
		else
		{
			newdiv.style.left = 250;
			newdiv.style.top = 250;
			newdiv.style.position = "absolute";
		}	   
		newdiv.style.background = "#f9f9fa";
		newdiv.style.border = "2px solid #000";
		newdiv.style.fontSize = "10px";
		newdiv.style.textAlign="center";
		document.body.appendChild(newdiv);
	}
	else
	{		
		newdiv=document.getElementById("divLoad");
		document.getElementById("divLoad").style.display='';
	}
	newdiv.innerHTML = "Please Wait Data Loading........";	
  }
  
function hideLoading()
{
	if (document.getElementById("divLoad")!=null)
		document.getElementById("divLoad").style.display='none';
}		