
// determine the browser type
var b=navigator.appName;
//alert(b)

if(b=="Netscape")
{
   var browser = "ns";
}
else if ( b=="Microsoft Internet Explorer")
{
   var browser = "ie";
}
else
{
   var browser = b;
}

/**********************************************************
* functions for the tab structure
************************************************************/
// Global variables
var lastTab = 'home';
var curTab = 'home';

// function used to change the tabs
function mouseEvent(imgName, imageSrc, flag)
{
   // Change the tab
   myImage = new Image;
   myImage.src = imageSrc;
//alert(imgName);
//alert(imageSrc);

   //if (browser == 'ie')
   //   myImage.src = imageSrc.substr(1,imageSrc.length);

   top.bones.document  [imgName].src = myImage.src;
//alert(myImage.src);

   // switch the old tab back
   oldImage = new Image;

//   if (browser == 'ie')
//      oldImage.src = "./images/bones/" + lastTab + "_off.jpeg";
//   else
   if (flag == 1)
      oldImage.src = "./images/bones/" + lastTab + "_off.gif";
   else
      oldImage.src = "../images/bones/" + lastTab + "_off.gif";
//alert(lastTab);
//alert(oldImage.src);

   top.bones.document  [lastTab].src = oldImage.src;
}


// Function called when 'home' tab is clicked
function clickHome(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./home/home.html";
}

// Function called when 'about' tab is clicked
function clickAbout(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./about/about.html";
}

// Function called when 'classes' tab is clicked
function clickClasses(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./classes/classes.html";
}

// Function called when 'schedule' tab is clicked
function clickSchedule(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./schedule/schedule.html";
}

// Function called when 'video' tab is clicked
function clickVideo(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./video/video.html";
}

// Function called when 'students' tab is clicked
function clickStudents(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./students/students.html";
}

// Function called when 'links' tab is clicked
function clickLinks(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./links/links.html";
}

// Function called when 'links' tab is clicked
function clickBrag(imgName, imgSrc) {
   if ( curTab != imgName )
   {
      lastTab = curTab;
      curTab = imgName;
      mouseEvent(imgName, imgSrc, 1);
   }
   // change icon
   parent.contents.location = "./bragbook/gbook.php";
}

// Function called when links are activated
function clickURL(urlToShow, tabTo) {
   imageStr = "../images/bones/"+tabTo+"_on.gif";
   //alert(imageStr);
   if ( curTab != tabTo) {
     lastTab = curTab;
     curTab = tabTo;
     mouseEvent(tabTo, imageStr, 2);
   }
   parent.contents.location = urlToShow;
}

