// JavaScript Document of Login Validation

function validateLoginform()
{

 if (trim(document.loginform.userid.value)=="-Enter User ID-")
	{
		document.loginform.userid.value=""
		alert("Please Enter User ID!");
		document.loginform.userid.focus();
		 return false;
	}
 if (trim(document.loginform.userid.value)=="")
	{
		alert("Please Enter User ID!");
		document.loginform.userid.focus();
		return false;
	}
 if (trim(document.loginform.password.value)=="")
	{
		alert("Please Enter Password!");
		document.loginform.password.focus();
		return false;
	}
	return true;

}

 function useridf(str)
 {
 
	if (str.value=="-Enter User ID-")
		{
		str.value="";
		str.focus();
		}
 }
 function useridoutf(str)
 {
 
	if (str.value=="")
		{
		str.value="-Enter User ID-";
		str.focus();
		}
 
 } 
 /*This function trims input string*/                                                    
function trim(inputString) {
	if (typeof inputString != "string") { return inputString; }
   	var retValue = inputString;
   	var ch = retValue.substring(0, 1);
   	while (ch == " ") {
      		retValue = retValue.substring(1, retValue.length);
      		ch = retValue.substring(0, 1);
   	}
   	ch = retValue.substring(retValue.length-1, retValue.length);
   	while (ch == " ") {
      		retValue = retValue.substring(0, retValue.length-1);
      		ch = retValue.substring(retValue.length-1, retValue.length);
   	}
   	while (retValue.indexOf("  ") != -1) {
      		retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);
   	}
   	return retValue;
}

function forget()
{
var temp ="toolbar=no,location=no,status=no,scrollbars=no,resizable=no,width=330,height=210";
	window.open("../mithilaIndex/forget.html",null,temp) ;
}