
// For all scripts running on AJAX online if and only if AJAX to runned more than once in a same form.somesh
// Start
function showHint1(str,sitename,geturl) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url=sitename+geturl;
	url=url+"&q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged1;	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null)
}
// End


function stateChanged1() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById("txtHint1").innerHTML=xmlHttp.responseText;
	} 
}

function GetXmlHttpObject() { 
	var objXMLHttp=null;
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return (objXMLHttp);
} 


////////////////////////////////ajax chk//////////////
var xmlHttp 
function Check_Availability1(url, displayitem) {	
	xmlHttp=GetXmlHttpObject();
	//document.getElementById(displayitem).innerHTML="Loading............";
	if (xmlHttp==null) {	
		alert ("Your browser does not support AJAX!");
		return;
	} 
	url =url+"&sid="+Math.random();		
	xmlHttp.onreadystatechange=function stateChanged() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {			
			if(xmlHttp.responseText.length>0) {			
				document.getElementById("txtHint").innerHTML=xmlHttp.responseText;							
				if (xmlHttp.responseText=="<font color=red>incorrect Email ID</font>" || xmlHttp.responseText=="<font color=red>Email ID already exist.</font>") {			
					document.joinForm.username.focus();
					document.getElementById('txtHint').style.display = 'block'; 
					return false;
				}
			}
			else {
				document.getElementById("txtHint").innerHTML="";
				document.getElementById('txtHint').style.display = 'none'; 
			}
		}
	};
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}