<!-- Standar image effects -->
<!--
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_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_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];
		}
}
function MM_showHideLayers() { //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) {
		if ((obj=MM_findObj(args[i]))!=null) { 
			v=args[i+2];
	    	if (obj.style) { 
	    		obj=obj.style; 
		    	v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
		    }
	    	obj.visibility=v;
	    }
	}
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
	var obj = MM_findObj(objName);
	if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
		if (theValue == true || theValue == false) eval("obj."+theProp+"="+theValue);
		else eval("obj."+theProp+"='"+theValue+"'");
	}
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
	if ((obj=MM_findObj(objName))!=null) with (obj)
		if (document.layers) {document.write(unescape(newText)); document.close();}
		else innerHTML = unescape(newText);
}

function popUpWindow(url,name) {
	newWindow = window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=yes,resizable=yes,width=640,height=480');
}

function printPage() {
  if (window.print) {
	  setTimeout('window.print();',200);
  }
  else if (agt.indexOf("mac") != -1) {
	  alert("Press 'Cmd+p' on your keyboard to print article.");
  }
  else {
	  alert("Press 'Ctrl+p' on your keyboard to print article.")
  }
}
function blankDate(){
	document.placeFinder.month.options.selectedIndex=0;
	document.placeFinder.day.options.selectedIndex=0;
}

