

function checkSideBarForm(){

	var theform = document.getElementById("contactform");
	
	if(theform["Name"].value == "" || theform["Name"].value == "Name"){
		alert("Please enter your first name");	
		return false;
	}

	if(theform["EmailAddress"].value == "" || theform["EmailAddress"].value == "Email Address"){
		alert("Please enter your Email Address");	
		return false;
	}

	if(theform["Phone"].value == "" || theform["Phone"].value == "Contact Phone"){
		alert("Please enter a contact telephone number");	
		return false;
	}

	if(theform["Query"].value == "" || theform["Query"].value == "What can we do for you?"){
		alert("Please enter a query");	
		return false;
	}

	return true;

}




function checkform(formName){
	
	var theform = document.getElementById(formName);
	
	
	if(theform.FirstName.value == ""){
		alert("Please enter your first name");	
		return false;
	}
	if(theform.LastName.value == ""){
		alert("Please enter your last name");	
		return false;
	}	
	if(theform.Address.value == ""){
		alert("Please enter your address");	
		return false;
	}		
	if(theform.City.value == ""){
		alert("Please enter your city");	
		return false;
	}	
	if(theform.Postcode.value == ""){
		alert("Please enter your Postcode");	
		return false;
	}
	if(theform.State.value == ""){
		alert("Please enter your State");	
		return false;
	}	
	if(theform.Phone.value == ""){
		alert("Please enter your Phone Number");	
		return false;
	}	
	if(theform.Email.value == ""){
		alert("Please enter your Email Address");	
		return false;
	}	
	//alert("Returning true");
	return true; 
}



var current = 1;

function eligible(control){

	switch(control.name){

		case "employed" :	if(current > 1) { current = 1; showQuestions(1)};
						clearEligibility();
						if(control.value == "yes"){
							showQuestions(++current);
						} else {
							showEligibility(false);
						}
						break;

		case "citizen" :	if(current > 2) { current = 2; showQuestions(2)};
						clearEligibility();
						if(control.value == "yes"){
							showEligibility(true);
						} else {
							showEligibility(false);
						}
						break;

		default : alert("I don't know");
				break;

	}

}


var qArray = new Array("q1","q2");

function showQuestions(pQuestionNum){

	for(var i=0; i < qArray.length; i++){
		var question = document.getElementById(qArray[i]);
		if(i + 1 <= pQuestionNum){
			question.style.display = "block";
		} else {
			question.style.display = "none";
		}

	}

}

function showEligibility(pEl){

	var inelblock = document.getElementById("NotEligible");
	var elblock = document.getElementById("IsEligible");

	if(pEl){
		elblock.style.display="block";
		inelblock.style.display="none";
	} else {
		elblock.style.display="none";
		inelblock.style.display="block";
	}

}

function clearEligibility(){
	var inelblock = document.getElementById("NotEligible");
	var elblock = document.getElementById("IsEligible");
	elblock.style.display="none";
	inelblock.style.display="none";
}



/* 
	Page: New to the Carpet Cleaning Business?
	URL: http://www.carpetcleaningtraining.com.au/new_to_the_carpet_cleaning_business.php
*/

function checkNewToIndustryForm(){

	var firstname = document.getElementById("FirstName");
	if(firstname.value == ""){
		alert("Please fill in your first name");
		return false;
	}

	var surname = document.getElementById("Surname");
	if(surname.value == ""){
		alert("Please fill in your surname");
		return false;
	}

	var mobilenumber = document.getElementById("MobileNumber");
	if(mobilenumber.value == ""){
		alert("Please fill in your mobile phone number");
		return false;
	}

	var email = document.getElementById("Email");
	if(email.value == ""){
		alert("Please fill in your Email Address ");
		return false;
	}

	var state = document.getElementById("State");
	if(state.selectedIndex < 2){
		alert("Please select your State");
		return false;
	}
	//alert("Returning True");
	return true;

}



