//fix for safari bug, top is offset by 10 on load then less on resize
var safoffset = 10
var HorzMenu = 1
function DisplayMainMenu(){
	//OK First thing, check what browser we have
		var D6=window,Y7=document;
		function B8(){
			this.ver=navigator.appVersion;
			this.agent=navigator.userAgent;
			this.dom=Y7.getElementById?1:0;
			this.opera5=this.agent.indexOf("Opera 5")>-1;
			this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
			this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
			this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
			this.ie4=(Y7.all && !this.dom && !this.opera5)?1:0;
			this.safari=this.agent.indexOf("safari")>-1;
			this.ie=this.ie4||this.ie5||this.ie6;
			this.ff=this.agent.indexOf("Firefox")>-1;
			this.mac=this.agent.indexOf("Mac")>-1;
			this.ns6=(this.dom && parseInt(this.ver)>=5)?1:0;
			this.ns4=(Y7.layers && !this.dom)?1:0;
			this.bw=(this.ie6||this.ff||this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5);
		return this}
		
	//Next Build our vars
		mt=document.getElementById("NavBar").offsetTop
		ml=document.getElementById("NavBar").offsetLeft;
		m=new Array();n=new Array();s=new Array();sw=new Array();su=new Array();st=new Array();wm=new Array()
		z=0;
		b=0;
		g="";
		w=75;
		mh=document.getElementById("NavBar").offsetHeight;
		mw=ml-w;
		mt=mt-z;
		bw=new B8();
		
	//Make Browser Safe adjustments to the vars
		if(bw.opera5||bw.ns6){b=2};
		if(bw.ie){g=" style='width: 100%'"}else{z=6}
		if(bw.safari){mt+=safoffset;safoffset =1 ;ml+=8}
		if(bw.ff){mt+=0}
		
		
	//Create Strings for attaching menu items
		p="<a class='mi2'"+g+" href='";
		q="' title='";
		r="\"; return true' onmouseout='window.status=\"\"; return true'>";
		t="</a>";
		a="' onmouseover='window.status=\"";
		v="<div class=sp2></div>"
		
	//Menu Details
		m[0]='Home';			n[0]='.';						sw[0]=75;	su[0]='Home';		st[0]="";	wm[0]=75;	s[0]="";	
		m[1]='Attractions';		n[1]='AttractionListing.asp';	sw[1]=150;	su[1]='Attractions';st[1]="";	wm[1]=100;	s[1]="";	
		if(HasMerch!='1'){
			m[2]='Merchandise';		n[2]='MerchandiseSelection.asp';sw[2]=100;	su[2]='Merchandise';st[2]="";	wm[2]=100;	s[2]="";	
		}else{
			m[2]='&nbsp;';		n[2]='#';sw[2]=100;	su[2]='';st[2]="";	wm[2]=100;	s[2]="";	
		}
		if(TheCustID>2){
			m[3]='My Profile';	n[3]='EditProfile.asp';			sw[3]=75;	su[3]='Profile';	st[3]="";	wm[3]=75;	s[3]="";}
		else{
			m[3]='&nbsp;';		n[3]='#';						sw[3]=75;	su[3]='Profile';	st[3]="";	wm[3]=75;	s[3]="";}
		if(TheCustID>2){
			m[4]='My History';	n[4]='ShowHistory.asp';			sw[4]=75;	su[4]='History';	st[4]="";	wm[4]=75;	s[4]="";}
		else{
			m[4]='&nbsp;';		n[4]='#';						sw[4]=75;	su[4]='History';	st[4]="";	wm[4]=75;	s[4]="";}
		if(TheCustID>2){
			m[5]='Log Out';		n[5]='SignOut.asp';				sw[5]=75;	su[5]='Log Out';	st[5]="";	wm[5]=75;	s[5]="";}
		else{
			m[5]='Log In';		n[5]='SignIn.asp';				sw[5]=75;	su[5]='Log In';		st[5]="";	wm[5]=75;	s[5]="";}
		m[6]='&nbsp;';			n[6]='#';						sw[6]=128;	su[6]='Step';		st[6]="";	wm[6]=128;	s[6]="";	
		m[7]='Shopping Cart <img border="0" src="images/ShoppingCartFragment2.gif" width="16" height="11">';n[7]='javascript:SCDetails(1)';sw[7]=120;su[7]='Shopping Cart';st[7]="";wm[7]=120;s[7]="";
		
	//Set the menu item length
		ma=m.length
		
	//Fix to look up any padding
		document.getElementById("NavBar").innerHTML = '<div id="PaddingTest" style="">.</div>'	
		if(bw.ff){
			ml += (document.getElementById("PaddingTest").offsetLeft - ml)
		}else{
			ml += document.getElementById("PaddingTest").offsetLeft
		}	
			
	//Clear out any old Menu code
	document.getElementById("NavBar").innerHTML =''
	
	//Determine its orientation
		NavBarWidth = document.getElementById("NavBar").offsetWidth;
		TotalWidth = 0
		for (i=0; i < ma; i++){TotalWidth+=wm[i]}
		if(NavBarWidth<TotalWidth){HorzMenu=0}
	//Fix for Expanding Main bodys in style sheets
		if(NavBarWidth>TotalWidth){
			wm[7] +=  NavBarWidth-TotalWidth
		}
	
	//Build Menus
	if (HorzMenu==1) {
		mw2=ml-w;
		for (i=0; i < ma; i++){
			if(i==0){
				(mw2+=wm[i]);(mw+=wm[i])}
			else{
				(mw2+=wm[i-1]);(mw+=wm[i-1])};
			if(s[i]==""){
				if(m[i]=='&nbsp;'){
					StepTop= mt+2;StepLeft= mw2;
					if(su[6]=='Step'){stepat="top:"+StepTop+"px;left:"+StepLeft+"px"}
					document.getElementById("NavBar").innerHTML +="<div id='blank"+i+"' onclick='' style='position: absolute; top:"+mt+";left:"+(mw2)+";width:"+wm[i]+"'><span class='bi2'>"+m[i]+"</span></div>"}			
				else{document.getElementById("NavBar").innerHTML +="<div id='Mnu"+i+"' style='position: absolute; top:"+mt+";left:"+(mw2)+";width:"+wm[i]+"'><a class='bi2'"+g+" href='"+n[i]+q+st[i]+a+su[i]+r+m[i]+t+"</div>"}}
			else{
				document.getElementById("NavBar").innerHTML +="<div id='sb"+i+"' class='mn2' style='visibility:hidden; position: absolute; top:"+(mt+mh)+";left:"+(mw)+";width:"+(sw[i]-b)+"' onmouseover='ShowMenu((\"sb"+i+"\"))' onmouseout='HideMenu((\"sb"+i+"\"))'>"+s[i]+"</div>"
				document.getElementById("NavBar").innerHTML +="<div id='Mnu"+i+"' style='position: absolute; top:"+mt+";left:"+(mw2)+";width:"+wm[i]+"' onmouseover='ShowMenu(\"sb"+i+"\")' onmouseout='HideMenu(\"sb"+i+"\")'><a class='bi2'"+g+" href='"+n[i]+q+st[i]+a+su[i]+r+m[i]+t+"</div>"}
		}
		SSTop=document.getElementById("Mnu"+(m.length-1)).offsetTop+document.getElementById("Mnu"+(m.length-1)).offsetHeight
		SSLeft=document.getElementById("Mnu"+(m.length-1)).offsetLeft+document.getElementById("Mnu"+(m.length-1)).offsetWidth-410
	}
	else {
		mw2=mt-mh;
		mt2=mt-mh+2;
		//Find largest Menu item width and make them all that size
			LMW=0
			for (i=0; i < ma; i++){if(LMW<wm[i]){LMW=wm[i]}}
		for (i=0; i < ma; i++){
			if(i==0){
				(mw2+=LMW);mw+=LMW}
			else{
				(mw2+=LMW);mw+=LMW}
			if(s[i]==""){
				if(m[i]=='&nbsp;'){
					if(su[6]=='Step'){stepat="top:"+(mt2+mh+1)+"px;left:"+ml+"px"}
					document.getElementById("NavBar").innerHTML +="<div id='blank"+i+"' style='position: absolute; top:"+(mt2+=(mh+1))+"px;left:"+ml+"px;width:"+LMW+"px'><span class='bi2'>"+m[i]+"</span></div>"}
				else{document.getElementById("NavBar").innerHTML +="<div id='Mnu"+i+"' style='position: absolute; top:"+(mt2+=(mh+1))+";left:"+ml+"px;width:"+LMW+"px'><a class='bi2'"+g+" href='"+n[i]+q+st[i]+a+su[i]+r+m[i]+t+"</div>"}}
			else{
				document.getElementById("NavBar").innerHTML +="<div id='sb"+i+"' class='mn2' style='position: absolute; top:"+(mt2+=(mh+1))+"px;left:"+(ml+LMW-10)+";width:"+sw[i]+"' onmouseover='ShowMenu(\"sb"+i+"\")' onmouseout='HideMenu(\"sb"+i+"\")'>"+s[i]+"</div>"
				document.getElementById("NavBar").innerHTML +="<div id='Mnu"+i+"' style='position: absolute; top:"+(mt2+=(mh+1))+"px;left:"+ml+"px;width:"+LMW+"px' onmouseover='ShowMenu(\"sb"+i+"\")' onmouseout='HideMenu(\"sb"+i+"\")'><a class='bi2'"+g+" href='"+n[i]+q+st[i]+a+su[i]+r+m[i]+t+"</div>"}
		}
		SSTop=document.getElementById("NavBar").offsetTop
		SSLeft=document.getElementById("Mnu"+(m.length-1)).offsetLeft+document.getElementById("Mnu"+(m.length-1)).offsetWidth
	}
	
	document.getElementById("NavBar").innerHTML +="<div id='SSD' style='position: absolute; top:1;left:1;width:1'>"
	
	document.getElementById("NavBar").innerHTML +='<div style="position: absolute; width: 128px; height: 21px; z-index: 1; cursor:pointer; '+stepat+'" id="StepLayer"></div>'
	ShoppingCartUpdate(1)
	Progress(TheStepOn)
	
	
}


