function check()
{
	/*User id field*/
	if((document.frm.uid.value.length==0)||(document.frm.uid.value==null))
	{
		alert("User id field is empty.");
		document.frm.uid.select();document.frm.uid.focus();
		return false;
	}

	if(Trim(document.frm.uid.value).length==0)
	{ 
		alert("User ID field is empty.");
		document.frm.uid.select();document.frm.uid.focus();
		return false;
	}
	/*Till here : User id field*/
	
	/*User password field*/
	if((document.frm.pwd.value.length==0)||(document.frm.pwd.value==null))
	{
		alert("User password field is empty.");
		document.frm.pwd.select();document.frm.pwd.focus();
		return false;
	}

	if(Trim(document.frm.pwd.value).length==0)
	{ 
		alert("User password field is empty.");
		document.frm.pwd.select();document.frm.pwd.focus();
		return false;
	}
	/*Till here : User password field*/
}

function Trim(TRIM_VALUE)
{
	if(TRIM_VALUE.length < 1)
		{return"";}
	TRIM_VALUE = RTrim(TRIM_VALUE);
	TRIM_VALUE = LTrim(TRIM_VALUE);
	if(TRIM_VALUE=="")
		{return "";}
	else
		{return TRIM_VALUE;}
} //End Function

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;
} //End Function
