<!--
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_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_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 hideImage(){
 	myheight = document.body.clientHeight;
	
	if (myheight < 801) {
	document.getElementById('contentStretch').style.height = "200px";
    }
}

function showForm () {
    var browserName = navigator.appName;
    var browserVersion = navigator.appVersion;
    var appString = "MSIE 6.0";
         
    document.getElementById('contactOwnerForm').style.display = "block";
    document.getElementById('contactOwnerLink').style.display = "none";
    
    if (browserName == "Microsoft Internet Explorer" & browserVersion == appString.indexOf("MSIE 6.0")!=-1) {
        document.getElementById('footer').style.position = "relative";
        document.getElementById('footer').style.margin = "-25px 0px 0px 0px";
    }
}

function toggleBlock (id) {
    
    if (document.getElementById(id).style.display != 'block')
    {
        document.getElementById(id).style.display = "block";
    }
    else
    {
        document.getElementById(id).style.display = "none";
    }
}

function showAll (action, faqnum) {
    for (id=1;id<faqnum;id++) {
    
        if (action == 'show')
        {
            document.getElementById(id).style.display = "block";
        }
        else
        {
            document.getElementById(id).style.display = "none";
        }
    }
}       


function expand (element1, element2) {
    
    if (document.getElementById(element2).value == '-')
    {
        document.getElementById(element1).style.display = "none";
        document.getElementById(element2).value = '+';
    }
    else
    {
        document.getElementById(element1).style.display = "block";
        document.getElementById(element2).value = '-';
    }
}

function loadpicture(picnum) {
    document.getElementById("uploadimage" + picnum).style.visibility = "visible";
    document.getElementById('placeholder' + picnum).src = "file://" + document.getElementById('browse' + picnum).value
}

function printpage(){
if (!window.print){
alert("To print, please press The 'Ctrl' and 'p' buttons together.")
return
}
window.print();
}

function validateEmail(addr,man,db) 
	{
	if (addr == '' && man) 
	{
	  if (db) alert('Please enter a valid email address');
	  return false;
	}
		                                
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
		                                
	for (i=0; i<invalidChars.length; i++) 
	{
	  if (addr.indexOf(invalidChars.charAt(i),0) > -1) 
	  {
	    if (db) alert('email address contains invalid characters');
	      return false;
	  }
	}
		                                
	for (i=0; i<addr.length; i++) 
	{
	  if (addr.charCodeAt(i)>127) 
	  {
	    if (db) alert("email address contains non ascii characters.");
	      return false;
	  }
	}

	var atPos = addr.indexOf('@',0);
		                                
	if (atPos == -1) 
	{
	  if (db) alert('email address must contain an @');
	    return false;
	}
	if (atPos == 0) 
	{
	  if (db) alert('email address must not start with @');
	    return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) 
	{
	  if (db) alert('email address must contain only one @');
	    return false;
	}

	if (addr.indexOf('.', atPos) == -1) 
	{
	  if (db) alert('email address must contain a period in the domain name');
	    return false;
	}
	if (addr.indexOf('@.',0) != -1) 
	{
	  if (db) alert('period must not immediately follow @ in email address');
	    return false;
	}
	if (addr.indexOf('.@',0) != -1)
	{
	  if (db) alert('period must not immediately precede @ in email address');
	    return false;
	}
	if (addr.indexOf('..',0) != -1) 
	{
	  if (db) alert('two periods must not be adjacent in email address');
	    return false;
	}

	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') 
	{
	  if (db) alert('invalid primary domain in email address');
	    return false;
	}
	return true;
	} 
	
function validatedetailsform(){
  var error = '';
  var detailsSection = '';
  
    if (document.userDetails.password.value == '')
    {
        error = 'You must enter your current password';
        document.userDetails.password.focus();
    }

    if (document.userDetails.passwordnew1.value != '' || document.userDetails.passwordnew2.value != '')
    {
    
        if (document.userDetails.passwordnew1.value != document.userDetails.passwordnew2.value){
        error = 'The two passwords that you have entered do not match.';
        document.userDetails.passwordnew1.focus();
        }
        if (document.userDetails.passwordnew2.value == ''){
        error = 'To confirm your new password, please enter it in the confirm password field.';
        document.userDetails.confirmpassword.focus();
        }
        if (document.userDetails.passwordnew1.value.length < 6){
        error = 'Please enter a password which is at least 6 characters long.';
        document.userDetails.passwordnew1.focus();
        }
    }
  
  detailsSection = detailsSection + document.userDetails.address1.value;
  detailsSection = detailsSection + document.userDetails.address2.value;
  detailsSection = detailsSection + document.userDetails.address3.value;
  detailsSection = detailsSection + document.userDetails.city.value;
  detailsSection = detailsSection + document.userDetails.county.value;
  detailsSection = detailsSection + document.userDetails.postcode.value;
  detailsSection = detailsSection + document.userDetails.country.value;
  detailsSection = detailsSection + document.userDetails.hometelephone.value;
  detailsSection = detailsSection + document.userDetails.worktelephone.value;
  detailsSection = detailsSection + document.userDetails.worktelephoneext.value;
  detailsSection = detailsSection + document.userDetails.mobile.value;
  
  if (detailsSection != '')
  {
      if (document.userDetails.hometelephone.value == ''){
      error = 'You must enter your home number';
      document.userDetails.hometelephone.focus();
      }
      
      if (document.userDetails.postcode.value == ''){
      error = 'Please enter your postcode';
      document.userDetails.postcode.focus();
      }
      
      if (document.userDetails.county.value == ''){
      error = 'Please enter your county';
      document.userDetails.county.focus();
      }
      
      if (document.userDetails.city.value == ''){
      error = 'Please enter your town/city';
      document.userDetails.city.focus();
      }
      
      if (document.userDetails.address1.value == ''){
      error = 'Please fill in your address';
      document.userDetails.address1.focus();
      }
  }

  if (document.userDetails.termsconditions.checked == false){
  error = 'You must accept our terms and conditions';
  document.userDetails.termsconditions.focus();
  }
  
  if (document.userDetails.email.value != document.userDetails.confirmemail.value){
        error = 'The two email addresses that you have entered do not match.';
        document.userDetails.email.focus();
        }
  
  if (!validateEmail(document.userDetails.email.value,1,0)){
		error = 'Please enter a valid email address';
		document.userDetails.email.focus();
	 }
  
  if (document.userDetails.surname.value == ''){
  error = 'Please enter your surname';
  document.userDetails.surname.focus();
  }
 
  if (document.userDetails.firstname.value == ''){
  error = 'Please enter your name';
  document.userDetails.firstname.focus();
  }
  
  if (error == '')
  { return true; }
  else
  {
  alert(error);
  return false;
  }
}

