﻿function setIFRAMETOOL(id) {
   if (document.getElementById && !(document.all)) {
      var height = document.getElementById(id).contentDocument.body.scrollHeight;
      document.getElementById(id).style.height = height;
   } else if (document.all) {
      var height = document.frames(id).document.body.scrollHeight;
      document.getElementById(id).style.height = height;
   }
   //parent.document.getElementById("iframe_top").style.height = height;
}

function setDEFAULTHEIGHT(id) {
   var height = window.frames[id].document.body.scrollHeight;
   //document.getElementById(id).style.height = height;
   document.getElementById(id).setAttribute("height", height);
}

function sRequest() {
   var tool = document.forms["sendform"].tool.value;
   if (tool==1) {
      document.forms["sendform"].pnh_category.value = document.forms["searchform"].pnh_category.value;
      document.forms["sendform"].area.value = document.forms["searchform"].area.value;
      document.forms["sendform"].location.value = document.forms["searchform"].location.value;
      document.forms["sendform"].bedroom.value = document.forms["searchform"].bedroom.value;
      document.forms["sendform"].pnh_price.value = document.forms["searchform"].pnh_price.value;
      document.forms["sendform"].pool.value = document.forms["searchform"].pool.value;
      document.forms["sendform"].seaview.value = document.forms["searchform"].seaview.value;
   } else if (tool==2) {
      document.forms["sendform"].pnh_category.value = document.forms["searchform"].pnh_category.value;
      if (document.forms["searchform"].term[0].checked) {
         termvalue = "long";
      } else {
         termvalue = "short";
      }
      document.forms["sendform"].term.value = termvalue;
      document.forms["sendform"].area.value = document.forms["searchform"].area.value;
      document.forms["sendform"].location.value = document.forms["searchform"].location.value;
      document.forms["sendform"].bedroom.value = document.forms["searchform"].bedroom.value;
      document.forms["sendform"].pnh_price.value = document.forms["searchform"].pnh_price.value;
      document.forms["sendform"].pool.value = document.forms["searchform"].pool.value;
      document.forms["sendform"].seaview.value = document.forms["searchform"].seaview.value;
   } else if (tool==3) {
      document.forms["sendform"].boattype.value = document.forms["searchform"].boattype.value;
      document.forms["sendform"].b_length.value = document.forms["searchform"].b_length.value;
      document.forms["sendform"].boatprice.value = document.forms["searchform"].boatprice.value;
   } else if (tool==4) {
      document.forms["sendform"].boatlocation.value = document.forms["searchform"].boatlocation.value;
      document.forms["sendform"].boattype.value = document.forms["searchform"].boattype.value;
      document.forms["sendform"].b_purpose.value = document.forms["searchform"].b_purpose.value;
      document.forms["sendform"].b_berths.value = document.forms["searchform"].b_berths.value;
   } else if (tool==5) {
      document.forms["sendform"].c_choice.value = document.forms["searchform"].c_choice.value;
      document.forms["sendform"].c_type.value = document.forms["searchform"].c_type.value;
      document.forms["sendform"].c_price.value = document.forms["searchform"].c_price.value;
   }
   
   document.forms["sendform"].submit();
}

function AdImgRandom(imgno) {
   return true;
}

// no right-click script
{
   am = "This function is disabled!";

   bV  = parseInt(navigator.appVersion)
   bNS = navigator.appName=="Netscape"
   bIE = navigator.appName=="Microsoft Internet Explorer"

   function norightclick(e)
   {
      if (bNS && e.which > 1){
         alert(am)
         return false
      } else if (bIE && (event.button >1)) {
        alert(am)
        return false;
      }
   }

   document.onmousedown = norightclick;
   if (document.layers)
      window.captureEvents(Event.MOUSEDOWN);
      
   if (bNS && bV<5)
      window.onmousedown = norightclick;
}

