/* <![CDATA[*/
/* function checkForm2(form) 
{ 
		if(form.email.value == "") { 
			alert("Error: Username(email) cannot be blank!"); 
			form.email.focus(); 
			return false; 
		} 
		if(form.name.value == "") { 
			alert("Error: Name(First,Last) cannot be blank!"); 
			form.name.focus(); 
			return false; 
		} 
		if(form.address.value == "") { 
			alert("Error: Address cannot be blank!"); 
			form.address.focus(); 
			return false; 
		} 
		if(form.city.value == "") { 
			alert("Error: City cannot be blank!"); 
			form.city.focus(); 
			return false; 
		} 
		if(form.state.value == "") { 
			alert("Error: State cannot be blank!"); 
			form.state.focus(); 
			return false; 
		} 
		if(form.postcode.value == "") { 
			alert("Error: Postcode cannot be blank!"); 
			form.postcode.focus(); 
			return false; 
		} 
		if(form.mob.value == "") { 
			alert("Error: Mobile Phone Number cannot be blank!"); 
			form.mob.focus(); 
			return false; 
		} 
		re = /^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z\.]{2,4}/      //  /^\w+$/; 
		if(!re.test(form.email.value)) { 
			alert("Error: Username must contain only letters, numbers, dash, dot,\n underscores(first part) and the 'at' sign!");    // @
			form.email.focus(); 
			return false; 
		}   
		rexp = /^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z\.]{2,4}/    
		if (form.emailpaypal.value != "") {  //  (form.emailpaypal.value != NULL
			//re1 = /^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z\.]{2,4}/      //  /^\w+$/; 
			if(!rexp.test(form.emailpaypal.value)) { 
				alert("Error: PayPal Email must contain only letters, numbers, dash, dot,\n underscores(first part) and the 'at' sign!");    // @
				form.emailpaypal.focus(); 
				return false; 
			} 		
		}
		if(form.password.value != "" && form.password.value == form.confirmpassword.value) { 
			var re0 = /^\w+$/;// /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{6,}$/; http://www.the-art-of-web.com/javascript/validate/1/
			var validPassword = re0.test(form.password.value);
			if (!validPassword) { 
				alert("Error: Password must contain only letters(uppercase and lowercase), underscores and numbers!"); 
				form.password.focus(); 
				return false;
			} 
			if (form.password.value.length < 6) { 
				alert("Error: Password must contain at least six characters!"); 
				form.password.focus(); 
				return false; 
			} 
			if (form.password.value.length > 12) { 
				alert("Error: Password must contain the max 12 characters!"); 
				form.password.focus(); 
				return false; 
			} 
			if (form.password.value == form.email.value) { 
				alert("Error: Password must be different from Username!"); 
				form.password.focus(); 
				return false; 
			} 
			re1 = /[0-9]/; 
			if (!re1.test(form.password.value)) { 
				alert("Error: Password must contain at least one number (0-9)!"); 
				form.password.focus(); 
				return false; 
			} 
			re2 = /[a-z]/; 
			if (!re2.test(form.password.value)) { 
				alert("Error: Password must contain at least one lowercase letter (a-z)!"); 
				form.password.focus(); 
				return false; 
			} 
			re3 = /[A-Z]/; 
			if (!re3.test(form.password.value)) { 
				alert("Error: Password must contain at least one uppercase letter (A-Z)!"); 
				form.password.focus(); 
				return false; 
			} 
		} else { 
			alert("Error: Please check that you've entered and confirmed your Password!"); 
			form.confirmpassword.focus(); 
			return false; 
		} 
		return confirm('Are you sure your changes are correct ?');  // return true; 
}  */
/* ]]>*/
	  