function callmap() {
    document.getElementById('tester').style.display = "block";
}

function hidemap() {
    document.getElementById('tester').style.display = "none";
}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}


function FieldLengthCheck(field, countfield, maxlimit)
{
    
    if (field.value.length > maxlimit)
        field.value = field.value.substring(0, maxlimit);
    else
        countfield.innerHTML = maxlimit - field.value.length;
}

function edittariff(number)
{
    document.getElementById('tariffadminedit').style.display = "block";
    
    document.savetariff.tarreferenceedit.value = document.getElementById('curref' + number).value;
    document.savetariff.tardescriptionedit.value = document.getElementById('curdesc' + number).value;
    document.savetariff.tarstartdateedit.value = document.getElementById('curfrom' + number).value;
    document.savetariff.tarenddateedit.value = document.getElementById('curto' + number).value;
    setCheckedValue(document.forms['savetariff'].elements['tartypeedit'],document.getElementById('curtype' + number).value)
    
    document.savetariff.tarcostedit.value = document.getElementById('curcost' + number).value;
    document.savetariff.confirmededit.checked = document.getElementById('tariffactive' + number).checked;
}

function hidetariff()
{
    document.savetariff.tarreferenceedit.value = '';
    document.savetariff.tardescriptionedit.value = '';
    document.savetariff.tarstartdateedit.value = '';
    document.savetariff.tarenddateedit.value = '';
    
    document.savetariff.tarcostedit.value = '';
    document.savetariff.confirmededit.checked = false;
	
	for (i=0;i<document.savetariff.tartypeedit.length;i++)
	{
		document.savetariff.tartypeedit[i].checked = false;
	}

    document.getElementById('tariffadminedit').style.display = "none";
}

function editavailability(number)
{
    document.getElementById('availabilityadminedit').style.display = "block";
    
    document.saveavailibility.availrefedit.value = document.getElementById('curavailref' + number).value;
    document.saveavailibility.bookingnameedit.value = document.getElementById('curavailname' + number).value;
    document.saveavailibility.descriptionedit.value = document.getElementById('curavaildesc' + number).value;
    document.saveavailibility.startdateedit.value = document.getElementById('curavailfrom' + number).value;
    document.saveavailibility.enddateedit.value = document.getElementById('curavailto' + number).value;
    document.saveavailibility.availconfirmededit.checked = document.getElementById('availconfirmed' + number).checked;
}

function hideavailability()
{
    document.saveavailibility.availrefedit.value = '';
    document.saveavailibility.bookingnameedit.value = '';
    document.saveavailibility.descriptionedit.value = '';
    document.saveavailibility.startdateedit.value = '';
    document.saveavailibility.enddateedit.value = '';
    document.saveavailibility.availconfirmededit.checked = false;
    document.getElementById('availabilityadminedit').style.display = "none";
}

function getCheckedValue(radioObj)
{
	if(!radioObj)
	{
		return "";
	}
	var radioLength = radioObj.length;
	
	if(radioLength == undefined)
	{
		if(radioObj.checked)
		{
			return radioObj.value;
		}
		else
		{
			return "";
		}
	}		
	for(var i = 0; i < radioLength; i++)
	{
		if(radioObj[i].checked)
		{
			return radioObj[i].value;
		}
	}
	return "";
}

function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function contactDetailsPreview() {
    
    
        document.getElementById('propcontactemail').style.display = "block";
}


function popup_linktous(path, qry){
window.open(path + 'linktous/?prop=' + qry,'linktousurl','width=765,height=540,left=10,top=10,resize=no,scrollbars=no,toolbar=no');}


function addtoshortlist(propref)
{
    window.open('../shortlist/default.asp?property='+propref+'&style=w','shortlistwindow','width=400,height=200,left=50,top=50,resize=no,scrollbars=no,toolbar=no');

}

function termswindow()
{
    window.open('../terms/termswindow.asp','yhrterms','width=785,height=540,left=10,top=10,resize=no,scrollbars=yes,toolbar=no');
}

function tracker(trackerurl, trackerpage, trackerdata){
    document.write("<img height='1' width='1' src='" + trackerurl + "/site.asp?site=yourholiday&amp;page=" + trackerpage + "&amp;data=" + trackerdata + "&amp;img=no&amp;ref="+escape(document.referrer)+"' alt='' />");
}

function Disable() {
   if (document.paypal.submit.disabled==true)
    {document.paypal.submit.disabled=false;}
   else
    {document.paypal.submit.disabled=true;}
}

//-->
