
//=========================================
//functions for crossbox
//=========================================

var inactiveEntry = '';
var activeEntry = '';
var activeEntryContent = '';
tabArray = new Array();

function switchBox(whichBox) {
		
	if(activeEntry) {
		document.getElementById(activeEntry).style.visibility = "hidden";
		document.getElementById(activeEntry).style.display = "none";
		document.getElementById(activeEntryContent).style.visibility = "hidden";
		document.getElementById(activeEntryContent).style.display = "none";
		if(activeEntry.indexOf("worldwide")!= -1) {
			document.getElementById('crossbox_world').style.visibility = "hidden";
			document.getElementById('crossbox_world').style.display = "none";
		}
		document.getElementById(inactiveEntry).style.visibility = "visible";
		document.getElementById(inactiveEntry).style.display = "block";
		if(navigator.appVersion.indexOf("MSIE") == -1) {
			document.getElementById(inactiveEntry).style.height = 17 + "px";
			document.getElementById(inactiveEntry).style.borderTop = "solid 1px #262626";
			document.getElementById(inactiveEntry).style.paddingTop = "2px";
		}		
	}
	var myEntry = whichBox + "_a";
	var myEntryContent = whichBox + "_b";
	activeEntry = myEntry;
	activeEntryContent = myEntryContent;
	inactiveEntry = whichBox;
	if (navigator.appVersion.indexOf("MSIE") == -1) {
		document.getElementById(whichBox).style.height = 0 + "px";
		document.getElementById(whichBox).style.border = 0 + "px";
		document.getElementById(whichBox).style.padding = 0 + "px";
	}
	else {
		document.getElementById(whichBox).style.visibility = "hidden";
		document.getElementById(whichBox).style.display = "none";	
	}	
	document.getElementById(activeEntry).style.visibility = "visible";
	document.getElementById(activeEntry).style.display = "block";
	document.getElementById(activeEntryContent).style.visibility = "visible";
	document.getElementById(activeEntryContent).style.display = "block";
	document.getElementById(activeEntryContent).style.height = 67 + "px";
	if (whichBox.indexOf("worldwide")!= -1) {
		document.getElementById('crossbox_world').style.visibility = "visible";
		document.getElementById('crossbox_world').style.display = "block";
	}
	
}

var crossboxInitialized = false;

function initCrossbox(whichCB) {

	var CBnum = tabArray.length;
	for(i=0;i<CBnum;i++) {
		var myEntry = tabArray[i] + "_a";
		var myEntryContent = tabArray[i] + "_b";
		document.getElementById(myEntry).style.visibility = "hidden";
		document.getElementById(myEntry).style.display = "none";
		document.getElementById(myEntryContent).style.visibility = "hidden";
		document.getElementById(myEntryContent).style.display = "none";	
	}

	if (document.getElementById(whichCB)) {
		var myEntry = whichCB + "_a";
		var myEntryContent = whichCB + "_b";
		activeEntry = myEntry;
		activeEntryContent = myEntryContent;
		inactiveEntry = whichCB;
		document.getElementById(whichCB).style.visibility = "hidden";
		document.getElementById(whichCB).style.display = "none";
		document.getElementById(activeEntry).style.visibility = "visible";
		document.getElementById(activeEntry).style.display = "block";
		document.getElementById(activeEntryContent).style.visibility = "visible";
		document.getElementById(activeEntryContent).style.display = "block";
	}
	//special case for worldwide
	if(whichCB == "worldwide") {
		document.getElementById('crossbox_world').style.visibility = "visible";
		document.getElementById('crossbox_world').style.display = "block";
  }
  
	crossboxInitialized = true;  
}

//counting tabs for default ibox display
function countTab(whichTab) {
	tabArray[tabArray.length] = whichTab;	
}

//=========================================
//functions for item_select
//=========================================
function handleSelection(whichForm) {
	try {
		eval(whichForm.item_select.options[whichForm.item_select.selectedIndex].value);
	}
	catch (ex) {
		// Ignore
	}
	return false;
}

