 var showMovie = true; 
 var firstTime = true; 
 var initialFlashContent;
 var currentInnerHTML;
 
 setBottomDiv();
 
//var winHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight);

var theWidth, theHeight;

function setDimensions() {

	// Window dimensions:
	if (window.innerWidth) {
	theWidth=window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth) {
	theWidth=document.documentElement.clientWidth;
	}
	else if (document.body) {
	theWidth=document.body.clientWidth;
	}
	if (window.innerHeight) {
	theHeight=window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
	theHeight=document.documentElement.clientHeight;
	}
	else if (document.body) {
	theHeight=document.body.clientHeight;
	}

//var currentHeight = theHeight + 1;
//var currentWidth = theWidth + 1;
//alert (currentHeight);
//alert (currentWidth);

}

function showTheMovie(){
	//minimum podium dimensions 780 x 400
	if (theHeight <= 500 || theWidth <= 1000) {
	
		showMovie = false; 
		
		
	}
	else {
		showMovie = true; 
	}
	
	
}

function writeStyle(){

	theHeight = theHeight-0;

	var flashStyle = '<style type="text/css">';
	flashStyle += '#flashcontent {';
	flashStyle += 'height:' + ((theHeight *1) + 25) +'px; ';
	flashStyle += 'color: #ffffff;';
	flashStyle += 'font-family: Arial, Helvetica, sans-serif; ';
	flashStyle += 'font-size: 12px; ';
	flashStyle += 'margin-top: -25px; ';
	flashStyle += '}\n';
	//flashStyle += '#fixme {';
	//flashStyle += 'margin-top:2px; ';
	//flashStyle += 'color: #ffffff;';
	//flashStyle += 'font-family: Arial, Helvetica, sans-serif; ';
	//flashStyle += 'font-size: 12px; ';
	//flashStyle += '}';
	flashStyle += '</style>';
	
	document.write (flashStyle);

}


// Changed 8/11/08 - GSI Please update
function setBottomDiv(){

	setDimensions();
	//document.getElementById("main").style.height =

	theHeight = ((theHeight *1) + 25);
	//winHeight = winHeight-15;
	writeStyle();

	

	showTheMovie();
	
	//initialFlashContent = document.getElementById('hiddenConent').innerHTML;
	//alert (initialFlashContent);
	
	//maximiser();
	
	writeContent();
	

}



var shownLast;

function resetBottomDiv(){

	setDimensions();
	//document.getElementById("main").style.height =

	theHeight = ((theHeight *1) + 25);
	//winHeight = winHeight-15;
	//writeStyle();

	

	showTheMovie();
	//if we screen is big enough
	
	writeContent();


}

function writeContent(){

	if (showMovie){
		//and we are already showing the movie
		if (shownLast) {
			document.getElementById('flashcontent').style.height = theHeight + "px";
			//document.getElementById('flashcontent').innerHTML = initialFlashContent;
			//alert(initialFlashContent);
			//alert(document.getElementById('flashcontent').innerHTML);
			//alert("if");
			
		}
		// else we are not currently showing the movie
		else {
			
			
			//so.write("flashcontent");
			
			document.getElementById('flashcontent').style.height = theHeight + "px";
			so.write("flashcontent");
			//document.getElementById('flashcontent').innerHTML = currentInnerHTML;
			currentInnerHTML = document.getElementById('flashcontent').innerHTML;
			shownLast = true;
			//alert(document.getElementById('flashcontent').innerHTML);
			//alert("else / if");

		
		}
	}
	
	else {
		var content = "";
		content +='<div id="stage" class="center">';
        content +='<img src="images/TBLlogo_noFlash.jpg" alt="" /><br /><br />';
		if ((screen.width>=1024) && (screen.height>=768))
		{

			content +='<a class="message" href="javascript:maximiser();">We need to open this window a little wider for you to view this site.<br />(We need at least 1000 x 500px)<br />Click Here!</a>';
		
		}
		else {
		
			content +="We’re sorry, your resolution is too low to view this site.(1024 x 768 required)";
		
		}
		document.getElementById('flashcontent').innerHTML = content;
		shownLast = false; 
		//alert("else");
	}

}
// end changed area


var emailImageOff  = new Image();
var emailImageOn= new Image();
var sendImageOff= new Image();
var sendImageOn= new Image();
var shopImageOff= new Image();
var shopImageOn= new Image();

emailImageOff.src = "./images/emails_off.jpg"
emailImageOn.src = "./images/emails_on.jpg"
sendImageOff.src = "./images/send_off.jpg"
sendImageOn.src = "./images/send_on.jpg"
shopImageOff.src = "./images/shop_off.jpg"
shopImageOn.src = "./images/shop_on.jpg"


function switchImage(id, newImage){

	document.getElementById(id).src = newImage.src;

}


function maximiser()
{
	window.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
	var currentLocation = window.location.href;
	//window.location.href= currentLocation;
	//shownLast = false;
	//resetBottomDiv();
}




var win = null;
function cWindow(page,w,h)
{
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
		if (winl < 0) winl = 0;
		if (wint < 0) wint = 0;
			var settings = 'height=' + h + ',';
			settings += 'width=' + w + ',';
			settings += 'top=' + wint + ',';
			settings += 'left=' + winl + ',';
			settings += 'statusbar=0';
				win = window.open(page,name,settings);


}

//floodlight tracking 
function trackclick1() {
	var click1 = new Image();
	var axel = Math.random() + "";
	var ord = axel * 1000000000000000000;
	click1.src ='http://ad.doubleclick.net/activityi;src=1562371;type=timbe959;cat=gosho439;ord='+ ord + '?';
	
}


 // Changed 8/21/08 - GSI Please update

//floodlight tracking from logo in flash
function logoclick(){
	//comment out to not use for UK
	trackclick1();
	
}
 // end changed area