///////////////////////////////////////////////////
function trimSpaces(inputStr){
	var len=inputStr.length;
	var i=0;
	while(i<len && inputStr.charAt(i)==" ") i++;
	var j=len-1;
	while(j>=0 && inputStr.charAt(j)==" ") j--;
	if (i<=j) // not empty
		return inputStr.substring(i,j+1);
	else
		return "";
}
function checkSubmit(theForm){
	uname =trimSpaces(theForm.Name.value);
	pword =trimSpaces(theForm.Password.value);
	if (uname==""){
		alert("Please enter the username");
		theForm.Name.focus();
		return false;
	}else if (pword==""){
		alert("Please enter the password")
		theForm.Password.focus();
		return false;
	}else return true;
}

//////////////////////////////
function hideDiv() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('forget').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.forget.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.forget.style.visibility = 'hidden'; 
} 
} 
} 
function showDiv() {
//document.getElementById("txtHint").innerHTML="";

if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('forget').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.forget.visibility = 'visible'; 
} 
else { // IE 4 
document.all.forget.style.visibility = 'visible'; 
} 
} 
}



/////////////////////////////////////////////////////
var xmlHttpCL
function forget()
{
xmlHttpCL=GetXmlHttpObject()
if (xmlHttpCL==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
mail		=document.getElementById('email').value;
var url="admin/ForGet.php"
url=url+"?email="+mail+"&co=1"
xmlHttpCL.onreadystatechange=stateChangedCL
xmlHttpCL.open("POST",url,true)
xmlHttpCL.send(null)
}

function stateChangedCL() 
{ 
hideDiv();
if(xmlHttpCL.readyState == 0)
	{document.getElementById("txtHint").innerHTML= "loading..please wait";	}
if(xmlHttpCL.readyState == 1)
	{document.getElementById("txtHint").innerHTML= "loading..please wait";	}
if(xmlHttpCL.readyState == 2)
	{document.getElementById("txtHint").innerHTML= "loading..please wait";	}
if(xmlHttpCL.readyState == 3)
	{document.getElementById("txtHint").innerHTML= "loading..please wait";	}
if (xmlHttpCL.readyState == 4 || xmlHttpCL.readyState=="complete")
if (xmlHttpCL.status==200)
 	{document.getElementById("txtHint").innerHTML=xmlHttpCL.responseText } 
 }
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;
}
