
/*
Scripts for club.com ticketing pages.
02.22.2006 Caleb Olin
*/

// show Tab and hideTab control the tab display on the upcoming component

function showTab() {
	var obj = document.getElementById(arguments[0]);
	obj.style.display = "inline";
}

function hideTab() {
	var obj = document.getElementById(arguments[0]);
	obj.style.display = "none";
}


// initSpots creates the mouseover/mouseout effects for the tier 2 spots

function initSpots() {
	var divs = document.getElementById('mc').getElementsByTagName('div');  
		
	for (var j = 0; j < divs.length; j++) {
    	if (divs[j].className.indexOf('spotcontainer') != -1) {
		
		divs[j].id = "tixSpot" + j;		
		containerDiv = divs[j].id;
	
		//	these 6 lines write a 1px x 100px spacing image into each spot, setting the minimum height to 100px
		var spacing_img = document.createElement('img');
		spacing_img.setAttribute('src', '/images/trans.gif');
		spacing_img.setAttribute('width', '1');
		spacing_img.setAttribute('height', '100');
		spacing_img.className = "floatRight";
		document.getElementById(containerDiv).insertBefore(spacing_img,document.getElementById(containerDiv).firstChild);
		
		//  mouseover function for each spot
		document.getElementById(containerDiv).onmouseover = function() {		
			if (this.className.indexOf('2thirds') != -1) {spotWidth = "_2thirds"}
			else if (this.className.indexOf('half') != -1) {spotWidth = "_half"}
			else if (this.className.indexOf('misc') != -1) {spotWidth = "_misc"}
			else if (this.className.indexOf('misc2') != -1) {spotWidth = "_misc2"}
			else if (this.className.indexOf('misc3') != -1) {spotWidth = "_misc3"}
			else if (this.className.indexOf('misc4') != -1) {spotWidth = "_misc4"}
			else{spotWidth=""};			
			this.className="spotcontaineron" + spotWidth;			
			for (var n = 0; n < this.childNodes.length; n++) {				
			if (this.childNodes[n].className) {
				if(this.childNodes[n].className.indexOf('tixgreenbutton') != -1){
					this.childNodes[n].className="tixgreenbuttonon" + spotWidth};
				if(this.childNodes[n].className.indexOf('tixgreybutton') != -1){
					this.childNodes[n].className="tixgreybuttonon" + spotWidth};
				if(this.childNodes[n].className.indexOf('tixwhitebutton') != -1){
					this.childNodes[n].className="tixwhitebuttonon" + spotWidth};			
			}					
			}
		}	
		//  mouseout function for each spot
		document.getElementById(containerDiv).onmouseout = function() {			
			if (this.className.indexOf('2thirds') != -1) {spotWidth = "_2thirds"}
			else if (this.className.indexOf('half') != -1) {spotWidth = "_half"}
			else if (this.className.indexOf('misc') != -1) {spotWidth = "_misc"}
			else if (this.className.indexOf('misc2') != -1) {spotWidth = "_misc2"}
			else if (this.className.indexOf('misc3') != -1) {spotWidth = "_misc3"}
			else if (this.className.indexOf('misc4') != -1) {spotWidth = "_misc4"}
			else{spotWidth=""};						
			this.className="spotcontainer" + spotWidth;
			for (var n = 0; n < this.childNodes.length; n++) {			
			if (this.childNodes[n].className) {
				if(this.childNodes[n].className.indexOf('tixgreenbutton') != -1) {
					this.childNodes[n].className="tixgreenbutton" + spotWidth};
				if(this.childNodes[n].className.indexOf('tixgreybutton') != -1) {
					this.childNodes[n].className="tixgreybutton" + spotWidth};
				if(this.childNodes[n].className.indexOf('tixwhitebutton') != -1) {
					this.childNodes[n].className="tixwhitebutton" + spotWidth};	
			}					
			}
		}	
		}
	}
}

addLoadEvent(initSpots);