function initFormChallenge()
{
	
	frmvalidator = new Validator("frmChallenge");
	frmvalidator.clearAllValidations();
  	frmvalidator.addValidation("first_name","req", "Please enter your name.");
	frmvalidator.addValidation("phone_number","req", "Please enter your phone number.");
  	frmvalidator.addValidation("email","req", "Please enter your email address."); 
	frmvalidator.addValidation("email","email", "Please enter a valid email address.");  
	
	frmvalidator.addValidation("txt_1","req", "Please enter your age.");
	//frmvalidator.addValidation("txt_1","range", "As you under the age of 18, please confirm that you have your parent or guardian's permission to enter the competition (as per our terms and conditions).");
	frmvalidator.addValidation("txt_1","num", "Please enter a valid age.");
	frmvalidator.addValidation("txt_2","req", "Please select your suggestion title."); 
  	frmvalidator.addValidation("txt_3","req", "Please enter your suggestion.");  
	frmvalidator.addValidation("txt_4","req", "Please select \"How did you find out about this website?\"");  
	
	
	frmvalidator.addValidation("b_tnc","shouldselchk", "Please read the terms and conditions.");
	
  	
}

function ageMsg(age)
{
	if (age.value != "")
	{
		if(age.value >= 13 && age.value <= 17)
            alert('"As you under the age of 18, please confirm that you have your parent or guardian\'\s permission to enter the competition (as per our terms and conditions)"');
	}
}


function ageCheck()
{

	if (!document.getElementsByTagName) {
		
		return false; 
	} 
	// create an array of objects of each link in the document 
	
	var popuplinks = document.getElementsByTagName("input");
	// loop through each of these links (anchor tags) 	
	for (var i=0; i < popuplinks.length; i++) {	
		// if the link has a class of "popup"...
		if (popuplinks[i].className == "ageCheck") {
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onblur = function() {ageMsg(this)};
			
		}
	} 
}




function ageMsgAskDerm(age)
{
	if (age.value != "")
	{
		if(age.value >= 13 && age.value <= 17)
            alert('"As you are under the age of 18, please confirm that you have your parent or guardian\'\s permission to submit your enquiry."');
	}
}


function ageCheckAskDerm()
{

	if (!document.getElementsByTagName) {
		
		return false; 
	} 
	// create an array of objects of each link in the document 
	
	var popuplinks = document.getElementsByTagName("input");
	// loop through each of these links (anchor tags) 	
	for (var i=0; i < popuplinks.length; i++) {	
		// if the link has a class of "popup"...
		if (popuplinks[i].className == "ageCheckAskDerm") {
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onblur = function() {ageMsgAskDerm(this)};
			
		}
	} 
}




function initFormAskDerm()
{
	
	frmvalidator = new Validator("frmAskDerm");
	frmvalidator.clearAllValidations();
  	frmvalidator.addValidation("first_name","req", "Please enter your name.");
	frmvalidator.addValidation("email","req", "Please enter your email address."); 
	frmvalidator.addValidation("email","email", "Please enter a valid email address.");  
	frmvalidator.addValidation("txt_1","req", "Please enter your age.");
	frmvalidator.addValidation("txt_1","num", "Please enter a valid age.");
	frmvalidator.addValidation("txt_2","req", "Please enter your question."); 
	
}

function MouseOver()
{
	MM_preloadImages('../images/genre/nav_home_hi.gif','../images/genre/nav_rapidClearRange_hi.gif','../images/genre/nav_the8hour_hi.gif','../images/genre/nav_ourExperts_hi.gif','../images/genre/nav_tellafriend_hi.gif');	
}
