// JavaScript Document
var xmlHttp;
function checker(str)
{	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Your Browser does not support AJAX");	
	}
	var url="checkfr.php";
		url=url+"?q="+str;
		url=url+"&sid="+Math.random();
		
		xmlHttp.onreadystatechange=stateChangedd;
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);
}
//--------------------------------------------------------
function stateChangedd()
{
	if(xmlHttp.readyState==4)
	{
		document.getElementById('checknom').innerHTML=xmlHttp.responseText;
		if(document.getElementById('checknom').innerHTML=='Invalid Franchisee code')
		{
			document.MailForm.franchisee.focus();
			return false;
		}
	}
	else
	{
		document.getElementById("checknom").innerHTML="Loading....";	
	}
	
}
//----------------------------------------------------------
function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		xmlHttp = new XMLHttpRequest();	
	}
	catch(e)
	{
		try
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");	
		}
		catch(e)
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTT");
		}
	}
	return xmlHttp;
}
