function addHandler(whichEvent, whichObject, attachThis){

	if(document.addEventListener){

		whichObject.addEventListener(whichEvent, attachThis, 0);
	}
	else if(document.attachEvent){

		whichObject.attachEvent("on"+whichEvent, attachThis);
	}
}

function checkLoginBoxForm() {

	if(document.getElementById('formlogin'))
	{
		document.getElementById('submitLogin').onclick = function()
		{
			if(document.getElementById('frmUser').value == '') {
				alert('Please type in your email');
				return false;
			}
			
			if(document.getElementById('frmPass').value == '') {
				alert('Please type in your password');
				return false;
			}
			
			document.getElementById('formlogin').submit();
			return true;
		}
	}
}

addHandler('load',window,checkLoginBoxForm);