//browser detection

if (document.all) {n=0;ie=1;ns6=0;fShow="visible";fHide="hidden";}//ie
else if (document.getElementById){n=0;ie=0;ns6=1;fShow="";fHide="hidden";}//ns6
else if (document.layers) {n=1;ie=0;ns6=0;fShow="show";fHide="hide";}//ns4
//current section to remain highlighted: name of "off" state image
currentSection="";
//height of the menu
imgMenuHeight = 90;
//Initialize variables used in displaySubMenu function
rightX = 0;
leftY = 0;
leftX = 0;
contactUsOn=1;

//menu contents
function showToolbar(){
//addItem(id, off-state, over-state, hint, location, alternativeLocation);
 menu = new Menu();
 menu.addItemImage("season", "img/mm_current_off.gif", "img/mm_current_on.gif", "Current Season",  null, "current.shtml");
 menu.addItemImage("support", "img/mm_support_off.gif", "img/mm_support_on.gif", "Support Us", null, "connected.shtml");
 menu.addItemImage("about", "img/mm_about_off.gif", "img/mm_about_on.gif", "About Us",  null, "mission.shtml");
 menu.addItemImage("contact", "img/mm_ticketsinfo_off.gif", "img/mm_ticketsinfo_on.gif", "Tickets and Info",  null, "tickets.shtml");
 

// addSubItem(idParent, text, hint, location); 
 menu.addSubItem("season", "The 10-11 Season", "The 10-11 Season",  "tickets.shtml");
 menu.addSubItem("season", "-Orlando", "Orlando",  "2011_orlando.shtml");
 menu.addSubItem("season", "-Three Sisters", "Three Sisters",  "2011_sisters.shtml");
 menu.addSubItem("season", "-Double Falsehood", "Double Falsehood",  "2011_double.shtml");
 menu.addSubItem("season", "-The School For Lies", "The School For Lies",  "2011_school.shtml");
 menu.addSubItem("season", "-Unnatural Acts", "Unnatural Acts",  "2011_unnatural.shtml");  
 menu.addSubItem("season", "-First Look: Moliere", "First Look: Moliere",  "2011_firstlook.shtml");
 menu.addSubItem("season", "-The Young Company", "The Young Company",  "2011_young.shtml");  
 menu.addSubItem("season", "-Books on Stage", "Books on Stage",  "2011_books.shtml");   
 
 menu.addSubItem("support", "Become Connected", "Become Connected",  "connected.shtml");
 menu.addSubItem("support", "Make A Donation", "Make A Donation",  "https://etm.patrontechnology.com/o/CSC/p/run_module.php?__module__=1346");
 menu.addSubItem("support", "Benefits of Giving", "Benefits of Giving",  "benefits.shtml");
 menu.addSubItem("support", "Supporters of CSC", "Supporters of CSC",  "supporters.shtml");
 menu.addSubItem("support", "Annual Benefit Gala", "Annual Benefit Gala",  "2010_gala.shtml");
 menu.addSubItem("support", "The Rosemarie Tichler Fund", "The Rosemarie Tichler Fund",  "tichler.shtml");

 menu.addSubItem("about", "Mission", "Mission",  "mission.shtml");
 menu.addSubItem("about", "History", "History",  "history.shtml");
 menu.addSubItem("about", "Staff", "Staff",  "staff.shtml");
 menu.addSubItem("about", "Board", "Board",  "board.shtml");
 menu.addSubItem("about", "Employment", "Employment",  "employment.shtml"); menu.addSubItem("about", "Awards", "Awards",  "awards.shtml");
 menu.addSubItem("about", "Season Archive", "Season Archive",  "archives/index.shtml");
 menu.addSubItem("about", "Space Rental", "Space Rental",  "rental.shtml");

 menu.addSubItem("contact", "Buy Tickets", "Buy Tickets",  "tickets.shtml");
 menu.addSubItem("contact", "Group Sales", "Group Sales",  "groupsales.shtml");
 menu.addSubItem("contact", "Become A Member", "Become A Member",  "member.shtml");
 menu.addSubItem("contact", "Classic Rewards", "Classic Rewards",  "rewards.shtml");
 menu.addSubItem("contact", "Discounts & Waitlist", "Discounts & Waitlist",  "discounts.shtml");
 menu.addSubItem("contact", "Visit Us", "Visit Us",  "directions.shtml");
 menu.addSubItem("contact", "FAQ", "FAQ",  "faq.shtml");

 menu.showMenu();
}


