// FROM: /MenuBuilder.js
/* 
 * Copyright 2006, David H. Marlin
 */

/* 
 *  Classes
 */

/*********************************
 * the Menu class
 *********************************/

function Menus(numMain)
{
   this.maxItems = 7;
   this.theData = new Array(numMain);
   this.numMain = numMain;
   this.numLevels = 3;
   this.theMenus = new Array();
   this.itemCounters=new Array(this.numLevels);
   for (var ii=1;ii<=this.numLevels;ii++)
      this.itemCounters[ii]=0;
}

Menus.prototype.AddMain=function(name, text, url, numSubs) 
{
   this.itemCounters[1]++;
   this.theData[this.itemCounters[1]] = new MenuItem(name, text, url, numSubs);
   //var prn = this.theData[this.itemCounters[1]];
   //document.write("<br>Item "+this.itemCounters[1]+": name "+prn.name+", text "+prn.text+", url "+prn.url);
   if (this.numLevels > 1)
      this.itemCounters[2]=0;
}

Menus.prototype.AddSub=function(name, text, url, numSubs) 
{
   this.itemCounters[2]++;
   this.theData[this.itemCounters[1]].theData[this.itemCounters[2]] = new MenuItem(name, text, url, numSubs);
   if (this.numLevels > 2)
      this.itemCounters[3]=0;
}

Menus.prototype.AddSubSub=function(name, text, url) 
{
   this.itemCounters[3]++;
   this.theData[this.itemCounters[1]].theData[this.itemCounters[2]].theData[this.itemCounters[3]] = new MenuItem(name, text, url, 0);
}

Menus.prototype.Done=function() 
{
  this.theMenus["free"]=this.BuildMenu(0,0);
  for(var ii=1;ii<=this.numMain;ii++)
   {
     var topMenuData = this.theData[ii];
     this.theMenus[topMenuData.name]=this.BuildMenu(ii,0, 0);
      
      for(var jj=1;jj<=topMenuData.numSubs;jj++)
      {
         var numSubSubs = this.theData[ii].theData[jj].numSubs;
         if (numSubSubs > 0)
         {
            menuBar = new MenuBar(1);
            for(var kk=1;kk<=numSubSubs;kk++)
               menuBar.AddItem(this.theData[ii].theData[jj].theData[kk].text, this.theData[ii].theData[jj].theData[kk].url);
            menuBar.Done();
            this.theMenus[topMenuData.theData[jj].name]=this.BuildMenu(ii,jj, 0)+menuBar.GetMenuBar(0);
         }
         else
            this.theMenus[topMenuData.theData[jj].name]=this.BuildMenu(ii,jj, 0);
         var subMenuData = topMenuData.theData[jj];
         for(var kk=1;kk<=numSubSubs;kk++)
            this.theMenus[subMenuData.theData[kk].name]=this.BuildMenu(ii,jj, kk)+menuBar.GetMenuBar(kk);
         
      }
   }
}

Menus.prototype.BuildMenu=function(mainNdx, subNdx, subsubNdx)
{
   var width = MASTER_WIDTH-HEADER_OFFSET;
   var mD = "<table width="+width+"px class=menu>"; 
   for(var ii=1;ii<=this.numMain;ii++)
   {
      if(ii==mainNdx) //selected item
        if(subNdx==0) //no sub item selected
           mD += "<td class=menu2 width="+CELL_WIDTH+">"+this.theData[ii].text+"</td>";
        else          //sub item selected
           mD += "<td class=menu2 width="+CELL_WIDTH+"><a href="+this.theData[ii].url+" class=menu2>"+this.theData[ii].text+"</a></td>";
      else            //not selected
        mD += "<td class=menu1 width="+CELL_WIDTH+"><a href="+this.theData[ii].url+" class=menu1>"+this.theData[ii].text+"</a></td>";
   } 
   for(var ii=this.numMain+1;ii<=this.maxItems;ii++)
      mD += "<td class=menu1 width="+CELL_WIDTH+">&nbsp;</td>";
   mD += "</tr><tr>";

   var numSubs;
   if(mainNdx==0)
     numSubs=0;
   else
   {
      numSubs = this.theData[mainNdx].numSubs;
      for(var ii=1;ii<=numSubs;ii++)
      {
         if(ii==subNdx)
            if(subsubNdx==0)
               mD += "<td class=menu2s width="+CELL_WIDTH+">"+this.theData[mainNdx].theData[ii].text+"</td>";
            else
               mD += "<td class=menu2s width="+CELL_WIDTH+"><a href="+this.theData[mainNdx].theData[ii].url+" class=menu2s>"+this.theData[mainNdx].theData[ii].text+"</a></td>";
         else
            mD += "<td class=menu2 width="+CELL_WIDTH+"><a href="+this.theData[mainNdx].theData[ii].url+" class=menu2>"+this.theData[mainNdx].theData[ii].text+"</a></td>";
      }
   }
   for(var ii=numSubs+1;ii<=this.maxItems;ii++)
      mD += "<td class=menu2 width="+CELL_WIDTH+">&nbsp;</td>";

   mD += "</tr><tr><td class=menu3 colspan=7><a href=/calendar/calendar.asp class=menu3>Calendar</a> | <a href=/announcements/announcements.asp class=menu3>Announcements</a> | <a href=/sitemap.htm class=menu3>Site Map</a> | <a href=/contacts.asp class=menu3>Contact Us&nbsp;</a></td></tr></table>";

   return mD;
}

Menus.prototype.GetMenuTable=function(name){return this.theMenus[name];}

Menus.prototype.GetSiteMap=function()
{
   var numPages=0;
   for(var ii=1;ii<=this.numMain;ii++)
   {
      var mainData=this.theData[ii];
      numPages+=mainData.numSubs+2;
      for (var jj=1;jj<=mainData.numSubs;jj++)
         numPages+=mainData.theData[jj].numSubs;
   }
   numPages+=3; //including grey menu bar
   numPages/=3;
   col=1;
   var mDl="", mDc="", mDr="", count=0;
   for(var ii=1;ii<=this.numMain;ii++)
   {
      var mainData=this.theData[ii];
      var mD="<a class=index1 href="+mainData.url+">"+mainData.text+"</a><br>"; count++;
      for (var jj=1;jj<=mainData.numSubs;jj++)
      {
         var subData=mainData.theData[jj];
         mD += "&nbsp;&nbsp;&nbsp;&nbsp;<a class=index2 href="+subData.url+">"+subData.text+"</a><br>"; count++;
         for (var kk=1;kk<=subData.numSubs;kk++)
         {
            var subsubData=subData.theData[kk];
            mD += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class=index3 href="+subsubData.url+">"+subsubData.text+"</a><br>"; count++;
         }
      }
      mD+="<br>"; count++;

      if (col==1)
         mDl+=mD;
      else if (col==2)
         mDc+=mD;
      else
         mDr+=mD;

      if (col==1 && count>numPages+2) //numPages
         col=2;
      if (col==2 && count>2*numPages) //2*numPages
         col=3;

   }
   mDr += "<a class=index1 href=/calendar/calendar.asp>calendar</a><br><a class=index1 href=/announcements/announcements.asp>announcements</a><br><a class=index1 href=/contacts.asp>contact us</a>";
   
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   siteTable=new Table(3,"","95%","valign=top");
   siteTable.AddCell(1,1,0,"","","valign=top","",mDl);
   siteTable.AddCell(1,2,0,"","","valign=top","",mDc);
   siteTable.AddCell(1,3,0,"","","valign=top","",mDr);
   siteTable.WriteTable();
}

function MenuItem(name, text, url, numSubs)
{
   this.name = name;
   this.text = text;
   this.url = url;
   this.numSubs = numSubs;
   if (numSubs > 0)
      this.theData = new Array(numSubs);
}

/*********************************
 * the MenuBar class
 *********************************/

function MenuBar(multi)
{
   this.theItems = new Array();
   this.theUrls = new Array();
   this.theMenus = new Array();
   this.multi = multi;
   this.numItems = 0;
}

MenuBar.prototype.AddItem=function(theItem, theUrl)
{
   this.numItems++;
   this.theItems[this.numItems] = theItem;
   this.theUrls[this.numItems] = theUrl;
}

MenuBar.prototype.Done=function()
{
   var len2=this.theItems.length;
   var len1;
   if (this.multi>0)
      len1=len2;
   else
      len1=1;
   for(var ii=0;ii<len1;ii++)
   {
      var mD="<p class=menu4>";
      //var mD="";
      for(var jj=1;jj<len2;jj++)
      {
         if(jj==ii)
            mD += "<span class=menu4s>"+this.theItems[jj]+"</span>";
         else
            mD += "<a href="+this.theUrls[jj]+" class=menu4>"+this.theItems[jj]+"</a>";
         if(jj<len2-1)
            mD += " | ";
      }
      mD+="</p>";
      this.theMenus[ii]=mD;
   }         
}
MenuBar.prototype.GetMenuBar=function(selected){return this.theMenus[selected];}

MenuBar.prototype.WriteMenuBar=function(selected){document.write(this.theMenus[selected]+"<br>");}

/*********************************
 * the SectionBar Class
 *********************************/

function SectionBar(width)
{
   this.theTitles = new Array();
   this.theLabels = new Array();
   this.theAnchors = new Array();
   this.theMenus = new Array();
   this.numItems = 0;
   this.width=width;
}

