/* The tab navigation script. Always use in conjunction with docobj.js! */

// Set up array of tab element style property strings 

var tabArray = new Array(7);
tabArray[0] = null;
tabArray[1] = getStyleObj('tab1');
tabArray[2] = getStyleObj('tab2');
tabArray[3] = getStyleObj('tab3');
tabArray[4] = getStyleObj('tab4');
tabArray[5] = getStyleObj('tab5');
tabArray[6] = getStyleObj('tab6');

// Set up array of tabmiddle td element style property strings 

var tabTextArray = new Array(7);
tabTextArray[0] = null;
tabTextArray[1] = getStyleObj('tabmiddle1');
tabTextArray[2] = getStyleObj('tabmiddle2');
tabTextArray[3] = getStyleObj('tabmiddle3');
tabTextArray[4] = getStyleObj('tabmiddle4');
tabTextArray[5] = getStyleObj('tabmiddle5');
tabTextArray[6] = getStyleObj('tabmiddle6');

// Set up array of text box element style property strings

var boxArray = new Array(7);
boxArray[0] = null;
boxArray[1] = getStyleObj('box1');
boxArray[2] = getStyleObj('box2');
boxArray[3] = getStyleObj('box3');
boxArray[4] = getStyleObj('box4');
boxArray[5] = getStyleObj('box5');
boxArray[6] = getStyleObj('box6');
// the global variables for the tab functions 
var active = null;

var activebgcolor = "#fff";
var activetextcolor = "black";


var inactivebgcolor = "#ccc";
var inactivetextcolor = "#999";

var overbgcolor = "#10467a";
var overtextcolor = "#fff";


// the tab appearance changing function

function tabcolor(tabnum,color1,color2) {
tab = eval(tabArray[tabnum]);
tabtext = eval(tabTextArray[tabnum]);
tab.backgroundColor = color1;
tabtext.color = color2;

if (document.all) {
 tabtext.cursor = 'hand';
 }
else {
 tabtext.cursor = 'pointer';
 }
}

// the central tab navigation function 

function choosebox(num) {
if (document.all || document.getElementById) { 
if (active) {
activetablayer = eval(tabArray[active]);
activetabtext = eval(tabTextArray[active]);
activeboxlayer = eval(boxArray[active]);
activetablayer.zIndex = 0;
activeboxlayer.zIndex = 0;
tabcolor(active,inactivebgcolor, inactivetextcolor);
        }

tablayer = eval(tabArray[num]);
tabtext = eval(tabTextArray[num]);
boxlayer = eval(boxArray[num]);
tablayer.zIndex = 11;
boxlayer.zIndex = 10;

tabcolor(num,activebgcolor, activetextcolor);

active = num;

  }
}


// invoked onmouseover the tab 

function tabover(tabnum) {
if (tabnum != active) {
 tabcolor(tabnum,overbgcolor,overtextcolor);
  }
}


//invoked onmouseout of the tab 

function tabout(tabnum) {

if (tabnum != active) {
tabcolor(tabnum,inactivebgcolor,inactivetextcolor);
 }
}

