/* ------------------------------------------------------------------------------------------------
	TAB SWITCHER SCRIPT
------------------------------------------------------------------------------------------------ */

// ==================================================
// Use like this:
// onclick="switchid('divname','tabname');"
// ==================================================


//element ids for each layer
var ids = new Array('tab1_content','tab2_content');
var tabs = new Array('tab1','tab2');

function switchid(id,tab){
	hideallids();
	showdiv(id,tab);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i],tabs[i]);
	}		  
}

function hidediv(id,tab) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
		document.getElementById(tab).className = 'none';
	}
	else { // Older IE
		document.all.id.style.display = 'none';
		document.all.tab.className = 'none';
	}
}

function showdiv(id,tab) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
		document.getElementById(tab).className = 'active';
	}
	else { // Older IE
		document.all.id.style.display = 'block';
		document.all.tab.className = 'active';
	}
}