SectionBar.prototype.AddItem=function(title, label, anchor)
{
   this.theTitles[this.numItems] = title;
   this.theLabels[this.numItems] = label;
   this.theAnchors[this.numItems] = anchor;
   this.numItems++;
}

SectionBar.prototype.Done=function()
{
   var len=this.theTitles.length;
   for(var ii=0;ii<len;ii++)
   {
      var mD="<a name="+this.theAnchors[ii]+"></a>";
      mD+="<table class=section width="+this.width+"px><tr><td class=sectionl>&nbsp;"+this.theTitles[ii]+"</td><td class=sectionr>";
      for(var jj=0;jj<len;jj++)
      {
         if(jj==ii)
            mD+=this.theLabels[jj];
         else
            mD+="<a href=#"+this.theAnchors[jj]+" class=section>"+this.theLabels[jj]+"</a>";
         if(jj<len-1)
            mD+="<span class=section> | </span>";
      }
      this.theMenus[ii]=mD+"&nbsp;</td></tr></table>";
   }         
}

// depricate first two
SectionBar.prototype.GetMenuBar=function(section){return this.theMenus[section];}

SectionBar.prototype.WriteMenuBar=function(section){document.write(this.theMenus[section]);}

SectionBar.prototype.GetSectionBar=function(section){return this.theMenus[section];}

SectionBar.prototype.WriteSectionBar=function(section){document.write(this.theMenus[section]);}

/*********************************
 * Headers, Trailers & Misc.
 *********************************/

function Header(name, subtitle, img)
{
   var title = "Mayfield High School<br>Trojan Marching Band";
   offset=MASTER_WIDTH+4; // adust for padding
   document.write("<a name=top></a><table width="+offset+"px class=header><tr><td class=header>"+title+"</td><td class=header width="+HEADER_IMG_WIDTH+"><img src="+img+" width="+HEADER_IMG_WIDTH+" align=right></td></tr></table>");
   document.write("<table width="+MASTER_WIDTH+"px class=header><tr><td class=header>"+window.theMenus.GetMenuTable(name)+"</td></tr></table>");
   document.write("<table class=master width="+MASTER_WIDTH+"px><tr><td class=master>");
}

function Trailer()
{
   document.write("</td></tr></table><table width="+offset+"px><tr><td colspan=5>&nbsp;</td></tr>");
   document.write("<tr><td class=trailert colspan=5><div width=100% class=trailert><a class=trailert href=#top>top</a>&nbsp;</div></td></tr>");
   document.write("<td align=center width=32% valign=top><p class=trailer>Webmasters <a class=trailer href=mailto:webmaster@mayfieldhsband.org>Kevin Mauldin and David Marlin</a>");
   document.write("<br>Webmasters e-mail: <a class=trailer href=mailto:webmaster@mayfieldhsband.org>webmaster@mayfieldhsband.org</a>");
   document.write("<br>Band Program e-mail: <a class=trailer href=mailto:director@mayfieldhsband.org>director@mayfieldhsband.org</a>");
   document.write("<br>Mayfield Band Parents Association<br />&copy;&nbsp;Copyright 2010-2011");
   document.write("</td><td align=right width=12% valign=bottom text-align=center><p class=trailer><img src=/images/valid-html401.png>");
   document.write("</td><td align=center width=13% valign=top text-align=center><p class=trailer><img src=/images/computersm.gif>");
   document.write("</td><td align=left width=12% valign=bottom text-align=center><p class=trailer><img src=/images/vcss.gif>");
   document.write("</td><td align=center width=31% valign=top text-align=center><p class=trailer>This website is maintained by the<br />Mayfield High School Band Parents Association<br />Its content does not necessarily represent the policies<br />or opinions of Mayfield High School or the Las Cruces<br />Public School District.");
}

function Title(title){document.write("<table class=title width="+MASTER_WIDTH+"px><tr><td>"+title+"</td><td align=right width=85 valign=middle><img src=/images/london.jpg alt=london width=85></td><td align=right width=52 valign=middle><img src=/images/china.jpg alt=china width=32></td><td align=right width=85 valign=middle><img src=/images/torlogo_small.jpg alt=torlogo width=85></td><td align=right width=80 valign=middle><img src=/images/macyslogo_small.jpg alt=macyslogo width=80></td><td align=right width=150 valign=middle><img src=/images/mhsbutton.gif alt=mhsbutton width=150></td></tr></table>");}

function br(num)
{
   for(var ii=0;ii<num;ii++)
      document.write("<br>");
}



// FROM: /MenuDefs.js
var MASTER_WIDTH = 960;//800;
var SECTION_WIDTH = 960;//800;//793;
var BODY_WIDTH = 960;//800;//790;
var HEADER_OFFSET = 0;//2;
var HEADER_IMG_WIDTH = 340;
var CELL_WIDTH = "14%";
var THUMB_WIDTH = 180;

theMenus = new Menus(7);

theMenus.AddMain("home", "Home", "/index.asp", 5);
  //theMenus.AddSub("homegallery",   "The NEW Gallery",    "/fotoplayer/welcome/album/welcome.html", 0);
  theMenus.AddSub("homeawards", "Awards",     "/awards.htm", 0);
  theMenus.AddSub("homeabout",   "About MHS",    "/about.htm", 0);
  theMenus.AddSub("homelinks",   "Links",    "/links.htm", 0);
  theMenus.AddSub("homesponsors",   "Sponsors",    "/sponsors.htm", 0);
  theMenus.AddSub("homeformsandfiles",   "Forms and Files",    "/forms/forms.asp", 0);
  //theMenus.AddSub("hometob",   "TOB Schedule",    "/events/tob.htm", 0);
  //theMenus.AddSub("homezia",   "ZIA Schedule",    "/events/zia.htm", 0);

theMenus.AddMain("homeshow",   "2011 Show",  "/show/2011show.htm", 4);
   theMenus.AddSub("tob", "Tournament of Bands",  "/events/tob2011.htm", 0);
   theMenus.AddSub("zia", "ZIA Marching Fiesta",  "/events/zia2011.htm", 0);
   theMenus.AddSub("boa", "BOA Regional",  "/events/boa2011.htm", 0);
   theMenus.AddSub("umea", "Red Rocks Invitational",  "/events/umea2011.htm", 0);

theMenus.AddMain("edu", "Learn Stuff",  "/educational/educational.htm", 1);
   theMenus.AddSub("perc", "Percussion",  "/educational/percussion.htm", 0);

theMenus.AddMain("events", "Event Planner", "/events/events.htm", 4);
   theMenus.AddSub("tob", "Tournament of Bands",  "/events/tob2011.htm", 0);
   theMenus.AddSub("zia", "ZIA Marching Fiesta",  "/events/zia2011.htm", 0);
   theMenus.AddSub("boa", "BOA Regional",  "/events/boa2011.htm", 0);
   theMenus.AddSub("umea", "Red Rocks Invitational",  "/events/umea2011.htm", 0);

theMenus.AddMain("fund", "Fundraisers", "/fundraisers/fundraisers.asp", 3);
  theMenus.AddSub("giftcards", "Gift Cards", "/fundraisers/giftcards.htm", 0);
  theMenus.AddSub("albertsons", "Albertsons", "/fundraisers/albertsons.htm", 0);
  theMenus.AddSub("paypal", "PayPal", "/fundraisers/paypal.htm", 0);

theMenus.AddMain("parents", "Band Parents", "/parents/parents.asp", 0);

theMenus.AddMain("gallerynew",      "Gallery",  "/fotoplayer/welcome/album/welcome.html", 0);

//theMenus.AddMain("old", "old website", "/old.htm", 0);

theMenus.Done();

window.theMenus = theMenus;




// FROM: /TableBuilder.js
/* 
 * Copyright 2006, David H. Marlin
 */

/*
 *  Classes
 */
var q=String.fromCharCode(34);

/*******************************************
 *  Table (Master)
 *******************************************/

function Table(numCols, classs, width, otheratts)
{
   this.numnumCols = numCols;
   this.classs = classs;
   this.width = width;
   this.otheratts = otheratts;
   this.theRows = new Array();
   this.anchors= new Array();
}

Table.prototype.AddCell=function(row, col, colspan, classs, width, otheratts, spanclass, content)
{
   if(typeof(this.theRows[row])=="undefined")
   {
      this.theRows[row] = new Object();
      this.theRows[row].theCells = new Array();
   }
   if(typeof(this.theRows[row].theCells[col])=="undefined")
      this.theRows[row].theCells[col] = new Object();
   var theCell = this.theRows[row].theCells[col];
   theCell.colspan = colspan;
   theCell.classs = classs;
   theCell.width = width;
   theCell.otheratts = otheratts;
   theCell.spanclass = spanclass;
   theCell.content = content;
}

Table.prototype.AddAnchor=function(row, anchor){this.anchors[row]=anchor;}
	
