
// cheesy off switch for menus

function allOff(){
  hideLayer('menu1');
  hideLayer('menu2');
  hideLayer('menu3');
  hideLayer('menu4');
  hideLayer('menu5');
  hideLayer('menu6');
  hideLayer('menu7');
  hideLayer('menu8');
  hideLayer('menu9');
}

// generic layer visibility switch

var closeIt;

function showLayer(layerName){
  allOff();
    clearTimeout(closeIt);
  
  if (document.layers) {
    var page = eval('document.'+layerName);
  } else if (document.getElementById) {
    var page= eval("document.getElementById(layerName).style");
  } else if (document.all) {
    var page = eval('document.all.'+layerName+'.style');
  }
 
    page.visibility="visible";
}
        
function hideLayer(layerName){
  if (document.layers) {
    var page = eval('document.'+layerName);
  } else if (document.getElementById) {
    var page= eval("document.getElementById(layerName).style");
  } else if (document.all) {
    var page = eval('document.all.'+layerName+'.style');
  }
    page.visibility="hidden";
}

function hideDelay(which) {
  closeIt = setTimeout('hideLayer("'+which+'")',500);
}


// find window dimensions and draw page

var winHeight; 
var winWidth; 

function myWinHeight(thisWindow) {
  if(document.all) {
    return thisWindow.document.body.clientHeight;
  } else {
    return thisWindow.innerHeight;
  }
}

function myWinWidth(thisWindow) {
  if(document.all) {
    return thisWindow.document.body.clientWidth;
  } else {
    return thisWindow.innerWidth;
  }
}

// for home page

function tableMaker() {
  
  winWidth = myWinWidth(self);
  cellWidth = winWidth/2 - 420;

  document.write('<td rowspan=3 width='+cellWidth+'><img src="images/spacer.gif" height=1 width='+cellWidth+'>&nbsp;</td>');
 
}

function divMaker(name, vert) {
  
  winWidth = myWinWidth(self);
  cellWidth = winWidth/2 - 420;
  if(document.layers) {
    howID = 'name';
  } else {
    howID = 'id';
  }
  
  divLeft = (cellWidth + 445);
  document.write('<div '+howID+'="'+name+'" class="menu" style="position: absolute; left: '+divLeft+'px; top: '+vert+'px; visibility: hidden; z-index: 1">');
 
}

// for interior pages

function contentTable() {
  
  winWidth = myWinWidth(self);
  avail = winWidth - 397;
  if(avail>550){
    tableWidth=550;
  } else {
    tableWidth = '100%';
  }

  document.write('<table border=0 cellpadding=9 cellspacing=0 width='+tableWidth+'>');
 
}

//fixing Netscape resize bug, dammit

NS4=(document.layers);
IE4=(document.all);
ver4=(NS4 || IE4);

if (!IE4) onload = setResize;

function setResize(){
	setTimeout('window.onresize=reDo;',500);
}

function reDo(){
    window.location.reload()
}

// rollover script

if (document.images){
        abouton = new Image();
        abouton.src = "images/n-about-on.gif";
        aboutoff = new Image();
        aboutoff.src = "images/n-about-off.gif";
        marketon = new Image();
        marketon.src = "images/n-market-on.gif";
        marketoff = new Image();
        marketoff.src = "images/n-market-off.gif";
        programson = new Image();
        programson.src = "images/n-programs-on.gif";
        programsoff = new Image();
        programsoff.src = "images/n-programs-off.gif";
        newson = new Image();
        newson.src = "images/n-news-on.gif";
        newsoff = new Image();
        newsoff.src = "images/n-news-off.gif";
        artistson = new Image();
        artistson.src = "images/n-artists-on.gif";
        artistsoff = new Image();
        artistsoff.src = "images/n-artists-off.gif";
        galleryon = new Image();
        galleryon.src = "images/n-gallery-on.gif";
        galleryoff = new Image();
        galleryoff.src = "images/n-gallery-off.gif";
        memberson = new Image();
        memberson.src = "images/n-members-on.gif";
        membersoff = new Image();
        membersoff.src = "images/n-members-off.gif";
        supporton = new Image();
        supporton.src = "images/n-support-on.gif";
        supportoff = new Image();
        supportoff.src = "images/n-support-off.gif";
        supporterson = new Image();
        supporterson.src = "images/n-supporters-on.gif";
        supportersoff = new Image();
        supportersoff.src = "images/n-supporters-off.gif";
        storeon = new Image();
        storeon.src = "images/n-store-on.gif";
        storeoff = new Image();
        storeoff.src = "images/n-store-off.gif";
        volunteeron = new Image();
        volunteeron.src = "images/n-volunteer-on.gif";
        volunteeroff = new Image();
        volunteeroff.src = "images/n-volunteer-off.gif";
        contacton = new Image();
        contacton.src = "images/n-contact-on.gif";
        contactoff = new Image();
        contactoff.src = "images/n-contact-off.gif";
        mapon = new Image();
        mapon.src = "images/n-map-on.gif";
        mapoff = new Image();
        mapoff.src = "images/n-map-off.gif";

}

function swapem(iname, gname) {
if (document.images){
        iname.src = gname.src;
}}



