function Any_illegal_Characters (element, Type) {
	if (Type == "Email") {
		if (element.value.indexOf("@") > 0) {
			Display_Error_Type (0);

			// Make sure the registered email doesn't attempt to create an account like john@shuzak.com [ Has Shuzak ]
			if ((element.value.indexOf("shuzak.com") > 0) || (element.value.indexOf("shuzak.Com") > 0) || (element.value.indexOf("Shuzak.Com") > 0) || (element.value.indexOf("Shuzak.com") > 0)){
				Display_Error_Type (10);
			}			
		}
		else {
			Display_Error_Type (2);
		}		
	}
	else if (Type == "Password") {
	/*
		var pwdfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
		var returnval=pwdfilter.test(element.value)
		alert (returnval)

		if (returnval==false) {
			Display_Error_Type (2);
		}
		else {
			Display_Error_Type (0);			
		}
	*/		
	}
} // Make sure Email has '@' in it [ Any Illegal Characters ]

function Has_Shuzak (element) {
	if ((element.value.indexOf("shuzak.com") > 0) || (element.value.indexOf("shuzak.Com") > 0) || (element.value.indexOf("Shuzak.Com") > 0) || (element.value.indexOf("Shuzak.com") > 0)){
		Display_Error_Type (10);
	}
	else {
		Display_Error_Type (0);
	}	
} // Make sure the registered email doesn't attempt to create an account like john@shuzak.com [ Has Shuzak ]

function Confirm_Password () {
	var Password1 = document.getElementById("Password1").value;
	var Password2 = document.getElementById("Password2").value;
	
	if ((Password1 != "") && (Password2 != "")) {
		if (Password1 != Password2) {
			Display_Error_Type (4);
		}
		else if (Password1.length < 5) {
			Display_Error_Type (5);
		}		
		else {
			Display_Error_Type (0);		
		}
	}
} // It checks whether the two passwords entered are same or not. It also makes sure the pwd's are of the correct length [ Confirm Password ]

function Display_Error_Type (Error_Type) {
Display_Error = document.getElementById("Javascript_Error");
Display_Error.style.visibility = "visible";

// Remove Error or Note div if it exists already

if ((document.getElementById("Error")) || (document.getElementById("Note"))) {
  var Error_Main = document.createElement("div");
  Error_Main.id = 'Error_Main';	

	if (document.getElementById("Error")) { 
		var Error_or_Note = document.getElementById("Error");	
	} 
	else { 
		var Error_or_Note = document.getElementById("Note");	
	}
		var MsgParent = Error_or_Note.parentNode;
		MsgParent.insertBefore(Error_Main, Error_or_Note);			
		MsgParent.removeChild(Error_or_Note);
}

	if (Error_Type == 2) {
		Display_Error.innerHTML = "<strong>#Error:</strong> Incomplete Email!";
	}
	else if (Error_Type == 4) {
		Display_Error.innerHTML = "<strong>#Error:</strong> Your two passwords do not match. Please re-enter";
	}
	else if (Error_Type == 5) {
		Display_Error.innerHTML = "<strong>#Error:</strong> Please choose a password longer than 4 characters";
	}
	else if (Error_Type == 10) {
		Display_Error.innerHTML = "<strong>#Error:</strong> You can not have an email with Shuzak.com in it. You must register with your own email.";
	}
	else if (Error_Type == 0) {
		Display_Error.innerHTML = "";
		Display_Error.style.visibility = "hidden";
	}
	
} // [ Display Error Type ]