//create the menu
function Menu(){
 this.addItemImage    = addItemImage;
 this.addSubItem = addSubItem;
 this.showMenu   = showMenu;
 this.MainbgColor     = "#99cccc"; 
 this.SubMenubgColor   = "#223565"; 
 this.mainPaneBorder = 0;
 this.subMenuPaneBorder = 0;
 this.subMenuCellSpacing = 1;
 this.subMenuPaneWidth = 175;
 lastMenu = null;
 
 HTMLstr = "";
 HTMLstr += "<!-- MENU PANE DECLARATION BEGINS -->\n";
 HTMLstr += "\n";
 if(n){}
 else{HTMLstr += "<div id='MainTable' style='position:relative'>\n";}
 //************************************
 //************************************
 //code specific to Classic Stage  menu
 HTMLstr += "<table width='746' cellpadding='0' cellspacing='0' border='"+this.mainPaneBorder+"'>\n";
 HTMLstr += "<tr><td rowspan=4 valign=top><a href=\"index.shtml\"><img src=\"img/newlogohome.gif\" width=202 height=134 border=0 alt=\"Classic Stage Company\"></a></td>";
 HTMLstr += "<td colspan=5 valign=top><img src=\"img/pixel_333366.gif\" width=544 height=63></td></tr>\n";
 HTMLstr += "<tr>\n";
 //end code specific to Classic Stage MENU
 //***************************************
 //***************************************
 HTMLstr += "<!-- MAIN MENU STARTS -->\n";
 HTMLstr += "<!-- MAIN_MENU -->\n";
 HTMLstr += "<!-- MAIN MENU ENDS -->\n";
 //************************************
 //************************************
 //code specific to Classic Stage  menu
 HTMLstr += "</tr>";
 HTMLstr += "<tr><td align=center colspan=5 bgcolor=\"#333333\" nowrap>\n";
 HTMLstr += "<a href=\"contact.shtml\" onMouseover=\"on('sb_contactus')\" onMouseout=\"off('sb_contactus')\" title=\"contact us\"><img src=\"img/sb_contactus_off.gif\" alt=\"contact us\" border=0 name=\"sb_contactus\"></a>";
 HTMLstr += "<a href=\"javascript:void(0)\" onMouseover=\"on('sb_mailinglist')\" onMouseout=\"off('sb_mailinglist')\" onClick=\"pop('http://www.patronmail.com/pmailweb/PatronSetup?oid=131')\" title=\"join our mailing list\"><img src=\"img/sb_mailinglist_off.gif\" alt=\"join our mailing list\" border=0 name=\"sb_mailinglist\"></a>";
 HTMLstr += "<a href=\"news.shtml\" onMouseover=\"on('sb_news')\" onMouseout=\"off('sb_news')\" title=\"news & events\"><img src=\"img/sb_news_off.gif\" alt=\"news & events\" border=0 name=\"sb_news\"></a>";
 HTMLstr += "<a href=\"member.shtml\" onMouseover=\"on('sb_member')\" onMouseout=\"off('sb_member')\" title=\"become a member\"><img src=\"img/sb_member_off.gif\" alt=\"become a member\" border=0 name=\"sb_member\"></a>";
 HTMLstr += "<a href=\"education.shtml\" onMouseover=\"on('sb_education')\" onMouseout=\"off('sb_education')\" title=\"education\"><img src=\"img/sb_education_off.gif\" alt=\"education\" border=0 name=\"sb_education\"></a>";
 HTMLstr += "</td></tr>\n";
 HTMLstr += "<tr><td valign=top colspan=5><img src=\"img/pixel_223565.gif\" height=21 width=544 border=0></td></tr>";
 HTMLstr += "</table>\n";
 //end code specific to Classic Stage MENU
 //*************************************
 //*************************************
 HTMLstr += "\n";
 HTMLstr += "<!-- SUB MENU STARTS -->\n";
 HTMLstr += "<!-- SUB_MENU -->\n";
 HTMLstr += "<!-- SUB MENU ENDS -->\n";
 HTMLstr += "\n"; 
  HTMLstr+= "</div>\n";
 HTMLstr += "<!-- MENU PANE DECALARATION ENDS -->\n";
}

