var posicionSup = 0; //posición del menú desde arriba

function posicion(nombre){
	tunMenu = document.getElementById(nombre)
	var scrollarriba=document.body.scrollTop;
	scrollarriba += posicionSup;
	tunMenu.style.top=scrollarriba + "px";
}
function iniciaMenu(nombre){
	tunMenu = document.getElementById(nombre)
	tunMenu.style.top = posicionSup + "px";
	tunMenu.style.position='fixed'; 
}

function setupSize(){

	

	//get values for width and height

	var img = document.getElementById('largeImage')

	oW = img.width;

	oH = img.height;

	ratio = oH/oW;

	resize_bg();

	

}

function resize_bg(){

	
	//-------------------------------------------positioning preloader
		var left_preloader = Math.round((document.body.clientWidth)/2) - 190  + 36;
	
		document.getElementById("preloader_layer").style.left = left_preloader + "px";
	
		document.getElementById("preloader_layer").style.top = 250 + "px"; 
	//----------------------------------------------------------
	
	var cW = document.body.clientWidth-190;
	var cH = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight);
	
	if (cH  > 650) { 
		
		document.getElementById('table_bg').style.width = cW+"px";
		document.getElementById('table_bg').style.height = cH+"px";
	}else{
		document.getElementById('table_bg').style.width = cW+"px";
		document.getElementById('table_bg').style.height = window.scrollMaxY+cH+"px";
	
	
	}
	
	//var width_now = Math.round((document.body.clientWidth)/2) - (document.getElementById("content_image").width/2) - 190  + 36;
	//document.getElementById("content_layersub").style.left = width_now + "px";
		
	var cH = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.parentNode.offsetHeight);
				
	if (cH  < 500) { 
		document.getElementById('logo').style.visibility = "hidden"; 
	 	document.getElementById('say_hola').style.visibility = "hidden";  }

	else { 
		document.getElementById('logo').style.visibility = "visible"; 
		document.getElementById('say_hola').style.visibility = "visible";
	}
	
	
}



