function popUp(URL, popWidth, popHeight, popLeft, popTop, autoCenter, fullScreen) {
	day = new Date();
	id = day.getTime();
	if (autoCenter == 1) {
		var popLeft = (screen.width - popWidth) / 2;
		var popTop = (screen.height - popHeight) / 2;
	}
	
	if (fullScreen == 1) {
		// Open in Full Screen window!
		eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+(screen.width-10)+",height="+(screen.height-26)+",left=0,top=0');");
	} else {
		// Open in normal window!
		eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+popWidth+",height="+popHeight+",left="+popLeft+",top="+popTop+"');");
	}
}

function toggleDiv( element, showhide ) {
	var e = document.getElementById(element);
	if ( e ) {
		switch ( showhide ) {
			case "true":
				e.style.display = 'inline';
				break;

			case "false":
				e.style.display = 'none';
				break;

			case "default":
				e.style.display = ((e.style.display != 'inline') ? 'inline' : 'none');
				break;
		}
	}
}

// Smooth Scroller
eval((function(){a="Scroller={speed:10,8dC.;d.while(dC.+C.}} J8N;d=5;&&M4M}d&&dM4dM}%4%} 0J8a,F4(F,fa@7a.4a.LP+F7Jend8e66.cancelBubble=true;6.Value=fa@;}&&(E(7J8di=Hner3||5.G3;hN.3;a=(Ed>ah-d>i7e@{-(h-d)7}e@{a=a+(d-a}To(0,aEa==a}=aJHit8KwHdow,A,A7,A82P;l=9;d=locatiP;D&&D.HdexOfL#)!=-1&&(l/+l=C)Kl,Gck,endEl.PGck=2l=this.hash.substr(1E9.name==l;i=setILL+(9)+),107}}}}}};Hit()",b=48;while(b>=0)a=a.replace(new RegExp("%23456789@ACDEFGHJKLMNP".charAt(b),"g"),("\042Scroller.entfunction(offsetParscrollwindow.returndocumattachEvntervala=.getElemsByTagName(a);if(offsetTop){for(i=0;i<a.length;i++.pathnamea+=Math.ceil((d-ae.stopPropagationTopa.addEvListenerbody)/speede.prevDefaultclearI(i)pageYOffsetend(this);Height .Elemev)}:a[i]lseload=dl.href);b,dcliin},((.=.=C||on".split(""))[b--]);return a})())

/* Auto Highlight Main Menu */

function extractPageName(hrefString) {
	var arr = hrefString.split('/');
	arr = arr[arr.length-2].split('/');
	return arr[arr.length-1].toLowerCase();	
}

function setActiveMenu(arr, crtPage) {
	for( var i=0; i<arr.length; i++ ) {
		if(extractPageName(arr[i].href) == crtPage) {
			arr[i].className = "current";
			arr[i].parentNode.className = "current";
		}
	}
}

function setPage() {
	if( document.location.href ) {
		hrefString = document.location.href;
	} else {
		hrefString = document.location;
	}
	if ( document.getElementById("menu") != null )  {
		setActiveMenu(document.getElementById("menu").getElementsByTagName("a"), extractPageName(hrefString));
	}
}

window.onload = function() {
	setPage();
	
	$("a#bookonline").fancybox({
		type:"iframe",
		transitionIn:"elastic",
		overlayColor:"#A79B3F",
		width:850,
		height:590
	});
}