//*****************************************************************************************
//*****************************************************************************************
//**************ADDED BY Annita Rashin 04.11.03 annita@umgraphics.com**********************
//******************************START addItemImage()***************************************
function addItemImage(idItem, image_off, image_on, hint, location, altLocation){
 var Lookup = "<!-- ITEM "+idItem+" -->";
 if (HTMLstr.indexOf(Lookup) != -1){
  alert(idParent + " already exist");
  return;
 }
 var MENUitem = "";
 MENUitem += "\n<!-- ITEM "+idItem+" -->\n";
 if (n){
   if (location != null){
      MENUitem += "<td>";   
      MENUitem += "<ilayer name="+idItem+">";
      MENUitem += "<a href='"+location+"' class=clsMenuItemNS onMouseOver=\"button_on('"+idItem+"', '"+image_on+"');\" onmouseout=\"button_off('"+idItem+"', '"+image_off+"')\"><img src=\"";
      MENUitem += image_off;
      MENUitem += "\" border=0 name="+idItem+"_img></a>";
      MENUitem += "</ilayer>";
      MENUitem += "</td>";
    }
   else if (altLocation != null){
      MENUitem += "<td>";  
      MENUitem += "<ilayer name="+idItem+">";
      MENUitem += "<a href='"+altLocation+"' class=clsMenuItemNS onmouseover=\"displaySubMenu('"+idItem+"'); button_on('"+idItem+"', '"+image_on+"');\" onmouseout=\"button_off('"+idItem+"', '"+image_off+"')\"><img src=\"";
      MENUitem += image_off;
      MENUitem += "\" border=0 name="+idItem+"_img></a>";
      MENUitem += "</ilayer>";
      MENUitem += "</td>"; 
    }
    
   else{
      MENUitem += "<td>";  
      MENUitem += "<ilayer name="+idItem+">";
      MENUitem += "<a href='.' class=clsMenuItemNS onmouseover=\"displaySubMenu('"+idItem+"'); button_on('"+idItem+"', '"+image_on+"');\" onmouseout=\"button_off('"+idItem+"', '"+image_off+"')\" onclick=\"return false;\"><img src=\"";
      MENUitem += image_off;
      MENUitem += "\" border=0 name="+idItem+"_img></a>";
      MENUitem += "</ilayer>";
      MENUitem += "</td>";  
    }
 }
 else{//IE or NS6
  MENUitem += "<td>";
  MENUitem += "<div id='"+idItem+"' style='position:relative; font: "+this.menuFont+";'>\n";
  MENUitem += "<a ";
  
  if(ie)
   MENUitem += "class=clsMenuItemIE ";
  if(ns6)
   MENUitem += "class=clsMenuItemNS6 ";
   
  if (hint != null)
   MENUitem += "title='"+hint+"' ";
  if (location != null){
   MENUitem += "href='"+location+"' ";
   MENUitem += "onmouseover=\"hideAll(); button_on('"+idItem+"', '"+image_on+"');\" onmouseout=\"button_off('"+idItem+"', '"+image_off+"')\"";
  }
  else{
   if (altLocation != null){
    MENUitem += "href='"+altLocation+"' ";
    MENUitem += "onmouseover=\"displaySubMenu('"+idItem+"'); button_on('"+idItem+"', '"+image_on+"');\" onmouseout=\"button_off('"+idItem+"', '"+image_off+"')\""
    }
   else{
    MENUitem += "href='.' ";
    MENUitem += "onmouseover=\"displaySubMenu('"+idItem+"'); button_on('"+idItem+"', '"+image_on+"');\" onmouseout=\"button_off('"+idItem+"', '"+image_off+"')\""
    MENUitem += "onclick=\"return false;\" "
    }
    
  }
  MENUitem += "><img src=\"";
  MENUitem += image_off;
  MENUitem += "\" border=0 name="+idItem+"_img></a>";
  MENUitem += "</div>";
  MENUitem += "</td>\n";
 }
 MENUitem += "<!-- END OF ITEM "+idItem+" -->\n\n";
 MENUitem += "<!-- MAIN_MENU -->\n";

 HTMLstr = HTMLstr.replace("<!-- MAIN_MENU -->\n", MENUitem);
}
//*****************************************************************************************
//******************************END addItemImage()*****************************************
//*****************************************************************************************
//*****************************************************************************************

