if (parent.location != window.location)
{
	parent.location = window.location.toString().split('?')[0];
}
function Validate()
{
	var c1 = document.getElementById("txtLogin");
	var c2 = document.getElementById("txtPassword");
	if (c1 && c2)
	{
		var re = /\S/;
		if (!re.exec(c1.value))
		//if (!c1.value)
		{
			alert("User Name can not be empty");
			return false;
		}
		re = /./;
		if (!re.exec(c2.value))
		//if (!c2.value)
		{
			alert("Password can not be empty");
			return false;
		}
		document.forms[0].submit();
	}
}

addEvent(document, "keypress", testEnterSubmit);

function testEnterSubmit(e)
{
	var KeyID = (window.event) ? event.keyCode : e.keyCode;
	if(KeyID == 13)
	{
		DisableEvent(e);
		if(Validate(e))
		{
			document.forms[0].submit();
		}
	} 
	else 
		return true;
}


