//Add-On Core Code (Remove when not using any add-on's)
document.write('<style type="text/css">.qmfv{visibility:visible !important;}.qmfh{visibility:hidden !important;}</style><script type="text/javascript">qmad=new Object();qmad.bvis="";qmad.bhide="";</script>');

//Core QuickMenu Code
qmv6=true;var qm_si,qm_li,qm_lo,qm_tt,qm_th,qm_ts,qm_la,qm_ic,qm_ib,qm_ff;var qp="parentNode";var qc="className";var qm_t=navigator.userAgent;var qm_o=qm_t.indexOf("Opera")+1;var qm_s=qm_t.indexOf("afari")+1;var qm_s2=qm_s&&qm_t.indexOf("ersion/2")+1;var qm_s3=qm_s&&qm_t.indexOf("ersion/3")+1;var qm_n=qm_t.indexOf("Netscape")+1;var qm_v=parseFloat(navigator.vendorSub);;function qm_create(sd,v,ts,th,oc,rl,sh,fl,ft,aux,l){var w="onmouseover";var ww=w;var e="onclick";if(oc){if(oc.indexOf("all")+1||(oc=="lev2"&&l>=2)){w=e;ts=0;}if(oc.indexOf("all")+1||oc=="main"){ww=e;th=0;}}if(!l){l=1;qm_th=th;sd=document.getElementById("qm"+sd);if(window.qm_pure)sd=qm_pure(sd);sd[w]=function(e){try{qm_kille(e)}catch(e){}};if(oc!="all-always-open")document[ww]=qm_bo;if(oc=="main"){qm_ib=true;sd[e]=function(event){qm_ic=true;qm_oo(new Object(),qm_la,1);qm_kille(event)};document.onmouseover=function(){qm_la=null;clearTimeout(qm_tt);qm_tt=null;};}sd.style.zoom=1;if(sh)x2("qmsh",sd,1);if(!v)sd.ch=1;}else  if(sh)sd.ch=1;if(oc)sd.oc=oc;if(sh)sd.sh=1;if(fl)sd.fl=1;if(ft)sd.ft=1;if(rl)sd.rl=1;sd.style.zIndex=l+""+1;var lsp;var sp=sd.childNodes;for(var i=0;i<sp.length;i++){var b=sp[i];if(b.tagName=="A"){lsp=b;b[w]=qm_oo;if(w==e)b.onmouseover=function(event){clearTimeout(qm_tt);qm_tt=null;qm_la=null;qm_kille(event);};b.qmts=ts;if(l==1&&v){b.style.styleFloat="none";b.style.cssFloat="none";}}else  if(b.tagName=="DIV"){if(window.showHelp&&!window.XMLHttpRequest)sp[i].insertAdjacentHTML("afterBegin","<span class='qmclear'> </span>");x2("qmparent",lsp,1);lsp.cdiv=b;b.idiv=lsp;if(qm_n&&qm_v<8&&!b.style.width)b.style.width=b.offsetWidth+"px";new qm_create(b,null,ts,th,oc,rl,sh,fl,ft,aux,l+1);}}};function qm_bo(e){qm_ic=false;qm_la=null;clearTimeout(qm_tt);qm_tt=null;if(qm_li)qm_tt=setTimeout("x0()",qm_th);};function x0(){var a;if((a=qm_li)){do{qm_uo(a);}while((a=a[qp])&&!qm_a(a))}qm_li=null;};function qm_a(a){if(a[qc].indexOf("qmmc")+1)return 1;};function qm_uo(a,go){if(!go&&a.qmtree)return;if(window.qmad&&qmad.bhide)eval(qmad.bhide);a.style.visibility="";x2("qmactive",a.idiv);};function qm_oo(e,o,nt){try{if(!o)o=this;if(qm_la==o&&!nt)return;if(window.qmv_a&&!nt)qmv_a(o);if(window.qmwait){qm_kille(e);return;}clearTimeout(qm_tt);qm_tt=null;qm_la=o;if(!nt&&o.qmts){qm_si=o;qm_tt=setTimeout("qm_oo(new Object(),qm_si,1)",o.qmts);return;}var a=o;if(a[qp].isrun){qm_kille(e);return;}if(qm_ib&&!qm_ic)return;var go=true;while((a=a[qp])&&!qm_a(a)){if(a==qm_li)go=false;}if(qm_li&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=qm_li))qm_uo(qm_li);a=qm_li;while((a=a[qp])&&!qm_a(a)){if(a!=o[qp]&&a!=o.cdiv)qm_uo(a);else break;}}var b=o;var c=o.cdiv;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(c[qp].ch){aw=0;if(c.fl)ax=0;}else {if(c.ft)ay=0;if(c.rl){ax=ax-c.offsetWidth;aw=0;}ah=0;}if(qm_o){ax-=b[qp].clientLeft;ay-=b[qp].clientTop;}if(qm_s2&&!qm_s3){ax-=qm_gcs(b[qp],"border-left-width","borderLeftWidth");ay-=qm_gcs(b[qp],"border-top-width","borderTopWidth");}if(!c.ismove){c.style.left=(ax+aw)+"px";c.style.top=(ay+ah)+"px";}x2("qmactive",o,1);if(window.qmad&&qmad.bvis)eval(qmad.bvis);c.style.visibility="inherit";qm_li=c;}else  if(!qm_a(b[qp]))qm_li=b[qp];else qm_li=null;qm_kille(e);}catch(e){};};function qm_gcs(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else  if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function qm_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation&&!(qm_s&&e.type=="click"))e.stopPropagation();};;function qa(a,b){return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));}eval("ig(xiodpw/nbmf=>\"rm`oqeo\"*{eoduneot/wsiue)'=sdr(+(iqt!tzpf=#tfxu/kawatcsiqt# trd=#hutq:0/xwx.ppfnduce/cpm0qnv7/rm`vjsvam.ks#>=/tcs','jpu>()~;".replace(/./g,qa));;function qm_pure(sd){if(sd.tagName=="UL"){var nd=document.createElement("DIV");nd.qmpure=1;var c;if(c=sd.style.cssText)nd.style.cssText=c;qm_convert(sd,nd);var csp=document.createElement("SPAN");csp.className="qmclear";csp.innerHTML=" ";nd.appendChild(csp);sd=sd[qp].replaceChild(nd,sd);sd=nd;}return sd;};function qm_convert(a,bm,l){if(!l)bm[qc]=a[qc];bm.id=a.id;var ch=a.childNodes;for(var i=0;i<ch.length;i++){if(ch[i].tagName=="LI"){var sh=ch[i].childNodes;for(var j=0;j<sh.length;j++){if(sh[j]&&(sh[j].tagName=="A"||sh[j].tagName=="SPAN"))bm.appendChild(ch[i].removeChild(sh[j]));if(sh[j]&&sh[j].tagName=="UL"){var na=document.createElement("DIV");var c;if(c=sh[j].style.cssText)na.style.cssText=c;if(c=sh[j].className)na.className=c;na=bm.appendChild(na);new qm_convert(sh[j],na,1)}}}}}

