var monthName = new Array("january", "february", "march", "april", "may", "june", "september", "september", "september", "october", "november", "january");

var headerName = new Array("index", "about", "meetings", "membership", "subscribe", "officers", "links", "offers", "library", "archive")

var altText = new Array("Home", "About SEMIUG", "Current month", "Membership", "Subscribe to newsletter", "Officers", "Links", "Special offers", "Library", "Index of Past Meetings")

var thieme =("~dthieme");
var semiug =("www.semiug.org");
var js7 =("js7");
var site =("_SEMIUG");
var website =("SEMIUG");


var indexVar = "index";
var aboutVar = "about";
var meetingsVar = "meetings";
var membershipVar = "membership";
var subscribeVar = "subscribe";
var officersVar = "officers";
var linksVar = "links";
var discountVar = "discount";
var libraryVar = "library";
var archiveVar = "archive";
// Create Date object - containes todays date.

var today = new Date();
var month = today.getMonth(); // month = 0-11
var year = today.getFullYear();

var mm = month + 1; // two digit month starting with 01
// if december, roll over to jan
if (month == 11)
{
   year = year + 1;
   month = 0;
}



// Retrieve the document path/file name & substring out the file name (try unix syntax then
// try windows syntax)


var url = document.URL;

var DocName
=(url.substring(url.lastIndexOf("\/")+1,url.lastIndexOf("\."))); // for *nix
var Path =(url.substring(0, url.lastIndexOf("\/"))); // for *nix
var Dir =(Path.substring(Path.lastIndexOf("\/")+1,Path.length)); // for *nix

if (DocName.length > 14)
{
  var DocName
=(url.substring(url.lastIndexOf("\\")+1,url.lastIndexOf("\."))); // for windows
  var Path =(url.substring(0, url.lastIndexOf("\\"))); // for windows
  var Dir =(Path.substring(Path.lastIndexOf("\\")+1,Path.length)); // for windows
}


var locateBit ="../";
if (Dir == thieme)
{
	locateBit = "";
}
if (Dir == semiug)
{
	locateBit = "";
}
if (Dir == js7)
{
	locateBit = "";
}
if (Dir == website)
{
	locateBit = "";
}
if (Dir == site)
{
	locateBit = "";
}
// newsletter button and links
var monthNumber = new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");

var str = today.getFullYear() + "";
var yy = eval(str.substring(str.length - 2, str.length));


var PDFfile = (locateBit + "docs/newsletter/news" + yy + monthNumber[month] + ".pdf")


switch(month)
{
  case 6:
  break;
  case 7:
  break;
  case 11:
  break;
  default:


  {
document.write("<a href='" + PDFfile + "'>");
  document.write("<img src='" + locateBit + "images/newsletter.png' width='150' height='42' alt='current newsletter' />");
  document.write("</a>");
  }




} // end of newsletter button

for (i=0; i<10; i++)

if (DocName == headerName[i])// Compare document name to array

{
  document.write("<div class='current'>")
  document.write("<img alt='" + altText[i] + "' src='" + locateBit + "images/" + headerName[i] + ".gif' height='30' width='150' border='0'>") // We have a match
  document.write("</div>")
}
else
{
	if (headerName[i] == meetingsVar)//Test for the meetings link button?
{
	document.write("<div class='off' onmouseover=this.className='on' onmouseout=this.className='off'>")
  document.write("<A HREF='" + locateBit + year + "/" + monthName[month] + year + ".htm'>")
  document.write("<img alt='Meetings' src='" + locateBit +"images/" +headerName[i] +".gif' height='30' width='150' border='0'>")
  document.write("</a></div>")
}

else
{
	document.write("<div class='off' onmouseover=this.className='on' onmouseout=this.className='off'>")
document.write("<a href='" + locateBit + headerName[i] +".htm'>")
document.write("<img alt='" + altText[i] + "' src='" + locateBit + "images/" + headerName[i] + ".gif' height='30' width='150' border='0'>")
document.write("</a></div>") // No match- make a link
}
}
{
 document.write("<a href='http://www.gomitec.com'>")
 document.write("<img src='" + locateBit + "images/2010Mitec120x240.png' width='120' height='240' hspace='15' vspace='5' alt='go to MiTEC 2010' border='0'/>")
 document.write("</a>")
}