function RTrim(VALUE){
	var w_space = String.fromCharCode(32);
	var v_length = VALUE.length;
	var strTemp = "";
	if(v_length < 0){
	return"";
	}
	var iTemp = v_length -1;

	while(iTemp > -1){
		if(VALUE.charAt(iTemp) == w_space){
		}
		else{
			strTemp = VALUE.substring(0,iTemp +1);
			break;
		}
	iTemp = iTemp-1;
	} //End While
return strTemp;

} //End Function

function LTrim(VALUE){
	var w_space = String.fromCharCode(32);
	if(v_length < 1){
	return"";
	}
	var v_length = VALUE.length;
	var strTemp = "";
	var iTemp = 0;

	while(iTemp < v_length){
	if(VALUE.charAt(iTemp) == w_space){
	}
	else{
	strTemp = VALUE.substring(iTemp,v_length);
	break;
	}
	iTemp = iTemp + 1;
	} //End While
	return strTemp;
}


function validateLogin()
{
	var LoginId=LTrim(RTrim(document.Login.LoginId.value));
	var Password=document.Login.Password.value;
//	document.Login.hLoginID.value=LoginId
//	document.Login.hPassword.value=Password
	if ( LoginId == "" || LoginId == null ) 
		{
			alert('Please enter Login Id');
			document.Login.LoginId.focus();
			return false;
		}
	if (Password == "" || Password == null)
	{
		alert('Please enter Password');
		document.Login.Password.focus();
		return false;
	}
	if (LoginId.length < 4)
	{
		alert('Login Id Should not be less than 4 characters');
		document.Login.LoginId.value='';
		document.Login.LoginId.focus();
		return false;
	}	
	if (Password.length < 6)
	{
		alert('Password is less than 6 characters');
		document.Login.Password.focus();
		return false;
	}	
	document.Login.Password.value=''
	document.Login.LoginId.value=''
	return true;
}


