// creates and manages an html select form element, from a
function PodTabbed(id, tabIDs, options){
	var nextIndex = 0;
	var parts = id.split("_");
	var podID = parts[1];
	
	function init(){
		tabIDs = tabIDs.split(",");
		
		for(var i = 0; i < tabIDs.length; i++){
			$("tabbeda_" + tabIDs[i]).onclick = function(){
				// reset the styles and hide all content
				for(var j = 0; j < tabIDs.length; j++){
					$("tabbedContent_" + tabIDs[j]).style.display = "none";
					$("tabbedspan_" + tabIDs[j]).className = "";
				}
				
				// get the current pod id
				var p = this.id.split("_");
				// set the current style 
				$("tabbedContent_" + p[1]).style.display = "block";
				$("tabbedspan_" + p[1]).className = "current";
				
				if(typeof(pageTracker) != "undefined"){
					var labelText = $("tabbeda_" + p[1]).innerHTML;
					labelText = labelText.replace("<span>", "");
					labelText = labelText.replace("</span>", "");
					labelText += " - [" + p[1] + "]";
					pageTracker._trackEvent("Pod-Tab", "click", labelText);
				}
			}
		}
		
		
		var index = options != "" && $defined(options.startIndex) ? options.startIndex : 0;
		if(index >= 0){
			// set the current style for the first tab
			$("tabbedContent_" + tabIDs[index]).style.display = "block";
			$("tabbedspan_" + tabIDs[index]).className = "current";
		}
	}
	
	// run the constructor
	init();
}
