/*
// This tab solution was created by Collin Yeadon collin@yeadongroup.com
*/
var oIndex = 0;
function tabSelect(tIndex){

	var objTabContainerOld = document.getElementById("box_" + oIndex);	
	objTabContainerOld.style.display = "none";
		
	var objTabOld = document.getElementById("tab_" + oIndex);
	objTabOld.className="";
	//objTabOld.setAttribute("class", "");
	//objTabOld.setAttribute("className", "");

	var objTabContainer = document.getElementById("box_" + tIndex);
	objTabContainer.style.display = "";

	var objTab = document.getElementById("tab_" + tIndex);
	objTab.className="here";	
	//objTab.setAttribute("class", "here");
	//objTab.setAttribute("className", "here");

	oIndex = tIndex;
	return false;
}

function tab_init(){
	if (!document.getElementById('tabs')) return false;
	
	if(!document.getElementById || !document.createElement)	return(false);
	
	var elements=document.getElementsByTagName("li");
	var ecount=elements.length;
	for ( i=0; i < ecount; i++){
		var ele=elements[i];
		if (ele.id.substring(0, 4) == 'tab_'){

			document.getElementById("box_"+ele.id.substr(4, ele.id.length)).style.display = "none";
			
			tabFuncz = function(evt){
				try{
				var srcElement = evt.target || evt.srcElement;
				} catch (error) {   
				}
				if (srcElement) {
					//alert(srcElement.parentNode.id);
					var tabID = srcElement.parentNode.id;
					tabSelect(tabID.substr(4, tabID.length));
									
					// FireFox FIX - CY 7/30/06
					srcElement.href='javascript:;';
					return false;
				}
				return false;
			}

//			AttachEvent(ele.getElementsByTagName('a')[0], 'click', tabFuncz, true);
			AttachEvent(ele.getElementsByTagName('a')[0], 'mouseover', tabFuncz, true);
			ele.onmouseover = tabFuncz;
			AttachEvent(ele.getElementsByTagName('a')[0], 'focus', tabFuncz, true);

			
			// The following line is to prevent #anchors from showing in the URL.  Currently only works in IE.
			//AttachEvent(ele.getElementsByTagName('a')[0], 'click', function(evt){return false;}, true);
		};
	}
	tabSelect(0);
	
	var tabCo = document.getElementById('tabContainer');
	if (tabCo) tabCo.className='';
}

if(window.attachEvent){
	window.attachEvent("onload", tab_init);
} else {
	if(typeof window.onload == "function"){
		var di_fOld = window.onload;
		window.onload = function(){ di_fOld(); tab_init(); };
	} else {
		window.onload = tab_init;
	};
};


//*** The following code is copyright 2003 by Gavin Kistner, gavin@refinery.com
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
//*** Reuse or modification is free provided you abide by the terms of that license.
//*** (Including the first two lines above in your source code satisfies the conditions.)

//***Cross browser attach event function. For 'evt' pass a string value with the leading "on" omitted
//***e.g. AttachEvent(window,'load',MyFunctionNameWithoutParenthesis,false);

function AttachEvent(obj,evt,fnc,useCapture){
	if (!useCapture) useCapture=false;
	if (obj.addEventListener){
		obj.addEventListener(evt,fnc,useCapture);
		return true;
	} else if (obj.attachEvent) return obj.attachEvent("on"+evt,fnc);
	else{
		MyAttachEvent(obj,evt,fnc);
		obj['on'+evt]=function(){ MyFireEvent(obj,evt) };
	}
} 

//The following are for browsers like NS4 or IE5Mac which don't support either
//attachEvent or addEventListener
function MyAttachEvent(obj,evt,fnc){
	if (!obj.myEvents) obj.myEvents={};
	if (!obj.myEvents[evt]) obj.myEvents[evt]=[];
	var evts = obj.myEvents[evt];
	evts[evts.length]=fnc;
}
function MyFireEvent(obj,evt){
	if (!obj || !obj.myEvents || !obj.myEvents[evt]) return;
	var evts = obj.myEvents[evt];
	for (var i=0,len=evts.length;i<len;i++) evts[i]();
}

