var highlightcolor="#fc3";
var ns6=document.getElementById&&!document.all;
var previous='';
var eventobj;



// REGULAR EXPRESSION TO HIGHLIGHT ONLY FORM ELEMENTS
	var intended=/INPUT|TEXTAREA|SELECT|OPTION/

// FUNCTION TO CHECK WHETHER ELEMENT CLICKED IS FORM ELEMENT
	function checkel(which){
		if (which.style && intended.test(which.tagName)){return true}
		else return false
	}

// FUNCTION TO HIGHLIGHT FORM ELEMENT
	function highlight(e){
		if(!ns6){
			eventobj=event.srcElement
			if (previous!=''){
				if (checkel(previous))
				previous.style.backgroundColor=''
				previous=eventobj
				if (checkel(eventobj)) eventobj.style.backgroundColor=highlightcolor
			}
			else {
				if (checkel(eventobj)) eventobj.style.backgroundColor=highlightcolor
				previous=eventobj
			}
		}
	}

function changeToDecimal(field){
	fieldValue = field.value;
//	if (fieldValue == '' || fieldValue == null || fieldValue == 'null' || fieldValue == 'undefined'){
//		field.value = "0.0";
//	}
	if (field.value.toString().indexOf(".") == -1){
		field.value = field.value.toString() + ".0";
	}
	if (field.value.toString().substring(field.value.toString().indexOf("."), field.value.toString().length).length < 2){
		field.value = field.value.toString() + "0";
	}
	else if (field.value.toString().substring(field.value.toString().indexOf("."), field.value.toString().length).length > 2){
		field.value = round(field.value,1);
	}
}

function round(number,X){
   X = (!X ? 2 : X);
   return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}

function toggleDisplay(objToDisplay){
	objToDisplay = getRef(objToDisplay)
	objToDisplay.style.display = (objToDisplay.style.display == "none") ? "block" : "none";
}

function getRef(sId){
   if(typeof sId == "string") var oObj = document.getElementById(sId);
   return oObj;
}

// SET ATTRIBUTE
	function setAttribute(){
		for(var x = 0; x < theParagraph.attributes.length; x++ ) {
			if(theParagraph.attributes[x].nodeName.toLowerCase() == 'align' ) {
				window.alert( 'The value of the \'align\' attribute is: ' +
					theParagraph.attributes[x].nodeValue );
			}
		}
	}

var activeExplanation = "";
var activeTab = "";

function switchTabs(explanationName, tabName) {
//Change Active Tab
	if(!activeTab){activeTab = getRef('overviewTab');}
	activeTab.className="";
	getRef(tabName).className="current";
	activeTab = getRef(tabName);

//Change Displayed Explanation
	if(!activeExplanation){activeExplanation = getRef('overview');}
	activeExplanation.style.display = "none"; // hiding currently displayed tab
	getRef(explanationName).style.display = "block"; //show new tab
	activeExplanation = getRef(explanationName); // keep track of the new tab that's active
}

var activebio = "";
var activeEmployee = "";

function switchEmployee(bioName, EmployeeName) {
//Change Active Tab
	if(!activeEmployee){activeEmployee = getRef('introTab');}
	activeEmployee.className="";
	getRef(EmployeeName).className="current";
	activeEmployee = getRef(EmployeeName);

//Change Displayed Explanation
	if(!activebio){activebio = getRef('intro');}
	activebio.style.display = "none"; // hiding currently displayed tab
	getRef(bioName).style.display = "block"; //show new tab
	activebio = getRef(bioName); // keep track of the new tab that's active
}




//POP UPS
function popUp(url) {
sealWin=window.open(url,'win','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=720,height=450');
self.name = 'mainWin';
}


function showstuff(boxid) {
    document.getElementById(boxid).style.visibility = "visible";
}

function hidestuff(boxid) {
    document.getElementById(boxid).style.visibility = "hidden"
    
    
    ;
}

//Strategy table
function toggleLayer(whichLayer) {
    var elem, vis;
    var elem = "";
    var vis = "";


    if (document.getElementById) // this is the way the standards work
        elem = document.getElementById(whichLayer);
    else if (document.all) // this is the way old msie versions work
        elem = document.all[whichLayer];
    else if (document.layers) // this is the way nn4 works
        elem = document.layers[whichLayer];
    vis = elem.style;
    // if the style.display value is blank we try to figure it out here
    if (vis.display == '' && elem.offsetWidth != undefined && elem.offsetHeight != undefined)
        vis.display = (elem.offsetWidth != 0 && elem.offsetHeight != 0) ? '' : 'none';
    vis.display = (vis.display == '' || vis.display == '') ? 'none' : '';
}


function showHide(EL, PM) {
    ELpntr = document.getElementById(EL);
    if (ELpntr.style.display == 'none') {
        document.getElementById(PM).innerHTML = ' <div class="arrow-down"><div class="arrow-down-1"></div><div class="arrow-down-2"></div></div>';
        ELpntr.style.display = '';
    }
    else {
        document.getElementById(PM).innerHTML = ' <div class="arrow-right"><div class="arrow-right-1"></div><div class="arrow-right-2"></div></div>';
        ELpntr.style.display = 'none';
    }
}