// JavaScript Document
<!--
function switchmenu(obj){
        if(document.getElementById){
        var el = document.getElementById(obj);
        var ar = document.getElementById("maindiv").getElementsByTagName("span"); 
                if(el.style.display != "block"){
                        for (var i=0; i<ar.length; i++){
                                if (ar[i].className=="submenu") 
                                ar[i].style.display = "none";
                        }
                        el.style.display = "block";
                }else{
                        el.style.display = "none";
                }
        }
}
var timeout;
function setSubTimer() {
	timeout=setTimeout('switchmenu(\'sub1\')', 300);
}

function chkTimeOut() {
	if (timeout) clearTimeout(timeout);
}
var timeout;
function setSubTimer() {
	timeout=setTimeout('switchmenu(\'sub1\')', 300);
}

function chkTimeOut() {
	if (timeout) clearTimeout(timeout);
}
/* modified browser detect from quirksmode.org */
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.isIE=(this.browser=='Explorer')? true : false;
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		}
	]
};

var Hilton={
	init:function() {
		this.targ=document.getElementById('maindiv');
		this.rome=document.getElementById('rome');
		this.ifrome=document.getElementById('if_rome');
		
		this.ORIG_ALPHA=0;
		this.DEST_ALPHA=60;
		this.step=0;
		this.tstep=10;
		this.power=0.5;

		var modal=document.createElement('div');
		modal.setAttribute('id', 'modal');
		this.modal=this.targ.appendChild(modal);
		
		this.rw=this.rome.offsetWidth/2.3;
		this.rh=this.rome.offsetHeight;
		this.rh=0;
		
		this.update2D();
		this.rome.style.display='none';
		
		this.modal.onclick=this.hclose;
	},
	hopen:function(where) {
		if (where != '') Hilton.ifrome.src=where;
		
		if (document.getElementById("field")) {
			document.getElementById("plat").style.display = 'none';
			document.getElementById("field").style.display = 'none';
		}

		Hilton.modal.style.display='block';
		Hilton.rome.style.display='block';
		
		Hilton.startpos=Hilton.ORIG_ALPHA;
		Hilton.dest=Hilton.DEST_ALPHA;
		if (Hilton.intval!=null) clearInterval(Hilton.intval);
		Hilton.intval=setInterval('Hilton.animate()', 10);
	},
	hclose:function() {
		Hilton.rome.style.display='none';

		Hilton.startpos=Hilton.DEST_ALPHA;
		Hilton.dest=Hilton.ORIG_ALPHA;
		if (Hilton.intval!=null) clearInterval(Hilton.intval);
		Hilton.intval=setInterval('Hilton.animate()', 10);

		if (document.getElementById("field")) {
			document.getElementById("plat").style.display = 'block';
			document.getElementById("field").style.display = 'block';
		}

	},
	update2D:function() {
		Hilton.tw=Hilton.targ.offsetWidth;
		Hilton.th=Hilton.targ.offsetHeight;
		
		var pos=Hilton.findPos(Hilton.targ);
		Hilton.tx=pos[0];
		Hilton.ty=pos[1];
		
		Hilton.modal.style.top=Hilton.ty+'px';
		Hilton.modal.style.left=Hilton.tx+'px';
		Hilton.modal.style.width=Hilton.tw+'px';
		Hilton.modal.style.height=Hilton.th+'px';
		
		Hilton.rl=(Hilton.tw/2)-Hilton.rw;
		Hilton.rt=(Hilton.th/2)-Hilton.rh;
		//Hilton.rome.style.top=Hilton.rt+'px';
		//Hilton.rome.style.left=Hilton.rl+'px';
		Hilton.rome.style.top='200px';
		Hilton.rome.style.left='400px';
	},
	findPos:function(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft;
			curtop = obj.offsetTop;
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			}
		}
		return [curleft,curtop];
	},
	animate:function() {
		var res=Hilton.easeInOut(Hilton.startpos, Hilton.dest, Hilton.tstep, Hilton.step, Hilton.power);
		if (BrowserDetect.isIE) Hilton.modal.style.filter='alpha(opacity='+res+')';
		else Hilton.modal.style.opacity=res/100;

		Hilton.step++;
		if (Hilton.step>Hilton.tstep) Hilton.denouement();
	},
	denouement:function() {
		clearInterval(Hilton.intval);
		Hilton.step=0;
		if (BrowserDetect.isIE) Hilton.modal.style.filter='alpha(opacity='+Hilton.dest+')';
		else Hilton.modal.style.opacity=Hilton.dest/100;
		
		if (Hilton.dest==Hilton.ORIG_ALPHA) Hilton.modal.style.display='none';
	},
	easeInOut:function(minValue,maxValue,totalSteps,actualStep,powr) {
		var delta = maxValue - minValue;
		var stepp = minValue+(Math.pow(((1 / totalSteps) * actualStep), powr) * delta);
		return Math.ceil(stepp);
	}
};
function init() {
	Hilton.init();
	BrowserDetect.init();
	window.onresize=Hilton.update2D;
}

window.onload=init;
//-->