<!--

//PRELOAD

var navOn = -1;
var timeoutId;
var loaded = false;

var subnavs = ['about','rooms','cuisine'];

//FLASH SNIFF
var useFlash = false;

if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
// Check for Flash version 5 or greater in Netscape
var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
//alert(plugin);
//alert(parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)));
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=5)
	useFlash = true;
} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	// Assume any Windows IE except for Windows 3.1 supports the OBJECT tag
	useFlash = true;
}

//BROWSER SNIFF
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isIE6 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isDHTML = (isIE5 || isIE6 || isNS6);
var isPc = navigator.userAgent.indexOf("Windows") != -1;
var isMac = !isPc;

var obj = null;

if(!isDHTML) {
	document.location.replace('oldbrowser.htm');
}


//FUNCTIONS

function doOnLoad() {
	loaded = true;
	//alert(document.all);
	//alert(document.getElementById);
}

function swap(name,state) {
	var elem = document.getElementById(name);
	elem.src = 'images/' + name + state + '.gif';
}

function navOver(which) {
	if(loaded==false) return;
    clearNavTimeout();
    navOn = which;
    setNavStates();
}

function navOut() {
    navTimeout();
}

function setNavStates() {
    //alert(subnavs);
	for(i=0; i<subnavs.length; i++) {
    	if(i==navOn) navTurn(subnavs[i],1);
    	else navTurn(subnavs[i],0);
    }
}

function clearAllNav() {
    navOn = -1;
    setNavStates(-1);
}

function navTimeout() {
    clearNavTimeout();
    timeoutId = setTimeout("clearAllNav()",500);
}

function clearNavTimeout() {
    clearTimeout(timeoutId);
}

function navTurn(which,state) {
	if (isNS6 || isIE4 || isIE5){
		var hidden = 'hidden';
		var visible = 'visible';
	} else if (document.layers){
		var hidden = 'hide';
		var visible = 'show';
	}

	//alert(which+':'+state);
    var newVis;
    if (state == 0) {
        newVis = hidden;
        swap('nav_'+which,'');
    } else {
        newVis = visible;
        swap('nav_'+which,'_over');
    }


        which = 'subnav_' + which;
	
	if (document.getElementById(which)) {
		//alert('getbyid');
		obj = document.getElementById(which);
        obj.style.visibility = newVis;
	} else if (isIE4 || isIE5){
        obj = eval('document.all.' + which + '.style');
        obj.visibility = newVis;
    } else if (isNS6){
        obj = document.getElementById(which);
        obj.style.visibility = newVis;
    } else if (document.layers['nav_test']){
        document.layers[which].visibility = newVis;
    }
}

function getFlash(flash,width,height,bgcolor) {
	var html = '';
	if(useFlash) {
		html = html + '<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=' + width + ' HEIGHT=' + height + '>';
		html = html + '<PARAM NAME=movie VALUE=\"' + flash + '\"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#' + bgcolor + '>';
		html = html + '<EMBED src=\"' + flash + '\" quality=high bgcolor=#' + bgcolor + ' WIDTH=' + width + ' HEIGHT=' + height + ' TYPE="application/x-shockwave-flash" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">';
		html = html + '</EMBED></OBJECT>';
	} else {
		html = html + '<br><br><br><a href=\"welcome.htm\">Click here to enter</a>';
	}
	return html;
}

function popRoom(roomId) {
	var dx=592;
	var dy=400;

	var w = window.open('room_'+roomId+'.htm', 'roomdetail', 'width=' + dx + ',height=' + dy + ',status=no,resizable=no,menubar=no,location=no,scrollbars=no,toolbar=no');
	w.focus();
}

function getOffset() {
    if (isNS6) { return Math.floor(self.innerWidth/2) - 7 - 380; }
    if (isOpera) { return Math.floor(self.innerWidth/2) - 380; }
    if (isIE4 || isIE5 || isIE6) { return Math.floor(self.innerWidth/2) - 380; }
    if (isIE4 || isIE5 || isIE6) { return navOffset[which]; }
}
//-->
