var mmSrc;
var mmI = new Array(); // Array of main menu images
var pbiIndex = -1; // Pricing Booking Info index

function activateMenus(){
	
	// Sub menu rollovers
	if ( document.getElementById("sub_menu") ){
		var LI = document.getElementById("sub_menu").getElementsByTagName("li");
		for (var i = 0; i < LI.length; i ++){
			LI[i].onmouseover = function(){ this.className += " doHover"; }
			LI[i].onmouseout  = function(){ this.className = ''; }
		}
	}
	// Main menu rollovers
	if ( document.getElementById("main_menu") ){
		mmA = document.getElementById("main_menu").getElementsByTagName("a");
		for (var i = 0; i < mmA.length; i ++){
		
			// Preload the swap image
			mmI[i] = new Image();
			var bOn = ( mmA[i].firstChild.src.indexOf('_on.gif') != -1 );
			mmI[i].src = mmA[i].firstChild.src.split(((bOn)?'_on.gif':'_off.gif')).join('_over.gif');
			
			// Do the mouseover
			mmA[i].onmouseover = function(){
				mmSrc = this.firstChild.src; // save the src for restore
				this.firstChild.src = mmSrc.split((( mmSrc.indexOf('_on.gif') != -1 )?'_on.gif':'_off.gif')).join('_over.gif');
			}
			
			// Do the mouseout
			mmA[i].onmouseout = function(){ this.firstChild.src = mmSrc; }
		}
	}
}

function initRollovers(){
  if ( document.images ){
    var preLoad = new Array();
    var tempSrc;
    
    for (var i = 0; i < document.images.length; i ++ ){

      // Only add rollover to images with the classname 'rollover'
      if ( document.images[i].className == 'rollover' ){
        var src = document.images[i].getAttribute('src'); // get the src
        var ext = src.substring( src.lastIndexOf('.'), src.length ); // get the file extension
        var hsrc = src.replace( ext, '_over' + ext ); // store the rollover src
        document.images[i].setAttribute('hsrc', hsrc); // set the new src attribute
        document.images[i].style.cursor = 'hand'; // Hand cursor where supported

        // Preload the image
        preLoad[i] = new Image();
        preLoad[i].src = hsrc;

        // Add the rollover functions
        document.images[i].onmouseover = function(){
          tempSrc = this.getAttribute('src');
          this.setAttribute('src', this.getAttribute('hsrc'));
        }
        document.images[i].onmouseout = function(){
          if (!tempSrc) tempSrc = this.getAttribute('src').replace('_over'+ext, ext);
          this.setAttribute('src', tempSrc);
        }
      }
    }
  }
	// Do rollover on go image
	if ( document.getElementById('go_button') ){
		var gb = document.getElementById('go_button');
		var gbi = new Image();
		gbi.src = gb.src.split('.gif').join('_over.gif');
		gb.onmouseover = function(){ this.src = this.src.split('.gif').join('_over.gif'); }
		gb.onmouseout  = function(){ this.src = this.src.split('_over.gif').join('.gif'); }
	}
}

function findConcessions(){
	// Main menu rollovers
	if ( document.getElementById("col_two") ){ // If we have the div
		var T = document.getElementById("col_two").getElementsByTagName("table");
		if ( T.length > 0 ){ // Check for tables
			var conIndex = -1; // Concessions index
			for ( var i = 0; i < T.length; i ++ ){	
				if ( T[i].className == 'concession' ){
					conIndex = i; // Store the index id
				}
				if ( T[i].className == 'wide' ){
					var TD = T[i].getElementsByTagName("td");
					for ( var j = 0; j < TD.length; j ++ ){
						if ( TD[j].className == 'concession' ){
							pbiIndex = i; 
							break;
						}
					}
				}
			}
			// If we have both tables and required styles 
			if ( pbiIndex > -1 && conIndex > -1 ){
			
				// The concessions table
				T[conIndex].className = 'concession_hidden'; // Hide it

				// Create a div with a copy of the concessions table
				var myDiv = document.createElement('div');
				myDiv.id = 'concession';
				myDiv.style.visibility = 'hidden';
				myDiv.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" class="concession">' + T[conIndex].innerHTML + '</table>';
				document.body.appendChild(myDiv);

				// Change the concession link text
				var TD = T[pbiIndex].getElementsByTagName("td");
				for ( var j = 0; j < TD.length; j ++ ){
					if ( TD[j].className == 'concession' ){
						var inner = TD[j].innerHTML;
						inner = inner.split('(see below)').join('&ndash; <a href="#" onmouseover="overConcession(\'on\');" onmouseout="overConcession(\'out\');">mouseover here to view</a>');
						TD[j].innerHTML = inner;
					}
				}
			}
		}
	}
}
function overConcession(s){
	var T = document.getElementById("col_two").getElementsByTagName("table");
	var C = document.getElementById("concession");
	if (s == 'on' ){
		// Move the new div to the correct position and show
		C.style.top = (findPosY(T[pbiIndex])+17) + 'px';
		C.style.left = findPosX(T[pbiIndex]) + 'px';		
		C.style.visibility = 'visible';
	} else { // Hide it
		C.style.visibility = 'hidden';
	}
}