window.addEvent('domready', function() {
	
	var semaforo = "verde";
	
	//SECOND EXAMPLE
	var background = $(document.body);
	var content = $('content_layer');
	var preloader = $('preloader_layer');
	var home_image = $('inside_content');
	
	var quote = $('home_quote');
	var panels = $('panels'); 
	
	var info = $('info');
	
	var image_0 = $('image_0');
	var image_1 = $('image_1');
	var image_2 = $('image_2');
	var image_3 = $('image_3');
	var image_4 = $('image_4');
	var image_5 = $('image_5');
	var image_6 = $('image_6');
	var image_7 = $('image_7');
	var image_8 = $('image_8');
	var image_9 = $('image_9');
	var image_10 = $('image_10');
	var image_11 = $('image_11');
	var image_12 = $('image_12');
	var image_rollover = $('image_rollover');
	var image_rollover_2 = $('image_rollover_2');
	
	var video_1 = $('video_1');
	
	var ColorEff = new Fx.Tween(background,{duration: 1000});
	
	function centra_preloader() {
	
		var left_preloader = Math.round((document.body.clientWidth)/2) - 190  + 36;
	
		document.getElementById("preloader_layer").style.left = left_preloader + "px";
	
		document.getElementById("preloader_layer").style.top = 250 + "px"; 
	
	}
	
	//--------------------PRELOADER --------------------------------------------------
	
	new Image().src = "./images/preloader.gif";  
	centra_preloader();
	
	
	//---------------------- RESET FUNCTIONS ------------------------------------
	
	function fadeOutVideo() {

		
    	if (document.getElementById("FIBProjectsVideoComponent")) {
			
				document.getElementById("FIBProjectsVideoComponent").doOutro(1);
					
				}

	}

	function allDissapears(){
		
	
		image_0.fade(0);
		image_1.fade(0);
		image_2.fade(0);
		image_3.fade(0);
		image_4.fade(0);
		image_5.fade(0);
		image_6.fade(0);
		image_7.fade(0);
		image_8.fade(0);
		image_9.fade(0);
		image_10.fade(0);
		image_11.fade(0);
		image_12.fade(0);
		image_rollover.fade(0);
		image_rollover_2.fade(0);
		
		fadeOutVideo();
		
		home_image.fade(0);
		
		info.fade(0);
		
	}
	function resetImages(){
		
		document.getElementById("content_image").src = "./images/trans.gif";
		document.getElementById("content_image_1").src = "./images/trans.gif";
		document.getElementById("content_image_2").src = "./images/trans.gif";
		document.getElementById("content_image_3").src = "./images/trans.gif";
		document.getElementById("content_image_4").src = "./images/trans.gif";
		document.getElementById("content_image_5").src = "./images/trans.gif";
		document.getElementById("content_image_6").src = "./images/trans.gif";
		document.getElementById("content_image_7").src = "./images/trans.gif";
		document.getElementById("content_image_8").src = "./images/trans.gif";
		document.getElementById("content_image_9").src = "./images/trans.gif";
		document.getElementById("content_image_10").src = "./images/trans.gif";
		document.getElementById("content_image_11").src = "./images/trans.gif";
		document.getElementById("content_image_rollover").src = "./images/trans.gif";
		document.getElementById("content_image_rollover_2").src = "./images/trans.gif";
		
		document.getElementById("video_1").innerHTML = "";
		
		document.getElementById("image_0").style.top = '70px';
		document.getElementById("image_1").style.top = '70px';
		document.getElementById("image_2").style.top = '70px';
		document.getElementById("image_3").style.top = '70px';
		document.getElementById("image_4").style.top = '70px';
		document.getElementById("image_5").style.top = '70px';
		document.getElementById("image_6").style.top = '70px';
		document.getElementById("image_7").style.top = '70px';
		document.getElementById("image_8").style.top = '70px';
		document.getElementById("image_9").style.top = '70px';
		document.getElementById("image_10").style.top = '70px';
		document.getElementById("image_11").style.top = '70px';
		document.getElementById("image_12").style.top = '70px';
		document.getElementById("image_rollover").style.top = '70px';
		document.getElementById("image_rollover_2").style.top = '70px';
		
		document.getElementById("content").style.height = '500px';
		
		document.getElementById("content_layer").style.height = '500px';
		
		window.scroll(0,0);
		
	}
	//----------------------------------------------------------------------------
	
	//----------------- NAVIGATION FUNTIONS ---------------------------------------
	function deselectAll(){

		document.getElementById('bershka').style.color = "#9b9386";
		document.getElementById('tattoo').style.color = "#9b9386";
		document.getElementById('cnc').style.color = "#9b9386";
		document.getElementById('adidas_women').style.color = "#9b9386";
		//document.getElementById('adidas_diesel').style.color = "#9b9386";
		document.getElementById('va').style.color = "#9b9386";
		//document.getElementById('topshop').style.color = "#9b9386";
		document.getElementById('eurostar').style.color = "#9b9386";
		document.getElementById('herois').style.color = "#9b9386";
		document.getElementById('adidas_football').style.color = "#9b9386";
		//document.getElementById('montjuic').style.color = "#9b9386";
		document.getElementById('cultura').style.color = "#9b9386";
		document.getElementById('lost').style.color = "#9b9386";
		document.getElementById('absolut_world').style.color = "#9b9386";
		document.getElementById('murmansk').style.color = "#9b9386";

	}


	function selectMe(id){

		deselectAll();
		
		document.getElementById(id).style.color = "#009036";

	}
	//---------------------------------------------------------------------------------
	//----------------- INFO FUNTIONS ---------------------------------------
	function setInfo(info) {
		
		document.getElementById("info").innerHTML = info;
		
	}

	function moveInfo(pos,offset){
		
		document.getElementById("info").style.top = pos +"px";
		document.getElementById("info").style.left = offset +"px";
	
	}
	
	function whiteInfo() {
		
		document.getElementById("info").style.color = "0x464646";
	
	}
	function whiteInfo() {
		
		document.getElementById("info").style.color = "0x464646";
	
	}
	
	//---------------------------------------------------------------------------------
	
	//----------------- VIDEO FUNTIONS ---------------------------------------
	
	function addVideoMontjuic(capa,hpos){
	
		document.getElementById(capa).style.top =  hpos + "px";
	
		document.getElementById(capa).innerHTML = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" name=\"FIBProjectsVideoComponent\" width=\"600\" height=\"434\" align=\"middle\" id=\"FIBVideoObj\"> <param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\"./FIBProjectsVideoComponent.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#000000\" /><PARAM NAME=FlashVars VALUE=\"xml_url=xml/video.xml\">	<embed  id=\"FIBProjectsVideoComponent\" FlashVars=\"xml_url=xml/video.xml\" src=\"./FIBProjectsVideoComponent.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"600\" height=\"434\" name=\"FIBVideoEmbed\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
		
		}
		
		function addVideoNegra(capa,hpos){
	
		document.getElementById(capa).style.top =  hpos + "px";
	
		document.getElementById(capa).innerHTML = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" name=\"FIBProjectsVideoComponent\" width=\"600\" height=\"434\" align=\"middle\" id=\"FIBVideoObj\"> <param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\"./FIBProjectsVideoComponent.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#000000\" /><PARAM NAME=FlashVars VALUE=\"xml_url=xml/bcn_negra.xml\">	<embed  id=\"FIBProjectsVideoComponent\" FlashVars=\"xml_url=xml/bcn_negra.xml\" src=\"./FIBProjectsVideoComponent.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"600\" height=\"434\" name=\"FIBVideoEmbed\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
		
		}
	
	//--------------------------------------------------------------------------------------------

	//------------------------------ IMAGES FUNCTIONS --------------------------------------------

	function nuevaImagen(imagen,pos,capa,id,offset){
		
		var nImage_2 = new Image();
 		
 		nImage_2.onload = function()
		
 			{   
			
				
				
				document.getElementById(capa).style.top =  pos + "px";
				
				document.getElementById(id).src =  nImage_2.src;
				
				centra(capa);
				
				eval(capa).fade(1);
				
				document.getElementById(capa).style.left = offset +"px";
				
			}
 
 		nImage_2.src = "./images/" + imagen;
			
		
	}
	
	function nuevaImagen_rollover(imagen,imagen_over,pos,capa,id,offset,href_value,type){
		
		var nImage_2 = new Image();
 		
 		nImage_2.onload = function()
 			{   
				
  				
				
				document.getElementById(capa).style.top =  pos + "px";
				
				document.getElementById(id).src =  nImage_2.src;
				
				centra(capa);
				
				eval(capa).fade(1);
				
				document.getElementById(capa).style.left = offset +"px";
				
				document.getElementById(id).onmouseover = function (){
				
					document.getElementById(id).src =  "./images/" + imagen_over;
					document.body.style.cursor='pointer';
					
				
				}
				document.getElementById(id).onmouseout = function () {
					
					document.getElementById(id).src =  "./images/" + imagen;
					document.body.style.cursor='default';
					
					
				}
				document.getElementById(id).onmousedown = function () {
					
					document.getElementById(id).src =  "./images/" + imagen_over;
					document.body.style.cursor='default';
					if (type=="new"){
						
						window.open(href_value);
						
						
					}else{
					
						window.location.href=href_value;
					}
					
				}
				
				
				
 			}
			
		
 
 		nImage_2.src = "./images/" + imagen;
			
	
	
		
	}
	
	
	

	function centra(cual) {
		
		var width_now = Math.round((document.body.clientWidth)/2) - (document.getElementById(cual).width/2) - 190  + 36;
	    //var width_now = Math.round((document.body.clientWidth)/2) -parseInt(document.images["content_image"].width/2) -190 + 36;
		//document.getElementById("content_layersub").style.left = width_now + "px";
		
	}
	
	
	function goSwap(TRGT,color,pos) 
	{ 
		
		
		document.getElementById("largeImage").src = "";
		
		
		
		if (color == "white") {   
		
			preloader.innerHTML ="<img src='./images/preloader.gif'>";
			document.getElementById("info").style.color = "#909090";
	
	
		}
		
		if (color == "black") {   
		
			preloader.innerHTML ="<img src='./images/preloader_black.gif'>";
			document.getElementById("info").style.color = "#585858";
			
			
		}
		
 		
		
		
 		
 		preloader.fade(1);
 		var nImage = new Image();
 		
 		nImage.onload = function()
 			{   
				
				preloader.fade(0);
			
				document.getElementById('content_image').src =  nImage.src;
				document.getElementById('image_0').style.top =  pos + "px";
				centra("image_0");
				
				
				
				image_0.fade(1);
				
				info.fade(1);
				
				semaforo = "verde";
				
				
					
				
 			}
 
  		nImage.src = "./images/" + TRGT;
		
	}  
	
	//-------------------------- PANELS FUNCTION ----------------------------------------------
	
	function inPanels () {
	
		panels.fade(1);
		home_image.fade(0);
		quote.fade(0);
	}
	
	function outPanels () {
	
		panels.fade(0);
 		quote.fade(0);
	}
	
	//------------------------------------------------------------------------------------------
	
	
	//-----------------------------------------------------------------------------------------------------------------
	//                            BERSHKA
	//-----------------------------------------------------------------------------------------------------------------
	
	$('bershka').addEvent('click', function(e) {
		
		e.stop();
	   
	   if (semaforo == "verde") {
		
		semaforo="rojo";
	   
	   selectMe('bershka');
	   
	   //top.document.location.replace( raiz_browser+"#bershka" );
	   
	  
	   
	   var x = new Chain(); 
		
		
			
			inPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#ffffff'); 
				resetImages();
				
			}
			tres = function (){
				
				setInfo(" ");
				
				goSwap('bershka/bsk00_combo02.jpg',"white",-40);
				
				
			}
			
			cuatro = function () {
				
				nuevaImagen("bershka/bsk_about_text.gif",560,'image_1',"content_image_1",0);
				nuevaImagen("bershka/bsk01_img_home03.jpg",866,"image_2","content_image_2",0);
				nuevaImagen("bershka/bsk02_img_collection02.jpg",1306,"image_3","content_image_3",0);
				nuevaImagen("bershka/bsk03_img_lookbook01.jpg",1746,"image_4","content_image_4",0);
				nuevaImagen("bershka/bsk03_img_lookbook02.jpg",2186,"image_5","content_image_5",0);
				nuevaImagen("bershka/bsk04_img_nosotros01.jpg",2626,"image_6","content_image_6",0);
				nuevaImagen("bershka/bsk05_img_estilismo02.jpg",3066,"image_7","content_image_7",0);
				nuevaImagen("bershka/bsk05_img_estilismo03.jpg",3506,"image_8","content_image_8",0);
				nuevaImagen("bershka/bsk06_img_myselection01.jpg",3946,"image_9","content_image_9",0);
				nuevaImagen("bershka/bsk06_img_myselection02.jpg",4386,"image_10","content_image_10",0);
				nuevaImagen("bershka/bsk07_img_tiendas01.jpg",4826,"image_11","content_image_11",0);
				moveInfo(-45,0);
				nuevaImagen_rollover("viewsite_fondo_blanco_normal.gif","viewsite_fondo_blanco_rollover.gif",5266,"image_rollover_2","content_image_rollover_2",0,"http://www.bershka.com","new");
				
			}
			
			
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
				x.chain(cuatro);
				
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
				x.callChain.delay(3000, x);
				
	   }
	});
	
	
	
	
	//-----------------------------------------------------------------------------------------------------------------
	//                               ABSOLUT WORLD
	//-----------------------------------------------------------------------------------------------------------------
		
	$('absolut_world').addEvent('click', function(e) {
		
		
		e.stop();
		
		if (semaforo == "verde") {
		
		semaforo = "rojo";
		
		selectMe('absolut_world');
		
		//top.document.location.replace( raiz_browser+"#absolut_world" );
	   	
		var x = new Chain(); 
		
		outPanels();
	
		one = function (){
				
				//content.fade(0);
				
				allDissapears();
				
				
			
			}
		dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
		 
		 
		tres = function (){
				
				setInfo("The following member(s) of <b>five is blue</b> worked on this project whilst at <a href='http://www.greatworks.es' target='_blank' class='info'>Great Works Barcelona<br></a><span class='destacado'>Dylan Inns:</span> Flash Programming of Blog tools and boxes (Kanye West, FlavourPill + Lauren Gropper).");
				goSwap('absolut-world/iaaw_about.gif',"black",-90+45);
				nuevaImagen("absolut-world/iaaw_logo.jpg",130+45-70,'image_1',"content_image_1",0);
				//nuevaImagen_rollover("tattoo/tattoo_contact.gif","tattoo/tattoo_contact_rollover.gif",430+45-70,"image_2","content_image_2",113);
				moveInfo(605+26-70,0);
				nuevaImagen_rollover("viewsite_off.gif","viewsite_on.gif",640+45-95,"image_rollover_2","content_image_rollover_2",0,"http://www.absolut.com/iaaw/es","new");
				
				
			}
		four = function () {
			
				nuevaImagen_rollover("absolut-world/iaaw_contact.gif","absolut-world/iaaw_contact_rollover.gif",430+45-70,"image_rollover","content_image_rollover",113,"mailto:info@fiveisblue.com");
			
		}
			
			
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
				x.chain(four);
                x.callChain();
                x.callChain.delay(800, x); 
				x.callChain.delay(2000, x);
				x.callChain.delay(4000, x);
					
					}
				
	});
	
	
	
	
	
	//-----------------------------------------------------------------------------------------------------------------
	//                               TATTOO
	//-----------------------------------------------------------------------------------------------------------------
		
	$('tattoo').addEvent('click', function(e) {
		
		
		e.stop();
		
		
		
		if (semaforo == "verde") {
		
		semaforo = "rojo";
		
		selectMe('tattoo');
		
		//top.document.location.replace( raiz_browser+"#tattoo" );
	   	
	   	var x = new Chain(); 
		
		
		
		 
	
		inPanels();
	
		one = function (){
				
				//content.fade(0);
				
				allDissapears();
				
				
			
			}
		dos = function (){
				
				ColorEff.start('background-color', '#ffffff'); 
				resetImages();
				
			}
		 
		 
		tres = function (){
				
				setInfo("The following member(s) of <b>five is blue</b> worked on this project whilst at <a href='http://www.greatworks.es' target='_blank' class='info_white'>Great Works Barcelona<br></a><span class='destacado'>Dylan:</span> Flash Programming + Technical lead  / <span class='destacado'>Dani:</span> Flash Programming / <span class='destacado'>Brie:</span> Art Direction, Design + Animation.");
				goSwap('tattoo/tattoo_about.gif',"white",-90+45);
				nuevaImagen("tattoo/tattoo_logo.jpg",130+45-70,'image_1',"content_image_1",0);
				//nuevaImagen_rollover("tattoo/tattoo_contact.gif","tattoo/tattoo_contact_rollover.gif",430+45-70,"image_2","content_image_2",113);
				moveInfo(605+26-70,0);
				//nuevaImagen_rollover("viewsite_off_w.gif","viewsite_on_w.gif",640+45-95,"image_rollover_2","content_image_rollover_2",0,"http://www.absolut.com","new");
				
				
			}
		four = function () {
			
				nuevaImagen_rollover("tattoo/tattoo_contact.gif","tattoo/tattoo_contact_rollover.gif",430+45-70,"image_rollover","content_image_rollover",113,"mailto:info@fiveisblue.com");
			
		}
			
			
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
				x.chain(four);
                x.callChain();
                x.callChain.delay(800, x); 
				x.callChain.delay(2000, x);
				x.callChain.delay(4000, x);
					
					}
				
	});
	

	
	//-----------------------------------------------------------------------------------------------------------------
	//                               CNC
	//-----------------------------------------------------------------------------------------------------------------
	
	$('cnc').addEvent('click', function(e) {
		
		e.stop();
		
		if (semaforo == "verde") {
		
			semaforo="rojo";
		
			selectMe('cnc');
			
			//top.document.location.replace( raiz_browser+"#cnc" );
		
	    	var x = new Chain(); 
		
			outPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
			tres = function (){
				
				
				setInfo("The following member(s) of <b>five is blue</b> worked on this project whilst at <a href='http://www.greatworks.es' target='_blank' class='info'>Great Works Barcelona<br></a><span class='destacado'>Brie:</span> Art direction + Design + IA / <span class='destacado'>Dani:</span> Flash Programming + Technical direction + IA");
				goSwap('cnc/cnc_about.gif',"black",-90+45);
				nuevaImagen("cnc/cnc_logo.jpg",130+45,'image_1',"content_image_1",0);
				//nuevaImagen_rollover("cnc/cnc_contact.gif","cnc/cnc_contact_rollover.gif",430+45,"image_2","content_image_2",113);
				moveInfo(605+26,0);
				//nuevaImagen_rollover("viewsite_off.gif","viewsite_on.gif",640+20,"image_rollover_2","content_image_rollover_2",0,"http://www.absolut.com","new");
				
			}
			
			four = function () {
				
				nuevaImagen_rollover("cnc/cnc_contact.gif","cnc/cnc_contact_rollover.gif",430+45,"image_rollover","content_image_rollover",113,"mailto:info@fiveisblue.com");
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
				x.chain(four);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
				x.callChain.delay(4000, x);
	
		}
	
	});
		
	//-----------------------------------------------------------------------------------------------------------------
	//                               BACARDI MURMANSK ROUTE
	//-----------------------------------------------------------------------------------------------------------------
		
	$('murmansk').addEvent('click', function(e) {
		
		
		e.stop();
		
		
		
		if (semaforo == "verde") {
		
		semaforo = "rojo";
		
		selectMe('murmansk');
		
		//top.document.location.replace( raiz_browser+"#bacardi-murmansk-route" );
	   	
	   	var x = new Chain(); 
		
		outPanels();
	
		one = function (){
				
				//content.fade(0);
				
				allDissapears();
				
				
			
			}
		dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
		 
		 
		tres = function (){
				
				setInfo("The following member(s) of <b>five is blue</b> worked on this project whilst at <a href='http://www.greatworks.es' target='_blank' class='info'>Great Works Barcelona<br></a><span class='destacado'>Brie:</span> Art direction / <span class='destacado'>Dani:</span> Back-end development / <span class='destacado'>Dylan:</span> Flash programming for phase 2.");
				goSwap('bacardi/bacardi_about.gif',"black",-90+45);
				nuevaImagen("bacardi/bacardi_logo.jpg",130+45+30,'image_1',"content_image_1",0);
				//nuevaImagen_rollover("tattoo/tattoo_contact.gif","tattoo/tattoo_contact_rollover.gif",430+45-70,"image_2","content_image_2",113);
				moveInfo(605+26+30,0);
				//nuevaImagen_rollover("viewsite_off.gif","viewsite_on.gif",640+45+5,"image_rollover_2","content_image_rollover_2",0,"http://www.murmanskroute.com","new");
				
				
			}
		four = function () {
			
				nuevaImagen_rollover("bacardi/bacardi_contact.gif","bacardi/bacardi_contact_rollover.gif",430+45+30,"image_rollover","content_image_rollover",113,"mailto:info@fiveisblue.com");
			
		}
			
			
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
				x.chain(four);
                x.callChain();
                x.callChain.delay(800, x); 
				x.callChain.delay(2000, x);
				x.callChain.delay(4000, x);
					
					}
				
	});

	
	//-----------------------------------------------------------------------------------------------------------------
	//                               ADIDAS WOMEN
	//-----------------------------------------------------------------------------------------------------------------
	
	$('adidas_women').addEvent('click', function(e) {
		
		
		e.stop();
		
		if (semaforo == "verde") {
		
		semaforo="rojo";
		
		selectMe('adidas_women');
		
		//top.document.location.replace( raiz_browser+"#adidas_women" );
		
	    var x = new Chain(); 
		
		
			
			outPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
			tres = function (){
				
				setInfo("Flash programming for the <span class='destacado'>adidas Women's </span>global website.<br />Agency: de-construct London.");
				
				goSwap('adidas-women/adidas_women00_combo.jpg',"black",0);
				nuevaImagen("adidas-women/adidas_women01_img.jpg",650,'image_1',"content_image_1",0);
				nuevaImagen("adidas-women/adidas_women02_img.jpg",1090,"image_2","content_image_2",0);
				nuevaImagen("adidas-women/adidas_women03_img.jpg",1530,"image_3","content_image_3",0);
				nuevaImagen("adidas-women/adidas_women04_img.jpg",1970,"image_4","content_image_4",0);
				nuevaImagen("adidas-women/adidas_women05_img.jpg",2410,"image_5","content_image_5",0);
				moveInfo(585,0);
				
				
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
	
		}
	
	});
												 
	
	//-----------------------------------------------------------------------------------------------------------------
	//                               ADIDAS DIESEL
	//-----------------------------------------------------------------------------------------------------------------
	
	/*$('adidas_diesel').addEvent('click', function(e) {
		e.stop();
	    
		if (semaforo == "verde") {
		
		semaforo="rojo";
		
		selectMe('adidas_diesel');
		
		var x = new Chain(); 
		
		
			
			inPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#ffffff'); 
				resetImages();
				
			}
			tres = function (){
				
				setInfo("Concept, UX and social media advisor for <span class='destacado'>adidas & Diesel's</span> <br />\"83 original ways to successfully waste your time\" campaign. Agency: Sid Lee Montreal.");
				
				goSwap('adidas-diesel/adidas_diesel00_combo.jpg',"white",0);
				nuevaImagen("adidas-diesel/adidas_diesel01_img.jpg",670,'image_1',"content_image_1",0);
				nuevaImagen("adidas-diesel/adidas_diesel02_img.jpg",1110,"image_2","content_image_2",0);
				nuevaImagen("adidas-diesel/adidas_diesel03_img.jpg",1550,"image_3","content_image_3",0);
				nuevaImagen("adidas-diesel/adidas_diesel04_img.jpg",1990,"image_4","content_image_4",0);
				nuevaImagen("adidas-diesel/adidas_diesel05_img.jpg",2430,"image_5","content_image_5",0);
				nuevaImagen("adidas-diesel/adidas_diesel06_img.jpg",2870,"image_6","content_image_6",0);
				//addVideo("image_4");
				moveInfo(605,0);
				
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
				
		}
				
	});
	*/
	
												  
	//-----------------------------------------------------------------------------------------------------------------
	//                               EUROSTAR
	//-----------------------------------------------------------------------------------------------------------------
	
	$('eurostar').addEvent('click', function(e) {
		e.stop();
	   
	   if (semaforo == "verde") {
		
		semaforo="rojo";
	   
	   	selectMe('eurostar');
		
		//top.document.location.replace( raiz_browser+"#eurostar" );
	   
	   var x = new Chain(); 
		
		
			
			outPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
			tres = function (){
				
				
				setInfo("Concept development and flash programming for competition games in the <span class='destacado'>Eurostar Da Vinci Code</span>,<br /> \"Join the Quest\" campaign. Agency: de-construct London.");
				

				
				goSwap('eurostar/eurostar00_combo.jpg',"black",0);
				nuevaImagen("eurostar/eurostar01_large.jpg",650,'image_1',"content_image_1",-100);
				nuevaImagen("eurostar/eurostar03_img.jpg",1290,"image_2","content_image_2",0);
				nuevaImagen("eurostar/eurostar04_img.jpg",1730,"image_3","content_image_3",0);
				nuevaImagen("eurostar/eurostar05_img.jpg",2130,"image_4","content_image_4",0);
				nuevaImagen("eurostar/eurostar06_img.jpg",2570,"image_5","content_image_5",0);
				moveInfo(1230,0);
				
				
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
				
	   }
	});
	
	
	//-----------------------------------------------------------------------------------------------------------------
	//                              ADIDAS FOOTBALL
	//-----------------------------------------------------------------------------------------------------------------
	
	$('adidas_football').addEvent('click', function(e) {
		e.stop();
	   
	   if (semaforo == "verde") {
		
		semaforo="rojo";
	   
	   selectMe('adidas_football');
	   
	   //top.document.location.replace( raiz_browser+"#adidas_football" );
	   
	   var x = new Chain(); 
		
		
			
			inPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#ffffff'); 
				resetImages();
				
			}
			tres = function (){
				
				setInfo("Flash development for the global <span class='destacado'>adidas Football</span> site.<br />Agency: de-construct");
				
				goSwap('adidas-football/adidas_football01_img.jpg',"white",20);
				nuevaImagen("adidas-football/adidas_football02_img.jpg",460,'image_1',"content_image_1",0);
				nuevaImagen("adidas-football/adidas_football03_img.jpg",900,"image_2","content_image_2",0);
				nuevaImagen("adidas-football/adidas_football04_img.jpg",1340,"image_3","content_image_3",0);
				nuevaImagen("adidas-football/adidas_football05_img.jpg",1780,"image_4","content_image_4",0);
				nuevaImagen("adidas-football/adidas_football06_img.jpg",2220,"image_5","content_image_5",0);
				nuevaImagen("adidas-football/adidas_football07_img.jpg",2660,"image_6","content_image_6",0);
				moveInfo(-45,0);
				
				
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
				
	   }
	});
	
	
	//-----------------------------------------------------------------------------------------------------------------
	//                              V&A
	//-----------------------------------------------------------------------------------------------------------------
	
	
	$('va').addEvent('click', function(e) {
		e.stop();
	    
		if (semaforo == "verde") {
		
		semaforo="rojo";
		
		selectMe('va');
		
		//top.document.location.replace( raiz_browser+"#v&a" );
		
		var x = new Chain(); 
		
			inPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#ffffff'); 
				resetImages();
				
				
			}
			tres = function (){
				
				setInfo("Art direction & design an IA for <span class='destacado'>Victoria & Albert Museum's</span> shop site.<br>Agency: Cabinet UK.");
				goSwap('va/va00_combo.jpg',"white",0);
				nuevaImagen("va/va01_img.jpg",670,'image_1',"content_image_1",0);
				nuevaImagen("va/va02_img.jpg",1110,"image_2","content_image_2",0);
				nuevaImagen("va/va03_img.jpg",1550,"image_3","content_image_3",0);
				nuevaImagen("va/va04_img.jpg",1990,"image_4","content_image_4",0);
				nuevaImagen("va/va05_img.jpg",2430,"image_5","content_image_5",0);
				nuevaImagen("va/va06_img.jpg",2870,"image_6","content_image_6",0);
				nuevaImagen("va/va07_img.jpg",3310,"image_7","content_image_7",0);
				moveInfo(605,0);
				
				
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
				
		}
	});
	
	//-----------------------------------------------------------------------------------------------------------------
	//                               HEROIS DE BARCELONA
	//-----------------------------------------------------------------------------------------------------------------
	
	$('herois').addEvent('click', function(e) {
		e.stop();
	    
		if (semaforo == "verde") {
		
		semaforo="rojo";
		
		selectMe('herois');
		
		//top.document.location.replace( raiz_browser+"#herois-barcelona" );
		
		var x = new Chain(); 
		
		
			
			inPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#ffffff'); 
				resetImages();
				
			}
			tres = function (){
				
				setInfo("The following member(s) of <b>five is blue</b> worked on this project whilst at <a href='http://www.greatworks.es' target='_blank' class='info_white'>Great Works Barcelona<br></a><span class='destacado'>Dani: </span>Technical direction and Back-end development ");
				goSwap('herois/herois_about.gif',"white",-90+45);
				nuevaImagen("herois/herois_logo.jpg",130+45-70,'image_1',"content_image_1",0);
				//nuevaImagen_rollover("herois/herois_contact.gif","herois/herois_contact_rollover.gif",430+45-70,"image_2","content_image_2",113);
				moveInfo(605+26-70,0);
				//nuevaImagen_rollover("viewsite_off_w.gif","viewsite_on_w.gif",640+45-95,"image_rollover_2","content_image_rollover_2",0);
				
				
			}
			
			four = function () {
				
				nuevaImagen_rollover("herois/herois_contact.gif","herois/herois_contact_rollover.gif",430+45-70,"image_rollover","content_image_rollover",113,"mailto:info@fiveisblue.com");
			
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
				x.chain(four);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
				x.callChain.delay(4000, x);
				
		}
	});
	
	
		//-----------------------------------------------------------------------------------------------------------------
	//                               MONTJUIC
	//-----------------------------------------------------------------------------------------------------------------
	
	/*
	$('montjuic').addEvent('click', function(e) {
		e.stop();
	    
		if (semaforo == "verde") {
		
		semaforo="rojo";
		
		selectMe('montjuic');
		
		var x = new Chain(); 
		
		
			
			outPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
			tres = function (){
				
				setInfo("Concept, art direction and production for <span class='destacado'>Institut de Cultura</span>. <br>Montju&iuml;c de Nit was a guerrilla event to generate online conversations in order to promote the night. <br>Agency: Great Works Barcelona.");
				
				goSwap('montjuic/monjuic01_img.jpg',"black",40);
				addVideoMontjuic('video_1',40);
				nuevaImagen("montjuic/monjuic02_img.jpg",480,'image_2',"content_image_2",0);
				nuevaImagen("montjuic/monjuic03_img.jpg",920,"image_3","content_image_3",0);
				
				moveInfo(-45,0);
				
				
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
		}
	});
	
	*/
	
	
	//-----------------------------------------------------------------------------------------------------------------
	//                              VIU LA CULTURA
	//-----------------------------------------------------------------------------------------------------------------
		
	$('cultura').addEvent('click', function(e) {
		
		
		e.stop();
		
		
		
		if (semaforo == "verde") {
		
		semaforo = "rojo";
		
		selectMe('cultura');
		
		//top.document.location.replace( raiz_browser+"#viu-cultura" );
	   	
	   	var x = new Chain(); 
		
		
		
		 
	
		outPanels();
	
		one = function (){
				
				//content.fade(0);
				
				allDissapears();
				
				
			
			}
		dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
		 
		 
		tres = function (){
				
				setInfo("The following member(s) of <b>five is blue</b> worked on this project whilst at <a href='http://www.greatworks.es' target='_blank' class='info'>Great Works Barcelona<br></a><span class='destacado'>Dani:</span> Technical direction and back-end development.");
				goSwap('cultura/viu_about.gif',"black",-90+45);
				nuevaImagen("cultura/viu_logo.jpg",130+45+90,'image_1',"content_image_1",0);
				//nuevaImagen_rollover("tattoo/tattoo_contact.gif","tattoo/tattoo_contact_rollover.gif",430+45-70,"image_2","content_image_2",113);
				moveInfo(605+26+90,0);
				//nuevaImagen_rollover("viewsite_off.gif","viewsite_on.gif",640+45+65,"image_rollover_2","content_image_rollover_2",0,"","new");
				
				
			}
		four = function () {
			
				nuevaImagen_rollover("cultura/viu_contact.gif","cultura/viu_contact_rollover.gif",430+45+90,"image_rollover","content_image_rollover",113,"mailto:info@fiveisblue.com");
			
		}
			
			
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
				x.chain(four);
                x.callChain();
                x.callChain.delay(800, x); 
				x.callChain.delay(2000, x);
				x.callChain.delay(4000, x);
					
					}
				
	});
	
	
	//-----------------------------------------------------------------------------------------------------------------
	//                               LOST
	//-----------------------------------------------------------------------------------------------------------------
	
	$('lost').addEvent('click', function(e) {
		e.stop();
	    
		if (semaforo == "verde") {
		
		semaforo="rojo";
		
		selectMe('lost');
		
		//top.document.location.replace( raiz_browser+"#lost" );
		
		var x = new Chain(); 
		
			
			
			outPanels();
			
			one = function (){
				allDissapears();
			}
			dos = function (){
				
				ColorEff.start('background-color', '#000000'); 
				resetImages();
				
			}
			tres = function (){
				
				setInfo("Art direction & design of the \"Lost\" website for UK's <span class='destacado'>Channel 4.</span> Flash design, programming and audio for homepage.<br>Agency: Hi-ReS!");
				
				goSwap('lost/lost01_img.jpg',"black",40-20);
				nuevaImagen("lost/lost02_img.jpg",480-18,'image_1',"content_image_1",0);
				nuevaImagen("lost/lost03_img.jpg",920-18,"image_2","content_image_2",0);
				nuevaImagen("lost/lost04_img.jpg",1360-18,"image_3","content_image_3",0);
				nuevaImagen("lost/lost05_img.jpg",1800-18,"image_4","content_image_4",0);
				nuevaImagen("lost/lost06_img.jpg",2240-18,"image_5","content_image_5",0);
				nuevaImagen("lost/lost07_img.jpg",2680-18,"image_6","content_image_6",0);
				nuevaImagen("lost/lost08_img.jpg",3120-18,"image_7","content_image_7",0);
				nuevaImagen("lost/lost09_img.jpg",3560-18,"image_8","content_image_8",0);
				
				moveInfo(-45,0);
				
				
				
			}
			 
			 	x.chain(one);
                x.chain(dos);
				x.chain(tres);
                x.callChain();
				x.callChain.delay(800, x);
				x.callChain.delay(2000, x);
		}
	});
	
	
});