function checkFormtemplate() 
{ 
		
		if (document.getElementById("email-login").value == "") { 
			alert("Error: Username(email) cannot be blank!"); 
			document.getElementById("email-login").focus(); 
			return false; 
		} 
		var retemplate = /^[a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])+@[a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])+\.[a-zA-Z\.]{2,4}/  // /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
		var str=document.getElementById("email-login").value;
		if (!retemplate.test(str)) {   //  
			alert("Error: Username must contain only letters, numbers, dash, dot, underscores(first part) and the 'at' sign!");    
			document.getElementById("email-login").focus(); 
			return false; 
		} 
		if(document.getElementById("password-login").value != "") { 
			var re0template = /^\w+$/;
			var str1=document.getElementById("password-login").value;
			var validPassword = re0template.test(str1);
			if (!validPassword) { 
				alert("Error: Password must contain only letters(uppercase and lowercase), underscores and numbers!"); 
				document.getElementById("password-login").focus(); 
				return false;
			} 
			if (document.getElementById("password-login").value.length < 6) { 
				alert("Error: Password must contain at least six characters!"); 
				document.getElementById("password-login").focus(); 
				return false; 
			} 
			if (document.getElementById("password-login").value.length > 12) { 
				alert("Error: Password must contain the max 12 characters!"); 
				document.getElementById("password-login").focus(); 
				return false; 
			} 
			if (document.getElementById("password-login").value == document.getElementById("email-login").value) { 
				alert("Error: Password must be different from Username!"); 
				document.getElementById("password-login").focus(); 
				return false; 
			} 
			re1template = /[0-9]+/; 
			if (!re1template.test(str1)) { 
				alert("Error: Password must contain at least one number (0-9)!"); 
				document.getElementById("password-login").focus(); 
				return false; 
			} 
			re2template = /[a-z]+/; 
			if (!re2template.test(str1)) { 
				alert("Error: Password must contain at least one lowercase letter (a-z)!"); 
				document.getElementById("password-login").focus(); 
				return false; 
			} 
			re3template = /[A-Z]+/; 
			if (!re3template.test(str1)) { 
				alert("Error: Password must contain at least one uppercase letter (A-Z)!"); 
				document.getElementById("password-login").focus(); 
				return false; 
			} 
		} else { 
			alert("Error: Please check that you've entered your Password!"); 
			document.getElementById("password-login").focus(); 
			return false; 
		} 
		return true;    
} 
/*
function checkFormtemplate(form) 
{ 
		
		if (form.email-login.value == "") { 
			alert("Error: Username(email) cannot be blank!"); 
			form.email-login.focus(); 
			return false; 
		} 
		var retemplate = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
		var str=form.email-login.value;
		if (!retemplate.test(str)) {   //  
			alert("Error: Username must contain only letters, numbers, dash, dot, underscores(first part) and the 'at' sign!");    
			form.email-login.focus(); 
			return false; 
		} 
		if(form.password-login.value != "") { 
			var re0template = /^\w+$/;
			var str1=form.password-login.value;
			var validPassword = re0template.test(str1);
			if (!validPassword) { 
				alert("Error: Password must contain only letters(uppercase and lowercase), underscores and numbers!"); 
				form.password-login.focus(); 
				return false;
			} 
			if (form.password-login.value.length < 6) { 
				alert("Error: Password must contain at least six characters!"); 
				form.password-login.focus(); 
				return false; 
			} 
			if (form.password-login.value.length > 12) { 
				alert("Error: Password must contain the max 12 characters!"); 
				form.password-login.focus(); 
				return false; 
			} 
			if (form.password-login.value == form.email.value) { 
				alert("Error: Password must be different from Username!"); 
				form.password-login.focus(); 
				return false; 
			} 
			re1template = /[0-9]/; 
			if (!re1template.test(str1)) { 
				alert("Error: Password must contain at least one number (0-9)!"); 
				form.password-login.focus(); 
				return false; 
			} 
			re2template = /[a-z]/; 
			if (!re2template.test(str1)) { 
				alert("Error: Password must contain at least one lowercase letter (a-z)!"); 
				form.password-login.focus(); 
				return false; 
			} 
			re3template = /[A-Z]/; 
			if (!re3template.test(str1)) { 
				alert("Error: Password must contain at least one uppercase letter (A-Z)!"); 
				form.password-login.focus(); 
				return false; 
			} 
		} else { 
			alert("Error: Please check that you've entered your Password!"); 
			form.password-login.focus(); 
			return false; 
		} 
		return true;    
} 
*/
function checkFormtemplate2news() 
{ 
		// ar form = f;
		if(document.getElementById("email-news").value == "") { 
			alert("Error: Username(email) cannot be blank!"); 
			document.getElementById("email-news").focus(); 
			return false; 
		} 
		var retemplatenews = /^[a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])+@[a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])+\.[a-zA-Z\.]{2,4}/      
		if(!retemplatenews.test(document.getElementById("email-news").value)) { 
			alert("Error: Username must contain only letters, numbers, dash, dot, underscores(first part) and the 'at' sign!");   
			document.getElementById("email-news").focus(); 
			return false; 
		} 
     	return true; 
		
} 
/*
function checkFormtemplate2news(form1) 
{ 
		// ar form = f;
		if(document.getElementById("email-news").value == "") { 
			alert("Error: Username(email) cannot be blank!"); 
			form1.email-news.focus(); 
			return false; 
		} 
		var retemplatenews = /^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z\.]{2,4}/      
		if(!retemplatenews.test(form1.email-news.value)) { 
			alert("Error: Username must contain only letters, numbers, dash, dot, underscores(first part) and the 'at' sign!");   
			form1.email-news.focus(); 
			return false; 
		} 
     	return true; 
		
} 
*/