Table.prototype.GetTable=function(start,stop)
{
   var theTable = "<table";
   if (this.classs != "")
      theTable += " class="+this.classs;        
   if (this.width !=0)
      theTable += " width="+q+this.width+q; 
   if (this.otheratts != "")
      theTable += " "+this.otheratts;        
   theTable += ">";

   if (arguments.length==0)
      startRow=1;
   else
      startRow=start;
   if (arguments.length<2)
      stopRow=this.theRows.length;
   else
      stopRow=stop;

   for(var ii=startRow;ii<stopRow;ii++)
   {
      theTable+="<tr>";
      //if (this.anchors[ii]!=null)
      //{
      //   theTable += "<a name="+this.anchors[ii]+" />";
      //}
      var theRow = this.theRows[ii]; 
      for(var jj=1; jj<theRow.theCells.length;jj++)
      {
         var theCell = theRow.theCells[jj];
         theTable += "<td";
         if (theCell.classs != "")
            theTable += " class="+theCell.classs;        
         if (theCell.width !=0)
            theTable += " width="+theCell.width; 
         if (theCell.colspan !=0)
            theTable += " colspan="+theCell.colspan; 
         if (theCell.otheratts != "")
            theTable += " "+theCell.otheratts; 
         theTable += "><span";
         if (theCell.spanclass != "")
            theTable += " class="+theCell.spanclass;        
         theTable += ">";
         if (this.anchors[ii]!=null && jj==1)
            theTable += "<a name="+this.anchors[ii]+"></a>";
         theTable += theCell.content+"</span></td>";
         //theTable += ">"+theCell.content+"</span></td>";
      }
      theTable += "</tr>";
   }
   theTable += "</table>";
   return theTable;
}

Table.prototype.WriteTable=function(start,stop)
{
   if (arguments.length==0)
      document.write(this.GetTable());
   else if (arguments.length==1)
      document.write(this.GetTable(start));
   else
      document.write(this.GetTable(start,stop));
}


/*******************************************
 *  TwoCol
 *******************************************/

function TwoCol()
{
   this.lcount=1;  
   this.rcount=1; 
   this.left=new Table(1,"","100%","valign=top cellpadding=5");
   this.right=new Table(1,"","100%","valign=top cellpadding=5");
}

TwoCol.prototype.AddLeft=function(data)
{
   this.left.AddCell(this.lcount,1,0,"","","valign=top","",data);
   this.lcount++;
}

TwoCol.prototype.AddRight=function(data)
{
   this.right.AddCell(this.rcount,1,0,"","","valign=top","",data);
   this.rcount++;
}

TwoCol.prototype.GetTable=function(classs, lclass, rclass, width, lwidth)
{
   theTable=new Table(2,classs,width,"valign=top");
   theTable.AddCell(1,1,0,lclass,lwidth,"valign=top","",this.left.GetTable());
   theTable.AddCell(1,2,0,rclass,"","valign=top","",this.right.GetTable());
   return theTable.GetTable();
}

TwoCol.prototype.WriteTable=function(classs, lclass, rclass, width, lwidth)
{document.write(this.GetTable(classs, lclass, rclass, width, lwidth));}

/*******************************************
 *  ThreeCol
 *******************************************/

function ThreeCol()
{
   this.lcount=1;  
   this.ccount=1;  
   this.rcount=1; 
   this.left=new Table(1,"","100%","valign=top cellpadding=5");
   this.center=new Table(1,"","100%","valign=top cellpadding=5");
   this.right=new Table(1,"","100%","valign=top cellpadding=5");
}

ThreeCol.prototype.AddLeft=function(data)
{
   this.left.AddCell(this.lcount,1,0,"","","valign=top","",data);
   this.lcount++;
}

ThreeCol.prototype.AddCenter=function(data)
{
   this.center.AddCell(this.ccount,1,0,"","","valign=top","",data);
   this.ccount++;
}

ThreeCol.prototype.AddRight=function(data)
{
   this.right.AddCell(this.rcount,1,0,"","","valign=top","",data);
   this.rcount++;
}

ThreeCol.prototype.WriteTable=function(classs, lclass, cclass, rclass, width, lwidth, cwidth)
{
   theTable=new Table(3,classs,width,"valign=top");
   theTable.AddCell(1,1,0,lclass,lwidth,"valign=top","",this.left.GetTable());
   theTable.AddCell(1,2,0,cclass,cwidth,"valign=top","",this.center.GetTable());
   theTable.AddCell(1,3,0,rclass,"","valign=top","",this.right.GetTable());
   theTable.WriteTable();
}


/*******************************************
 *  GreenBox (GP) (greenbox, greenboxh,greenboxu)
 *******************************************/

function GreenBox(width, underline)
{
   this.theTable = new Table(4,"greenbox",width,"align=center valign=top cellpadding=5");
   this.numRows=0;
   this.ul = underline;
   this.col21="";
   this.col22="";
   this.col31="";
   this.col32="";
   this.col33="";
   this.col41="";
   this.col42="";
   this.col43="";
   this.col44="";
}

GreenBox.prototype.SetWidths=function(col1, col2, col3)
{
   this.col21=col1+"%";
   this.col22=col2+col3+"%";
   this.col31=col1+"%";
   this.col32=col2+"%";
   this.col33=col3+"%";
}

GreenBox.prototype.AddTitle=function(title)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,4,"greenboxh","","valign=top","greenboxh", title);
}

GreenBox.prototype.Add1=function(item)
{
   this.numRows++;
   if (this.ul==1)
      this.theTable.AddCell(this.numRows,1,4,"greenboxu","","valign=top","greenbox", item);
   else
      this.theTable.AddCell(this.numRows,1,4,"greenbox","","valign=top","greenbox", item);
}

GreenBox.prototype.Add2=function(item1, item2)
{
   this.numRows++;
   if (this.ul==1)
   {
      this.theTable.AddCell(this.numRows,1,2,"greenboxu",this.col21,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,2,"greenboxu",this.col22,"valign=top","greenbox", item2);
   }
   else
   {
      this.theTable.AddCell(this.numRows,1,2,"greenbox",this.col21,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,2,"greenbox",this.col22,"valign=top","greenbox", item2);
   }
}

GreenBox.prototype.Add3=function(item1, item2, item3)
{
   this.numRows++;
   if (this.ul==1)
   {
      this.theTable.AddCell(this.numRows,1,0,"greenboxu",this.col31,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenboxu",this.col32,"valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,2,"greenboxu",this.col33,"valign=top","greenbox", item3);
   }
   else
   {
      this.theTable.AddCell(this.numRows,1,0,"greenbox",this.col31,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenbox",this.col32,"valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,2,"greenbox",this.col33,"valign=top","greenbox", item3);
   }
}

GreenBox.prototype.Add4=function(item1, item2, item3, item4)
{
   this.numRows++;
   if (this.ul==1)
   {
      this.theTable.AddCell(this.numRows,1,0,"greenboxu",this.col41,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenboxu",this.col42,"valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,0,"greenboxu",this.col43,"valign=top","greenbox", item3);
      this.theTable.AddCell(this.numRows,4,0,"greenboxu",this.col44,"valign=top","greenbox", item4);
   }
   else
   {
      this.theTable.AddCell(this.numRows,1,0,"greenbox",this.col41,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenbox",this.col42,"valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,0,"greenbox",this.col43,"valign=top","greenbox", item3);
      this.theTable.AddCell(this.numRows,4,0,"greenbox",this.col44,"valign=top","greenbox", item4);
   }
}

GreenBox.prototype.GetTable=function(){return this.theTable.GetTable();}

GreenBox.prototype.WriteTable=function(){document.write(this.GetTable());}

/*******************************************
 *  GreenBox2 (GP) (greenbox, greenboxh,greenboxu)
 *******************************************/

function GreenBox2(width, underline)
{
   this.theTable = new Table(4,"greenbox",width,"align=center valign=top cellpadding=5");
   this.numRows=0;
   this.ul = underline;
   this.col21="";
   this.col22="";
   this.col31="";
   this.col32="";
   this.col33="";
   this.col41="";
   this.col42="";
   this.col43="";
   this.col44="";
}

GreenBox2.prototype.SetWidths=function(col1, col2, col3)
{
   this.col21=col1+"%";
   this.col22=col2+col3+"%";
   this.col31=col1+"%";
   this.col32=col2+"%";
   this.col33=col3+"%";
}

GreenBox2.prototype.AddTitle=function(title)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,4,"greenboxh","","valign=top","greenboxh", title);
}

GreenBox2.prototype.Add1=function(item)
{
   this.numRows++;
   if (this.ul==1)
      this.theTable.AddCell(this.numRows,1,4,"greenboxu","","valign=top","greenbox", item);
   else
      this.theTable.AddCell(this.numRows,1,4,"greenbox","","valign=top","greenbox", item);
}

GreenBox2.prototype.Add2=function(item1, item2)
{
   this.numRows++;
   if (this.ul==1)
   {
      this.theTable.AddCell(this.numRows,1,2,"greenboxu",this.col21,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,2,"greenboxu",this.col22,"valign=top","greenbox", item2);
   }
   else
   {
      this.theTable.AddCell(this.numRows,1,2,"greenbox",this.col21,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,2,"greenbox",this.col22,"valign=top","greenbox", item2);
   }
}

