function blockError(){return true;}
window.onerror = blockError;

//Hides all select elements
function hideSelect(){
       var selects = document.getElementsByTagName("select");
       for(var x=0;x<selects.length;x++){
          selects[x].style.display = "none";
       }
}

function showSelect(){
       var selects = document.getElementsByTagName("select");
       for(var x=0;x<selects.length;x++){
          selects[x].style.display = "block";
       }
}



// GALLERY VIEWER OPTIONS

var viewer 		= "same"	// OPTIONS: | new | popup | same | New browser or a popup
var width 		= "800"		// WIDTH OF THE POPUP
var height 		= "625"		// HEIGHT OF THE POPUP
var scrollbars		= "yes"		// SHOW SCROLLBARS IN POPUP - yes OR no
var menu		= "no"		// SHOW MENU IN POPUP - yes OR no
var tool		= "no"		// SHOW TOOLBAR IN POPUP - yes OR no



// FAQ POPUP OPTIONS

var FAQ_width 		= 500		// FAQ POPUP HEIGHT
var FAQ_height 		= 500		// FAQ POPUP HEIGHT
var faqscrollbarS 	= "0"		// TURN ON FAQ SCROLLBARS "1" FOR ON "0" FOR OFF
var FAQviewer	 	= "no"		// yes/ FAQ FULL SCREEN OR no/POPUP MODE






// COPYRIGHT 2007 © Allwebco Design Corporation
// Unauthorized use or sale of this script is strictly prohibited by law

// YOU DO NOT NEED TO EDIT BELOW THIS LINE






// START IMAGE VIEW CODE

function ViewImage(data) {
   if (viewer == "popup") {
    windowHandle = window.open('image-viewer.htm' + '?' + data,'windowName',',scrollbars='+scrollbars+',resizable=yes,toolbar='+tool+',menubar='+menu+',width='+width+',height='+height+'');

}
else if (viewer == "new") {
    windowHandle = window.open('image-viewer.htm' + '?' + data,'windowName');
}
else if (viewer == "same") {
    window.location = ('image-viewer.htm' + '?' + data);
}
}

// END IMAGE VIEW CODE










// START FAQ POPUP

function popUpFAQ(URL) {
day = new Date();
id = day.getTime();
   if (FAQviewer == "no") {
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=' + faqscrollbarS + ',location=0,statusbar=0,menubar=0,resizable=1,width='+FAQ_width+',height='+FAQ_height+'');");
}
else
if (FAQviewer == "yes") {
eval("page" + id + " = window.open(URL);");
}
}

IEMhover = function() {
	
   var IEMh = document.getElementById("topmenu0").getElementsByTagName("LI");

	for (var i=0; i<IEMh.length; i++) {
		IEMh[i].onmouseover=function() {
			this.className+=" IEMhover";
			hideSelect();
		}
		IEMh[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" IEMhover\\b"), "");
			showSelect();
		}
	}
}

IEMhover2 = function() {
	
   var IEMh2 = document.getElementById("side").getElementsByTagName("LI");

	for (var i=0; i<IEMh2.length; i++) {
		IEMh2[i].onmouseover=function() {
			this.className+=" IEMhover2";
			//hideSelect();
		}
		IEMh2[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" IEMhover2\\b"), "");
			//showSelect();
		}
	}
}

function runIEmenu(){
  if(window.attachEvent){
   var IEMh = document.getElementById("topmenu0").getElementsByTagName("LI");

	for (var i=0; i<IEMh.length; i++) {
		IEMh[i].onmouseover=function() {
			this.className+=" IEMhover";
			hideSelect();
		}
		IEMh[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" IEMhover\\b"), "");
			showSelect();
		}
	}
  }
}

function runIEmenu2(){
  if(window.attachEvent){
    var IEMh2 = document.getElementById("side").getElementsByTagName("LI");

    for (var i=0; i<IEMh2.length; i++) {
		IEMh2[i].onmouseover=function() {
			this.className+=" IEMhover2";
			//hideSelect();
		}
		IEMh2[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" IEMhover2\\b"), "");
			//showSelect();
		}
	}
  }
}

function setSelect(id,value){
   var length = document.getElementById(id).options.length;
   for(var x=0;x< length;x++){
      if(document.getElementById(id).options[x].value == value){
          document.getElementById(id).selectedIndex =x;
          break;
      }
   }
}

function setBookerDate(){
   var currentDate = new Date();
   var millis = currentDate.getTime();
   var startDate = new Date(millis+2*24*60*60*1000);
   var endDate = new Date(millis+4*24*60*60*1000);
   
   var month = startDate.getMonth()+1
   var startIt = String(startDate.getFullYear())+"/"+String(month)+"/"+String(startDate.getDate());
   document.getElementById("arrive").value = startIt;
   var month = endDate.getMonth()+1
   var end = String(endDate.getFullYear())+"/"+String(month)+"/"+String(endDate.getDate());
   document.getElementById("depart").value = end;
}


if (window.attachEvent) window.attachEvent("onload", IEMhover);
if (window.attachEvent) window.attachEvent("onload", IEMhover2);
if (window.attachEvent) window.attachEvent("onload", setBookerDate);

