function check_empty() {

	if(document.frm.ContactName.value=='') {
		alert('Please enter your name');
		document.frm.ContactName.focus();
		return false
	}
	if(document.frm.TelephoneNumber.value=='') {
		alert('Please enter your telephone number');
		document.frm.TelephoneNumber.focus();
		return false
	}
	if(document.frm.EmailAddress.value=='') {
		alert('Please enter your email address');
		document.frm.EmailAddress.focus();
		return false
	}	

    //alert(document.frm.enquiryType[document.frm.enquiryType.selectedIndex].value);
    var formSection = document.frm.enquiryType[document.frm.enquiryType.selectedIndex].value;

	if (formSection==""){
		alert('Please seect your type of enquiry');
			return false
	}else{

	/*switch(formSection) {
		case "section1":
			validateForm1();
		break;
		case "section2":
			validateForm2();
		break;
		case "section3":
			validateForm3();
		break;
		case "section4":
			validateForm4();
		break;
		case "section5":
			validateForm5();
		break;
		default:
			validateForm5();
		break;

	}*/
	//		alert("returning false");
//		return false
	}
}

function validateForm1(){


	
    if(document.frm.eventDescription1.value=='') {
		alert('Please enter an event description');
		document.frm.eventDescription1.focus();
		return false
	}

    if(document.frm.eventDate1.value=='') {
		alert('Please enter an event date');
		document.frm.eventDate1.focus();
		return false
	}

    if(document.frm.howManyPeople1.value=='') {
		alert('Please state how many people the event is for');
		document.frm.howManyPeople1.focus();
		return false
	}
    
    if(document.frm.barCost[document.frm.barCost.selectedIndex].value=='--') {
		alert('Please state if it is a free or pay bar');
		document.frm.barCost.focus();
		return false
	}
    
    if(document.frm.address1.value=='') {
		alert('Please state the postcode or address');
		document.frm.address1.focus();
		return false
	}

    if(document.frm.firstTimeEvent1[document.frm.firstTimeEvent1.selectedIndex].value=='--') {
		alert('Please state if this is a first time event');
		document.frm.firstTimeEvent1.focus();
		return false
	}
    
//		document.frm.submit();
}

function validateForm2(){
	
	
    if(document.frm.eventDescription2.value=='') {
		alert('Please enter an event description');
		document.frm.eventDescription2.focus();
		return false
	}

    if(document.frm.eventDate2.value=='') {
		alert('Please enter an event date');
		document.frm.eventDate2.focus();
		return false
	}

    if(document.frm.address2.value=='') {
		alert('Please state the postcode or address');
		document.frm.address2.focus();
		return false
	}

    if(document.frm.firstTimeEvent2[document.frm.firstTimeEvent2.selectedIndex].value=='--') {
		alert('Please state if this is a first time event');
		document.frm.firstTimeEvent2.focus();
		return false
	}
    
//		document.frm.submit();
}

function validateForm3(){
	

    if(document.frm.equipmentRequired.value=='') {
		alert('Please state the equipment required');
		document.frm.equipmentRequired.focus();
		return false
	}

    if(document.frm.requiredDate.value=='') {
		alert('Please state the date it is required');
		document.frm.requiredDate.focus();
		return false
	}
    
    if(document.frm.requiredTime.value=='') {
		alert('Please state the time it is required');
		document.frm.requiredTime.focus();
		return false
	}

    if(document.frm.address3.value=='') {
		alert('Please state the postcode or address');
		document.frm.address3.focus();
		return false
	}
    
    if(document.frm.accessRestrictions[document.frm.accessRestrictions.selectedIndex].value=='--') {
		alert('Please state if this is a first time event');
		document.frm.accessRestrictions.focus();
		return false
	}
    
//		document.frm.submit();
}

function validateForm4(){

	
    if(document.frm.alreadyRegistered.value=='') {
		alert('Please state if you have you already registered with us');
		document.frm.alreadyRegistered.focus();
		return false
	}
    
    if(document.frm.enquiryRelatingTo[document.frm.enquiryRelatingTo.selectedIndex].value=='--') {
		alert('Please state what your enquiry is relating to');
		document.frm.enquiryRelatingTo.focus();
		return false
	}
    
    if(document.frm.furtherInfo4.value=='') {
		alert('Please provide further information regarding your enquiry');
		document.frm.furtherInfo4.focus();
		return false
	}
//		document.frm.submit();
}

function validateForm5(){
	  //  	alert("1");

	
   if(document.frm.furtherInfo5.value=='') {
		alert('Please provide further information regarding your enquiry');
		document.frm.furtherInfo5.focus();
		return false
	}
//    	alert("2");
//		document.frm.submit();
}

	
function displayOption(val){

	switch(val) {
		
		case "section1":
			showDiv("section1");
		break;
		
		case "section2":
			showDiv("section2");
		break;
		
		case "section3":
			showDiv("section3");
		break;
		
		case "section4":
			showDiv("section4");
		break;

		case "section5":
			showDiv("section5");
		break;
		
		default:
			clearDivs();
		break;
		
	}
}

function showDiv(divId){
	//alert("divId = " + divId);
	clearDivs();
	if (document.getElementById){
		eval('document.getElementById("' + divId + '").style.display = "block"');
	}else if (document.all){
		eval('document.all.' + divId + '.style.display = "block"');
	}else{
		eval('document.' + divId + '.display = "block"');
	}
}	

function clearDivs() {
	if (document.getElementById){
		document.getElementById("section1").style.display = "none";
		document.getElementById("section2").style.display = "none";
		document.getElementById("section3").style.display = "none";
		document.getElementById("section4").style.display = "none";
		document.getElementById("section5").style.display = "none";
	}else if (document.all){
		document.all.section1.style.display = "none";
		document.all.section2.style.display = "none";
		document.all.section3.style.display = "none";
		document.all.section4.style.display = "none";
		document.all.section5.style.display = "none";
	}else{
		document.section1.display = "none";
		document.section2.display = "none";
		document.section3.display = "none";
		document.section4.display = "none";
		document.section5.display = "none";
	}
}
