// JavaScript Document
function bookmarksite(title, url){
	if (document.all){    // IE
		window.external.AddFavorite(url, title);
	}
	else if(window.sidebar){ // firefox
		window.sidebar.addPanel(title, url, "");
		}
	else if( window.opera && window.print ){  // opera
		var mbm = document.createElement('a');
		mbm.setAttribute('rel','sidebar');
		mbm.setAttribute('href',url);
		mbm.setAttribute('title',title);
		mbm.click();
    }	
}
function newWindow(curr)
{
	currWindow = window.open(curr, 'CurrConverter', 'width=460,height=310');
	currWindow.focus;
}

// BOF :: Search Form Validations
function chk_hotelfrm(){
		var msg="Hotel name, attraction, postcode";
		var obj = document.HotelSearch;
		if(obj.city_sa.value=="" || obj.city_sa.value==msg) {
			var btn = valButton(obj.city);
			if (btn == null) {
				alert("Please Enter your destination.");
				obj.city_sa.focus();
				return false; 
			}			
		}
		if(obj.SDate.value=="") {
			alert("Please Select Date.");
			obj.SDate.focus();
			return false; 
		}
		if(obj.Nights_num.value=="") {
			alert("Please Select No. of nights.");
			obj.Nights_num.focus();
			return false; 
		}
		return true;		
}

function valButton(btn) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
   if (btn[i].checked) {cnt = i; i = -1;}
   }
if (cnt > -1) return btn[cnt].value;
else return null;
}
// EOF :: Search Form Validations


var state = 'hidden';
function showhide(layer_ref) {
	if (state == 'visible') {
		state = 'hidden';
	}
	else {
		state = 'visible';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
	}
	if (document.getElementById && !document.all) {
		maxwell_smart = document.getElementById(layer_ref);
		maxwell_smart.style.visibility = state;
	}
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=460,height=360,screenX=150,screenY=150,top=150,left=150')
}

/*function showhide(id) {
	var class = 'divShow';
  if (document.getElementById(id).className == "divHide") {
	  class = 'divShow';
  }
  if (document.getElementById(id).className == "divShow") {
		class = 'divHide';
  }
  document.getElementById(id).className = class;
}*/