/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="https://www.vendini.com/ticket-software.html?m=cd280607054d818e205edf44232ecf4c&t=tix" onclick="window.open(\'http://www.vendini.com/service/tickets/index.html?m=cd280607054d818e205edf44232ecf4c\', \'order_window\', \'scrollbars,width=596,height=485,status=yes,left=\'+((window.screen.width - 596)/2)+\',top=\'+((window.screen.height - 485) /2.5)).focus();return false;">BUY TICKETS!</a>'
menu1[1]='<a href="/subscriptions.html">Subscriptions</a>'
menu1[2]='<a href="/gala.html">2010 Benefit</a>'
menu1[3]='<a href="/music.html">All Music</a>'
menu1[4]='<a href="/bluegrass.html">Bluegrass</a>'
menu1[5]='<a href="/blues.html">Blues</a>'
menu1[6]='<a href="/comedy.html">Comedy</a>'
menu1[7]='<a href="/dance.html">Dance</a>'
menu1[8]='<a href="/family.html">Family</a>'
menu1[9]='<a href="/film.html">Film</a>'
menu1[10]='<a href="/folk.html">Folk</a>'
menu1[11]='<a href="/great_traditions.html">Great Traditions</a>'
menu1[12]='<a href="/concert.html">In Concert</a>'
menu1[13]='<a href="/insights.html">Insights &amp; Revelations</a>'
menu1[14]='<a href="/missoula.html">Missoula Children\'s Theatre</a>'
menu1[15]='<a href="/school.html">School Outreach</a>'
menu1[16]='<a href="/special.html">Special Events</a>'
menu1[17]='<a href="/theatre.html">Theatre</a>'
menu1[18]='<a href="/rentals.html">Rentals</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="/subscriptions.html">Subscriptions</a>'

var menu3=new Array()
menu3[0]='<a href="/photos.html">Photos</a>'
menu3[1]='<a href="/video.html">Audio &amp; Video</a>'

var menu4=new Array()
menu4[0]='<a href="/membership.html">Membership & Donations</a>'
menu4[1]='<a href="/support.html">Sponsors</a>'
menu4[2]='<a href="/contributors.html">Contributors</a>'

var menu5=new Array()
menu5[0]='<a href="/about.html">Mission</a>'
menu5[1]='<a href="/boxoffice.html">Box Office</a>'
menu5[2]='<a href="/board.html">Board of Trustees</a>'
menu5[3]='<a href="/directions.html">Directions</a>'
menu5[4]='<a href="/theatre_rental.html">Theatre Rental</a>'
menu5[5]='<a href="http://www.facebook.com/pages/Emelin-Theatre/77851070546" target="_blank">Facebook</a>'
menu5[6]='<a href="http://twitter.com/EmelinTheatre" target="_blank">Twitter</a>'
menu5[7]='<a href="/blog/">Blog</a>'
menu5[8]='<a href="/employment.html">Employment</a>'

var menu6=new Array()
menu6[0]='<a href="/contact.html">Contact Info</a>'
menu6[1]='<a href="/email.html">Join our Email List</a>'

var menu7=new Array()
menu7[0]='<a href="/theatre.html">2009/2010 Theatre season announced</a>'
menu7[1]='<a href="/insights.html">2009/2010 Insights and Revelations season announced</a>'
menu7[2]='<a href="/special.html">2009/2010 Special Events announced</a>'
menu7[3]='<a href="/concert.html">2009/2010 In Concert season announced</a>'
menu7[4]='<a href="/cabaret.html">2009/2010 Cabaret season announced</a>'
menu7[5]='<a href="/index.html">Emelin Mourns Loss of Seth Kaplan</a>'
menu7[6]='<a href="/dance.html">2009/2010 Dance season announced</a>'
menu7[7]='<a href="/great_traditions.html">2009/2010 Great Traditions season announced</a>'
menu7[8]='<a href="/blues.html">2009/2010 Blues season announced</a>'
menu7[9]='<a href="/folk.html">2009/2010 Folk season announced</a>'
menu7[10]='<a href="/film.html">July Film Club Extras</a>'

var menuwidth='165px' //default menu width
var menubgcolor='lightyellow' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function show_div(div_id) {	
	document.getElementById(div_id).style.display = 'block';
}

function hide_div(div_id) {
    document.getElementById(div_id).style.display = 'none';
}

var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function AssignPositionReverse(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX-360) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ShowContentReverse(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPositionReverse(dd);
dd.style.display = "block";
}

function show_div_photos(div_id) {
    // hide all the divs
    document.getElementById('0708').style.display = 'none';
    document.getElementById('0809').style.display = 'none';
	document.getElementById('0910').style.display = 'none';
    // show the requested div
    document.getElementById(div_id).style.display = 'block';
}

function show_div_cal(div_id) {
    // hide all the divs
	document.getElementById('aug10').style.display = 'none';
	document.getElementById('sep10').style.display = 'none';
	document.getElementById('oct10').style.display = 'none';
	document.getElementById('nov10').style.display = 'none';
	document.getElementById('dec10').style.display = 'none';
	document.getElementById('jan11').style.display = 'none';
	document.getElementById('feb11').style.display = 'none';
	document.getElementById('mar11').style.display = 'none';
	document.getElementById('apr11').style.display = 'none';
	document.getElementById('may11').style.display = 'none';
    // show the requested div
    document.getElementById(div_id).style.display = 'block';
}

function show_div(div_id) {
    // show the requested div
    document.getElementById(div_id).style.display = 'block';
}

function show_div_gala(div_id) {
    // hide all the divs
    document.getElementById('direct1').style.display = 'none';
	document.getElementById('committee').style.display = 'none';
	document.getElementById('tickets').style.display = 'none';
	document.getElementById('tables').style.display = 'none';
    // show the requested div
    document.getElementById(div_id).style.display = 'block';
}