//add sub-menu items to applicable drop-down containor
function addSubItem(idParent, text, hint, location){
 var MENUitem = "";
 Lookup = "<!-- ITEM "+idParent+" -->";
 if (HTMLstr.indexOf(Lookup) == -1){
  alert(idParent + " not found");
  return;
 }
 Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->";
 if (HTMLstr.indexOf(Lookup) == -1){
  if (n){
   MENUitem += "\n";
   MENUitem += "<layer id='"+idParent+"submenu' visibility=hide bgcolor=#336699>\n";
   MENUitem += "<table cellspacing='"+this.subMenuCellSpacing+"' border='"+this.subMenuPaneBorder+"' width="+this.subMenuPaneWidth+">\n";
   MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
   MENUitem += "</table>\n";
   MENUitem += "</layer>\n";
   MENUitem += "\n";
  }
  else{//IE or NS6
   MENUitem += "\n";
   MENUitem += "<div id='"+idParent+"submenu' style='position:absolute; visibility: hidden; background-color: #336699; width: "+this.subMenuPaneWidth+"; top: -300;'>\n";
   MENUitem += "<table cellspacing='"+this.subMenuCellSpacing+"' border='"+this.subMenuPaneBorder+"' width="+this.subMenuPaneWidth+">\n";
   MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
   MENUitem += "</table>\n";
   MENUitem += "</div>\n";
   MENUitem += "\n";
  }
  MENUitem += "<!-- SUB_MENU -->\n";
  HTMLstr = HTMLstr.replace("<!-- SUB_MENU -->\n", MENUitem);
 }

 Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
 if (n)  MENUitem = "<tr><td bgcolor='"+this.SubMenubgColor+"'><a class=clsMenuItemNS title='"+hint+"' href='"+location+"'>"+text+"</a><br></td></tr>\n";
 else //IE or NS6
  if(ie)
   MENUitem = "<tr><td bgcolor='"+this.SubMenubgColor+"'><a class=clsMenuItemIE title='"+hint+"' href='"+location+"'>"+text+"</a><br></td></tr>\n";
  if(ns6)
   MENUitem = "<tr><td bgcolor='"+this.SubMenubgColor+"'><a class=clsMenuItemNS6 title='"+hint+"' href='"+location+"'>"+text+"</a><br></td></tr>\n";
 MENUitem += Lookup;
 HTMLstr = HTMLstr.replace(Lookup, MENUitem);

}


//*****************************************************************************************
//*****************************************************************************************
//**************ADDED BY Annita Rashin 04.11.03 annita@umgraphics.com**********************
//*****************************************************************************************
//add sub-menu items IMAGE MENU to applicable drop-down containor
function addSubItemImage(idParent,id,image_off, image_on, hint, location){
 var MENUitem = "";
 Lookup = "<!-- ITEM "+idParent+" -->";
 if (HTMLstr.indexOf(Lookup) == -1){
  alert(idParent + " not found");
  return;
 }
 Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->";
 if (HTMLstr.indexOf(Lookup) == -1){
  if (n){
   MENUitem += "\n";
   MENUitem += "<layer id='"+idParent+"submenu' visibility=hide>\n";
   MENUitem += "<table cellspacing='"+this.subMenuCellSpacing+"' cellpadding=0 border='"+this.subMenuPaneBorder+"' width="+this.subMenuPaneWidth+">\n";
   MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
   MENUitem += "</table>\n";
   MENUitem += "</layer>\n";
   MENUitem += "\n";
  }
  else{//IE or NS6
   MENUitem += "\n";
   MENUitem += "<div id='"+idParent+"submenu' style='position:absolute; visibility: hidden; width: "+this.subMenuPaneWidth+"; top: -300;'>\n";
   MENUitem += "<table cellspacing='"+this.subMenuCellSpacing+"' cellpadding=0 border='"+this.subMenuPaneBorder+"' width="+this.subMenuPaneWidth+">\n";
   MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
   MENUitem += "</table>\n";
   MENUitem += "</div>\n";
   MENUitem += "\n";
  }
  MENUitem += "<!-- SUB_MENU -->\n";
  HTMLstr = HTMLstr.replace("<!-- SUB_MENU -->\n", MENUitem);
 }

 Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
 if (n)  MENUitem = "<tr><td bgcolor='"+this.bgColor+"'><a class=clsMenuItemNS title='"+hint+"' href='"+location+"' onmouseover=\"sub_button_on('"+idParent+"submenu','"+idParent+"_"+id+"', '"+image_on+"');\" onmouseout=\"sub_button_off('"+idParent+"submenu','"+idParent+"_"+id+"', '"+image_off+"')\"><img src="+image_off+" border=0 name="+idParent+"_"+id+"_img></a></td></tr>\n";
 else //IE or NS6
  if(ie)
   MENUitem = "<tr><td bgcolor='"+this.bgColor+"'><a class=clsMenuItemIE title='"+hint+"' href='"+location+"' onmouseover=\"sub_button_on('"+idParent+"submenu','"+idParent+"_"+id+"', '"+image_on+"');\" onmouseout=\"sub_button_off('"+idParent+"submenu','"+idParent+"_"+id+"', '"+image_off+"')\"><img src="+image_off+" border=0 name="+idParent+"_"+id+"_img></a></td></tr>\n";
  if(ns6)
   MENUitem = "<tr><td bgcolor='"+this.bgColor+"'><a class=clsMenuItemNS6 title='"+hint+"' href='"+location+"' onmouseover=\"sub_button_on('"+idParent+"submenu','"+idParent+"_"+id+"', '"+image_on+"');\" onmouseout=\"sub_button_off('"+idParent+"submenu','"+idParent+"_"+id+"', '"+image_off+"')\"><img src="+image_off+" border=0 name="+idParent+"_"+id+"_img></a></td></tr>\n";
 MENUitem += Lookup;
 HTMLstr = HTMLstr.replace(Lookup, MENUitem);

}

