// this file is a bit of a mess at the moment, unused functions etc.

function prefill() {

	//alert("onblur worked");

	afirstname = document.getElementById('firstname').value;
	//alert("afirstname: " + afirstname);
	alastname = document.getElementById('lastname').value;
	//alert("alastname: " + alastname);
	document.getElementById('chn').value = afirstname + " " + alastname;
	
}
	
function autotab(current,next){

if (current.getAttribute&&current.value.length==current.getAttribute("maxlength"))
next.focus()

}


function loadIFdata() {

	document.getElementById("roomdiv").innerHTML = roomSelectIF.document.body.innerHTML
	
}



function which() {

}	

function fntopResize() { 

	if (window.roomSelectIF){
		var fHeight = (window.roomSelectIF.tHeight) + 12;
		document.getElementById("roomSelectIF").style.height = fHeight+"px";
	}
}


function OpenNewPopupWinFacGuide(c) {
	window.open(c,
					'FacilitiesGuide',
					'width=250,height=200,scrollbars=auto,status=yes');
}

function OpenNewPopupWinRoomDetails(c) {
	window.open(c,
					'FullRoomDetails',
					'width=500,height=350,scrollbars=auto,status=yes');
}

function OpenNewPopupWinCurrConv(c) {
	window.open(c,
					'CurrencyConverter',
					'width=500,height=350,scrollbars=auto,status=yes');
}

function OpenNewPopupWin (c) {
    window.open(c,
                    'SendtoAFriend',
                    'width=550,height=270,scrollbars=yes,status=yes');
}


function bookMark() {

	  var Netscape, MSIE, Opera, Unknown;
	  var Win, Mac, Other;
	  var NetscapeVer, MSIEVer, OperaVer;
	  
	  Netscape = navigator.appName == "Netscape";
	  MSIE = navigator.appName == "Microsoft Internet Explorer";
	  Opera = navigator.userAgent.indexOf("Opera") > -1;
	  Unknown = !(Netscape || MSIE || Opera);
	  
	  Win = navigator.userAgent.indexOf("Win") > -1;
	  Mac = navigator.userAgent.indexOf("Mac") > -1;
	  Other = !(Win || Mac);
	  
	  if(Netscape) {
		NetscapeVer = parseFloat(navigator.appVersion);
	  }
	  else if(MSIE) {
		n = navigator.userAgent;
		MSIEVer = n.substr(n.indexOf("MSIE ")+("MSIE ").length, 4);
		MSIEVer = parseFloat(MSIEVer); 
		
		if(Opera) {
		  OperaVer = n.substr(n.indexOf("Opera ")+("Opera ").length, 4);
		  OperaVer = parseFloat(OperaVer);
		}
	  }

	if(Opera) {
	alert("Press Ctrl+T to bookmark this site!");
	}
	else if(Win && MSIE && MSIEVer >= 5) {
	window.external.addfavorite(location.href, document.title);
	}
	else if(Mac) {
	alert("Press Cmd+D to bookmark this site!");
	}
	else {
	alert("Press Ctrl+D to bookmark this site!");
	}

}

function showDetails(mainURL) {
    detailsWindow = window.open(mainURL,"detail","width=600,height=320,scrollbars=1,resizeable=1");
   	detailsWindow.focus();
   	return false;
}
