if(typeof window.tabNames == "undefined")
	var tabNames = ["Tickets","Cast","Menu"];
var tabObjs = new Array();
var frameObj = null;
var tabCursor = null;

function tabControl(o){
	var clicked;
	for(var i = 0; i < tabNames.length; i++){
		if(o.id == "t" + tabNames[i]) clicked = i;
		tabObjs[i].t.style.backgroundImage = "url(/07core/gfx/inside-tab-0.gif)";
		tabObjs[i].t.style.color = "#ffffff";
		tabObjs[i].c.style.display = "none";
	}

	if(tabCursor != clicked){
		tabObjs[clicked].t.style.backgroundImage = "url(/07core/gfx/inside-tab-1.gif)";
		tabObjs[clicked].t.style.color = "#400";
		tabObjs[clicked].c.style.display = "block";
		tabCursor = clicked;
	}
	else {
		tabCursor = null;
	}
}

function tabInit(){
	for(var i = 0; i < tabNames.length; i++){
		var t = document.getElementById("t" + tabNames[i]);
		var c = document.getElementById("c" + tabNames[i]);
		if(t && c){
			tabObjs[i] = {t:t,c:c};
			t.onclick = function(){
				tabControl(this);
				return false;
			}
			c.onmouseover = function(){
				if(typeof document.all == "undefined") this.style.height = "auto";
				this.style.overflow = "visible";
				frameObj.style.borderBottom = "0px none #400";
				this.style.filter = "alpha(opacity=90)";
				this.style.opacity = ".9";
				this.style.MozOpacity = ".9";
			}
			c.onmouseout = function(){
				if(typeof document.all == "undefined") this.style.height = "300px";
				this.style.overflow = "hidden";
				frameObj.style.borderBottom = "1px solid #400";
				this.style.filter = "alpha(opacity=70)";
				this.style.opacity = ".7";
				this.style.MozOpacity = ".7";
			}
		}
		else
			tabObjs[i] = null;
	}
	frameObj = document.getElementById("frame");
	var tabLinks = document.getElementsByName("tab_link");
	if(tabLinks)
		for(var i = 0; i < tabLinks.length; i++){
			tabLinks[i].onmouseover = function(){ return true; }
			tabLinks[i].onmouseout = function(){ return false; }
		}
}

if(typeof window.onload != "undefined" && window.onload != null){
	var bakOnload = window.onload;
	window.onload = function(){
		bakOnload();
		tabInit();
	}
}
else {
	window.onload = tabInit;
}