function checkFormtemplate3aff() 
{ 
		// var form = f1;document.getElementById("email-affiliates")
		if(document.getElementById("email-affiliates").value == "") { 
			alert("Error: Username(email) cannot be blank!"); 
			document.getElementById("email-affiliates").focus(); 
			return false; 
		} 
		var retemplateaff = /^[a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])+@[a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])+\.[a-zA-Z\.]{2,4}/    
		if(!retemplateaff.test(document.getElementById("email-affiliates").value)) { 
			alert("Error: Username must contain only letters, numbers, dash, dot, underscores(first part) and the 'at' sign!");  
			document.getElementById("email-affiliates").focus(); 
			return false; 
		}   
		if(document.getElementById("password-affiliates").value != "") { 
			var re0templateaff = /^\w+$/;
			var validPassword = re0templateaff.test(document.getElementById("password-affiliates").value);
			if (!validPassword) { 
				alert("Error: Password must contain only letters(uppercase and lowercase), underscores and numbers!"); 
				document.getElementById("password-affiliates").focus(); 
				return false;
			} 
			if (document.getElementById("password-affiliates").value.length < 6) { 
				alert("Error: Password must contain at least six characters!"); 
				document.getElementById("password-affiliates").focus(); 
				return false; 
			} 
			if (document.getElementById("password-affiliates").value.length > 12) { 
				alert("Error: Password must contain the max 12 characters!"); 
				document.getElementById("password-affiliates").focus(); 
				return false; 
			} 
			if (document.getElementById("password-affiliates").value == document.getElementById("email-affiliates").value) { 
				alert("Error: Password must be different from Username!"); 
				document.getElementById("password-affiliates").focus(); 
				return false; 
			} 
			re1templateaff = /[0-9]+/; 
			if (!re1templateaff.test(document.getElementById("password-affiliates").value)) { 
				alert("Error: Password must contain at least one number (0-9)!"); 
				document.getElementById("password-affiliates").focus(); 
				return false; 
			} 
			re2templateaff = /[a-z]+/; 
			if (!re2templateaff.test(document.getElementById("password-affiliates").value)) { 
				alert("Error: Password must contain at least one lowercase letter (a-z)!"); 
				document.getElementById("password-affiliates").focus(); 
				return false; 
			} 
			re3templateaff = /[A-Z]+/; 
			if (!re3templateaff.test(document.getElementById("password-affiliates").value)) { 
				alert("Error: Password must contain at least one uppercase letter (A-Z)!"); 
				document.getElementById("password-affiliates").focus(); 
				return false; 
			} 
		} else { 
			alert("Error: Please check that you've entered your Password!"); 
			document.getElementById("password-affiliates").focus(); 
			return false; 
		} 
		return true;   
} 

/*
function checkFormtemplate3aff(form2) 
{ 
		// var form = f1;
		if(form2.email-affiliates.value == "") { 
			alert("Error: Username(email) cannot be blank!"); 
			form2.email-affiliates.focus(); 
			return false; 
		} 
		var retemplateaff = /^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z\.]{2,4}/    
		if(!retemplateaff.test(form2.email-affiliates.value)) { 
			alert("Error: Username must contain only letters, numbers, dash, dot, underscores(first part) and the 'at' sign!");  
			form2.email-affiliates.focus(); 
			return false; 
		}   
		if(form2.password-affiliates.value != "") { 
			var re0templateaff = /^\w+$/;
			var validPassword = re0templateaff.test(form2.password-affiliates.value);
			if (!validPassword) { 
				alert("Error: Password must contain only letters(uppercase and lowercase), underscores and numbers!"); 
				form2.password-affiliates.focus(); 
				return false;
			} 
			if (form2.password-affiliates.value.length < 6) { 
				alert("Error: Password must contain at least six characters!"); 
				form2.password-affiliates.focus(); 
				return false; 
			} 
			if (form2.password-affiliates.value.length > 12) { 
				alert("Error: Password must contain the max 12 characters!"); 
				form2.password-affiliates.focus(); 
				return false; 
			} 
			if (form2.password-affiliates.value == form2.email.value) { 
				alert("Error: Password must be different from Username!"); 
				form2.password-affiliates.focus(); 
				return false; 
			} 
			re1templateaff = /[0-9]/; 
			if (!re1templateaff.test(form2.password-affiliates.value)) { 
				alert("Error: Password must contain at least one number (0-9)!"); 
				form2.password-affiliates.focus(); 
				return false; 
			} 
			re2templateaff = /[a-z]/; 
			if (!re2templateaff.test(form2.password-affiliates.value)) { 
				alert("Error: Password must contain at least one lowercase letter (a-z)!"); 
				form2.password-affiliates.focus(); 
				return false; 
			} 
			re3templateaff = /[A-Z]/; 
			if (!re3templateaff.test(form2.password-affiliates.value)) { 
				alert("Error: Password must contain at least one uppercase letter (A-Z)!"); 
				form2.password-affiliates.focus(); 
				return false; 
			} 
		} else { 
			alert("Error: Please check that you've entered your Password!"); 
			form2.password-affiliates.focus(); 
			return false; 
		} 
		return true;   
} 
*/