//DEFINING GLOBAL VARIABLES FOR SWAPIT ALL THIS FUNCTION DOES IS CLOSE ANY OPEN SUBMENUS WHEN YOU CLICK ON THE PAGE
var selected_id = null; 
var dom = document.getElementById; 


//HEADER LAYER
function showHeader()
{
	document.write("<h1>Homebrew Fair III - March 17, 2007 1-5PM</h1>");
	document.write("<p>brought to you by</p>");
	document.write("<h2>Your Seattle Area Homebrew Stores and Clubs</h2>");	
//	document.write("<hr/>");
}


function showAds()
{
	       
	var maxAdNo = 7;
        var adNo;
        var myAd = new Array();
    	myAd[0] =  '<img  src = "banners/D300_41626.jpg">';    
    	myAd[1] =  '<img  src = "banners/D300_41681.jpg">';    	
    	myAd[2] =  '<img  src = "banners/D300_41762.jpg">';  
    	myAd[3] =  '<img  src = "banners/D300_41790.jpg">'; 
	myAd[4] =  '<img  src = "banners/D300_41792.jpg">';    
    	myAd[5] =  '<img  src = "banners/D300_41847.jpg">';    	
    	myAd[6] =  '<img  src = "banners/D300_41856.jpg">';  
    	myAd[7] =  '<img  src = "banners/D300_41862.jpg">';   

        adNo = Math.round(Math.random() * maxAdNo);
     	document.write(myAd[adNo]);
}

function showAdsI()
{
      
	var maxAdNo = 3;
        var adNo;
        var myAd = new Array();
        myAd[0] =  '<img  src = "../borders/D300_41626.jpg" border="0">';    
    	myAd[1] =  '<img  src = "../borders/D300_41681.jpg" border="0">';    	
    	myAd[2] =  '<img  src = "../borders/D300_41762.jpg" border="0">';  
    	myAd[3] =  '<img  src = "../borders/D300_41790.jpg" border="0">';  


        adNo = Math.round(Math.random() * maxAdNo);
	document.write(myAd[adNo]);

}
//FOOTER LAYER
function showFooter()
{
	document.write("<h2>what ails your ales?</h2>");
	document.write("<p>&copy;2005 Jon Tobey jontobey@yahoo.com</p>");
}