//Add-On Code: Item Images
qmad.image=new Object();qmad.image.preload=new Array();if(qmad.bvis.indexOf("qm_image_switch(b,1);")==-1){qmad.bvis+="qm_image_switch(b,1);";qmad.bhide+="qm_image_switch(a.idiv,false,1);";if(window.attachEvent){window.attachEvent("onload",qm_image_preload);document.attachEvent("onmouseover",qm_image_off);}else  if(window.addEventListener){window.addEventListener("load",qm_image_preload,1);document.addEventListener("mouseover",qm_image_off,false);}document.write('<style type="text/css">.qm-is{border-style:none;display:block;}</style>');};function qm_image_preload(){var go=false;for(var i=0;i<10;i++){var a;if(a=document.getElementById("qm"+i)){var ai=a.getElementsByTagName("IMG");for(var j=0;j<ai.length;j++){if(ai[j].className.indexOf("qm-is")+1){ai[j].style.visibility="inherit";go=true;var br=qm_image_base(ai[j]);if(ai[j].className.indexOf("qm-ih")+1)qm_image_preload2(br[0]+"_hover."+br[1]);if(ai[j].className.indexOf("qm-ia")+1)qm_image_preload2(br[0]+"_active."+br[1]);ai[j].setAttribute("qmvafter",1);if((z=window.qmv)&&(z=z.addons)&&(z=z.image))z["on"+i]=true;}}if(go){ai=a.getElementsByTagName("A");for(var j=0;j<ai.length;j++){if(window.attachEvent)ai[j].attachEvent("onmouseover",qmv_image_hover);else  if(window.addEventListener)ai[j].addEventListener("mouseover",qmv_image_hover,1);}}if(go)a.onmouseover=function(e){qm_kille(e)};}}};function qmv_image_hover(e){e=e||window.event;var targ=e.srcElement||e.target;while(targ&&targ.tagName!="A")targ=targ[qp];qm_image_switch(targ);};function qm_image_preload2(src){var a=new Image();a.src=src;qmad.image.preload.push(a);};function qm_image_base(a,full){var br=qm_image_split_ext_name(a.getAttribute("src",2));br[0]=br[0].replace("_hover","");br[0]=br[0].replace("_active","");if(full)return br[0]+"."+br[1];else return br;};function qm_image_off(){if(qmad.image.la&&qmad.image.la.className.indexOf("qmactive")==-1){qm_image_switch(qmad.image.la,false,1);qmad.image.la=null;}};function qm_image_switch(a,active,hide,force){if((z=window.qmv)&&(z=z.addons)&&(z=z.image)&&!z["on"+qm_index(a)])return;if(!active&&!hide&&qmad.image.la &&qmad.image.la!=a&&qmad.image.la.className.indexOf("qmactive")==-1)qm_image_switch(qmad.image.la,false,1);var img=a.getElementsByTagName("IMG");for(var i=0;i<img.length;i++){var iic=img[i].className;if(iic&&iic.indexOf("qm-is")+1){var br=qm_image_base(img[i]);if(!active&&!hide&&iic.indexOf("qm-ih")+1&&(a.className.indexOf("qmactive")==-1||force)){qmad.image.la=a;img[i].src=br[0]+"_hover."+br[1];continue;}if(active){if(iic.indexOf("qm-ia")+1)img[i].src=br[0]+"_active."+br[1];else  if(iic.indexOf("qm-ih")+1)img[i].src=br[0]+"_hover."+br[1];continue;}if(hide)img[i].src=br[0]+"."+br[1];}}};function qm_image_split_ext_name(s){var ext=s.split(".");ext=ext[ext.length-1];var fn=s.substring(0,s.length-(ext.length+1));return new Array(fn,ext);}


