function checkLogin(pratsavi)
{
var invalid12=new Array(" ","!","@","#","$","%","^","&","*","=","'",'"',"`","?","|",".","{","}",";",":","~","<",">","+",",","-");

//alert("1");
// to check for username
var str90=document.pratsavi.logname.value;
var len21=str90.length;
if (str90.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.pratsavi.logname.value="";
  document.pratsavi.logname.focus();    
 return false;// used to check empty field name
 }
 
if(len21==0)
{
	
	alert("Please enter Username");
	document.pratsavi.logname.focus();
	return false;
}


if(len21!=0)
	{
	for(var i=0;i<=len21;i++)
	{
		chr=str90.charAt(i);
		for(var j=0;j<28;j++)
		{	
			if(invalid12[j]==chr)
			{
				alert("Special characters and space is not allowed except underscore sign");
				 document.pratsavi.logname.value="";
					document.pratsavi.logname.focus();  
				return  false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
}//end of outer if

// to check for password
var str91=document.pratsavi.logpass.value;
var len22=str91.length;
if (str91.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.pratsavi.logpass.value="";
  document.pratsavi.logpass.focus();    
 return false;// used to check empty field password
 }
 
if(len22==0)
{
	
	alert("Please enter your Password");
	document.pratsavi.logpass.focus();
	return false;
}

	return false;	
}