function findConcessions2(){
	// Main menu rollovers
	if ( document.getElementById("col_two") ){ // If we have the div
		var T = document.getElementById("col_two").getElementsByTagName("table");
		if ( T.length > 0 ){ // Check for tables
			var conIndex = -1; // Concessions index
			for ( var i = 0; i < T.length; i ++ ){	
				if ( T[i].className == 'concession2' ){
					conIndex = i; // Store the index id
				}
				if ( T[i].className == 'wide' ){
					var TD = T[i].getElementsByTagName("td");
					for ( var j = 0; j < TD.length; j ++ ){
						if ( TD[j].className == 'concession2' ){
							pbiIndex = i; 
							break;
						}
					}
				}
			}
			// If we have both tables and required styles 
			if ( pbiIndex > -1 && conIndex > -1 ){
			
				// The concessions table
				T[conIndex].className = 'concession2_hidden'; // Hide it

				// Create a div with a copy of the concessions table
				var myDiv = document.createElement('div');
				myDiv.id = 'concession2';
				myDiv.style.visibility = 'hidden';
				myDiv.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" class="concession2">' + T[conIndex].innerHTML + '</table>';
				document.body.appendChild(myDiv);

				// Change the concession link text
				var TD = T[pbiIndex].getElementsByTagName("td");
				for ( var j = 0; j < TD.length; j ++ ){
					if ( TD[j].className == 'concession2' ){
						var inner = TD[j].innerHTML;
						inner = inner.split('(see below)').join('&ndash; <a href="#" onmouseover="overConcession2(\'on\');" onmouseout="overConcession2(\'out\');">mouseover here to view</a>');
						TD[j].innerHTML = inner;
					}
				}
			}
		}
	}
}
function overConcession2(s){
	var T = document.getElementById("col_two").getElementsByTagName("table");
	var C = document.getElementById("concession2");
	if (s == 'on' ){
		// Move the new div to the correct position and show
		C.style.top = (findPosY(T[pbiIndex])+17) + 'px';
		C.style.left = findPosX(T[pbiIndex]) + 'px';		
		C.style.visibility = 'visible';
	} else { // Hide it
		C.style.visibility = 'hidden';
	}
}


function findConcessions3(){
	// Main menu rollovers
	if ( document.getElementById("col_two") ){ // If we have the div
		var T = document.getElementById("col_two").getElementsByTagName("table");
		if ( T.length > 0 ){ // Check for tables
			var conIndex = -1; // Concessions index
			for ( var i = 0; i < T.length; i ++ ){	
				if ( T[i].className == 'concession3' ){
					conIndex = i; // Store the index id
				}
				if ( T[i].className == 'wide' ){
					var TD = T[i].getElementsByTagName("td");
					for ( var j = 0; j < TD.length; j ++ ){
						if ( TD[j].className == 'concession3' ){
							pbiIndex = i; 
							break;
						}
					}
				}
			}
			// If we have both tables and required styles 
			if ( pbiIndex > -1 && conIndex > -1 ){
			
				// The concessions table
				T[conIndex].className = 'concession3_hidden'; // Hide it

				// Create a div with a copy of the concessions table
				var myDiv = document.createElement('div');
				myDiv.id = 'concession3';
				myDiv.style.visibility = 'hidden';
				myDiv.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" class="concession3">' + T[conIndex].innerHTML + '</table>';
				document.body.appendChild(myDiv);

				// Change the concession link text
				var TD = T[pbiIndex].getElementsByTagName("td");
				for ( var j = 0; j < TD.length; j ++ ){
					if ( TD[j].className == 'concession3' ){
						var inner = TD[j].innerHTML;
						inner = inner.split('(see below)').join('&ndash; <a href="#" onmouseover="overConcession3(\'on\');" onmouseout="overConcession3(\'out\');">mouseover here to view</a>');
						TD[j].innerHTML = inner;
					}
				}
			}
		}
	}
}
function overConcession3(s){
	var T = document.getElementById("col_two").getElementsByTagName("table");
	var C = document.getElementById("concession3");
	if (s == 'on' ){
		// Move the new div to the correct position and show
		C.style.top = (findPosY(T[pbiIndex])+17) + 'px';
		C.style.left = findPosX(T[pbiIndex]) + 'px';		
		C.style.visibility = 'visible';
	} else { // Hide it
		C.style.visibility = 'hidden';
	}
}