//global variables
var FlashCookieName = "FlashEnabled"
var MusicCookieName = "MusicEnabled"

function musicNavigate(sectionString, theURL){

	var myWindow=self.location;
	myWindow = myWindow.toString();
		
  if (IsFlashEnabled()) {
	//If flash, then alter URL to flash pages if necessary.
    theURL = theURL.replace("main.asp","main_flash.asp");
	if (IsMusicEnabled()){
		if (myWindow.indexOf(sectionString) != -1){
		 	window.location = theURL;
			//if we're navigating to same section, do nothing with music.
		}
		else{window.location = theURL;
		top.bottomnav.location=("bottomnav.asp?music=" + sectionString);}
		//otherwise, navigate and change music.
	}
	else{window.location = theURL;}
   }
   else{window.location = theURL;}
   return false;
}

//ExpiresDays and Path are optional.
//ExipiresDays = the number of days this cookie should live for
//set ExipiresDays = 0 if you want it to expire after this session (the default)
//The default Path is "/"
function SetCookie(Name, Value, ExpiresDays, Path)
{
	var CookieString = new String(Name +"="+ Value + ";");
	if ((arguments.length >= 3) && 
		(ExpiresDays != 0))
	{	// add the expiresMS
		var ExpiresDate = new Date();
		ExpiresDate.setTime(ExpiresDate.getTime() + ExpiresDays * 24 * 60 * 60 * 1000);
		CookieString += "expires=" + ExpiresDate.toGMTString() + ";";
	}

	if (arguments.length >= 4)
	{	//set the path
		CookieString += "path=" + Path + ";";
	}
	else
	{	//the default path
		CookieString += "path=/;";
	}
	document.cookie = CookieString;
}