GreenBox2.prototype.Add3=function(item1, item2, item3)
{
   this.numRows++;
   if (this.ul==1)
   {
      this.theTable.AddCell(this.numRows,1,0,"greenboxu","35%","valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenboxu","30%","valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,2,"greenboxu","35%","valign=top","greenbox", item3);
   }
   else
   {
      this.theTable.AddCell(this.numRows,1,0,"greenbox","35%","valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenbox","30%","valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,2,"greenbox","35%","valign=top","greenbox", item3);
   }
}

GreenBox2.prototype.Add4=function(item1, item2, item3, item4)
{
   this.numRows++;
   if (this.ul==1)
   {
      this.theTable.AddCell(this.numRows,1,0,"greenboxu",this.col41,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenboxu",this.col42,"valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,0,"greenboxu",this.col43,"valign=top","greenbox", item3);
      this.theTable.AddCell(this.numRows,4,0,"greenboxu",this.col44,"valign=top","greenbox", item4);
   }
   else
   {
      this.theTable.AddCell(this.numRows,1,0,"greenbox",this.col41,"valign=top","greenbox", item1);
      this.theTable.AddCell(this.numRows,2,0,"greenbox",this.col42,"valign=top","greenbox", item2);
      this.theTable.AddCell(this.numRows,3,0,"greenbox",this.col43,"valign=top","greenbox", item3);
      this.theTable.AddCell(this.numRows,4,0,"greenbox",this.col44,"valign=top","greenbox", item4);
   }
}

GreenBox2.prototype.GetTable=function(){return this.theTable.GetTable();}

GreenBox2.prototype.WriteTable=function(){document.write(this.GetTable());}

/*******************************************
 *  GoldBox (GP) (goldbox, boldboxb, goldboxu, goldboxbu)
 *******************************************/

function GoldBox(width, underline, border)
{
   if (border==1)
      this.theTable = new Table(1,"goldboxb",width,"align=center valign=top cellpadding=5");
   else
      this.theTable = new Table(1,"goldbox",width,"align=center valign=top cellpadding=5");
   this.numRows=0;
   this.ul = underline;
   this.bd = border;
}

GoldBox.prototype.AddTitle=function(title)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,2,"goldboxh","100%","valign=top","goldboxh", title);
}

GoldBox.prototype.AddTitleA=function(title, name)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,2,"goldboxh","100%","valign=top","goldboxh", "<a name="+name+"></a>"+title);
}

GoldBox.prototype.Add=function(item)
{
   this.numRows++;
   if (this.bd==1)
      if (this.ul==1)
         this.theTable.AddCell(this.numRows,1,2,"goldboxbu","100%","valign=top","goldbox", item);
      else
         this.theTable.AddCell(this.numRows,1,2,"goldboxb","100%","valign=top","goldbox", item);
   else
      if (this.ul==1)
         this.theTable.AddCell(this.numRows,1,2,"goldboxu","100%","valign=top","goldbox", item);
      else
         this.theTable.AddCell(this.numRows,1,2,"goldbox","100%","valign=top","goldbox", item);
}

GoldBox.prototype.GetTable=function(){return this.theTable.GetTable();}

GoldBox.prototype.WriteTable=function(){document.write(this.GetTable());}

/*******************************************
 *  LinkBox (GP) (linkbox, linkboxb, linkboxu, linkboxbu)
 *******************************************/

function LinkBox(width, underline, border)
{
   if (border==1)
      this.theTable = new Table(1,"linkboxb",width,"align=center valign=top cellpadding=5");
   else
      this.theTable = new Table(1,"linkbox",width,"align=center valign=top cellpadding=5");
   this.numRows=0;
   this.ul = underline;
   this.bd = border;
}

LinkBox.prototype.AddTitle=function(title)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,2,"linkboxh","100%","valign=top","linkboxh", title);
}

LinkBox.prototype.AddTitleA=function(title, name)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,2,"linkboxh","100%","valign=top","linkboxh", "<a name="+name+"></a>"+title);
}

LinkBox.prototype.Add=function(item)
{
   this.numRows++;
   if (this.bd==1)
      if (this.ul==1)
         this.theTable.AddCell(this.numRows,1,2,"linkboxbu","100%","valign=top","linkbox", item);
      else
         this.theTable.AddCell(this.numRows,1,2,"linkboxb","100%","valign=top","linkbox", item);
   else
      if (this.ul==1)
         this.theTable.AddCell(this.numRows,1,2,"linkboxu","100%","valign=top","linkbox", item);
      else
         this.theTable.AddCell(this.numRows,1,2,"linkbox","100%","valign=top","linkbox", item);
}

LinkBox.prototype.GetTable=function(){return this.theTable.GetTable();}

LinkBox.prototype.WriteTable=function(){document.write(this.GetTable());}

/*******************************************
 *  NoteBox (GP) (notebox)
 *******************************************/

function NoteBox(width)
{
   this.theTable = new Table(1,"notebox",width,"align=center valign=top cellpadding=5");
   this.numRows=0;
}

NoteBox.prototype.Add=function(item)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,2,"notebox","100%","valign=top","notebox", item);
}

NoteBox.prototype.GetTable=function(){return this.theTable.GetTable();}

NoteBox.prototype.WriteTable=function(){document.write(this.GetTable());}

 
/*******************************************
 *  NewBox (newbox, goldbox)
 *******************************************/

function NewBox(width)
{
   this.theTable = new Table(3,"newbox",width,"align=center valign=top");
   this.numRows=0;
}

NewBox.prototype.AddExternal=function(date,item,url)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,0,"newbox","10%","valign=center align=right","newbox","("+date+")");
   this.theTable.AddCell(this.numRows,2,0,"newbox","5%","valign=center align=right","","<img src=/images/goldtrojan.gif width=20 valign=center>");
   item+="<a class=goldbox href="+url+" target=_blank>&nbsp;&nbsp;more...</a>";
   this.theTable.AddCell(this.numRows,3,0,"newbox","85%","valign=center","goldbox",item);
}

NewBox.prototype.AddLinked=function(date,item,url)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,0,"newbox","10%","valign=center align=right","newbox","("+date+")");
   this.theTable.AddCell(this.numRows,2,0,"newbox","5%","valign=center align=right","","<img src=/images/goldtrojan.gif width=20 valign=center>");
   item+="<a class=goldbox href="+url+">&nbsp;&nbsp;more...</a>";
   this.theTable.AddCell(this.numRows,3,0,"newbox","85%","valign=center","goldbox",item);
}

NewBox.prototype.AddText=function(date,item)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,0,"newbox","10%","valign=center align=right","newbox","("+date+")");
   this.theTable.AddCell(this.numRows,2,0,"newbox","5%","valign=center align=right","","<img src=/images/goldtrojan.gif width=20 valign=center>");
   this.theTable.AddCell(this.numRows,3,0,"newbox","85%","valign=center","goldbox",item);
}

NewBox.prototype.AddSpecialText=function(item)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,0,"newbox","100%","valign=center","goldbox",item);
}

NewBox.prototype.AddSpecialExternal=function(item,url)
{
   this.numRows++;
   item+="<a class=special2 href="+url+" target=_blank>Promise For New Mexico</a>";
   this.theTable.AddCell(this.numRows,1,0,"newbox","100%","valign=center","goldbox",item);
}

NewBox.prototype.AddSpecialLinked=function(item,url)
{
   this.numRows++;
   item+="<a class=goldbox href="+url+">&nbsp;&nbsp;link to page...</a>";
   this.theTable.AddCell(this.numRows,1,0,"newbox","100%","valign=center","goldbox",item);
}

NewBox.prototype.AddLondonText=function(date,item)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,1,0,"newbox","10%","valign=center align=right","newbox","("+date+")");
   this.theTable.AddCell(this.numRows,2,0,"newbox","5%","valign=center align=right","","<img src=/images/logo.png width=30 valign=center>");
   this.theTable.AddCell(this.numRows,3,0,"newbox","85%","valign=center","goldbox",item);
}

NewBox.prototype.AddLondonLinked=function(date,item,url,url2)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,0,0,"newbox","10%","valign=center align=right","newbox","("+date+")");
   this.theTable.AddCell(this.numRows,1,0,"newbox","5%","valign=center align=right","","<img src=/images/logo.png width=30 valign=center>");
   item+="<a class=index1 href="+url+">&nbsp;Band&nbsp</a>";
   item+="<b>and</b>";
   item+="<a class=index1 href="+url2+">&nbsp;Orchestra</a>";
   this.theTable.AddCell(this.numRows,2,0,"newbox","85%","valign=center","goldbox",item);
}

NewBox.prototype.AddLondonExternal=function(date,item,url,url2)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows,0,0,"newbox","10%","valign=center align=right","newbox","("+date+")");
   this.theTable.AddCell(this.numRows,1,0,"newbox","5%","valign=center align=right","","<img src=/images/logo.png width=30 valign=center>");
   item+="<a class=index1 href="+url+" target=_blank>&nbsp;Band&nbsp</a>";
   item+="<b>and</b>";
   item+="<a class=index1 href="+url2+" target=_blank>&nbsp;Orchestra</a>";
   this.theTable.AddCell(this.numRows,2,0,"newbox","85%","valign=center","goldbox",item);
}

NewBox.prototype.GetTable=function(){return this.theTable.GetTable();}

NewBox.prototype.WriteTable=function(){document.write(this.GetTable());}


/*******************************************
 *  FundraisersI (Individual) (fund, fundh)
 *******************************************/

function FundraisersI(width)
{
   this.theTable = new Table(7, "fund", width, "align=center")
   //this.theTable.AddCell(1, 1, 4, "", "", "", "", "");
   //this.theTable.AddCell(1, 2, 2, "fund", "", "", "fundh", "Goal per Student");
   //this.theTable.AddCell(1, 3, 0, "", "",  "", "", "");

   this.theTable.AddCell(1, 1, 0, "fundh", "22%", "", "", "Fundraiser");
   this.theTable.AddCell(1, 2, 0, "fundh", "10%", "", "", "Start Date");
   this.theTable.AddCell(1, 3, 0, "fundh", "10%", "", "", "End Date");
   this.theTable.AddCell(1, 4, 0, "fundh", "22%", "", "", "Venue");
   this.theTable.AddCell(1, 5, 0, "fundh", "", "", "", "Comment");
   //this.theTable.AddCell(2, 5, 0, "fundh", "5%",  "", "", "Raise");
   //this.theTable.AddCell(2, 6, 0, "fundh", "18%", "", "", "&nbsp;Sell");
   //this.theTable.AddCell(2, 7, 0, "fundh", "6%",  "", "", "Total");

   this.numRows=1;
}

