// JavaScript Document

function validate_required(field,alerttxt){ with (field) {
	if (value==null||value==""){
		alert(alerttxt);return false;}
	else {
		return true}
	}
}


function validate_form(thisform){ with (thisform) {
	
	if(	media_pack.checked) {
	
		if(	interested_in_bus_ticket_advertising.checked || 
			interested_in_car_park_ticket_advertising.checked ||
			interested_in_tram_ticket_advertising.checked ||
			interested_in_boarding_pass_ticket_advertising.checked ||
			interested_in_tube_ticket_advertising.checked ||
			interested_in_epos_advertising.checked 
			){
		
		}else {
			alert("Please select at least one area of interest");
			return false;
			
		}
	}
	
	
	if (validate_required(name,"Name must be filled in")==false){
		name.focus();return false;
	}
	
	if (validate_required(position,"Position must be filled in")==false){
		position.focus();return false;
	}
	
	if (validate_required(company,"Company must be filled in")==false){
		company.focus();return false;
	}
	
	if (validate_required(address,"Address must be filled in")==false){
		address.focus();return false;
	}
	
	if (validate_required(town,"Town must be filled in")==false){
		town.focus();return false;
	}
	
	if (validate_required(county,"County must be filled in")==false){
		county.focus();return false;
	}
	
	if (validate_required(postcode,"Postcode must be filled in")==false){
		postcode.focus();return false;
	}
	
	
	if (validate_required(email,"Email must be filled in")==false){
		email.focus();return false;
	}
	
	if (validate_required(telephone,"Telephone must be filled in")==false){
		telephone.focus();return false;
	}
	
	if(contact_me_by[0].checked || contact_me_by[1].checked ){
	
	}else {
		alert("Please select how you want to be contacted");
		return false;
		
	}
	

	if (validate_required(business_type,"Business type must be filled in")==false){
		business_type.focus();return false;
	}
	
	if (validate_required(where_did_you_hear_about_us,"Where did you hear about us type must be filled in")==false){
		where_did_you_hear_about_us.focus();return false;
	}
	
	
	
	
	
	
	
	
}
		
	
}