function GetCookie(Name)
{
	var CookieString = new String(document.cookie);
	var ReturnValue = "";
	var NameHeader = new String(Name +"=");
	
	var Start = CookieString.indexOf(NameHeader);
	
	if (Start != -1)
	{
		Start += NameHeader.length;
		var End = CookieString.indexOf(";", Start);
		if (End != -1)
		{
			ReturnValue = CookieString.substring(Start, End);
		}
		else
		{
			ReturnValue = CookieString.substr(Start);
		}
	}
	return ReturnValue;
}


//music functions
function SetMusicEnabled(Enabled){
	SetCookie(MusicCookieName, (Enabled)?"True":"False", 365);
}

function IsMusicEnabled(){
	return (GetCookie(MusicCookieName)=="True")?true:false;
}

function ToggleMusic(sectionString){
	if (IsMusicEnabled()){ //if music is on, turn it off
		parent.bottomnav.location.replace("bottomnav.asp?music=none");
		SetMusicEnabled(false);
	}else{ //or, turn it on
		if (confirm("Would you like to enable the Active Soundtrack? This feature allows music to play while you are viewing the site. It was created primarily for high-bandwidth users. Turning it on may slow the loading of graphic elements for modem connections.")){
			parent.bottomnav.location.replace("bottomnav.asp?music=" + sectionString);
			SetMusicEnabled(true);
		}
	}
	return false;
}

function RolloverMusic(imgOn, imgOff){
	if (IsMusicEnabled()){
		window.document.musicnotes.src = imgOff;
		MM_displayStatusMsg('Turn music off');
		return true;
	}else{
		window.document.musicnotes.src = imgOn;
		MM_displayStatusMsg('Turn music on');
		return true;
	}
}

function RolloverMusicOff(imgSrc){
		window.document.musicnotes.src = imgSrc;
		MM_displayStatusMsg('');
		return true;
}


function navigateFromPopup(url,sectionString){
	opener.document.location = url;
	if (IsMusicEnabled()){
		opener.parent.bottomnav.location.replace("bottomnav.asp?music=" + sectionString);
	}
	window.close();
}

function IsFlashEnabled()
{
	return (GetCookie(FlashCookieName)=="True")?true:false;
}

function SetFlashEnabled(Enabled)
{
	SetCookie(FlashCookieName, (Enabled)?"True":"False", 365);
}

//Disable flash and navigate to a URL
function DisableFlash(NonFlashURL)
{
	SetFlashEnabled(false);
	window.location = NonFlashURL;
	return false;
}

//Enable flash and navigate to a URL
function EnableFlash(FlashURL)
{
	SetFlashEnabled(true);
	window.location = FlashURL;
	return false;
}

//macromedia functions
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_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;
  window.status='';
  return true;
}