//SUBNAV LAYER (LEFT COLUMN) AT THE INDEX LEVEL
function writeNavI()
{
 document.write('<ul class="nobullet"');
    	document.write('<li><a href="index.html" onmouseover="swapIt(selected_id,\'out\')">Home</a></li>');
    	document.write('<li><a href="#" onmouseover="down(\'menu1nav\',\'out\',\'down\')"  >Event</a></li>');
    	document.write('<ul id="menu1nav"   class="out">');
	    	document.write('<li><a href="text/format.html">Format</a></li>');
		   	document.write('<li><a href="text/registration.html">Registration</a></li>');
//	   	document.write('<li><a href="text/shirt.html">Get a Shirt!</a></li>');
		   	document.write('<li><a href="text/schedule.html">Schedule</a></li>');
    		document.write('<li><a href="text/lectures.html">Lectures & Demonstrations</a></li>');
      		document.write('<li><a href="text/prizes.html">Prizes</a></li>');
      		//document.write('<li><a href="text/sponsors.html">Sponsors</a></li> ');
      		document.write('<li><a href="text/directions.html">Directions</a></li>');
      		document.write('<li><a href="text/sponsorship.html">Sponsorship Worksheet</a></li>');
      		document.write('<li><a href="text/pubcrawl.html">Post Event</a></li>');
			document.write('<li><a href="text/2006_wrap_up.html">Previous Fairs</a></li>');
       	document.write('</ul>');
    
    	document.write('<li><a href="#" onmouseover="down(\'menu2nav\',\'out\',\'down\')"  >Resources</a></li>');
    	document.write('<ul id="menu2nav"   class="out">');
      		document.write('<li><a href="text/styles.html">Styles</a></li>');
      		//document.write('<li><a href="text/factpackage.html">Project Worksheet</a></li>');
      		document.write('<li><a href="text/bac.html">Blood Alcohol Content</a></li>');
      		document.write('<li><a href="text/cheers.html">International Cheers</a></li>');
      		document.write('<li><a href="text/beer_stores.html">Good Beer Stores</a></li>');
       	document.write('</ul>');
    	
    	document.write('<li><a href="#" onmouseover="down(\'menu3nav\',\'out\',\'down\')" >Homebrewing</a></li>');
    	document.write('<ul id="menu3nav" class="out">');
      		document.write('<li><a href="text/flavor.html">Flavor Descriptors</a></li>');
      		document.write('<li><a href="text/tentips.html">Quick Tips </a></li>');
      		document.write('<li><a href="text/stores.html">Homebrew Stores</a></li>');
      		document.write('<li><a href="text/clubs.html">Homebrew Clubs</a></li>');
         document.write('</ul>');

	document.write('<li><a href="#" onmouseover="down(\'menu4nav\',\'out\',\'down\')" >Philosophising</a></li>');
    	document.write('<ul id="menu4nav" class="out">');
      		document.write('<li><a href="text/judging.html">Judging</a></li>');
      		document.write('<li><a href="text/philosophy.html">Why Styles?</a></li>');
         document.write('</ul>');
    document.write('</ul>');
}
//SUBNAV LAYER (LEFT COLUMN) FOR ALL OTHER PAGES
function writeNav()
{
 document.write('<ul class="nobullet"');
    	document.write('<li><a href="../index.html" onmouseover="swapIt(selected_id,\'out\')">Home</a></li>');
   	 document.write('<li><a href="#" onmouseover="down(\'menu1nav\',\'out\',\'down\')"  onmousedown="down(\'menu1\',\'out\',\'down\')">Event</a></li>');
    	document.write('<ul id="menu1nav"   class="out">');
      		document.write('<li><a href="format.html">Format</a></li>');
		   	document.write('<li><a href="registration.html">Registration</a></li>');
//		   	document.write('<li><a href="shirt.html">Get a Shirt!</a></li>');
		   	document.write('<li><a href="schedule.html">Schedule</a></li>');
      		document.write('<li><a href="lectures.html">Lectures & Demonstrations</a></li>');
      		document.write('<li><a href="prizes.html">Prizes</a></li>');
//			document.write('<li><a href="sponsors.html">Sponsors</a></li> ');
      		document.write('<li><a href="directions.html">Directions</a></li>');
      		document.write('<li><a href="sponsorship.html">Sponsorship Worksheet</a></li>');
      		document.write('<li><a href="pubcrawl.html">Post Event</a></li>');
			document.write('<li><a href="2006_wrap_up.html">Previous Fairs</a></li>');
       	document.write('</ul>');
    
    	document.write('<li><a href="#" onmouseover="down(\'menu2nav\',\'out\',\'down\')"  onmousedown="down(\'menu2\',\'out\',\'down\')">Resources</a></li>');
    	document.write('<ul id="menu2nav"   class="out">');
      		document.write('<li><a href="styles.html">Styles</a></li>');
      		//document.write('<li><a href="factpackage.html">Project Worksheet</a></li>');
      		document.write('<li><a href="bac.html">Blood Alcohol Content</a></li>');
      		document.write('<li><a href="cheers.html">International Cheers</a></li>');
      		document.write('<li><a href="beer_stores.html">Good Beer Stores</a></li>');
       	document.write('</ul>');
    	
    	document.write('<li><a href="#" onmouseover="down(\'menu3nav\',\'out\',\'down\')"  onmousedown="down(\'menu3\',\'out\',\'down\')">Homebrewing</a></li>');
    	document.write('<ul id="menu3nav" class="out">');
      		document.write('<li><a href="flavor.html">Flavor Descriptors</a></li>');
      		document.write('<li><a href="tentips.html">Quick Tips</a></li>');
      		document.write('<li><a href="stores.html">Homebrew Stores</a></li>');
      		document.write('<li><a href="clubs.html">Hombrew Clubs</a></li>');
       document.write('</ul>');

	document.write('<li><a href="#" onmouseover="down(\'menu4nav\',\'out\',\'down\')" onmousedown="down(\'menu4\',\'out\',\'down\')">Philosophising</a></li>');
    	document.write('<ul id="menu4nav" class="out">');
      		document.write('<li><a href="judging.html">Judging</a></li>');
      		document.write('<li><a href="philosophy.html">Why Styles?</a></li>');
         document.write('</ul>');
    document.write('</ul>');
}

