/*

*/

var hovering = false;
var state;
var tooltipArray = new Array(4);
tooltipArray[0] = new Array();
tooltipArray[1] = new Array();
tooltipArray[2] = new Array();
tooltipArray[3] = new Array();

//// tv tooltips
// ira 
tooltipArray[0][0] = "Betrayed - IRA Training";
// drugs			
tooltipArray[0][1] = "Betrayed - Drugs Story";
// kids+guns		
tooltipArray[0][2] = "Betrayed - Kids &amp; Guns";
// gothic			
tooltipArray[0][3] = "Underground 2003 - Gothic";
// end of world	
tooltipArray[0][4] = "Brave New World";
// dog fight		
tooltipArray[0][5] = "Battle for Britain";
// dr who			
tooltipArray[0][6] = "Doctor Who Teaser";
// minister			
tooltipArray[0][7] = "The Minister";
// psyc				
tooltipArray[0][8] = "Underground 2003 - Psychedelic";
// wimbledon		
tooltipArray[0][9] = "Underground 2003 - Wimbledon";
// min				
tooltipArray[0][10] = "Underground 2003 - Minimalist";
// pro golf			
tooltipArray[0][11] = "Underground 2003 - Pro Golf";
// f1					
tooltipArray[0][12] = "Underground 2003 - Formula 1";
// hideout			
tooltipArray[0][13] = "Betrayed - Hideout";
// graveyard		
tooltipArray[0][14] = "Betrayed - Graveyard";
// culture			
tooltipArray[0][15] = "Betrayed - Culture Clash";
// slash				
tooltipArray[0][16] = "Slash Comedy";
// spooks			
tooltipArray[0][17] = "Spooks/BBC Interactive Promo";
// effects			
tooltipArray[0][18] = "Visual Effects Reel";
// exit				
tooltipArray[0][19] = "Exit";

//// music vid tooltips
// some tears
tooltipArray[1][0] = "Shayne Ward - Some Tears Never Dry";
// matty groves
tooltipArray[1][1] = "Silverwheel - Matty Groves";
// stand by me
tooltipArray[1][2] = "Shayne Ward - Stand By Your Side";
// tangled up
tooltipArray[1][3] = "Shayne Ward - Tangled Up";
// through dark night
tooltipArray[1][4] = "Wild Beasts - Domino";
// tell him
tooltipArray[1][5] = "Shayne Ward - Tell Him";
// robbie williams
tooltipArray[1][6] = "Robbie Williams - Voodoo";





//// corporate tooltips
// Fuel
tooltipArray[2][0] = "Fuel";
// Silverstone
tooltipArray[2][1] = "Silverstone";
// relocation
tooltipArray[2][2] = "Relocation";
// ipi - solutions
tooltipArray[2][3] = "IPI - Solutions";
// ipi - molecules to medicine
tooltipArray[2][4] = "IPI - Molecules to Medicine";
// opera north - transformation
tooltipArray[2][5] = "Opera North - Transformation";
// roses advertising awards 2005
tooltipArray[2][6] = "Roses Advertising Awards 2005";
// waste - groceries
tooltipArray[2][7] = "Waste - Groceries";
// waste - takeaway
tooltipArray[2][8] = "Waste - Takeaway";
// waste - garage
tooltipArray[2][9] = "Waste - Garage";

//// commercial tooltips
// Deep Down
tooltipArray[3][0] = "Mentholatum UK - Deep Relief";
// Stavros Flatley
tooltipArray[3][1] = "Mazuma Mobile - Stavros Flatley";
// coke - hamaki
tooltipArray[3][2] = "Coca-Cola - Hamaki";
// vodafone - impressions
tooltipArray[3][3] = "Vodafone - Impressions";
// Magician
tooltipArray[3][4] = "Mazuma Mobile - Magician";
// The Range 
tooltipArray[3][5] = "The Range - Diversity";
// Journey
tooltipArray[3][6] = "Almarai - Journey";
// Oracle
tooltipArray[3][7] = "Oracle - Oracle";

// Ricky
tooltipArray[3][8] = "The Range - Ricky";