FundraisersI.prototype.Add=function(name, start, end, venue, comment)
//FundraisersI.prototype.Add=function(name, start, end, venue, goal, sell, total)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   this.numRows++;
   var fund;
   if ((this.numRows%2)==1)
      fund="fund1";
   else
      fund="fund2";
   this.theTable.AddCell(this.numRows, 1, 0, fund, "", "", "", name);
   this.theTable.AddCell(this.numRows, 2, 0, fund, "", "", "", start);
   this.theTable.AddCell(this.numRows, 3, 0, fund, "", "", "", end);
   this.theTable.AddCell(this.numRows, 4, 0, fund, "", "", "", venue);
   this.theTable.AddCell(this.numRows, 5, 0, fund, "", "", "", comment);
   //this.theTable.AddCell(this.numRows, 5, 0, fund, "", "", "", goal);
   //this.theTable.AddCell(this.numRows, 6, 0, fund, "", "", "", sell);
   //this.theTable.AddCell(this.numRows, 7, 0, fund, "", "", "", total);
}

FundraisersI.prototype.GetTable=function(){return this.theTable.GetTable();}

FundraisersI.prototype.WriteTable=function(){document.write(this.GetTable());}


/*******************************************
 *  FundraisersG (General) (fund, fundh)
 *******************************************/

function FundraisersG(width)
{
   this.theTable = new Table(4, "fund", width, "align=center")
   this.theTable.AddCell(1, 1, 0, "fundh", "22%", "", "", "Fundraiser");
   this.theTable.AddCell(1, 2, 0, "fundh", "10%", "", "", "Start Date");
   this.theTable.AddCell(1, 3, 0, "fundh", "10%", "", "", "End Date");
   this.theTable.AddCell(1, 4, 0, "fundh", "22%", "", "", "Venue");
   this.theTable.AddCell(1, 5, 0, "fundh", "", "", "", "Comment");
   this.numRows=1;
}

FundraisersG.prototype.Add=function(name, start, end, venue, comment)
//FundraisersG.prototype.Add=function(name, start, end, venue)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   this.numRows++;
   var fund;
   if ((this.numRows%2)==1)
      fund="fund1";
   else
      fund="fund2";
   this.theTable.AddCell(this.numRows, 1, 0, fund, "", "", "", name);
   this.theTable.AddCell(this.numRows, 2, 0, fund, "", "", "", start);
   this.theTable.AddCell(this.numRows, 3, 0, fund, "", "", "", end);
   this.theTable.AddCell(this.numRows, 4, 0, fund, "", "", "", venue);
   this.theTable.AddCell(this.numRows, 5, 0, fund, "", "", "", comment);
}

FundraisersG.prototype.GetTable=function(){return this.theTable.GetTable();}

FundraisersG.prototype.WriteTable=function(){document.write(this.GetTable());}


/*******************************************
 *  FundraisersW (Winners) (fund, fundh)
 *******************************************/

function FundraisersW(width, title)
{
   this.theTable = new Table(3, "fund", width, "align=center")

   this.theTable.AddCell(1, 1, 3, "fundh", "", "align=center", "fundh", title);

   this.theTable.AddCell(2, 1, 0, "fundh", "40%", "", "", "Prize");
   this.theTable.AddCell(2, 2, 0, "fundh", "30%", "", "", "Winner");
   this.theTable.AddCell(2, 3, 0, "fundh", "30%", "", "", "Ticket Sold by");
   this.numRows=2;
}

FundraisersW.prototype.Add=function(prize, winner, seller)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   this.numRows++;
   var fund;
   if ((this.numRows%2)==1)
      fund="fund1";
   else
      fund="fund2";
   this.theTable.AddCell(this.numRows, 1, 0, fund, "", "", "", prize);
   this.theTable.AddCell(this.numRows, 2, 0, fund, "", "", "", winner);
   this.theTable.AddCell(this.numRows, 3, 0, fund, "", "", "", seller);
}

FundraisersW.prototype.GetTable=function(){return this.theTable.GetTable();}

FundraisersW.prototype.WriteTable=function(){document.write(this.GetTable());}

 
/*******************************************
 *  Calendar (calendar, calendarh)
 *******************************************/

function Calendar(width)
{
   this.theTable = new Table(6, "calendar", width, "align=center")
   this.numRows=0;
   this.numBreaks=0;
}

Calendar.prototype.AddHeader=function()
{
   this.numRows++;

   this.theTable.AddCell(this.numRows, 1, 0, "calendarh", "8%", "", "calendarh", "Month");
   this.theTable.AddCell(this.numRows, 2, 0, "calendarh", "9%", "", "calendarh", "Date");
   this.theTable.AddCell(this.numRows, 3, 0, "calendarh", "12%", "", "calendarh", "Weekday");
   this.theTable.AddCell(this.numRows, 4, 0, "calendarh", "39%", "", "calendarh", "Activity");
   this.theTable.AddCell(this.numRows, 5, 0, "calendarh", "17%",  "", "calendarh", "Location");
   this.theTable.AddCell(this.numRows, 6, 0, "calendarh", "15%", "", "calendarh", "Time");
}

Calendar.prototype.AddBreak=function()
{
   if (this.numBreaks == 0)
      this.breaks=new Array();
   this.breaks[this.numBreaks]=this.numRows+1;
   this.numBreaks++;
}

Calendar.prototype.Add=function(month, date, day, activity, location, time)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   this.numRows++;
   var calendar;
   if ((this.numRows%2)==1)
      calendar="calendar1";
   else
      calendar="calendar2";
   this.theTable.AddCell(this.numRows, 1, 0, calendar, "", "", "calendar", month);
   this.theTable.AddCell(this.numRows, 2, 0, calendar, "", "", "calendar", date);
   this.theTable.AddCell(this.numRows, 3, 0, calendar, "", "", "calendar", day);
   this.theTable.AddCell(this.numRows, 4, 0, calendar, "", "", "calendar", activity);
   this.theTable.AddCell(this.numRows, 5, 0, calendar, "", "", "calendar", location);
   this.theTable.AddCell(this.numRows, 6, 0, calendar, "", "", "calendar", time);
}

Calendar.prototype.GetTable=function(section)
{
   if (arguments.length==0 || this.numBreaks==0)
     return this.theTable.GetTable();
   else if (section > this.numBreaks)
     return this.theTable.GetTable();
   else if (section==0)
     return this.theTable.GetTable(1,this.breaks[0]-1);
   else if (section==this.numBreaks)
     return this.theTable.GetTable(this.breaks[section-1]);
   else
     return this.theTable.GetTable(this.breaks[section-1],this.breaks[section]-1);
   //else
   //  return this.theTable.GetTable();

}

Calendar.prototype.WriteTable=function(section)
{
   if (arguments.length==0)
      document.write(this.GetTable());
   else
      document.write(this.GetTable(section));
}


/*******************************************
 *  SCalendar (Summer) (calendar, calendarh, calendarh1)
 *******************************************/

function SCalendar(width, pd, pt, pw)
{
   this.theTable = new Table(3, "calendar", width, "align=center")
   this.numRows=0;
   this.pd=pd;
   this.pt=pt;
   this.pw=pw;
}

SCalendar.prototype.AddSection=function(section)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows, 1, 3, "calendarh1", "", "", "calendarh1", section);
   this.numRows++;
   this.theTable.AddCell(this.numRows, 1, 0, "calendarh", this.pd, "", "calendarh", "Date");
   this.theTable.AddCell(this.numRows, 2, 0, "calendarh", this.pt, "", "calendarh", "Time");
   this.theTable.AddCell(this.numRows, 3, 0, "calendarh", this.pw, "", "calendarh", "Who");
//   this.theTable.AddCell(this.numRows, 1, 0, "calendarh", "32%", "", "calendarh", "Date");
//   this.theTable.AddCell(this.numRows, 2, 0, "calendarh", "25%", "", "calendarh", "Time");
//   this.theTable.AddCell(this.numRows, 3, 0, "calendarh", "43%", "", "calendarh", "Who");
}

SCalendar.prototype.Add=function(date, time, who)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   this.numRows++;
   var calendar;
   if ((this.numRows%2)==1)
      calendar="calendar1";
   else
      calendar="calendar2";
   this.theTable.AddCell(this.numRows, 1, 0, calendar, "", "", "calendar", date);
   this.theTable.AddCell(this.numRows, 2, 0, calendar, "", "", "calendar", time);
   this.theTable.AddCell(this.numRows, 3, 0, calendar, "", "", "calendar", who);
}

SCalendar.prototype.GetTable=function(){return this.theTable.GetTable();}

SCalendar.prototype.WriteTable=function(){document.write(this.GetTable());}

/*******************************************
 *  SCalendar2 (Summer) (calendar, calendarh, calendarh1)
 *******************************************/

function SCalendar2(width, pd, pt)
{
   this.theTable = new Table(2, "calendar", width, "align=center")
   this.numRows=0;
   this.pd=pd;
   this.pt=pt;
   //this.pw=pw;
}

