


function getData(url,whatDiv)
{
	var xmlHttpGetObject
	xmlHttpGetObject=GetXMLHttpObject();
	if (xmlHttpGetObject == null)
	{
		alert("Your Browser does not support AJAX");
		return;
	}
	divName = whatDiv;
	document.getElementById(divName).innerHTML = "Retrieving data please wait...."
	
	xmlHttpGetObject.onreadystatechange=function (){if (xmlHttpGetObject.readyState==4){document.getElementById(whatDiv).innerHTML = xmlHttpGetObject.responseText;}}
	xmlHttpGetObject.open("GET",url,true);
	xmlHttpGetObject.send(null);
	//xmlHttpGetObject.close
	//xmlHttpGetObject = null;
}

function sendData(url,params,whatDiv,responseDiv)
{
	var xmlHttpSendObject
	xmlHttpSendObject=GetXMLHttpObject();
	if (xmlHttpSendObject == null)
	{
		alert("Your Browser does not support AJAX");
		return;
	}

	//xmlHttpObject.onreadystatechange=stateChanged;
	divName = whatDiv;
	document.getElementById(divName).innerHTML = ""
	
	xmlHttpSendObject.onreadystatechange=function (){if (xmlHttpSendObject.readyState==4){document.getElementById(whatDiv).innerHTML = xmlHttpSendObject.responseText;}}
	xmlHttpSendObject.open("POST",url,true);
	xmlHttpSendObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	//xmlHttpObject.setRequestHeader("Content-length", params.length);	
	xmlHttpSendObject.send(params);
	//xmlHttpSendObject.close;
	//xmlHttpSendObject = null;
}



function GetXMLHttpObject()
{ 
	var xmlHttpObject = null;
	try
	{
		xmlHttpObject = new XMLHttpRequest();		
	}
	catch (e)
	{
		try
		{
			xmlHttpObject = new ActiveXObject("Msxml2.XMLHttp");
		}
		catch (e)
		{
			xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
		}	
	}
	return xmlHttpObject;
}

		function calcHeight(iFrameID)
		{
		  var the_height= document.getElementById(iFrameID).contentWindow.document.body.scrollHeight;	
		  document.getElementById(iFrameID).height=the_height + 10;
		}