//*****************************************************************************************
//******************************END addSubItemImage****************************************
//*****************************************************************************************



//write out main menu bar
function showMenu(){
 document.writeln(HTMLstr);
}

//show submenu, and then calculate its x and y coordinates
function displaySubMenu(idMainMenu){
 var menu;
 var submenu;
 if(idMainMenu=='contactus')
  {
   toggleBox('loginBox',0);
   contactUsOn=0;
  }
 if (n){
  submenu = document.layers[idMainMenu+"submenu"];
  if (lastMenu != null && lastMenu != submenu) hideAll();
  submenu.left = document.layers[idMainMenu].pageX;
  submenu.top  = document.layers[idMainMenu].pageY + document.layers[idMainMenu].clip.height;
  submenu.visibility = fShow;
  submenu.zIndex=10
  leftX  = document.layers[idMainMenu+"submenu"].left;
  rightX = leftX + document.layers[idMainMenu+"submenu"].clip.width;
  leftY  = document.layers[idMainMenu+"submenu"].top+document.layers[idMainMenu+"submenu"].clip.height+15;
 } else if (ns6) {
 
 menu = document.getElementById(idMainMenu);  
  submenu = document.getElementById(idMainMenu+"submenu");
  if (lastMenu != null && lastMenu != submenu) hideAll();
  submenu.style.left = calculateSumOffset(menu, 'offsetLeft')-1;
  //submenu.style.top  = document.getElementById(idMainMenu).offsetHeight + 4;
  //mama=document.getElementById(idMainMenu).offsetParent;
  //submenu.style.top  = mama.offsetHeight+mama.offsetTop-20;
  //submenu.style.top=document.getElementById(mama).offsetTop+document.getElementById(mama).clientHeight;
  submenu.style.top=imgMenuHeight;
  submenu.style.visibility = fShow;
  leftX  = calculateSumOffset(menu, 'offsetLeft');
  rightX =leftX + document.getElementById(idMainMenu+"submenu").offsetWidth;
  //leftY  = document.getElementById(idMainMenu+"submenu").offsetHeight + window.pageYOffset + 4;
  leftY  = document.getElementById(idMainMenu+"submenu").offsetHeight + document.getElementById(idMainMenu).offsetTop+20;

 } else if (ie) { 
  menu = eval(idMainMenu);
  submenu = eval(idMainMenu+"submenu.style");
  if (lastMenu != null && lastMenu != submenu) hideAll();   
  submenu.left = calculateSumOffset(menu, 'offsetLeft')-1;
  //submenu.top  = document.all[idMainMenu].offsetHeight + 4;
  //mama=document.all[idMainMenu].offsetParent;
  //submenu.top = mama.offsetHeight+mama.offsetTop-20;
  submenu.top=imgMenuHeight;
  submenu.visibility = fShow;
  leftX  = document.all[idMainMenu+"submenu"].style.posLeft;
  rightX = leftX + document.all[idMainMenu+"submenu"].offsetWidth;
  leftY  = document.all[idMainMenu+"submenu"].style.posTop+document.all[idMainMenu+"submenu"].offsetHeight + 4;
  //leftY  = document.all[idMainMenu+"submenu"].style.posTop+document.all[idMainMenu+"submenu"].offsetHeight + document.all[idMainMenu].offsetHeight;
 }
 if(idMainMenu=='contactus')
  {
   toggleBox('loginBox',0);
   contactUsOn=0;
  }
 lastMenu = submenu;
}