SCalendar2.prototype.AddSection=function(section)
{
   this.numRows++;
   this.theTable.AddCell(this.numRows, 1, 2, "calendarh1", "", "", "calendarh1", section);
   this.numRows++;
   this.theTable.AddCell(this.numRows, 1, 0, "calendarh", this.pd, "", "calendarh", "Date");
   this.theTable.AddCell(this.numRows, 2, 0, "calendarh", this.pt, "", "calendarh", "Time");
//   this.theTable.AddCell(this.numRows, 3, 0, "calendarh", this.pw, "", "calendarh", "Who");
//   this.theTable.AddCell(this.numRows, 1, 0, "calendarh", "32%", "", "calendarh", "Date");
//   this.theTable.AddCell(this.numRows, 2, 0, "calendarh", "25%", "", "calendarh", "Time");
//   this.theTable.AddCell(this.numRows, 3, 0, "calendarh", "43%", "", "calendarh", "Who");
}

SCalendar2.prototype.Add=function(date, time)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   this.numRows++;
   var calendar;
   if ((this.numRows%2)==1)
      calendar="calendar1";
   else
      calendar="calendar2";
   this.theTable.AddCell(this.numRows, 1, 0, calendar, "", "", "calendar", date);
   this.theTable.AddCell(this.numRows, 2, 0, calendar, "", "", "calendar", time);
   //this.theTable.AddCell(this.numRows, 3, 0, calendar, "", "", "calendar", who);
}

SCalendar2.prototype.GetTable=function(){return this.theTable.GetTable();}

SCalendar2.prototype.WriteTable=function(){document.write(this.GetTable());}


/*******************************************
 *  AnnouncementsB (Brief)
 *******************************************/

function AnnouncementsB()
{
   this.bulll=new Table(1,"infobox2","100%","align=center cellpadding=10");
   this.bullr=new Table(1,"infobox2","100%","align=center cellpadding=10");
   this.bullcount=2;
   this.leftcount=0;
   this.rightcount=0;
   this.leftrow=1;
   this.rightrow=1;
}

AnnouncementsB.prototype.Add=function(classs,deadline,author,posted,id,data)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   var alldata;
   if (classs==1)
   {
      clss="infobox2u";
      fnt="infoboxu";
      //alldata="<span class=infoboxhu>From "+author+" on "+posted+"</span><br>";
      alldata="<span class=infoboxhu>From "+author+" on "+posted+"</span>";
      if (deadline!="")
         alldata=alldata+", <span class=infoboxhu><i>Deadline "+deadline+"</i></span>";
         //alldata=alldata+"<span class=infoboxhu><i>Deadline "+deadline+"</i><br></span>";
      //alldata=alldata+"<span style=font-size:6pt;><br></span><b>"+data+"</b>";
      alldata=alldata+"<br><span style=font-size:6pt;><br></span><b>"+data+"</b>";
   }
   else
   {
      clss="infobox2";
      fnt="infobox";
      //alldata="<span class=infoboxh>From "+author+" on "+posted+"</span><br>";
      alldata="<span class=infoboxh>From "+author+" on "+posted+"</span>";
      if (deadline!="")
         alldata=alldata+", <span class=infoboxh><i>Deadline "+deadline+"</i></span>";
         //alldata=alldata+"<span class=infoboxh><i>Deadline "+deadline+"</i><br></span>";
      //alldata=alldata+"<span style=font-size:6pt;><br></span><b>"+data+"</b>";
      alldata=alldata+"<br><span style=font-size:6pt;><br></span><b>"+data+"</b>";
   }
   if (id != 0)
      alldata=alldata+FullLink(id); // need to check for existance of full before creating link

   this.Insert(clss,alldata);
}

AnnouncementsB.prototype.Insert=function(clss,alldata)
{
   //document.write(this.leftcount+", "+this.rightcount+", "+data.length+"<br>");
   //if (this.bullcount%2 == 0)
   if (this.leftcount <= this.rightcount)
   {
      //document.write("left<br>");
      //this.bulll.AddCell(Math.floor(this.bullcount/2),1,0,clss,"","","",alldata);
      this.bulll.AddCell(this.leftrow,1,0,clss,"","","",alldata);
      this.leftcount+=alldata.length;
      this.leftrow++;
   }
   else
   {
      //document.write("right<br>");
      //this.bullr.AddCell(Math.floor(this.bullcount/2),1,0,clss,"","","",alldata);
      this.bullr.AddCell(this.rightrow,1,0,clss,"","","",alldata);
      this.rightcount+=alldata.length;
      this.rightrow++;
   }
   //this.bullcount++;
}

AnnouncementsB.prototype.GetLeftTable=function(){return this.bulll.GetTable();}

AnnouncementsB.prototype.GetRightTable=function(){return this.bullr.GetTable();}

AnnouncementsB.prototype.GetNumRows=function(){return Math.max(this.leftrow-1,this.rightrow-1);}

function FullLink(id){return "&nbsp;&nbsp;<a class=infobox href=/announcements/announcements.asp#full"+id+">more...</a>";}


/*******************************************
 *  AnnouncementsF (Full)
 *******************************************/

function AnnouncementsF()
{
   this.bulll=new Table(1,"infobox2","100%","align=center cellpadding=10");
   this.bullr=new Table(1,"infobox2","100%","align=center cellpadding=10");
   //this.bullcount=2;
   this.leftcount=0;
   this.rightcount=0;
   this.leftrow=1;
   this.rightrow=1;
   var theUrl=location.href;
   var loc=theUrl.indexOf("#full");
   var nstring=theUrl.substring(loc+5);
   this.id=Number(nstring);
}

AnnouncementsF.prototype.Add=function(classs,deadline,author,posted,id,data)
{
   //(row, col, colspan, classs, width, otheratts, fontclass, content)
   var alldata;
   alldata="";
   if (classs==1)
   {
      if (id==this.id)
         clss="infobox2us";
      else
         clss="infobox2u";
      fnt="infoboxu";
      alldata=alldata+"<span class=infoboxhu>From "+author+" on "+posted+"</span><br>";
      if (deadline!="")
        alldata=alldata+"<span class=infoboxhu><i>Deadline "+deadline+"</i><br></span>";
      alldata=alldata+"<br>"+data;
   }
   else
   {
      if (id==this.id)
         clss="infobox2s";
      else
         clss="infobox2";
      fnt="infobox";
      alldata=alldata+"<span class=infoboxh>From "+author+" on "+posted+"</span><br>";
      if (deadline!="")
        alldata=alldata+"<span class=infoboxh><i>Deadline "+deadline+"</i><br></span>";
      alldata=alldata+"<br>"+data;
   }
 
   //if (this.bullcount%2 == 0)
   count=alldata.length;
   next=alldata.search("<br>");
   ndx=0;
   while (next>=0)
   {
      count+=20;
      ndx+=next+4;
      next=(alldata.substr(ndx)).search("<br>");
   }
   if (this.leftcount <= this.rightcount)
   {
      this.bulll.AddAnchor(this.leftrow,"full"+id);
      //this.bulll.AddCell(Math.floor(this.bullcount/2),1,0,clss,"","","",alldata);
      this.bulll.AddCell(this.leftrow,1,0,clss,"","","",alldata);
      this.leftcount+=count;
      this.leftrow++;
   }
   else
   {
      this.bullr.AddAnchor(this.rightrow,"full"+id);
      //this.bullr.AddCell(Math.floor(this.bullcount/2),1,0,clss,"","","",alldata);
      this.bullr.AddCell(this.rightrow,1,0,clss,"","","",alldata);
      this.rightcount+=count;
      this.rightrow++;
   }
   //this.bullcount++;
}

AnnouncementsF.prototype.GetLeftTable=function(){return this.bulll.GetTable();}

AnnouncementsF.prototype.GetRightTable=function(){return this.bullr.GetTable();}


/*******************************************
 *  Gallery
 *******************************************/

function Gallery(id)
{
   this.gall=new Table(1,"","100%","cellpadding=5");
   this.row=1;
   this.col=1;
   this.count=0;
   this.numCol=4;
   this.id=id;
   this.theImages=new Array();
}

//function viewer(file,)
//function viewer(file, galleryId, imageId)
function viewer(galleryId, imageId)
{
   window.galleryId=galleryId;
   window.imageId=imageId;
   //window.open("galleryviewer.asp?"+file,"galleryviewer","menubar=no,resizable=yes,scrollbars");
   window.open("galleryviewer.htm","galleryviewer","menubar=no,status=no,resizable=yes,scrollbars");
}
var q=String.fromCharCode(34);
Gallery.prototype.AddImg=function(im, imth)
{
   //data="<a href="+im+" target=galleryviewer><img src="+imth+" width=190></a>";
   //data="<a onclick=javascript:viewer("+q+im+q+") style=cursor:hand><img src="+imth+"></a>";
   //data="<a onclick=javascript:viewer("+q+im+q+","+this.id+","+this.count+") style=cursor:hand><img src="+imth+"></a>";
   data="<a onclick=javascript:viewer("+this.id+","+this.count+") style=cursor:hand><img src="+imth+"></a>";
   this.gall.AddCell(this.row,this.col,0,"","","align=center","",data);
   this.theImages.push(im);
   this.count++;
   this.col++;
   if (this.col>this.numCol)
   {
      this.col=1;
      this.row++;
   }
}

Gallery.prototype.DrawTable=function(){document.write(this.gall.GetTable());}

