function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}







function ValidateSUBSCRIBERForm(){

var customerName;
var customerCompany;
var customerAddress;
var customerPostcode;
var customerEmail;
var customerTelephone;
var customerAdditional;

if(document.contactForm.customerName.value == "") {
window.alert("Please supply a contact name!")
return false;}

if (document.contactForm.customerName.value.length > 255) {
window.alert("Your contact name is too long. This field is limited to 255 characters.") 
return false;}
		
		
if(document.contactForm.customerCompany.value == "") {
window.alert("Please provide the name of your company or organisation!")
return false;}
if (document.contactForm.customerCompany.value.length > 255) {
window.alert("Your company name is too long. This field is limited to 255 characters.") 
return false;}
		
					
if(document.contactForm.customerAddress.value == "") {
window.alert("Please include your address details!")
return false;}
if (document.contactForm.customerAddress.value.length > 3000) {
window.alert("Your contact address is too long. Consider shortening the address by reducing the number of characters.") 
return false;}
			
					
if(document.contactForm.customerPostcode.value == "") {
window.alert("Please include your Postcode!")
return false;}	
if (document.contactForm.customerPostcode.value.length > 10) {
window.alert("Your postcode is too long. The maximum number of characters you may use is 10.") 
return false;}
			
if(document.contactForm.customerEmail.value == "") {
window.alert("Please include your Email Address!")
return false;}
if (document.contactForm.customerEmail.value.length > 255) {
window.alert("Your email address is too long. The maximum number of characters you may use is 255.") 
return false;}
			
if(document.contactForm.customerTelephone.value == "") {
window.alert("Please provide your daytime telephone number!")
return false;}
if (document.contactForm.customerTelephone.value.length > 50) {
window.alert("There are too many characters in the field 'Telephone'. You can use a maximum of 50 characters.") 
return false;}
			
			
if (document.contactForm.customerAdditional.value.length > 1000) {
window.alert("The additional information you provided is too long. The maximum number of characters you may use is 1000.") 
return false;}

else { return true; }
}


function ValidateSUBSCRIBER2Form(){

var customerName;
var customerTelephone;
var customerEmail;
var propertyAddress;
var propertyTypeofoffer;
var propertyCost;
var propertyDescription;

if(document.contactForm.customerName.value == "") {
window.alert("Please supply a contact name!")
return false;}

if (document.contactForm.customerName.value.length > 255) {
window.alert("Your contact name is too long. This field is limited to 255 characters.") 
return false;}		
							
if(document.contactForm.customerTelephone.value == "") {
window.alert("Please provide a contact telephone number!")
return false;}
if (document.contactForm.customerTelephone.value.length > 100) {
window.alert("There are too many characters in the field 'Telephone'. You can use a maximum of 50 characters.") 
return false;}

if(document.contactForm.customerEmail.value == "") {
window.alert("Please include your email address!")
return false;}
if (document.contactForm.customerEmail.value.length > 255) {
window.alert("Your email address is too long. The maximum number of characters you may use is 255.") 
return false;}
						
if(document.contactForm.propertyAddress.value == "") {
window.alert("Please include your address details!")
return false;}
if (document.contactForm.propertyAddress.value.length > 255) {
window.alert("Your contact address is too long. The maximum number of characters you may use is 255.") 
return false;}

if(document.contactForm.propertyTypeofoffer.value == "") {
window.alert("Please include the type of offer details!")
return false;}

if(document.contactForm.propertyCost.value == "") {
window.alert("Please include the cost of the property!")
return false;}

if(document.contactForm.propertyDescription.value == "") {
window.alert("Please include a description for the property!")
return false;}
if (document.contactForm.propertyDescription.value.length > 3000) {
window.alert("Your property description is too long. The maximum number of characters is 3000.") 
return false;}

else { return true; }
}





function wordCounter(field, countfield, maxlimit) {
wordcounter=1;
for (x=1;x<field.value.length;x++) {
      if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")  {wordcounter++}  // Counts the spaces while ignoring double spaces, usually one in between each word.
      if (wordcounter > 250) {field.value = field.value.substring(0, x);}
      else {countfield.value = wordcounter;}
      }
   }

   
   
   
   
   
   
   
   
   function ValidateForm(){

var Name;
var Company;
var Message;
var Address;
var Postcode;
var Email;
var Telephone;

		if(document.contactForm.Name.value == "") {
	
			window.alert("Please supply a contact name!")
		
			return false;}
		
		
		if(document.contactForm.Company.value == "") {
	
			window.alert("Please provide the name of your company or organisation!")
		
			return false;}
		
					
		if(document.contactForm.Message.value == "") {
	
			window.alert("Please type your message!")
					
			return false;}
			
			
		if (document.contactForm.Message.value.length > 3000) {
     
            window.alert("Your message is too long. The maximum number of characters you may use is 1000.") 
					
			return false;}

			
					
		if(document.contactForm.Address.value == "") {
	
			window.alert("Please include your address details!")
					
			return false;}
			
					
		if(document.contactForm.Postcode.value == "") {
	
			window.alert("Please include your Postcode!")
					
			return false;}
			
			
		if(document.contactForm.Email.value == "") {
	
			window.alert("Please include your Email Address!")
					
			return false;}
			
			
		if(document.contactForm.Telephone.value == "") {
	
			window.alert("Please provide your daytime telephone number!")
					
			return false;}
	
				
		else { return true; }
}



