//------------------------------------------------------------------------
// validation for Free Listing Form on 'infoserve.com/are_you_listed.asp'
//------------------------------------------------------------------------

function validateAreYouListedForm(){
	
	if ((isBlank(document.areYouListedForm.CompanyName.value)) && (isBlank(document.areYouListedForm.PostCode.value))){
		alert ("Please enter a Company Name OR a Post Code!");
		return false;
		}
	
//	if {(isBlank(document.areYouListedForm.PostCode.value))
//		alert ("Please enter a Post Code!");
//		return false;
//		}

}


function validateFreeListingForm(){

	// test for blank fields
		
	if (isBlank(document.freeListingForm.CompanyName.value)){
		alert ("Please enter your Company Name!");
		return false;
		}

	if (isBlank(document.freeListingForm.Address1.value)){
		alert ("Please enter your Address (Address1) !");
		return false;
		}
	
//	if (isBlank(document.freeListingForm.Town.value)){
//		alert ("Please enter the Company Town!");
//		return false;
//		}

	if (isBlank(document.freeListingForm.PostCode.value)){
		alert ("Please enter a Company Postcode!");
		return false;
		}
	
		
	if (isBlank(document.freeListingForm.ContactName.value)){
		alert ("Please enter a Contact Name!");
		return false;
		}
	
//	if (isBlank(document.freeListingForm.ContactPosition.value)){
//		alert ("Please enter a Contact Position!");
//		return false;
//		}
		
	if(!document.freeListingForm.ContactEmail.readOnly == true){
		if (!isEmail(document.freeListingForm.ContactEmail.value)){
		alert ("The Email Address is not a valid Contact Email Address!");
		return false;
		}
	}
}

function acceptTerms(){

if (document.freeListingForm3.tandc.checked == false){
	alert("Please Check the 'Agree Terms & Conditions' Option");
	return false;
}
else
	return true;
}

function ammendDetails(){
	document.freeListingForm3.action='are_you_listed.asp?action=sendBack1';
	document.freeListingForm3.submit();	
}

function ammendDesc(){
	document.freeListingForm3.action='are_you_listed.asp?action=sendBack3';
	document.freeListingForm3.submit();	
}

function noEmailAddress(){



if (document.freeListingForm.ContactEmail.value == 'no_email_address@search.infoserve.com'){
	//document.freeListingForm.ContactEmail.disabled = false;
	document.freeListingForm.ContactEmail.readOnly = false;
	document.freeListingForm.ContactEmail.style.color = '#498EBD';
	document.freeListingForm.ContactEmail.style.bgColor = '#FFFFFF';	
	document.freeListingForm.ContactEmail.value = ''	
	
	

}
else{
	//document.freeListingForm.ContactEmail.disabled = true;
	document.freeListingForm.ContactEmail.readOnly = true;
	document.freeListingForm.ContactEmail.style.color = '#EBEBE4';
	document.freeListingForm.ContactEmail.bgColor = '#EBEBE4';	
	document.freeListingForm.ContactEmail.value = 'no_email_address@search.infoserve.com';	
	}
}