Gallery.prototype.GetImages=function(){return this.theImages;}

function AdjustGallery(size)
{
   for (ii=1;ii<document.images.length;ii++) // assumes one picture (in menu) loaded before gallery
   {
      var width=document.images[ii].width;
      var height=document.images[ii].height;
      var aspect = height/width;
      var vert, max;
      if (aspect>1)
      {
         vert=true;
         max=height;
      }
      else
      {
         vert=false;
         max=width;
      }
      if (max>size)
      {
         if (vert)
         {
            height=size;
            width=size/aspect;
         }
         else
         {
            width=size;
            height=size*aspect;
         }
         document.images[ii].width=width;
         document.images[ii].height=height;
      }
   }
}


/*******************************************
 *  Functions
 *******************************************/

MAX_IMAGE=70.999;
MAX_COLOR=12.999;
fillColors=new Array(15);
fillColors[0]= "008080"; // teal
fillColors[1]= "00DED1"; // turquoise
fillColors[2]= "191970"; // midnight blue
fillColors[3]= "4169E1"; // royal blue
fillColors[4]= "4682B4"; // steel blue
fillColors[5]= "8B0000"; // dark red
fillColors[6]= "BA55D3"; // medium orchid
fillColors[7]= "C71585"; // violet red
fillColors[8]= "DA70D6"; // orchid
fillColors[9]= "DDA0DD"; // plum
fillColors[10]="EE82EE"; // violet
fillColors[11]="FFE4E1"; // misty rose
fillColors[12]="FF7F50"; // coral
prefix=new Array(2);
prefix[0]="v";
prefix[1]="h";
function GetFillers(numRows, numCols)
{
   var num=Math.floor(MAX_COLOR*Math.random());
   var num1=Math.floor(MAX_COLOR*Math.random());
   while(num1==num || num1==num-1 || num==num+1)
      num1=Math.floor(MAX_COLOR*Math.random());   
   var bgcolor="style=background-color:#"+fillColors[num];
   var bcolor="border-color:#"+fillColors[num1];

   var start=Math.round(Math.random());
   //data="<table class=goldboxb width=100% style=padding:2%>";
   var data="<table width=100% style=padding:2%;border-style:double;border-width:6px;"+bcolor+">";
   var used="";
   for (var ii=0;ii<numRows;ii++)
   {
      data+="<tr height=180>";
      for (var jj=0;jj<numCols;jj++)
      {
         data+="<td align=center valign=center width=50% "+bgcolor+"><img style=border-style:double;border-width:3px;"+bcolor+" src=/fills/";
         num=Math.floor(MAX_IMAGE*Math.random());
         if (num<10)
           num="0"+String(num);
         else
           num=String(num);
         while(used.indexOf(num)!=-1)
         {
            num=Math.floor(MAX_IMAGE*Math.random());
            if (num<10)
               num="0"+String(num);
            else
               num=String(num);
         }
         used+=num+",";
         //data+=num+".jpg>";
         data+=prefix[(ii+jj+start)%2]+num+".jpg>";
      }
      data+="</tr>";
   }
   data+="</table>";
   return data;
}

//function PageBreak(){document.write("<a class=newpage></a>");}

function GenLink(text,hreff,classs)
{
   var link="<a href="+hreff;
   if (classs != "")
      link+=" class="+classs;
   link+=">"+text+"</a>";
   return link;
}

//function SummAnchor(id){return "<a name=full"+id+"></a>";}



// FROM: /ThisMonth.js
/* Copyright 2006, David H. Marlin
 */

var WEEKDAYS=new Array(7);
WEEKDAYS[0]="Sunday";
WEEKDAYS[1]="Monday";
WEEKDAYS[2]="Tuesday";
WEEKDAYS[3]="Wednesday";
WEEKDAYS[4]="Thursday";
WEEKDAYS[5]="Friday";
WEEKDAYS[6]="Saturday";

var MONTHS=new Array(12);
MONTHS[0]="Jan";
MONTHS[1]="Feb";
MONTHS[2]="Mar";
MONTHS[3]="Apr";
MONTHS[4]="May";
MONTHS[5]="Jun";
MONTHS[6]="Jul";
MONTHS[7]="Aug";
MONTHS[8]="Sep";
MONTHS[9]="Oct";
MONTHS[10]="Nov";
MONTHS[11]="Dec";

var DATETIME=new Date();
var YEAR=DATETIME.getFullYear();
var MONTH=DATETIME.getMonth();
//var MONTH=6;
var DATE=DATETIME.getDate();
//var DATE=30;
var DAY=DATETIME.getDay();
//var DAY=0;
var HOUR=DATETIME.getHours();
var MIN=DATETIME.getMinutes();
if(DATETIME.getSeconds()>30)
  MIN++;

function today1(){return WEEKDAYS[DAY];}
function today2(){return MONTHS[MONTH]+" "+DATE;}
function today3()
{
   if (MIN==0)
      if (HOUR==0)
         return "Midnight";
      else if (HOUR==12)
         return "Noon";

   if (MIN<10)
      min=":0"+MIN;
   else
      min=":"+MIN;

   if (HOUR>11)
      mm=" pm";
   else
      mm=" am";

   if (HOUR>12)
      hour=HOUR-12;
   else if (HOUR==0)
      hour=12;
   else
      hour=HOUR;
   return hour+min+mm;
}

function update()
{
   MIN++;
   if (MIN==60)
   {
      HOUR++;
      MIN=0;
   }
   if (HOUR==24)
      window.setTimeout(location.refresh(),31000);
   else
      document.getElementById('theTime').innerHTML=today3();
}  

function sjulian(month,date,year)
{
   julian=365*year;
   if (year==05 || year==09) // need to make room if previous year was leapyear
      julian++;

   julian+=31*month; // first approx at months, need to fine tune next

   if (month>1) // feb
      julian-=3;
   if (year==8 || year==12) // put one back for leapyear
         julian++;

   if (month>3) // apr
      julian-=1;

   if (month>5) // jun
      julian-=1;

   if (month>8) // sep
      julian-=1;

   if (month>10) // nov
      julian-=1;

   return julian+date;
}


/*******************************************
 *  ThisMonth (Calendar Summary)
 *******************************************/

function ThisMonth(width,numann)
{
   this.theGreenBox=new GreenBox(width,1);
   this.theGreenBox.SetWidths(17,83,0);
   this.theGreenBox.AddTitle("Upcoming Events");
   var today=sjulian(MONTH,DATE,YEAR-2000);
   this.minDateM=today;
   //this.maxDateM=this.minDateM+31;
   //this.maxRowsM=7+2*Math.ceil(numann/2);
   this.maxRowsM=2+2*numann;
   this.numRowsM=0;

   this.events=new Array();
   this.years=new Array();
   this.months=new Array();
   this.dates=new Array();
   this.numEvents=0;
   this.minDateW=today-DAY;
   this.maxDateW=this.minDateW+6;
}

ThisMonth.prototype.AddBoth=function(month,date,year,event)
{
   this.AddMonth(month,date,year,event);
   this.AddWeek(month,date,year,event);
}

ThisMonth.prototype.AddWeek=function(month,date,year,event)
{
   var eventd=sjulian(month-1,date,year);
   if (eventd>=this.minDateW && eventd<=this.maxDateW)
   {
      this.events[this.numEvents]=event;
      this.years[this.numEvents]=year;
      this.months[this.numEvents]=month-1;
      this.dates[this.numEvents]=date;
      this.numEvents++;
   }
}

ThisMonth.prototype.AddMonth=function(month,date,year,event)
{
   var eventd=sjulian(month-1,date,year);
   if (eventd>=this.minDateM && this.numRowsM<=this.maxRowsM)
   {
      this.theGreenBox.Add2("<b>"+MONTHS[month-1]+" "+date+"</b>",event);
      this.numRowsM++;
   }
}

ThisMonth.prototype.GetMonth=function(){return this.theGreenBox.GetTable();}

ThisMonth.prototype.WriteMonth=function(){document.write(this.theGreenBox.GetTable());}

ThisMonth.prototype.GetWeek=function()
{
   var theTable;
   theTable="<table class=thisweek><tr>";
   theTable+="<td class=thisweekdt><b>"+today1()+"<br>"+today2()+"<br><span class=thisweek id=theTime>"+today3()+"</span></b></td>";
   theTable+="<td class=thisweeke><table>";

   var today=sjulian(MONTH,DATE,YEAR-2000);
   for (var ii=0;ii<this.numEvents;ii++)
   {
      var event=sjulian(this.months[ii],this.dates[ii],this.years[ii]);
      var day=event-today;
      if (day<0)
         clss="old";
      else
         clss="current";
      theTable+="<tr><td valign=top class="+clss+">";

      if (day==-1)
         theTable+="<b>Yesterday: </b></td><td valign=top class="+clss+">"+this.events[ii];
      else if (day==0)
         theTable+="<b>Today: </b></td><td valign=top class="+clss+">"+this.events[ii];
      else if (day==1)
         theTable+="<b>Tomorrow: </b></td><td valign=top class="+clss+">"+this.events[ii];
      else
         theTable+="<b>"+WEEKDAYS[day+DAY]+": </b></td><td valign=top class="+clss+">"+this.events[ii];
      theTable+="</td></tr>";
   }
   if (this.numEvents==0)
      theTable+="<tr><td class=current>There are no MHS Band events this week.</td></tr>";

   theTable+="</table></td><td class=thisweek></td>";
   theTable+="</tr></table>";

   window.setInterval("update();",60000);

   return theTable;//+offset;
}



