/* The tab navigation script. Always use in conjunction with docobj.js! */

// Set up array of tab element style property strings 

var tabArray = new Array(6);
tabArray[0] = null;
tabArray[1] = getStyleObj('tab1');
tabArray[2] = getStyleObj('tab2');
tabArray[3] = getStyleObj('tab3');
tabArray[4] = getStyleObj('tab4');
tabArray[5] = getStyleObj('tab5');


// Set up array of tabmiddle td element style property strings 

var tabTextArray = new Array(6);
tabTextArray[0] = null;
tabTextArray[1] = getStyleObj('tabmiddle1');
tabTextArray[2] = getStyleObj('tabmiddle2');
tabTextArray[3] = getStyleObj('tabmiddle3');
tabTextArray[4] = getStyleObj('tabmiddle4');
tabTextArray[5] = getStyleObj('tabmiddle5');


// Set up array of text box element style property strings

var boxArray = new Array(6);
boxArray[0] = null;
boxArray[1] = getStyleObj('box1');
boxArray[2] = getStyleObj('box2');
boxArray[3] = getStyleObj('box3');
boxArray[4] = getStyleObj('box4');
boxArray[5] = getStyleObj('box5');

// the global variables for the tab functions 
var active = null;

var activebgcolor = "#D0A264";
var activetextcolor = "white";


var inactivebgcolor = "#F7DD81";
var inactivetextcolor = "#000000";

var overbgcolor = "#FFBD39";
var overtextcolor = "white";


// 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);
 }
}

//--------------------------------------------------------------
// from the docobj.js
//--------------------------------------------------------------
function getDocObj(elem,parent) {
	if (document.layers) {
	    if (parent) {
	     return "document."+parent+".document."+elem;
	      }
	    else {
		return "document."+elem;
		     }
		
	  } 
	    else if (document.all) {
		return "document.all."+elem;
	} 
	    else if (document.getElementById) {
		return "document.getElementById('"+elem+"')";
	}
}


function getStyleObj(elem,parent) {
	if (document.layers) {
	    if (parent) {
	     return "document."+parent+".document."+elem;
	      }
	    else {
		return "document."+elem + ".style";
		     }
		
	  } 
	    else if (document.all) {
		return "document.all."+elem + ".style";
	  } 
	    else if (document.getElementById) {
		return "document.getElementById('"+elem+"').style";
		
	}
}
