// JavaScript Document
var xmlHttp

//makes ajax call
function ajaxCall(path,div,div2,query) {

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url=path+"?"+query;

	xmlHttp.onreadystatechange= function() {
		if (xmlHttp.readyState==4) {
			if (xmlHttp.responseText !== "") {
				document.getElementById(div).innerHTML=xmlHttp.responseText;
				document.getElementById(div).style.display="block";
				document.getElementById(div2).focus();
				document.getElementById(div2).className='required';
			} else {
				document.getElementById(div).innerHTML="";
				document.getElementById(div).style.display="none";
				document.getElementById(div2).className='';
			}
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
	
//get Ajax object
function GetXmlHttpObject() {
	var xmlHttp=null;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}