// JavaScript Document
$(document).ready(function(){
				  cargarSWF("header",400,1000);
				  cargarSWF("news",150,1000);
				  cargarSWF("hacemos",350,500);
				  cargarSWF("showSticker",350,500);
				  cargarSWF("creemos",200,1000);
				   cargarSWF("contacto",200,1000);
				   cargarSWF("somos",150,1000);
				    cargarSWF("artDirection",750,1000);
					 cargarSWF("graCom",750,1000);
					  cargarSWF("idSys",750,1000);
					  cargarSWF("phDaily",1000,1000);
					   cargarSWF("footer",450,1000);
					   doTimer();
						$('#showSticker').width($('#showSticker').children().length*500);
					   $('#mapa_google').fancybox(
												  
												  {'onStart':function(){
													  $('#mapa_google').css('display','block');
													 					 },
													'onCleanup':function(){
													  $('#mapa_google').css('display','none');
													 					 }					 
													  }
													  );
						
						   });

function cargarSWF(swfName,h,w){
	var flashvars = {};

	var params = {};
	params.wmode="transparent";
	
	var attributes = {};
	
	var movieName = swfName+".swf";
	var movieID = swfName+"Swf";
	
	swfobject.embedSWF( movieName, movieID, w, h, "9.0.0","js/swfObject/expressInstall.swf", flashvars, params, attributes);

}
function abrir_mapa(){
	 $('#mapa_google').trigger('click');
	}
	
function abrir_vimeo(l){
	$.fancybox(l,{'autoDimensions'	: true});
	}
	
	
var t;
var timer_is_on=0;
var fotoA=1;
 var n=0;
 var k=0;
function timedCount()
{	if (timer_is_on){
	if(fotoA < k){
		
		$('#showSticker').animate({"left": "-=500px"}, 0);
		fotoA++;
	}else{
		$('#showSticker').animate({"left": 0}, 0);
		fotoA=1;
		}
	//fotoA == 6 ? fotoA=1 : fotoA++;
	t=setTimeout("timedCount()",100);
}
}

function doTimer()
{
	k=$('#showSticker').children().length;
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount();
  }}