// FROM: /Countdown.js
function GetCountdown()
{
var springbreak="Before Spring Break Begins";
var summervacation="Before Summer Vacation";
var bandcamp="Before Band Camp Begins";
var schoolstarts="Before 2011-2012 <br>School Year Starts";
var ziamarching="Before ZIA Marching Fiesta";
var boamarching="Before BOA Marching Competition";
var tobmarching="Before TOB Marching Competition";
var christmasvacation="Before Christmas Vacation";

var montharray=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];

var montharrayspringbreak=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrb=2012;mb=3;db=16;hourb=15;minb=45;secb=0;

var montharrayvacation=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrv=2012;mv=5;dv=23;hourv=15;minv=0;secv=0;

var montharraycamp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrc=2012;mc=7;dc=20;hourc=6;minc=0;secc=0;

var montharrayschool=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrs=2012;ms=8;ds=15;hours=8;mins=0;secs=0;

var montharrayzia=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrs=2012;ms=10;ds=22;hours=9;mins=22;secs=0;

var montharrayboa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrs=2012;ms=10;ds=29;hours=7;mins=45;secs=0;

var montharraytob=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrs=2012;ms=11;ds=5;hours=8;mins=0;secs=0;

var montharraychristmas=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
yrch=2012;mch=12;dch=14;hourch=15;minch=45;secch=0;

// The getMonth() method returns the month (from 0 to 11)
// January is 0, February is 1, and so on.
// todaym+1 equals todays month

var today=new Date();
var todayy=today.getYear();
if (todayy < 1000)
{
todayy+=1900;
}
var todaym=today.getMonth();
var todayd=today.getDate();
var todayh=today.getHours();
var todaymin=today.getMinutes();
var todaysec=today.getSeconds();
var todaystring=montharray[todaym+1]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec;

/*******************************************
 *  Spring Break
 *******************************************/

futurestringspringbreak=montharrayspringbreak[mb]+" "+db+", "+yrb+" "+hourb+":"+minb+":"+secb;
ddb=Date.parse(futurestringspringbreak)-Date.parse(todaystring);
ddayb=Math.floor(ddb/(60*60*1000*24));
dhourb=Math.floor((ddb%(60*60*1000*24))/(60*60*1000));
dminb=Math.floor(((ddb%(60*60*1000*24))%(60*60*1000))/(60*1000));
dsecb=Math.floor((((ddb%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);

/*******************************************
 *  Summer Vacation Starts
 *******************************************/

futurestringvacation=montharrayvacation[mv]+" "+dv+", "+yrv+" "+hourv+":"+minv+":"+secv;
ddv=Date.parse(futurestringvacation)-Date.parse(todaystring);
ddayv=Math.floor(ddv/(60*60*1000*24));
dhourv=Math.floor((ddv%(60*60*1000*24))/(60*60*1000));
dminv=Math.floor(((ddv%(60*60*1000*24))%(60*60*1000))/(60*1000));
dsecv=Math.floor((((ddv%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);

/*******************************************
 *  Band Camp Starts
 *******************************************/

futurestringcamp=montharraycamp[mc]+" "+dc+", "+yrc+" "+hourc+":"+minc+":"+secc;
ddc=Date.parse(futurestringcamp)-Date.parse(todaystring);
ddayc=Math.floor(ddc/(60*60*1000*24));
dhourc=Math.floor((ddc%(60*60*1000*24))/(60*60*1000));
dminc=Math.floor(((ddc%(60*60*1000*24))%(60*60*1000))/(60*1000));
dsecc=Math.floor((((ddc%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);

/*******************************************
 *  School Starts
 *******************************************/

futurestringschool=montharrayschool[ms]+" "+ds+", "+yrs+" "+hours+":"+mins+":"+secs;
dds=Date.parse(futurestringschool)-Date.parse(todaystring);
ddays=Math.floor(dds/(60*60*1000*24));
dhours=Math.floor((dds%(60*60*1000*24))/(60*60*1000));
dmins=Math.floor(((dds%(60*60*1000*24))%(60*60*1000))/(60*1000));
dsecs=Math.floor((((dds%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);

/*******************************************
 *  Zia Marching
 *******************************************/

futurestringzia=montharrayzia[mzia]+" "+dzia+", "+yrzia+" "+hourzia+":"+minzia+":"+seczia;
ddzia=Date.parse(futurestringzia)-Date.parse(todaystring);
ddayzia=Math.floor(ddzia/(60*60*1000*24));
dhourzia=Math.floor((ddzia%(60*60*1000*24))/(60*60*1000));
dminzia=Math.floor(((ddzia%(60*60*1000*24))%(60*60*1000))/(60*1000));
dseczia=Math.floor((((ddzia%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);

/*******************************************
 *  BOA Marching
 *******************************************/

futurestringboa=montharrayboa[mboa]+" "+dboa+", "+yrboa+" "+hourboa+":"+minboa+":"+secboa;
ddboa=Date.parse(futurestringboa)-Date.parse(todaystring);
ddayboa=Math.floor(ddboa/(60*60*1000*24));
dhourboa=Math.floor((ddboa%(60*60*1000*24))/(60*60*1000));
dminboa=Math.floor(((ddboa%(60*60*1000*24))%(60*60*1000))/(60*1000));
dsecboa=Math.floor((((ddboa%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);

/*******************************************
 *  TOB Marching
 *******************************************/

futurestringtob=montharraytob[mtob]+" "+dtob+", "+yrtob+" "+hourtob+":"+mintob+":"+sectob;
ddtob=Date.parse(futurestringtob)-Date.parse(todaystring);
ddaytob=Math.floor(ddtob/(60*60*1000*24));
dhourtob=Math.floor((ddtob%(60*60*1000*24))/(60*60*1000));
dmintob=Math.floor(((ddtob%(60*60*1000*24))%(60*60*1000))/(60*1000));
dsectob=Math.floor((((ddtob%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);

/*******************************************
 *  Christmas Vacation
 *******************************************/

futurestringchristmas=montharraychristmas[mch]+" "+dch+", "+yrch+" "+hourch+":"+minch+":"+secch;
ddch=Date.parse(futurestringchristmas)-Date.parse(todaystring);
ddaych=Math.floor(ddch/(60*60*1000*24));
dhourch=Math.floor((ddch%(60*60*1000*24))/(60*60*1000));
dminch=Math.floor(((ddch%(60*60*1000*24))%(60*60*1000))/(60*1000));
dsecch=Math.floor((((ddch%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000);


if((ddayb===-1 || ddayb<-1) && ddayv>0)
{
value="Only "+ddayv+ " days, "+dhourv+" hours, <br>"+dminv+" minutes, "+dsecv+" seconds <br>"+summervacation;
}
else if((ddayb===-1 || ddayb<-1) && (ddayv===-1 || ddayv<-1) && ddayc>0)
{
value="Only "+ddayc+ " days, "+dhourc+" hours, <br>"+dminc+" minutes, "+dsecc+" seconds <br>"+bandcamp;
}
else if((ddayb===-1 || ddayb<-1) && (ddayv===-1 || ddayv<-1) && (ddayc===-1 || ddayc<-1) && ddays>0)
{
value="Only "+ddays+ " days, "+dhours+" hours, <br>"+dmins+" minutes, "+dsecs+" seconds <br>"+schoolstarts;
}
else if((ddayb===-1 || ddayb<-1) && (ddayv===-1 || ddayv<-1) && (ddayc===-1 || ddayc<-1) && (ddays===-1 || ddays<-1) && ddayzia>0)
{
value="Only "+ddayzia+ " days, "+dhourzia+" hours, <br>"+dminzia+" minutes, "+dseczia+" seconds <br>"+ziamarching;
}
else if((ddayb===-1 || ddayb<-1) && (ddayv===-1 || ddayv<-1) && (ddayc===-1 || ddayc<-1) && (ddays===-1 || ddays<-1) && (ddayzia===-1 || ddayzia<-1) && ddayboa>0)
{
value="Only "+ddayboa+ " days, "+dhourboa+" hours, <br>"+dminboa+" minutes, "+dsecboa+" seconds <br>"+boamarching;
}
else if((ddayb===-1 || ddayb<-1) && (ddayv===-1 || ddayv<-1) && (ddayc===-1 || ddayc<-1) && (ddays===-1 || ddays<-1) && (ddayzia===-1 || ddayzia<-1) && (ddayboa===-1 || ddayboa<-1) && ddaytob>0)
{
value="Only "+ddaytob+ " days, "+dhourtob+" hours, <br>"+dmintob+" minutes, "+dsectob+" seconds <br>"+tobmarching;
}
else if((ddayb===-1 || ddayb<-1) && (ddayv===-1 || ddayv<-1) && (ddayc===-1 || ddayc<-1) && (ddays===-1 || ddays<-1) && (ddayzia===-1 || ddayzia<-1) && (ddayboa===-1 || ddayboa<-1) && (ddaytob===-1 || ddaytob<-1) && ddaych>0)
{
value="Only "+ddaych+ " days, "+dhourch+" hours, <br>"+dminch+" minutes, "+dsecch+" seconds <br>"+christmasvacation;
}
else
{
value="Only "+ddayb+ " days, "+dhourb+" hours, <br>"+dminb+" minutes, "+dsecb+" seconds <br>"+springbreak;
}
   return value;

}
