
// JavaScript code for Tabbed menus
// College of Forestry
// 04-May-2007 - chris.smith@oregonstate.edu
 

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}


function hidebox(id) {
	var lyrdet = getElemRefs(id);
	lyrdet.css.display = "none";

	return true;
}


function showbox(id) {
	var lyrdet = getElemRefs(id);
	lyrdet.css.display = "block";

	return true;
}


function swaptab(tbid, tbset) {
	var lyrdet = getElemRefs(curtab[tbset]);
	lyrdet.className = "";
	contentbx = (curtab[tbset]+"content");
	hidebox(contentbx);
	var lyrdet = getElemRefs(tbid);
	lyrdet.className = "tbcurrent";
	curtab[tbset]=tbid;
	contentbx = (tbid+"content");
	showbox(contentbx);
	return false;
}

/*
function swaptab(tbid) {
	var lyrdet = getElemRefs(curtab);
	lyrdet.className = "";
	contentbx = (curtab+"content");
	hidebox(contentbx);
	var lyrdet = getElemRefs(tbid);
	lyrdet.className = "tbcurrent";
	curtab = tbid;
	contentbx = (curtab+"content");
	showbox(contentbx);
	return true;
}
*/


function simplesettab(tbid, tbset) {
	lyrdet.className = "";
	contentbx = (curtab[tbset]+"content");
	hidebox(contentbx);
	var lyrdet = getElemRefs(tbid);
	lyrdet.className = "tbcurrent";
	curtab[tbset]=tbid;
	contentbx = (tbid+"content");
	showbox(contentbx);
	return false;

}


function settab(tbid, tbset) {
	//lyrdet.className = "";
	//contentbx = (curtab[tbset]+"content");
	//hidebox(contentbx);
	var lyrdet = getElemRefs(tbid);
	lyrdet.className = "tbcurrent";
	curtab[tbset]=tbid;
	contentbx = (tbid+"content");
	showbox(contentbx);
	return false;
}

function newswaptab(tbid, tbset) {
	//window.location.href = "http://sandbox.fsl.orst.edu/admin_new/aboutdean-chris.php?tbid=".tbid;
	window.location.search = "tbid="+tbid;
	//window.location.hash = tbid;
	/*var lyrdet = getElemRefs(curtab[tbset]);
	lyrdet.className = "";
	contentbx = (curtab[tbset]+"content");
	hidebox(contentbx);
	var lyrdet = getElemRefs(tbid);
	lyrdet.className = "tbcurrent";
	curtab[tbset]=tbid;
	contentbx = (tbid+"content");
	showbox(contentbx);*/
	return false;
}