//hide the submenu
function hideAll(){
 if(contactUsOn==0)
   {toggleBox('loginBox',1);}
 if (ns6){
  if (lastMenu != null) 
   {lastMenu.style.visibility = fHide;}
 }else{
  if (lastMenu != null) 
   {lastMenu.visibility = fHide;}
 }  
}

//used to calculate position of a submenu
function calculateSumOffset(idItem, offsetName){
 var totalOffset = 0;
 var item = eval('idItem');
 do{
  totalOffset += eval('item.'+offsetName);
  item = eval('item.offsetParent');
 } while (item != null);
 return totalOffset;
}

//close menu on mouse out of menu containor
function updateIt(e){
 if (ns6){
  var x = e.pageX;
  var y = e.pageY;
  if (x > rightX || x < leftX) hideAll();
  else if (y > leftY) hideAll();
 }
  else if (ie){
  var x = window.event.clientX;
  var y = window.event.clientY;
  if (x > rightX || x < leftX) hideAll();
  else if (y > leftY) hideAll();
 }
 else if (n){
  var x = e.pageX;
  var y = e.pageY;
  if (x > rightX || x < leftX) hideAll();
  else if (y > leftY) hideAll();
 }
}

//set page to hide menus on a mouse click or on mouseout of menu containor
if (ns6)
{
 document.body.onclick=hideAll;
 document.body.onmousemove=updateIt;
}
else if (ie)
{
 document.body.onclick=hideAll;
 document.body.onscroll=hideAll;
 document.body.onmousemove=updateIt;
}
else if (n)
{
 document.onmousedown=hideAll;
 window.captureEvents(Event.MOUSEMOVE);
 window.onmousemove=updateIt;
}

//currentsection function
function current(id, image_off, image_on)
{
 currentSection=image_off;
 if(n)
  {document.layers[id].document.images[id+"_img"].src=image_on;}
 else
  {document.images[id+"_img"].src=image_on;}
}

//rollover functions for main menu items
function button_on(id, image_on)
 {  
  if(n)
   {document.layers[id].document.images[id+"_img"].src=image_on;}
  else
   {document.images[id+"_img"].src=image_on;}
 }  



function button_off(id, image_off)
 {  
  if(n)
   {
    if(image_off!=currentSection)
     {document.layers[id].document.images[id+"_img"].src=image_off;}
   }
  else
   {
    if(image_off!=currentSection)
     {document.images[id+"_img"].src=image_off;}
   }

 }  
 
//rollover function for submenu items
function sub_button_on(layer, id, image_on)
 {  
  if(n)
   {document.layers[layer].document.images[id+"_img"].src=image_on;}
  else
   {document.images[id+"_img"].src=image_on;}
 }  



function sub_button_off(layer, id, image_off)
 {  
  if(n)
   {
    if(image_off!=currentSection)
     {document.layers[layer].document.images[id+"_img"].src=image_off;}
   }
  else
   {
    if(image_off!=currentSection)
     {document.images[id+"_img"].src=image_off;}
   }

 }  
 
 function on(imgName)
 {
        if (document.images)
        {document[imgName].src="img/"+imgName + "_on.gif";}        
 }  



 function off(imgName)
 {
 if (document.images)
        {document[imgName].src="img/"+imgName + "_off.gif";}        
}  


function poptickets(url)
{
 submenuWindow=window.open(url,'submenu','toolbar=no,width=800,height=500,directories=no,status=yes,scrollbars=yes,resize=yes,menubar=no');
 if(submenuWindow.open)
                        {submenuWindow.focus();}
}

function pop(url)
{
 submenuWindow2=window.open(url,'submenu2','toolbar=no,width=600,height=400,directories=no,status=yes,scrollbars=yes,resize=yes,menubar=no');
 if(submenuWindow2.open)
                        {submenuWindow2.focus();}
}
function photo(url)
{
 submenuWindow2=window.open(url,'submenu2','toolbar=no,width=550,height=550,directories=no,status=yes,scrollbars=yes,resize=yes,menubar=no');
 if(submenuWindow2.open)
                        {submenuWindow2.focus();}
}
