function showall() {
	whichpost = document.getElementById("1006");
	whichpost.className="postshown";
	whichpost = document.getElementById("1005");
	whichpost.className="postshown";
	whichpost = document.getElementById("1004");
	whichpost.className="postshown";
	whichpost = document.getElementById("1003");
	whichpost.className="postshown"; 
	whichpost = document.getElementById("1002");
	whichpost.className="postshown"; 
	whichpost = document.getElementById("1001");
	whichpost.className="postshown"; 
}
function hideall() {
	whichpost = document.getElementById("1006");
	whichpost.className="posthidden";
	whichpost = document.getElementById("1005");
	whichpost.className="posthidden";
	whichpost = document.getElementById("1004");
	whichpost.className="posthidden";
	whichpost = document.getElementById("1003");
	whichpost.className="posthidden"; 
	whichpost = document.getElementById("1002");
	whichpost.className="posthidden"; 
	whichpost = document.getElementById("1001");
	whichpost.className="posthidden"; 
}
function expandcollapse (postid) { 
  whichpost = document.getElementById(postid); 
  if (whichpost.className=="postshown") { 
    whichpost.className="posthidden"; 
   } 
   else { 
    whichpost.className="postshown"; 
   } 
} 
<!-- this is for show hide on Help pages END -->
function NewWindow(mypage, myname, w, h, scroll) {
 var winl = (screen.width - w) / 2;
 var wint = (screen.height - h) / 2;
 winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+false+''
 win = window.open(mypage, myname, winprops)
 if (parseInt(navigator.appVersion) >= 4) {
   win.window.focus(); 
 }
}
<!-- this is for Opening in a new window END -->

<!-- this is for pictures on resort pages START -->
var preloadedImg = new Image(32,32);
preloadedImg.src = '/pix/indicator.gif';
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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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];}
}
<!-- this is for pictures on resort pages END -->

SubmitSearchValue = "";
function SetFocusOnSearch() {
  document.searchform.prodType.focus();
}
function SetSubmitSearchValue(control) {
  SubmitSearchValue = control.value;
}
function ForceLogin(SourceIdent) {
  document.ForceLogin.SourceIdent.value = SourceIdent;
  document.ForceLogin.submit();
}
function VerifyResortSearch() { 
  var box=document.ressearchform;
  if (box.searchInput.value == "") {
    box.searchInput.focus();
    return false;
  }
  else {
    writeIndicator('indicator');
    Go();
    return true;
  }
} 
function VerifySearchParam() {
  if (SubmitSearchValue != "Advanced") {
    var box = document.searchform.prodType;
    if ((document.searchform.searchInput.value == "") ||
        (box.options[box.selectedIndex].value == "#")) {
      document.searchform.searchInput.focus();
      return false;
    }
    else {
      return true;
    }
  }
  else {
    return true;
  }
}
function prodTypeChanged(control) {
  if (control.options[control.selectedIndex].value == 4) {
    SubmitSearchValue = "Advanced";
    document.searchform.submit();
  }
}
function writeAlert(text, id) {
  alert(text);
	if (document.getElementById){
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML ='<b>'+ text+ '</b>';
    setTimeout("deleteAlert('"+id+"')",5000);
	}
	else if (document.all) {
    x = document.all[id];
    x.innerHTML = '<b>'+text+'</b>';
    setTimeout("deleteAlert('"+id+"')",5000);
	}
	else if (document.layers) {
    x = document.layers[id];
    text2 = '<P CLASS="alert"><b>' + text + '</b></P>';
    x.document.open();
    x.document.write(text2);
    x.document.close();
    setTimeout("deleteAlert('"+id+"')",5000);
	}
}
function deleteAlert(id) {
  if (document.getElementById) {
    x = document.getElementById(id);
    x.innerHTML = '';
  }
	else if (document.all) {
    x = document.all[id];
    x.innerHTML = '';
  }
	else if (document.layers) {
    x = document.layers[id];
    text2 = '';
    x.document.open();
    x.document.write(text2);
    x.document.close();
  }    
}
function writeIndicator(id) {
  if (document.getElementById) {
    x = document.getElementById(id);
    x.innerHTML = '';
    x.innerHTML ='<img id="indicator" class="indicator" name="indicator"  width="20" height="20"/>';
  }
	else if (document.all) {
    x = document.all[id];
    x.innerHTML ='<img id="indicator" class="indicator" name="indicator"   width="20" height="20"/>';
  }
  else if (document.layers) {
    x = document.layers[id];
    text2 = '<img id="indicator" class="indicator" name="indicator"   width="20" height="20"/>';
    x.document.open();
    x.document.write(text2);
    x.document.close();
  }    
}
function Go() {
  document.images['indicator'].src=preloadedImg.src;
}
function pointAdjust(radioButton) {
  //writeAlert('XXXXXXXX','alertpoints');
  var d=document.BookForm;
  var tPoint=document.getElementById("Points"+radioButton.name);
  var old=document.getElementById("OldPoints"+radioButton.name);
  var RNOU=document.getElementById("RNOU"+radioButton.name);
  if (RNOU.value=='') {
    RNOU.value=1;
  }
  var oldButton='';
  if (old.value != '') {
    oldButton=document.getElementById(old.value);
  }
  var Parse=radioButton.value;
  var points='';
  var i=19;
  while (i < Parse.length + 1) {
    points= points+Parse.substring(i, i + 1);
    i++;
  }
  var Add=parseInt(d.RemainingPoints.value)+parseInt(tPoint.value);
  if(radioButton != oldButton) { // Selected
    if(Add-(parseInt(RNOU.value)*points)>=0) {
      old.value=radioButton.id;
      d.RemainingPoints.value=Add;
      tPoint.value=parseInt(RNOU.value)*parseInt(points);
      d.RemainingPoints.value=parseInt(d.RemainingPoints.value)-parseInt(tPoint.value);
      d.UsedPoints.value=parseInt(d.TotalPoints.value)-parseInt(d.RemainingPoints.value);
    }
    else {
      var id="alertpoints";
      writeAlert('Not enough points - Required ' + points + ' where available ' + Add,id);
      radioButton.checked=false;
      RNOU.value='';
      if (oldButton.name != '')
        oldButton.checked=true;
    }
  }
  else { // UnSelected
    oldButton='';
    old.value='';
    radioButton.checked=false;
    d.RemainingPoints.value=Add;
    d.UsedPoints.value=parseInt(d.TotalPoints.value)-parseInt(d.RemainingPoints.value);
    tPoint.value=0;
    RNOU.value='';
  }
  if (d.UsedPoints.value > 0) {
    allowBooking(true);
  }
  else {
    allowBooking(false);
  }
}