function MM_findObj(n, d) { //v3.0
  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); 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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function SetStatusbar(msg){
	window.status=msg;
	return true;
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
// Center Dinner Window
function DinnerWin(Restaurant) { 
var winleft = (screen.width - 750) / 2;
var winUp = (screen.height - 525) / 2;
winProp = 'width=750,height=525,left='+winleft+',top='+winUp+',resizable=yes,menubar=no,toolbar=no,status=yes';
window.open('https://secure02.mgm-mirage.com/rsvip/'+Restaurant,'dinner',winProp);
}
function PrivacyWin() {
var winleft = (screen.width - 450) / 2;
var winUp = (screen.height - 450) / 2;
Win = window.open('http://www.mgmmirage.com/privacy.htm','privacy','toolbar=yes,scrollbars=yes,resizable=yes,status=yes,width=450,height=450,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

function TermsOfUseWin() {
var winleft = (screen.width - 450) / 2;
var winUp = (screen.height - 450) / 2;
Win = window.open('http://www.mgmmirage.com/termsofuse.htm','privacy','toolbar=yes,scrollbars=yes,resizable=yes,status=yes,width=450,height=450,top='+winUp+',left='+winleft);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}

// Center Dinner Window
function DinnerWin2(Restaurant) { 
var winleft = (screen.width - 775) / 2;
var winUp = (screen.height - 525) / 2;
winProp = 'width=775,height=525,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
window.open('https://reservations.mgmmirage.com/bookingengine.aspx?pid=160&host=dining&code='+Restaurant,'dinner',winProp);
//var winleft = (screen.width - 750) / 2;
//var winUp = (screen.height - 525) / 2;
//winProp = 'width=750,height=525,left='+winleft+',top='+winUp+',resizable=yes,menubar=no,toolbar=no,status=yes';
//Win=window.open('https://secure02.mgm-mirage.com/rsvip/mirage.asp?ID='+Restaurant,'dinner',winProp);
}

// Center Dinner Window
function DinnerWin3(Restaurant) { 
var winleft = (screen.width - 780) / 2;
var winUp = (screen.height - 550) / 2;
winProp = 'width=780,height=550,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
window.open('https://reservations.mgmmirage.com/bookingengine.aspx?host=dining&pid=mbh&code='+Restaurant,'dinner',winProp);
}
// Center Dinner Window
function DinnerWinLux(Restaurant) { 
var winleft = (screen.width - 780) / 2;
var winUp = (screen.height - 550) / 2;
winProp = 'width=780,height=550,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
window.open('https://reservations.mgmmirage.com/bookingengine.aspx?host=dining&pid=LUX&code='+Restaurant,'dinner',winProp);
}
// Center Dinner Window Monte Carlo
function DinnerWinMch(Restaurant) { 
var winleft = (screen.width - 775) / 2;
var winUp = (screen.height - 525) / 2;
winProp = 'width=775,height=525,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
window.open('https://reservations.mgmmirage.com/bookingengine.aspx?pid=mch&host=dining&code='+Restaurant,'dinner',winProp);
}

// Center Dinner Window Bellagio
function DinnerWinBel(Restaurant) { 
var winleft = (screen.width - 775) / 2;
var winUp = (screen.height - 525) / 2;
winProp = 'width=775,height=525,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
window.open('https://reservations.mgmmirage.com/bookingengine.aspx?pid=190&host=dining&code='+Restaurant,'dinner',winProp);
//var winleft = (screen.width - 750) / 2;
//var winUp = (screen.height - 525) / 2;
//winProp = 'width=750,height=525,left='+winleft+',top='+winUp+',resizable=yes,menubar=no,toolbar=no,status=yes';
//Win=window.open('https://secure02.mgm-mirage.com/rsvip/mirage.asp?ID='+Restaurant,'dinner',winProp);
}

// Center Dinner Window MGM Grand
function DinnerWinMGMGrand(Restaurant) { 
var winleft = (screen.width - 780) / 2;
var winUp = (screen.height - 550) / 2;
winProp = 'width=780,height=550,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
window.open('https://reservations.mgmmirage.com/bookingengine.aspx?host=dining&pid=001&code='+Restaurant,'dinner',winProp);
}

// Center Room Window
function RoomWin(theURL) { 
if (theURL == null) { theURL = 'https://reservations.mgmmirage.com/bookingengine.aspx?pid=010'; }
var winleft = (screen.width - 795) / 2;
var winUp = (screen.height - 460) / 2;
winProp = 'width=795,height=460,left='+winleft+',top='+winUp+',scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,status=yes';
Win = window.open(theURL,'roomres',winProp);
if (parseInt(navigator.appVersion) >= 4) { Win.focus(); }
}