//SPONSOR COLUMNS (RIGHT COLUMN) AT THE INDEX LEVEL
function writeColSponI()
{
	document.write('<p><a href = "http://www.cascadebrewersclub.org/"><img src = "images/cbgsmall.jpg" border = 0></a></p>'); 
	document.write('<p><a href = "http://groups.yahoo.com/group/GEBL/"><img src = "images/gebl_logo.jpg" border = 0></a></p>'); 
	document.write('<p><a href = "http://www.gurple.com/nshc/">North Seattle Homebrew Club</a></p>'); 
	//document.write('<p><img src = "images/cellar_dude.gif" ><br><a href = "http://www.cellar-homebrew.com/">The Cellar Homebrew</a></p>'); 
	document.write('<p><a href = "http://www.westsoundbrewers.org/"><img src = "images/westsound_logo.gif" border = 0></a></p>');  
	document.write('<p><a href = "http://www.hopsclub.com/"><img src = "images/hops_logo.gif" border = 0></a></p>'); 
	document.write('<p><a href = "http://www.geocities.com/impalingalers/"><img src = "images/alers_logo.gif" border = 0><br>Impaling Alers</a></p>');                                                
}


//SPONSOR COLUMNS (RIGHT COLUMN)
function writeColSpon()
{
	//document.write('<p><a href = "http://www.cascadebrewersguild.org/bobshbs.asp">Bob\'s Homebrew Supply</p></a>'); 
	document.write('<p><a href = "http://www.cascadebrewersclub.org/"><img src = "../images/cbgsmall.jpg" border = 0></a></p>'); 
	document.write('<p><a href = "http://groups.yahoo.com/group/GEBL/"><img src = "../images/gebl_logo.jpg" border = 0></a></p>'); 
	document.write('<p><a href = "http://www.gurple.com/nshc/">North Seattle Homebrew Club</a></p>');   
	//document.write('<p><img src = "../images/cellar_dude.gif" ><br><a href = "http://www.cellar-homebrew.com/">The Cellar Homebrew</a></p>');  
	document.write('<p><a href = "http://www.westsoundbrewers.org/"><img src = "../images/westsound_logo.gif" border = 0></a></p>'); 
	document.write('<p><a href = "http://www.hopsclub.com/"><img src = "../images/hops_logo.gif" border = 0></a></p>'); 
	document.write('<p><a href = "http://www.geocities.com/impalingalers/"><img src = "../images/alers_logo.gif" border = 0><br>Impaling Alers</a></p>');                       
}


//NAVIGATION FOR SHOWING AND HIDING VARIOUS PARTS (AS IF IE COULD DO CSS)
//swaps visibility 




//changes cursor image, stores current class value
function swapIt(id, newclass) { 
if (dom) { 
if(id != null) { 
document.getElementById(id).className = newclass; 
} 
}
}
//swaps layer class - changes class of clicked button returns previously clicked button to it's old class
function down(id,oldclass,newclass){ 
if (dom) {
if(selected_id != null) { 
document.getElementById(selected_id).className = oldclass; 
} 
document.getElementById(id).className = newclass; 
selected_id = id; 
} 
} 

//test
//closing the hanging chad (menu opened with no chosen sublinks)
//function closechad(){
//if (selected_id.classname = down){
//selected_id.classname = out;
//}
//}
	
//DYNAMIC LOADING SCRIPT FOR IFRAMES
function loadIframe(theURL) {
  document.getElementById("contentFRM").src = theURL;
}

//POP-UP IMAGE LOADER
window.defaultStatus=document.title;
function openWin(imgName, imgWidth, imgHeight) {
	var imageWin = window.open(imgName, 'imageWin','width=' + imgWidth + ',height=' + imgHeight);
}

	