// Maz 2
tooltipArray[3][9] = "Mazuma Mobile - Maz 2";
// Coca Cola - Let it out (Hamaki teaser)
tooltipArray[3][10] = "Coca Cola - Let it out (Hamaki teaser)";

// Ricky 2
tooltipArray[3][11] = "The Range - Ricky 2";

// Maz
tooltipArray[3][12] = "Mazuma Mobile - Maz";
// Chips Away
tooltipArray[3][13] = "Chips Away - Chips Away";
// Machine Mart 1
tooltipArray[3][14] = "Machine Mart - Machine Mart";
// Farm Foods 1
tooltipArray[3][15] = "Farm Foods - Farm Foods";
// Machine Mart 2
tooltipArray[3][16] = "Machine Mart - Machine Mart 2";
// Farm Foods 2
tooltipArray[3][17] = "Farm Foods - Farm Foods 2";
// Sony Centers
tooltipArray[3][18] = "Sony Centers - Sony Centers";
// Farm Foods 3
tooltipArray[3][19] = "Farm Foods - Farm Foods 3";



function swap() {
	
	var ob = this.what + '-' + this.num;
	
	var ind;
	switch(this.what) {
		case "tv": ind = 0; break;
		case "mv": ind = 1; break;
		case "corp": ind = 2; break;
		case "comm": ind = 3; break;
	}
	
	
	
	if (!hovering)	{ 
		if (this.num % 3 == 0) {
			overlib(tooltipArray[ind][this.num-1], DELAY, 500, LEFT, OFFSETX, 0);
		} else {
			overlib(tooltipArray[ind][this.num-1], DELAY, 500, RIGHT);
		}
				
		hovering = true;
		state = '-Over';
	} else if (hovering) {
		nd();
		hovering = false;
		state = '';
	}
	
	//alert("i/thumbs/" + this.what + "-" + this.num + state + ".jpg")
	
	document[ob].src="i/thumbs/" + this.what + "-" + this.num + state + ".jpg";
	
	
}


function swapart() {
	var ob = 'art-' + this.num;
	if (hovering == false)	{ 
		hovering = true;
		state = 'thumbnail';
	} else if (hovering == true) {
		hovering = false;
		state = 'thumbnail-bw';
	}
	document[ob].src="i/art/" + this.id + "-" + state + ".jpg" ;
}


function placeVid(vid) {
	//var fo = new SWFObject("f/tv1.swf", "Flash", "545", "303", 8, "#000000");
	var fo = new SWFObject("f/tv1.swf", "Flash", "576", "320", 8, "#000000");
	fo.addVariable("whichVid", vid);
	fo.addParam("scale", "scale");
	fo.addParam("quality", "high");
	fo.addParam("menu", "false");
	fo.addParam("salign", "LT");
	fo.write("vidholder");
}

function placeVidNew(vid) {
	//var fo = new SWFObject("f/tv1.swf", "Flash", "545", "303", 8, "#000000");
	var fo = new SWFObject("f/tv1.swf", "Flash", "576", "324", 8, "#000000");
	fo.addVariable("whichVid", vid);
	fo.addParam("scale", "scale");
	fo.addParam("quality", "high");
	fo.addParam("menu", "false");
	//fo.addParam("salign", "LT");
	fo.write("vidholder");
}


function setHandlers(curr) {
	
	var testhold = document.getElementById("thumbholder");
	var thelinks = testhold.getElementsByTagName("a");
	for (var i=0; i<thelinks.length; i++){
		thelinks[i].what = "tv";
		thelinks[i].num = i+1;
			
		var linkClass = $(thelinks[i]).attr("class");
			
		if(linkClass.indexOf("current") == -1){ // dont apply this to the current thumbnail, we don't want to remove the highlight on mouseout
			thelinks[i].onmouseout = thelinks[i].onmouseover = swap; 
		}

	}
	document['tv-'+curr].src="i/thumbs/tv-" + curr + "-Over.jpg";
}

// Highlights the current video's thumbnail when the page loads
function setCurrent(what,curr) {
	
	document[what + '-' + curr].src="i/thumbs/" + what + "-" + curr + "-Over.jpg";	
}





