// two states
// -Active and -Inactive
// -Inactive has one additional state: -Inactive-Hover

//regex var test for -Active state
	var VarTestActiveState = /-Active$/;
	
//regex var test for -Inactive state
	var VarTestInactiveState = /-Inactive$/;
	
//regex var test for -Inactive-Hover state
	var VarTestInactiveHoverState = /-Hover$/;

	

// tabMouseOverEvent toggles between -Inactive and -Inactive-Hover states onmouseover & onmouseout
// must use javascript for hover because of quirks mode problems. If we could change doctype, we would not need this javascript
function tabMouseOverEvent(obj) {
	// tabs onmouseover event 
	
	// regex var change -Inactive to -Inactive-Hover
//	var VarChangeInactiveToInactiveHover = obj.className.replace(/-Inactive/, "-Inactive-Hover");

// regex var change -Inactive-Hover to -Inactive
//	var VarChangeInactiveHoverToInactive = obj.className.replace(/-Inactive-Hover/, "-Inactive");


	// test states
	// if inactive state, change classname to -Inactive-Hover	
	if (VarTestInactiveState.test(obj.className)) {
		//change inactive to inactive-hover state
		obj.className = 'contentBin_iconModule-Hover';
	}	
	
	// if -inactive-hover change to -inactive state
	else if (VarTestInactiveHoverState.test(obj.className)) {
		//change inactive-hover to inactive state
		obj.className = 'contentBin_iconModule-Inactive';
	}
	
	// if active state, do nothing
	else if (VarTestActiveState.test(obj.className)) {
		// do nothing, no active hover state yet but here if we want one later...
	}
	else {
		//nothing
		//alert('error in tabMouseOverEvent');
	}
		
} // END tabMouseOverEvent function


/* ########## BEGIN  click events for tabs appearing in content area  #################### */
// this is only for tabs appearing in the content area
function CA_TabClickEvent(obj) {

	//test which tab is active, changes it to inactive state and then hides the tab content for it
	if (VarTestActiveState.test(obj.className)) {
		// don't do anything... it is already active and it needs to stay active until user clicks an inactive one
	}	
		
	else if (document.getElementById('CA_TabModule1').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('CA_TabModule1').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('CA_TabContent1').style.display = 'none';

		//run content switcher function	
		CA_TabToggleContent(obj);
	}

	else if (document.getElementById('CA_TabModule2').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('CA_TabModule2').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('CA_TabContent2').style.display = 'none';

		//run content switcher function	
		CA_TabToggleContent(obj);
	}
	
	else if (document.getElementById('CA_TabModule3').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('CA_TabModule3').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('CA_TabContent3').style.display = 'none';

		//run content switcher function	
		CA_TabToggleContent(obj);
	}

	else if (document.getElementById('CA_TabModule4').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('CA_TabModule4').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('CA_TabContent4').style.display = 'none';

		//run content switcher function	
		CA_TabToggleContent(obj);
	}
	
	else if (document.getElementById('CA_TabModule5').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('CA_TabModule5').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('CA_TabContent5').style.display = 'none';

		//run content switcher function	
		CA_TabToggleContent(obj);
	}
	
	else {
		//nothing
	}
	
} // END CA_TabClickEvent function


// this is only for tabs appearing in the content area
// it's called by CA_TabClickEvent function
function CA_TabToggleContent(obj) {
	
	if (obj.id == 'CA_TabModule1') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('CA_TabContent1').style.display = 'block';
	}
	
	else if (obj.id == 'CA_TabModule2') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('CA_TabContent2').style.display = 'block';

	}	

	else if (obj.id == 'CA_TabModule3') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('CA_TabContent3').style.display = 'block';

	}
	
	else if (obj.id == 'CA_TabModule4') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('CA_TabContent4').style.display = 'block';
	}

	else if (obj.id == 'CA_TabModule5') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('CA_TabContent5').style.display = 'block';
	}
	
	else {	
		//nothing
	}

} //END CA_TabToggleContent function

/* ########## END  click events for tabs appearing in content area  #################### */






	
/* ########## BEGIN  click events for tabs appearing in pop over  #################### */
// this is only for tabs appearing in the pop over
function PO_TabClickEvent(obj) {

	//test which tab is active, changes it to inactive state and then hides the tab content for it
	if (document.getElementById('PO_TabModule1').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('PO_TabModule1').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('PO_TabContent1').style.display = 'none';

		//run content switcher function	
		PO_TabToggleContent(obj);
	}

	else if (document.getElementById('PO_TabModule2').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('PO_TabModule2').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('PO_TabContent2').style.display = 'none';

		//run content switcher function	
		PO_TabToggleContent(obj);
	}
	
	else if (document.getElementById('PO_TabModule3').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('PO_TabModule3').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('PO_TabContent3').style.display = 'none';

		//run content switcher function	
		PO_TabToggleContent(obj);
	}

	else if (document.getElementById('PO_TabModule4').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('PO_TabModule4').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('PO_TabContent4').style.display = 'none';

		//run content switcher function	
		PO_TabToggleContent(obj);
	}
	
	else if (document.getElementById('PO_TabModule5').className == 'TABS_TabModulesBin_TabModule-Active') {
		//make it inactive
		document.getElementById('PO_TabModule5').className = 'TABS_TabModulesBin_TabModule-Inactive';
		document.getElementById('PO_TabContent5').style.display = 'none';

		//run content switcher function	
		PO_TabToggleContent(obj);
	}
	
	else {
		//nothing
	}
	
} // END PO_TabClickEvent function


// this is only for tabs appearing in the pop over
// it's called by PO_TabClickEvent function
function PO_TabToggleContent(obj) {
	
	if (obj.id == 'PO_TabModule1') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('PO_TabContent1').style.display = 'block';
	}
	
	else if (obj.id == 'PO_TabModule2') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('PO_TabContent2').style.display = 'block';

	}	

	else if (obj.id == 'PO_TabModule3') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('PO_TabContent3').style.display = 'block';

	}
	
	else if (obj.id == 'PO_TabModule4') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('PO_TabContent4').style.display = 'block';
	}

	else if (obj.id == 'PO_TabModule5') {
		obj.className = 'TABS_TabModulesBin_TabModule-Active';
		document.getElementById('PO_TabContent5').style.display = 'block';
	}
	
	else {	
		//nothing
		//alert('error in PO_tabToggleContent function')
	}

}//END PO_TabToggleContent function

/* ########## END  click events for tabs appearing in pop over  #################### */