var blankobj
var StepTop
var StepLeft 
function HideMenu(o){HideMenuTimer =  setTimeout("document.getElementById('"+o+"').style.visibility='hidden'",500)}
function ShowMenu(o){try{HideMenuTimer = clearTimeout(HideMenuTimer)}catch(err){}; document.getElementById(o).style.visibility='visible'}

function Progress(s){

	if(s==1){step1="stepdone"}else{step1="stepnotdone"}
	if(s==2){step2="stepdone";step1="stepdone"}else{step2="stepnotdone"}
	if(s==3){step3="stepdone";step2="stepdone";step1="stepdone"}else{step3="stepnotdone"}
	if(s==4){step4="stepdone";step3="stepdone";step2="stepdone";step1="stepdone"}else{step4="stepnotdone"}
	var HTML ='<table border="0" cellpadding="0" cellspacing="1" width="100%" height="100%" id="Steptbl" style="border-style:inset; border-width:1px; font-size: 10px; font-family: Arial; color:#FFFFFF; text-transform: uppercase">'
			 +'<tr><td width="39" id=Step align="center" class="'+step1+'">Step</td><td align="center" class="'+step1+'" id=Step1 onmouseover="StepHelp(this)" onmouseout="StepHelpHide(this)" onclick="GotoStep(this)">1</td><td class="'+step2+'" align="center" id=Step2 onmouseover="StepHelp(this)" onmouseout="StepHelpHide(this)" onclick="GotoStep(this)">2</td><td class="'+step3+'" align="center" id=Step3 onmouseover="StepHelp(this)" onmouseout="StepHelpHide(this)" onclick="GotoStep(this)">3</td><td class="'+step4+'" align="center" id=Step4 onmouseover="StepHelp(this)" onmouseout="StepHelpHide(this)" onclick="GotoStep(this)">4</td></tr>'
			 +'</table>'; 
	try{document.getElementById("StepLayer").innerHTML = HTML}catch(e){}
	TOP = -5
	LEFT = 39
	Step1HTML 	='<div style="position: absolute; width: 100px; height: 40px; z-index: 2; left: '+(LEFT -30)+'px; top: '+(TOP-46)+'px; visibility:hidden" id="Step1Help">'
				+'<table border="0" cellpadding="0" cellspacing="1" width="100%" id="Step1tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+'<tr><td><p align="center">Locate Attraction you wish you purchase tickets for</td></tr></table></div>'
	Step2HTML	='<div style="position: absolute; width: 110px; height: 33px; z-index: 2; left: '+(LEFT -18)+'px; top: '+(TOP-33)+'px; visibility:hidden" id="Step2Help">'
				+'<table border="0" cellpadding="0" cellspacing="1" width="112%" id="Step2tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+'<tr><td><p align="center">Locate the Seats you wish to purchase</td></tr></table></div>'
	Step3HTML	='<div style="position: absolute; width: 110px; height: 33px; z-index: 2; left: '+(LEFT +10)+'px; top: '+(TOP-33)+'px; visibility:hidden" id="Step3Help">'
				+'<table border="0" cellpadding="0" cellspacing="1" width="112%" id="Step3tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+'<tr><td><p align="center">Select the Type of Ticket you would like</td></tr></table></div>'
	Step4HTML	='<div style="position: absolute; width: 100px; height: 33px; z-index: 2; left: '+(LEFT +30)+'px; top: '+(TOP-33)+'px; visibility:hidden" id="Step4Help">'
				+'<table border="0" cellpadding="0" cellspacing="1" width="112%" id="Step4tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+'<tr><td><p align="center">Checkout and pay for your Tickets</td></tr></table></div>'
	try{document.getElementById("StepLayer").innerHTML += Step1HTML+Step2HTML+Step3HTML+Step4HTML}catch(e){}
}
function GotoStep(o){
	if(grabing){return false};
	if(o.id=='Step1'){window.location='Attractionlisting.asp'}
	if(o.id=='Step2'){}
	if(o.id=='Step3'){}
	if(o.id=='Step4'){window.location='checkout.asp'}
}
var ShowStep = new Array()
var prevO
function StepHelp(o){
	try{ShowStep[prevO.slice(prevO.length-1,prevO.length)] = clearTimeout(ShowStep[prevO.slice(prevO.length-1,prevO.length)]);ShowStep[prevO.slice(prevO.length-1,i.length)] = setTimeout("document.getElementById('"+prevO+"tblhlp').style.visibility='hidden'",50)}catch(err){}; 
	i=o.id
	prevO=i
	try{ShowStep[i.slice(i.length-1,i.length)] = clearTimeout(ShowStep[i.slice(i.length-1,i.length)])}catch(err){}; 
	ShowStep[i.slice(i.length-1,i.length)] =  setTimeout("document.getElementById('"+i+"tblhlp').style.visibility='visible'",500)
}
function StepHelpHide(o){
	try{ShowStep[prevO.slice(prevO.length-1,prevO.length)] = clearTimeout(ShowStep[prevO.slice(prevO.length-1,prevO.length)]);ShowStep[prevO.slice(prevO.length-1,i.length)] = setTimeout("document.getElementById('"+prevO+"tblhlp').style.visibility='hidden'",50)}catch(err){}; 
	i=o.id
	prevO=i
	try{ShowStep[i.slice(i.length-1,i.length)] = clearTimeout(ShowStep[i.slice(i.length-1,i.length)]);ShowStep[i.slice(i.length-1,i.length)] =  setTimeout("document.getElementById('"+i+"tblhlp').style.visibility='hidden'",500)}catch(err){}; 

}