<!-- pop up code for home page -->
function newCookie(name,value,days) {
 var days = 1;   // the number at the left reflects the number of days for the cookie to last
                 // modify it according to your needs
 if (days) {
   var date = new Date();
   date.setTime(date.getTime()+(days*24*60*60*1000));
   var expires = "; expires="+date.toGMTString(); }
   else var expires = "";
   document.cookie = name+"="+value+expires+"; path=/";
}
/*function openMap(lat, lng, hotelName, hotelAddress){ //old
 	var win = window.open("/hotels/map?lat="+lat+"&lng="+lng+"&hotelName="+escape(hotelName)+"&hotelAddress="+escape(hotelAddress), "Map", "width=615,height=415,status=no,resizable=no,top=200,left=200");
 	win.focus();
}*/
function openMap(chainId,classId,lat,lng,hotelName,hotelAddress){
 	var win = window.open("/hotels/map?chainId="+chainId+"&classId="+classId+"&lat="+lat+"&lng="+lng+"&hotelName="+escape(hotelName)+"&hotelAddress="+escape(hotelAddress), "Map", "width=615,height=415,status=no,resizable=no,top=200,left=200");
 	win.focus();
}
function readCookie(name) {
   var nameSG = name + "=";
   var ca = document.cookie.split(';');
  for(var i=0; i<ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
  if (c.indexOf(nameSG) == 0) return c.substring(nameSG.length,c.length); }
    return null;
}
function eraseCookie(name) {
  newCookie(name,"",1);
}
function amt() {
  var num = readCookie('sancookie1')
  if (num < 1) { 
  newCookie('sancookie1','testcookie1');
  //SW=window.open('../action/newzealand','NewWin','toolbar=no,status=no,width=350,height=135,scrollbars')
  SW=window.open('../action/newzealand','NewZealand','toolbar=no,location=0,directories=0,status=0,scrollbars=no,resizable=yes,width=406,height=330');
  SW.moveTo(190,240); 
  }
}
function showHotelSearchTab() {
	MM_changeProp('mapSearchMain','','style.display','none');
	MM_changeProp('hotelSearchMain','','style.display','block');
	MM_swapImage('mapSearch','','../../images/map_search_off_en.gif',1);
	MM_swapImage('hotelSearch','','../../images/book_hotel_on_en.gif',1);
	MM_changeProp('mapSearchTab','','style.zIndex','1','DIV');
	MM_changeProp('hotelSearchTab','','style.zIndex','4','DIV');
}
function showMapSearchTab() {
	MM_changeProp('mapSearchMain','','style.display','block');
	MM_changeProp('hotelSearchMain','','style.display','none');
	MM_swapImage('mapSearch','','../../images/map_search_on_en.gif',1);
	MM_swapImage('hotelSearch','','../../images/book_hotel_off_en.gif',1);
	MM_changeProp('mapSearchTab','','style.zIndex','4','DIV');
	MM_changeProp('hotelSearchTab','','style.zIndex','1','DIV');
}
function showMiniMapSearchTab() {
	MM_changeProp('miniMapSearchMain','','style.display','block');
	MM_changeProp('bookWide','','style.display','none');
	MM_swapImage('mapSearch','','../../images/map_search_on_en.gif',1);
	MM_swapImage('hotelSearch','','../../images/book_hotel_off_en.gif',1);	
	MM_changeProp('mapSearchTab','','style.zIndex','4','DIV');
	MM_changeProp('hotelSearchTab','','style.zIndex','1','DIV');
}
function showMiniHotelSearchTab() {
	MM_changeProp('miniMapSearchMain','','style.display','none');
	MM_changeProp('bookWide','','style.display','block');
	MM_swapImage('mapSearch','','../../images/map_search_off_en.gif',1);
	MM_swapImage('hotelSearch','','../../images/book_hotel_on_en.gif',1);
	MM_changeProp('mapSearchTab','','style.zIndex','1','DIV');
	MM_changeProp('hotelSearchTab','','style.zIndex','4','DIV');
}
function showHideLanguageSelector() {
	var obj, display, image;
	obj=document.getElementById('languageSelector');
	if( obj != null ) {
		if( obj.style.display=='none' || obj.style.display=='' ) {	//expand
			display='block';
			image='../../common/images/dropdown_arrow_up.gif';
		} else if(obj.style.display=='block') {	//contract
			display='none';
			image='../../common/images/dropdown_arrow_down.gif';
		}
		MM_swapImage('languageDropdown','',image,1);
		MM_changeProp('languageSelector','','style.display',display);
	}
}
function openCalendar(str_ctrl,str_month,str_day,str_form){
	var vWinCal = window.open("/hotels/calendar?ctrl="+str_ctrl+"&month="+str_month+"&day="+str_day+"&form="+str_form, "Calendar", "width=350,height=250,status=no,resizable=yes,top=200,left=200");
	vWinCal.focus();
}
function openCalendarssl(str_ctrl,str_month,str_day,str_form){
	var vWinCal = window.open("/hotels/calendarssl?ctrl="+str_ctrl+"&month="+str_month+"&day="+str_day+"&form="+str_form, "Calendar", "width=350,height=250,status=no,resizable=yes,top=200,left=200");
	vWinCal.focus();
}
function checkDates(ctrl, formName){
	//get the values of these dates so we can validate
	var myform = document.getElementById(formName);
	var ONE_DAY = 1000 * 60 * 60 * 24;
	var today = new Date();
	var arrivalDate = new Date(today.getFullYear(),myform.month.options.selectedIndex-1,myform.day.options.selectedIndex);
	var departDate = new Date(today.getFullYear(),myform.depart_month.options.selectedIndex-1,myform.depart_day.options.selectedIndex);
	if(myform.month.options.selectedIndex < today.getMonth()){
		arrivalDate.setFullYear(today.getFullYear()+1);
	}	
	if(myform.depart_month.options.selectedIndex < today.getMonth()){
		departDate.setFullYear(today.getFullYear()+1);
	}	
	if(ctrl == 'arrival'){
	   if (arrivalDate.getTime() >= departDate.getTime()){
	      departDate.setTime(arrivalDate.getTime()+ONE_DAY);			
	   }        
	}else if(ctrl == 'depart'){
	   if (departDate.getTime() <= arrivalDate.getTime()){
	      arrivalDate.setTime(departDate.getTime()-ONE_DAY);
	   }
	}
	myform.day.options.selectedIndex=eval(arrivalDate.getDate());
	myform.month.options.selectedIndex=eval(arrivalDate.getMonth()+1);
	myform.depart_day.options.selectedIndex=eval(departDate.getDate());
	myform.depart_month.options.selectedIndex=eval(departDate.getMonth()+1);
}
function validateDates(formName){
	//get the values of these dates so we can validate
	var myform = document.getElementById(formName);
	var today = new Date();
	var arrivalDate = new Date(today.getFullYear(),myform.month.options.selectedIndex-1,myform.day.options.selectedIndex);
	var departDate = new Date(today.getFullYear(),myform.depart_month.options.selectedIndex-1,myform.depart_day.options.selectedIndex);

	//if selected arrival date is earlier than the current date, add 1 year to the arrival date
	if (myform.month.options.selectedIndex < today.getMonth()){
	  arrivalDate.setFullYear(today.getFullYear()+1);
	}	
	//if selected departure date is earlier than the current month, add 1 year to the departure date
	if (myform.depart_month.options.selectedIndex < today.getMonth()){
	  departDate.setFullYear(today.getFullYear()+1);
	}
	if (arrivalDate.getTime() > departDate.getTime()){	
		return 1;
	}
	//if arrival departure booking is more than 51 weeks(357 days) in advance inform the
	//user this isn't possible to book
	//Call the weeks_between function
	var days_left = daysBetween(today, arrivalDate)
	if (days_left > 357){
		return 2;
	}
	
	// Call the weeks_between function
	days_left = daysBetween(today, departDate)
	if (days_left > 357){	
		return 5; 
	}
}
function daysBetween(date1, date2) {
    // The number of milliseconds in one day
    var ONE_DAY = 1000 * 60 * 60 * 24
    // Convert both dates to milliseconds
    var date1_ms = date1.getTime()
    var date2_ms = date2.getTime()
    // Calculate the difference in milliseconds
    var difference_ms = Math.abs(date1_ms - date2_ms)
    // Convert back to days and return
    return Math.round(difference_ms/ONE_DAY)
}
function loadFlashMap(){
	var text = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" name="map" width="770" height="286" id="map"><param name="movie" value="../map/map.swf?lang=eng" /><param name="quality" value="high" /><param name="swliveconnect" value="true" /><embed src="../map/map.swf?lang=eng" width="770" height="286" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="map" swliveconnect="true"></embed></object>';
	MM_setTextOfLayer('mapSearchMainForm','',text);
}
function loadFlashMapNZ(){
	var text = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" name="map_nz" width="770" height="286" id="map_nz"><param name="movie" value="../map/map_nz.swf?lang=eng" /><param name="quality" value="high" /><param name="swliveconnect" value="true" /><embed src="../map/map_nz.swf?lang=eng" width="770" height="286" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="map_nz" swliveconnect="true"></embed></object>';
	MM_setTextOfLayer('mapSearchMainForm','',text);
}
function show51wAd() {
	MM_changeProp('fiftyOneWeeksAd','','style.display','block');
	MM_changeProp('fiftyOneWeeksLink','','style.display','none');
	hideSelect();
}
function close51wAd() {
	MM_changeProp('fiftyOneWeeksAd','','style.display','none');
	MM_changeProp('fiftyOneWeeksLink','','style.display','block');
	unhideSelect();
}
function mapit(url) {
	var win = window.open(url, "HotelMap", "width=620,height=550,screenX=" + (screen.availWidth/2 -(620/2)) + ",left=" + (screen.availWidth/2 -(620/2)) +",screenY=" + (screen.availHeight/2 - (500/2)) +",top=" + (screen.availHeight/2 - (500/2)) +",resizable=yes,scrollbars=yes,location=no");
	win.focus();
}
function openPicture(hotelName, hotelId) {
     var url = "/hotels/picture?hotelName="+escape(hotelName)+"&hotel="+hotelId+"&crs=true";    
 	 var win = window.open(url, "Picture", "width=650,height=500,resizable=yes,top=200,left=200,scrollbars=2");
 	 win.focus();
}
function loadPhotos(hotelName, photourl, thumbnailurl, hotelId) {
 	var win = window.open("/hotels/picture?hotelName="+escape(hotelName)+'&photourl='+photourl+'&hotel='+hotelId+'&crs=true', "Picture", "width=650,height=500,resizable=yes,top=200,left=200,scrollbars=2");
 	win.focus();
}
function popSeal(url) {
  sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=550,height=500');
  self.name = "mainWin"; 
}
function checkGoogle(searchMsg) {
	var google = document.getElementById('google');
	if( google.q.value == searchMsg ) {
		return false;
	}
	return true;
}
function inputMiniSearchSpecialCode(code) {
	var miniPlaceFinder = document.getElementById('miniPlaceFinder');
	miniPlaceFinder.minisrp.value = code;
}
var rateCalendarHelpText = "";
function createRateCalendarHelp(titleTxt) {
	if( rateCalendarHelpText == "" ) {
		new Ajax.Request('/hotels/rateCalendarHelp', {
		    method:'get',
		    onSuccess: function(transport){
		      rateCalendarHelpText = transport.responseText || "no response text";
		      new Tip('rateCalendarHelp', rateCalendarHelpText, {title: titleTxt, className: 'rateCalendarHelp', showOn: 'click', hideOn: 'click', closeButton: true, hook:{target: 'bottomRight', tip: 'topLeft'}});
		    }
	  	});
  	}
}
var awardHelpText = "";
function showAwardHelp(titleTxt,xo,yo) {
	if( awardHelpText == "" ) {
		new Ajax.Request('/hotels/awardHelp', {
		    method:'get',
		    onSuccess: function(transport){
		      awardHelpText = transport.responseText || "no response text";
		      var xoff = xo;
		      var yoff = yo;
		      new Tip('awardHelp', awardHelpText, {title:titleTxt, className:'awardHelp', showOn:'click', hideOn:'click', closeButton:true, hook:{target:'bottomRight', tip:'topLeft'}, offset:{x:xoff,y:yoff} });
		    }
	  	});
  	}
}
var award2008Winners = "";
function show2008AwardWinners(titleTxt) {
	if( award2008Winners == "" ){
		new Ajax.Request('/hotels/awardWinners', {
		    method:'get',
		    parameters:{year: 2008},
		    onSuccess: function(transport){
		      award2008Winners = transport.responseText || "no response text";
		      new Tip('2008', award2008Winners, {title:titleTxt, className:'awardWinners', showOn:'click', hideOn:'click', closeButton:true, hook:{target:'topLeft', tip:'topLeft'}, offset:{x:-270,y:-250} });
		    }
	  	});
  	}
}
var award2007Winners = "";
function show2007AwardWinners(titleTxt) {
	if( award2007Winners == "" ){
		new Ajax.Request('/hotels/awardWinners', {
		    method:'get',
		    parameters:{year: 2007},
		    onSuccess: function(transport){
		      award2007Winners = transport.responseText || "no response text";
		      new Tip('2007', award2007Winners, {title:titleTxt, className:'awardWinners', showOn:'click', hideOn:'click', closeButton:true, hook:{target:'topLeft', tip:'topLeft'}, offset:{x:-230,y:-210} });
		    }
	  	});
  	}
}
//-->