	function strTrim(st)
	{
	var tmp=st;
		
		while(tmp.charAt(0)==" ")
		{
			tmp=tmp.slice(1);
		}
		while(tmp.charAt(tmp.length - 1)== " ")
		{
			tmp=tmp.slice(0, tmp.length - 1);
		}
		return tmp;
	}


	function CheckLoginForm(frm)
	{
		var tt = strTrim(frm.txt_username.value);
		
		if (tt.length==0)
		{
			//STRING LITERAL//
			alert("Please enter username");
			frm.txt_username.focus();
			return false;
		}
		else
			if(tt.length>32)
			{
				//STRING LITERAL//
				alert("Username should not be longer than 32 characters (" + tt.length + ")");
				frm.txt_username.focus();
				return false;
			}
		
		var tt = strTrim(frm.txt_password.value);
		
		if (tt.length<6)
		{
			//STRING LITERAL//
			alert("Password should not be less than 6 characters");
			frm.txt_password.focus();
			return false;
		}
		else
			if(tt.length>50)
			{
				//STRING LITERAL//
				alert("Password should not be longer than 50 characters (" + tt.length + ")");
				frm.txt_password.focus();
				return false;
			}

		return true;
	}

	function AcceptCookie()
	{
	var res;
		document.cookie="_DummyCookie_="+"1";
		res=document.cookie!=""	
		document.cookie="_DummyCookie_=1;expires=now";
		return res;
	}

	function CheckCookie()
	{
	//STRING LITERAL//
	var Msg="You should enable cookies to be able to log in.";
		if (!AcceptCookie())
			alert(Msg);
	}