var xmlHttp;
var display_id;
var load_id;
var title;
var title1;
var url1;
var tr_id;
function ajax_validation(url,disp_id,tag_id,trid)
{
	//document.getElementById(trid).className = "click";
	document.getElementById(disp_id).style.display="block";
	title=document.getElementById(tag_id).value;
	title = title.replace(/ /g,"~~~");
	display_id = disp_id;
	tr_id=trid;
	var url2=url+"?tag_id="+tag_id+"&entered="+title;
	xmlHttp=CreateHttpObject();
	if(xmlHttp == null)
	{
		alert("Your browser doesn't support HTTP request");
		return 
	}
	xmlHttp.onreadystatechange=stateChanged1
	xmlHttp.open("GET",url2,true)
	xmlHttp.send(null)
}


function ajax_validationpass(url,disp_id,tag_id,tag_id1,trid)
{
	//document.getElementById(trid).className = "click";
	document.getElementById(disp_id).style.display="block";
	title=document.getElementById(tag_id).value;
	title1=document.getElementById(tag_id1).value;
	title = title.replace(/ /g,"~~~");
	title1 = title1.replace(/ /g,"~~~");
	display_id = disp_id;
	tr_id=trid;
	var url2=url+"?tag_id="+tag_id+"&entered="+title+"&entered1="+title1;
	xmlHttp=CreateHttpObject();
	if(xmlHttp == null)
	{
		alert("Your browser doesn't support HTTP request");
		return 
	}
	xmlHttp.onreadystatechange=stateChanged1 
	xmlHttp.open("GET",url2,true)
	xmlHttp.send(null)
}

function ajax_validationlogpass(url,disp_id,tag_id,tag_id1,trid)
{
	//document.getElementById(trid).className = "click";
	document.getElementById(disp_id).style.display="block";
	title=document.getElementById(tag_id).value;
	title1=document.getElementById(tag_id1).value;
	title = title.replace(/ /g,"~~~");
	title1 = title1.replace(/ /g,"~~~");
	display_id = disp_id;
	tr_id=trid;
	var url2=url+"?tag_id="+tag_id+"&entered="+title+"&entered1="+title1;
	xmlHttp=CreateHttpObject();
	if(xmlHttp == null)
	{
		alert("Your browser doesn't support HTTP request");
		return 
	}
	xmlHttp.onreadystatechange=stateChanged1 
	xmlHttp.open("GET",url2,true)
	xmlHttp.send(null)
}

function forgot_pwd(url,disp_id,tag_id)
{
	document.getElementById(disp_id).style.display="block";
	title=document.getElementById(tag_id).value;
	title = title.replace(/ /g,"~~~");
	display_id = disp_id;
	
	var url2=url+"?entered="+title;
	xmlHttp=CreateHttpObject();
	if(xmlHttp == null)
	{
		alert("Your browser doesn't support HTTP request");
		return 
	}
	xmlHttp.onreadystatechange=stateChanged2
	xmlHttp.open("GET",url2,true)
	xmlHttp.send(null)
}


function stateChanged1()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		
		document.getElementById(display_id).style.display = "block";
		document.getElementById(display_id).innerHTML = xmlHttp.responseText;
		if(xmlHttp.responseText=="")
		{
			document.getElementById(tr_id).className = "";
		}
	}
}

function stateChanged2()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		
		document.getElementById(display_id).style.display = "block";
		document.getElementById(display_id).innerHTML = xmlHttp.responseText;
		
	}
}

function CreateHttpObject()
{
	var xmlHttp=null;
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{

		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
	}
	return xmlHttp;
}

