

onerror=handleErr;
var txt="";

function handleErr(msg,url,l)
{
txt="There was an error on this page.\n\n";
txt+="Error: " + msg + "\n";
txt+="URL: " + url + "\n";
txt+="Line: " + l + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
return false;
}

function validateMailOnly(){

	noError = true;
	
	usernameId = document.getElementById("logUsernameId");

	usernameLabel = document.getElementById("logUsernameLabelId");
	
	if(usernameId.value==""){
		noError = false;
		usernameId.style.borderColor="#FF0000";
		usernameLabel.style.color="#FF0000";
	} else {
		usernameLabel.style.color="#000000";
		//usernameId.removeAttribute("style");
		usernameId.style.borderColor=("#000000");
	}
	
	return noError;
}

function validateLog(){
	
	noError = true;
	
	usernameId = document.getElementById("logUsernameId");
	passwordId = document.getElementById("passwordId");

	usernameLabel = document.getElementById("logUsernameLabelId");
	passwordLabel = document.getElementById("passwordLabelId");

	if(usernameId.value==""){
		noError = false;
		usernameId.style.borderColor="#FF0000";
		usernameLabel.style.color="#FF0000";
	} else {
		usernameLabel.style.color="#000000";
		//usernameId.removeAttribute("style");
		usernameId.style.borderColor=("#000000");
	}
	
	if(passwordId.value==""){
		noError = false;
		passwordId.style.borderColor="#FF0000";
		passwordLabel.style.color="#FF0000";
	} else {
		passwordLabel.style.color="#000000";
		//passwordId.removeAttribute("style");
		passwordId.style.borderColor=("#000000");
			
	}

	
	return noError;
}

function validateChangePwd(){
	
	noError = true;
	
	usernameId = document.getElementById("logUsernameId");
	passwordId = document.getElementById("passwordId");
	newpassId  = document.getElementById("newpassId");
	repassId   = document.getElementById("repassId");

	usernameLabel  = document.getElementById("logUsernameLabelId");
	passwordLabel  = document.getElementById("passwordLabelId");
	newpassLabel = document.getElementById("NewpassLabelId");
	repassLabel  = document.getElementById("RepassLabelId");

	if(usernameId.value==""){
		noError = false;
		usernameId.style.borderColor="#FF0000";
		usernameLabel.style.color="#FF0000";
	} else {
		usernameLabel.style.color="#000000";
		//usernameId.removeAttribute("style");
		usernameId.style.borderColor=("#000000");
	}
	
	if(passwordId.value==""){
		noError = false;
		passwordId.style.borderColor="#FF0000";
		passwordLabel.style.color="#FF0000";
	} else {
		passwordLabel.style.color="#000000";
		//passwordId.removeAttribute("style");
		passwordId.style.borderColor=("#000000");
			
	}
	
	if(newpassId.value==""){
		noError = false;
		newpassId.style.borderColor="#FF0000";
		newpassLabel.style.color="#FF0000";
	} else {
		newpassLabel.style.color="#000000";
		//passwordId.removeAttribute("style");
		newpassId.style.borderColor=("#000000");
	}
	
	if(repassId.value==""){
		noError = false;
		repassId.style.borderColor="#FF0000";
		repassLabel.style.color="#FF0000";
	} else {
		repassLabel.style.color="#000000";
		//passwordId.removeAttribute("style");
		repassId.style.borderColor=("#000000");
	}

	
	return noError;
}