/* Success color */
/*var color = "#90c51f";*/
var color = "#7CFC00";
/* Input color */
var white = "#ffffff";

function validateForm(frm){
	if ((frm.first.value.length==0) || (frm.first.value == null)	 
		|| (frm.sur.value.length==0) || (frm.sur.value == null)
		|| (frm.email1.value.length==0) || (frm.email1.value == null)
		|| (frm.username.value.length==0) || (frm.username.value == null)
		|| (frm.username.style.background == "#ffffff")
		|| (frm.tc.checked == false)
		|| (frm.password1.value.length==0) || (frm.password1.value == null))
	{
		window.alert("Please fill in all the information.");
		return false;
	}
	else{
		return true;
	}
}
	
function check(frm){
	/* Check that the email accounts match and that the user has entered a @ symbol and indicate by a color change */
	if (((frm.email1.value.length!=0 && frm.email1.value.length!=-1 ) && 
		 (frm.email2.value.length!=0 && frm.email2.value.length!=-1)) && 
		 (frm.email1.value == frm.email2.value) && 
		 (frm.email1.value.indexOf("@") != -1))	
	{
		frm.email1.style.background = color; frm.email2.style.background = color;
	}
	else{
		frm.email1.style.background = white; frm.email2.style.background = white;
	}
	
	/* Check that the passwords match and indicate by a color change */
	if ((frm.password1.value.length!=0 && frm.password1.value.length!=-1 ) && 
		(frm.password2.value.length!=0 && frm.password2.value.length!=-1) &&
		(frm.password1.value == frm.password2.value))
	{
		frm.password1.style.background = color; frm.password2.style.background = color;
	}
	else{
		frm.password1.style.background = white; frm.password2.style.background = white;
	}		
	return true;
}