function findConcessions4(){
	// Main menu rollovers
	if ( document.getElementById("col_two") ){ // If we have the div
		var T = document.getElementById("col_two").getElementsByTagName("table");
		if ( T.length > 0 ){ // Check for tables
			var conIndex = -1; // Concessions index
			for ( var i = 0; i < T.length; i ++ ){	
				if ( T[i].className == 'concession4' ){
					conIndex = i; // Store the index id
				}
				if ( T[i].className == 'wide' ){
					var TD = T[i].getElementsByTagName("td");
					for ( var j = 0; j < TD.length; j ++ ){
						if ( TD[j].className == 'concession4' ){
							pbiIndex = i; 
							break;
						}
					}
				}
			}
			// If we have both tables and required styles 
			if ( pbiIndex > -1 && conIndex > -1 ){
			
				// The concessions table
				T[conIndex].className = 'concession4_hidden'; // Hide it

				// Create a div with a copy of the concessions table
				var myDiv = document.createElement('div');
				myDiv.id = 'concession4';
				myDiv.style.visibility = 'hidden';
				myDiv.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" class="concession4">' + T[conIndex].innerHTML + '</table>';
				document.body.appendChild(myDiv);

				// Change the concession link text
				var TD = T[pbiIndex].getElementsByTagName("td");
				for ( var j = 0; j < TD.length; j ++ ){
					if ( TD[j].className == 'concession4' ){
						var inner = TD[j].innerHTML;
						inner = inner.split('(see below)').join('&ndash; <a href="#" onmouseover="overConcession4(\'on\');" onmouseout="overConcession4(\'out\');">mouseover here to view</a>');
						TD[j].innerHTML = inner;
					}
				}
			}
		}
	}
}
function overConcession4(s){
	var T = document.getElementById("col_two").getElementsByTagName("table");
	var C = document.getElementById("concession4");
	if (s == 'on' ){
		// Move the new div to the correct position and show
		C.style.top = (findPosY(T[pbiIndex])+17) + 'px';
		C.style.left = findPosX(T[pbiIndex]) + 'px';		
		C.style.visibility = 'visible';
	} else { // Hide it
		C.style.visibility = 'hidden';
	}
}
function findConcessions5(){
	// Main menu rollovers
	if ( document.getElementById("col_two") ){ // If we have the div
		var T = document.getElementById("col_two").getElementsByTagName("table");
		if ( T.length > 0 ){ // Check for tables
			var conIndex = -1; // Concessions index
			for ( var i = 0; i < T.length; i ++ ){	
				if ( T[i].className == 'concession5' ){
					conIndex = i; // Store the index id
				}
				if ( T[i].className == 'wide' ){
					var TD = T[i].getElementsByTagName("td");
					for ( var j = 0; j < TD.length; j ++ ){
						if ( TD[j].className == 'concession5' ){
							pbiIndex = i; 
							break;
						}
					}
				}
			}
			// If we have both tables and required styles 
			if ( pbiIndex > -1 && conIndex > -1 ){
			
				// The concessions table
				T[conIndex].className = 'concession5_hidden'; // Hide it

				// Create a div with a copy of the concessions table
				var myDiv = document.createElement('div');
				myDiv.id = 'concession5';
				myDiv.style.visibility = 'hidden';
				myDiv.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" class="concession5">' + T[conIndex].innerHTML + '</table>';
				document.body.appendChild(myDiv);

				// Change the concession link text
				var TD = T[pbiIndex].getElementsByTagName("td");
				for ( var j = 0; j < TD.length; j ++ ){
					if ( TD[j].className == 'concession5' ){
						var inner = TD[j].innerHTML;
						inner = inner.split('(see below)').join('&ndash; <a href="#" onmouseover="overConcession5(\'on\');" onmouseout="overConcession5(\'out\');">mouseover here to view</a>');
						TD[j].innerHTML = inner;
					}
				}
			}
		}
	}
}
function overConcession5(s){
	var T = document.getElementById("col_two").getElementsByTagName("table");
	var C = document.getElementById("concession5");
	if (s == 'on' ){
		// Move the new div to the correct position and show
		C.style.top = (findPosY(T[pbiIndex])+17) + 'px';
		C.style.left = findPosX(T[pbiIndex]) + 'px';		
		C.style.visibility = 'visible';
	} else { // Hide it
		C.style.visibility = 'hidden';
	}
}
function findConcessions6(){
	// Main menu rollovers
	if ( document.getElementById("col_two") ){ // If we have the div
		var T = document.getElementById("col_two").getElementsByTagName("table");
		if ( T.length > 0 ){ // Check for tables
			var conIndex = -1; // Concessions index
			for ( var i = 0; i < T.length; i ++ ){	
				if ( T[i].className == 'concession6' ){
					conIndex = i; // Store the index id
				}
				if ( T[i].className == 'wide' ){
					var TD = T[i].getElementsByTagName("td");
					for ( var j = 0; j < TD.length; j ++ ){
						if ( TD[j].className == 'concession6' ){
							pbiIndex = i; 
							break;
						}
					}
				}
			}
			// If we have both tables and required styles 
			if ( pbiIndex > -1 && conIndex > -1 ){
			
				// The concessions table
				T[conIndex].className = 'concession6_hidden'; // Hide it

				// Create a div with a copy of the concessions table
				var myDiv = document.createElement('div');
				myDiv.id = 'concession5';
				myDiv.style.visibility = 'hidden';
				myDiv.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" class="concession6">' + T[conIndex].innerHTML + '</table>';
				document.body.appendChild(myDiv);

				// Change the concession link text
				var TD = T[pbiIndex].getElementsByTagName("td");
				for ( var j = 0; j < TD.length; j ++ ){
					if ( TD[j].className == 'concession6' ){
						var inner = TD[j].innerHTML;
						inner = inner.split('(see below)').join('&ndash; <a href="#" onmouseover="overConcession6(\'on\');" onmouseout="overConcession6(\'out\');">mouseover here to view</a>');
						TD[j].innerHTML = inner;
					}
				}
			}
		}
	}
}
function overConcession6(s){
	var T = document.getElementById("col_two").getElementsByTagName("table");
	var C = document.getElementById("concession6");
	if (s == 'on' ){
		// Move the new div to the correct position and show
		C.style.top = (findPosY(T[pbiIndex])+17) + 'px';
		C.style.left = findPosX(T[pbiIndex]) + 'px';		
		C.style.visibility = 'visible';
	} else { // Hide it
		C.style.visibility = 'hidden';
	}
}
function findPosX(obj){
	var curleft = 0;
	if ( obj.offsetParent ){
		while (1){
			curleft += obj.offsetLeft;
			if ( !obj.offsetParent ) break;
			obj = obj.offsetParent;
		}
	} else if ( obj.x ){ curleft += obj.x; }
  return curleft;
}
function findPosY(obj){
	var curtop = 0;
	if ( obj.offsetParent ){
		while (1){
			curtop += obj.offsetTop;
			if ( !obj.offsetParent ) break;
			obj = obj.offsetParent;
		}
	} else if ( obj.y ){ curtop += obj.y; }
  return curtop;
}
function printPage(){
	alert('For best printing results please select \'landscape\'\norientation in your printing preferences.');
	window.print();
}
window.onload = function(){
	activateMenus();
	initRollovers()
	findConcessions();
	findConcessions2();
	findConcessions3();
	findConcessions4();
	findConcessions5();
	findConcessions6();

}
