/***********************************************
* DD Tab Menu II script- c Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
function expandcontent(cid, aobject){
	if (document.getElementById){
	  highlighttab(aobject);
		if (previoustab!="")
	  	document.getElementById(previoustab).style.display="none";
  	document.getElementById(cid).style.display="block";
  	previoustab = cid;
	}
}

function expandcontentflash(cid, aid){
	if (document.getElementById){
	  highlighttab(document.getElementById(aid));
		if (previoustab!="")
	  	document.getElementById(previoustab).style.display="none";
  	document.getElementById(cid).style.display="block";
  	previoustab = cid;
	}
}

function highlighttab(aobject){
	if (typeof tabobjimgs=="undefined")
		collectddimagetabs();
	for (i=0; i<tabobjimgs.length; i++)
		tabobjimgs[i].src = tabobjimgs[i].src.replace("_on", "_off");
	aobject.src = aobject.src.replace("_off", "_on");
}

function collectddimagetabs(){
	var tabobj=document.getElementById("ddimagetabs");
	tabobjimgs=tabobj.getElementsByTagName("IMG");
}

function do_onload(){
	collectddimagetabs();
	expandcontent(initialtab[1], tabobjimgs[initialtab[0]-1]);
	positionflash();
}

if (window.addEventListener)
	window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
	window.attachEvent("onload", do_onload)
else if (document.getElementById)
	window.onload=do_onload
