jQuery.fn.reset = function () {
  $(this).each (function() { this.reset(); });
}

function load(){

  var point = new google.maps.LatLng(19.417944,-99.165234);

  var myMapOptions = {
    zoom: 18,
    center: point,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  };

  var map = new google.maps.Map(document.getElementById("elmapa"),myMapOptions);

  var image = new google.maps.MarkerImage(
    'img/assets/marcador.png',
    new google.maps.Size(32,49),
    new google.maps.Point(0,0),
    new google.maps.Point(16,49)
  );

  var shadow = new google.maps.MarkerImage(
    'img/assets/shadow.png',
    new google.maps.Size(60,49),
    new google.maps.Point(0,0),
    new google.maps.Point(16,49)
  );

  var shape = {
    coord: [21,0,23,1,25,2,26,3,27,4,28,5,29,6,29,7,30,8,30,9,31,10,31,11,31,12,31,13,31,14,31,15,31,16,31,17,31,18,31,19,31,20,30,21,30,22,30,23,29,24,29,25,28,26,28,27,27,28,27,29,27,30,26,31,25,32,25,33,24,34,24,35,23,36,23,37,22,38,22,39,21,40,21,41,20,42,19,43,19,44,18,45,17,46,17,47,16,48,15,48,14,47,14,46,13,45,12,44,12,43,11,42,10,41,10,40,9,39,9,38,8,37,8,36,7,35,7,34,6,33,6,32,5,31,4,30,4,29,4,28,3,27,3,26,2,25,2,24,1,23,1,22,1,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,1,9,1,8,2,7,2,6,3,5,4,4,5,3,6,2,8,1,10,0,21,0],
    type: 'poly'
  };

  var marker = new google.maps.Marker({
    draggable: true,
    raiseOnDrag: false,
    icon: image,
    shadow: shadow,
    shape: shape,
    map: map,
    position: point
  });

}

$(document).ready(function() {


    
// Secciones que se cargan via DOM

//jQuery("#clients").load("new_slider.html");
jQuery("#slide").load("slide-clientes.html");
//jQuery("#mapaZetabe").load("maps.html");
//jQuery(".footer").load("footer.html");
//jQuery("servicios").load("servicios.html");
//jQuery("#parallax").load("parallaxCompleto.html");



// fecto de fade en hover

	jQuery('.linkedin, .facebook, .twitter').blend(600);
	
// Detecta el evento MOUSEWHEEL en el slider doble
	jQuery("#wrapper_slider").mousewheel(function(objEvent, intDelta){
			    if (intDelta > 0){
			       //intOverallDelta++;
				   $('#slider').data('AnythingSlider').goBack();
				   $('#slider2').data('AnythingSlider').goBack();
				}
			    else if (intDelta < 0){
					//intOverallDelta--;
			       $('#slider').data('AnythingSlider').goForward();
				   $('#slider2').data('AnythingSlider').goForward();

				}
			});
// SLIDER DOBLE
		
//----- parte 1		
		
		$('#slider').anythingSlider({

    buildNavigation: false,
	buildArrows         : false,  
    autoPlay: true,
	delay               : 10000,     
  animationTime       : 600, 
  pauseOnHover        : false,
  stopAtEnd           : false,
  startStopped        : false, 
  easing              : "swing",
  autoPlayLocked	: true,
  height		: null,
  width :			null,

});
	



jQuery('#externalNav input.nxt').click(function(){
false;
	
	$('#slider').data('AnythingSlider').goForward();
});
jQuery('#externalNav input.fwd').click(function(){
	
	$('#slider').data('AnythingSlider').goBack();
});


//----- parte 2


jQuery('#slider2').anythingSlider({
    buildNavigation: false,
	buildArrows         : false,  
    autoPlay: true,
	playRtl             : true,
	delay               : 10000,     
  animationTime       : 600, 
  pauseOnHover        : false,
  stopAtEnd           : false, 
  startStopped        : false,
  easing              : "swing",
  autoPlayLocked		: true,
  height		: null,
  width :			null,

});

// api externa del SLIDER DOBLE

jQuery('#externalNav input.nxt').click(function(){
	$('#slider2').data('AnythingSlider').goForward();
});
jQuery('#externalNav input.fwd').click(function(){
	$('#slider2').data('AnythingSlider').goBack();
});

// Botones del SLIDER DOBLE
jQuery('#wrapper_slider, #externalNav').hover(function(){
	$('#externalNav').stop(true, true).animate( {opacity: 1},500)
	})
	$('#wrapper_slider, #externalNav').mouseleave(function(){
	$('#externalNav').stop(true, true).animate( {opacity: .1},120)
	})
});



jQuery(document).ready(function() {	

// Boton en el logo de INICIO


$(".zb_welcome_down").mousedown(
		function()
		{
      		$(".zb_welcome_down").css('cursor',"url(img/circulo/closedHand.png), pointer");
    	}
	).mouseup(
		function()
		{
			$(".zb_welcome_down").css('cursor',"url(img/circulo/hand.png), pointer");
		}
	);


	// MENÚ general	

// CLIENTES	

jQuery(".zb_welcome_down").click(function(){
	jQuery(".mainContainers").slideUp(1200, 'easeInBack', function() {
	});
	
jQuery('#containerClientes').fadeIn(1200, function(){
	      jQuery("#containerClientes").animate({ top : "0px", opacity:1} ,1400, 'easeInQuad');
	   });
  });
/*  
 jQuery("#header .logo").click(function(){
	jQuery(".mainContainers").slideUp(1200, 'easeInBack', function() {
	});
	
jQuery('#containerClientes').fadeIn(1200, function(){
	      jQuery("#containerClientes").animate({ top : "0px", opacity:1} ,1400, 'easeInQuad');
	   });
  }); 
  
// AGENCIA
jQuery(".agencia").click(function(){
	jQuery(".mainContainers").slideUp(1200, 'easeInBack', function() {
	});
	
jQuery('#containerAgencia').fadeIn(1200, function(){
	      jQuery("#containerAgencia").animate({ top : "0px", opacity:1} ,1400, 'easeInQuad');
	   });
  });
// SERVICIOS 
jQuery(".servicios").click(function(){
	jQuery(".mainContainers").slideUp(1200, 'easeInBack', function() {
	});
	
jQuery('#containerServicios').fadeIn(1200, function(){
	      jQuery("#containerServicios").animate({ top : "0px", opacity:1} ,1400, 'easeInQuad');
	   });
  });
// Proyectos 
jQuery(".proyectos").click(function(){
	jQuery(".mainContainers").slideUp(1200, 'easeInBack', function() {
	});
	
jQuery('#containerProyectos').fadeIn(1200, function(){
	      jQuery("#containerProyectos").animate({ top : "0px", opacity:1} ,1400, 'easeInQuad');
	   });
  });
// CONTACTO 
jQuery(".contacto").click(function(){
	jQuery(".mainContainers").slideUp(1200, 'easeInBack', function() {
	});
	
jQuery('#containerContacto').fadeIn(1200, function(){
	      jQuery("#containerContacto").animate({ top : "0px", opacity:1} ,1400, 'easeInQuad');
	   });
  }); */

});

//-- TWITTER

 // ---- img resizer
var imgSizer = {
	Config : {
		imgCache : []
		//,spacer : "algo.gif"
	}

	,collate : function(aScope) {
		var isOldIE = (document.all && !window.opera && !window.XDomainRequest) ? 1 : 0;
		if (isOldIE && document.getElementsByTagName) {
			var c = imgSizer;
			var imgCache = c.Config.imgCache;

			var images = (aScope && aScope.length) ? aScope : document.getElementsByTagName("img");
			for (var i = 0; i < images.length; i++) {
				images[i].origWidth = images[i].offsetWidth;
				images[i].origHeight = images[i].offsetHeight;

				imgCache.push(images[i]);
				c.ieAlpha(images[i]);
				images[i].style.width = "100%";
			}

			if (imgCache.length) {
				c.resize(function() {
					for (var i = 0; i < imgCache.length; i++) {
						var ratio = (imgCache[i].offsetWidth / imgCache[i].origWidth);
						imgCache[i].style.height = (imgCache[i].origHeight * ratio) + "px";
					}
				});
			}
		}
	}

	,ieAlpha : function(img) {
		var c = imgSizer;
		if (img.oldSrc) {
			img.src = img.oldSrc;
		}
		var src = img.src;
		img.style.width = img.offsetWidth + "px";
		img.style.height = img.offsetHeight + "px";
		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
		img.oldSrc = src;
		img.src = c.Config.spacer;
	}

	// Ghettomodified version of Simon Willison's addLoadEvent() -- http://simonwillison.net/2004/May/26/addLoadEvent/
	,resize : function(func) {
		var oldonresize = window.onresize;
		if (typeof window.onresize != 'function') {
			window.onresize = func;
		} else {
			window.onresize = function() {
				if (oldonresize) {
					oldonresize();
				}
				func();
			}
		}
	}
}

addLoadEvent(function() {
	imgSizer.collate();
});

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
} 

// Formulario
function enviarMail()
{
    
    
    $.ajax({
              url     : 'mail.php',
              type    : "POST",
              data    : $("#formContact").serialize(),
              success : function(data) 
              {
                if(data==1)
                {
                   // window.location.href = 'contacto';
				  $("#formContact").reset();
				   
                }
                else
                {
                    alert(data);
                }
              }
            });
    
}
// TWITTER
jQuery(document).ready(function() {	
jQuery('.boastful').boastful({
      location: 'http://www.zetabe.com/',
      limit: 18,
      empty_message: 'No hay tuits :('
    });
	// hide #back-top first
	jQuery(".gotoTop").hide();
	
	// fade in #back-top
	jQuery(function () {
		jQuery(window).scroll(function () {
			if (jQuery(this).scrollTop() > 400) {
				jQuery('.gotoTop').fadeIn();
			} else {
				jQuery('.gotoTop').fadeOut();
			}
		});

		// scroll body to 0px on click
		jQuery('.gotoTop').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});
});
// Barra DRAGABLE

function moverBarra2(pos)
{
	$( "#barraDrag" ).animate({'left': pos+'px'}, tiempo,'easeOutBounce');
}

function inicioServicios()
{
	moverBarra2(200);
	resetearCirculos();
	$(".textoBarra").html("Inicio");
	$("#infoInicio").fadeIn('slow');
	
}
	tiempo = 1000;
	tam = 118;
$(document).ready(function (){
	


	//-------------variables para la barrita pikada-----------
	moverBarra2(200);
	
	$("#barraDrag").mousedown(
		function()
		{
      		$("#barraDrag").css('cursor',"url('img/circulo/closedHand.png'), pointer");
    	}
	).mouseup(
		function()
		{
			$("#barraDrag").css('cursor',"url('img/circulo/hand.png'), pointer");
		}
	);

	
	$( "#barraDrag" ).draggable({ 
		axis: 'x',
		containment: 'barraHorizontal',
		snapMode: 'inner',
		stop: function(event, ui) { 
		
			tam14 = (tam/4);

			position = $( "#barraDrag" ).position();
			if( position.left > -1000000 && position.left<(tam14*3)+200 )
			{
				inicioServicios();
				//$( "#barraDrag" ).html('<span class="textoBarra">INICIO</span>');
				//$( "#barraDrag" ).animate({'left': (tam*0)+'px'}, tiempo,'easeOutBounce');
			}else
			if( position.left > tam && position.left<(tam14*7)+200 )
			{
				showBLOGS();
				
				//$( "#barraDrag" ).html('<span class="textoBarra">LANDING</span>');
				//$( "#barraDrag" ).animate({'left': (tam*1)+'px'}, tiempo,'easeOutBounce');
			}
			else
			if( position.left > (tam14*7)+200 && position.left<(tam14*11)+200 )
			{
				showMOBILE();
				
				//$( "#barraDrag" ).animate({'left': (tam*2)+'px'}, tiempo,'easeOutBounce');
			}else
			if( position.left > (tam14*11)+200 && position.left<(tam14*15)+200 )
			{
				showCRM();
				
				//$( "#barraDrag" ).animate({'left': (tam*3)+'px'}, tiempo,'easeOutBounce');
			}else
			if( position.left > (tam14*15)+200 && position.left<(tam14*19)+200 )
			{
				showDIGITALPR();
				
			}else
			if( position.left > (tam14*19)+200 && position.left<(tam14*23)+200 )
			{
				showSOCIALMEDIA();
				
				//$( "#barraDrag" ).animate({'left': (tam*5)+'px'}, tiempo,'easeOutBounce');
			}else
			if( position.left > (tam14*23)+200 && position.left<(tam14*27)+200 )
			{
				showPAUTA();
				
				//$( "#barraDrag" ).animate({'left': (tam*6)+'px'}, tiempo,'easeOutBounce');
			}else
			if( position.left > (tam14*27)+200 && position.left<(tam14*10000) )
			{
				showSearch();
				
				//$( "#barraDrag" ).animate({'left': (tam*7)+'px'}, tiempo,'easeOutBounce');
			}
		}
	});
});
	// FUNCIONES DE BARRA DRAGABLE

	function resetearCirculos()
	{
		$(".subItem").fadeOut('slow');
		$(".circulosprincipales").removeClass("circulosprincipalesClickeado");
		$(".subItem").css('top','16px');
		$(".subItem").css('left','16px');
		$(".ocultaInfo").css('display', 'none');
	}

	function showSearch()
	{
		resetearCirculos();
		moverBarra2(1026);
		$('#SEO').fadeIn(500);
		$('#SEM').fadeIn(500);
		$('#SEO').animate({left:'-100px'},1000);
		$('#SEM').animate({top:'-100px'},1000);
		$('#search').addClass("circulosprincipalesClickeado");
		$('#infoSearch').fadeIn(500);
		$(".textoBarra").html("SEARCH");
		$("#infoInicio").css('display', 'none');
	}
	
	function showCRM()
	{
		resetearCirculos();
		moverBarra2(554);
		$('#nwLet').fadeIn(500);
		$('#nwSMS').fadeIn(500);
		$('#nwLet').animate({left:'150px'},1000);
		$('#nwSMS').animate({top:'150px', left:'75px',},1000);
		$('#crm').addClass("circulosprincipalesClickeado");
		$('#infoCRM').fadeIn(500);
		$(".textoBarra").html("CRM");
		$("#infoInicio").css('display', 'none');
	}
	
	function showBLOGS()
	{
		resetearCirculos();
		moverBarra2(318);
		$('#blogs').fadeIn(500);
		$('#blogs').animate({top:'-100px'},1000);
		$('#landing').addClass("circulosprincipalesClickeado");
		$('#infoBlogs').fadeIn(500);
		$(".textoBarra").html("LANDING");
		$("#infoInicio").css('display', 'none');
	}
	
	function showMOBILE()
	{
		resetearCirculos();
		moverBarra2(436);
		$('#apps').fadeIn(500);
		$('#apps').animate({top:'-100px'},1000);
		$('#mobileSite').fadeIn(500);
		$('#mobileSite').animate({left:'150px'},1000);
		$('#mobile').addClass("circulosprincipalesClickeado");
		$('#infoMobile').fadeIn(500);
		$(".textoBarra").html("MOBILE");
		$("#infoInicio").css('display', 'none');
	}
	
	function showPAUTA()
	{
		resetearCirculos();
		moverBarra2(908);
		$('#pauta').addClass("circulosprincipalesClickeado");
		$('#infoPauta').fadeIn(500);
		$(".textoBarra").html("PAUTA");
		$("#infoInicio").css('display', 'none');
	}
	
	function showSOCIALMEDIA()
	{
		resetearCirculos();
		moverBarra2(790);
		$('#socialmedia').addClass("circulosprincipalesClickeado");
		$('#infoSocial').fadeIn(500);
		$(".textoBarra").html("SOCIAL");
		$("#infoInicio").css('display', 'none');
	}
	
	function showDIGITALPR()
	{
		resetearCirculos();
		moverBarra2(672);
		$('#insider').fadeIn(500);
		$('#insider').animate({left:'150px'},1000);
		$('#digital').addClass("circulosprincipalesClickeado");
		$('#infoDigital').fadeIn(500);
		$(".textoBarra").html("DIGITAL PR");
		$("#infoInicio").css('display', 'none');
	}
	
	// NOSOTROS
	
	$(document).ready(function () {
	// ---EZEQUIEL
	$('.worker.ezequiel').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.ezequiel').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Ezequiel es el fundador y CEO de Zetabe. Licenciado en sistemas de informaci&oacute;n, desde el lanzamiento de la agencia en 2007 ha definido la estrategia y visi&oacute;n futura para el crecimiento de la misma. A lo largo de la &uacute;ltima decada ha participado en numerosos proyectos digitales relevantes en Latinoamerica. Siempre interesado en el mundo digital y con una extensa formaci&oacute;n como director digital, Ezequiel brinda a la agencia toda su experiencia y fresca visi&oacute;n para la direcci&oacute;n y ejecuci&oacute;n de las estrategias digitales. ");
			$('#wrapper-nosotros .legend h2 span.desc').html("Ezequiel <span class='grisZB'>Zabalua<span>");
			});
	
	//--- ALEJANDRO
	$('.worker.alejandro').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.alejandro').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Alejandro es fundador y director general de Zetabe. Titulado como economista y con una maestr&iacute;a en negocios por la Universidad Humboldt de Berl&iacute;n se centra en la direcci&oacute;n financiera y cuentas de la agencia. Su experiencia en econom&iacute;a y negocios aporta directamente en el marketing de la empresa y en el ROI tangible hacia nuestros clientes. Apasionado por los n&uacute;meros y el golf Alejando es quien lleva la proyecci&oacute;n de la agencia.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Alejandro <span class='grisZB'>Lara</span>");
			});
		//--- ALEXANDRA
	$('.worker.alexandra').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.alexandra').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Diseñadora de profesi&oacute;n y creativa por vocaci&oacute;n, Alexandra es Directora de Arte. Amante de la arquitectura de interfaces, usabilidad y navegabilidad. Se encuentra al frente del &aacute;rea de arte en la agencia y su responsabilidad es mantenerse siempre al dise&ntilde;o en las tendencias del diseño digital.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Alexandra <span class='grisZB'>Hern&aacute;ndez</span>");

			});
		//--- PABLO
	$('.worker.pablo').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.pablo').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Experto en diseño y maquetaci&oacute;n web, Pablo es quien liderea el area programando interfaces en HTML5 y CSS3. Amante de las aplicaciones &oacute;viles, nuevas tecnolog&iacute;as y el diseño minimalista.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Pablo <span class='grisZB'>Rello</span>");
			});
		//--- CINTHIA
	$('.worker.cinthia').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.cinthia').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Egresada de la UNAM como diseñadora gr&aacute;fica, Cinthia cuenta con amplia experiencia en diseño de interfaces de usuario y web.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Cinthia <span class='grisZB'>Samaniego</span>");
			});
		//--- NOT ANTONIA
	$('.worker.antonia').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.antonia').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Santiago es el encargado de dirigir las cuentas del norte de M&eacute;xico y sur de Estados Unidos. Con mas de 10 años de experiencia como director de marketing para diversas marcas,  aporta liderazgo y claridad para nuestros clientes.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Santiago <span class='grisZB'>Navarrete</span>");
			});
		//--- ARIEL
	$('.worker.ariel').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.ariel').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Ariel es responsable de las nuevas cuentas, con mas de 13 años de experiencia como director de marketing aporta liderazgo y proyecci&oacute;n al su &aacute;rea.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Ariel <span class='grisZB'>Castelan</span>");
			});
		//---  ANTONIA
	$('.worker.tonia').stop(true, true).hover( 
		function () {
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.tonia').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Antonia realiza la planeaci&oacute;n digital de las campañas digitales. Egresada de la universad Anahuac del norte como Lic. en comunicaci&oacute;n aporta informaci&oacute;n relevante para la ejecuci&oacute;n de las mismas.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Antonia <span class='grisZB'>Rigual</span>");
			});
			
		//--- JORGE
	$('.worker.jorge').stop(true, true).hover( 
		function () {
  

	
	
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.jorge').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Egresado del Instituto Tecnol&oacute;gico de Minatitl&aacute;n, Jorge es un porgramador enfocado al &aacute;rea web y de aplicaci&oacute;nes con un gran potencial.<br /> El objetivo del &aacute;rea a su cargo es descubrir nuevas herramientas y tecnolog&iacute;as con beneficios para nuestros clientes");
			$('#wrapper-nosotros .legend h2 span.desc').html("Jorge <span class='grisZB'>Padilla</span>");
			});
		// _ BENJAMIN
		
			
		//--- JORGE
	$('.worker.benja').stop(true, true).hover( 
		function () {
  

	
	
			$(this).animate({zIndex: 2000}, 0);},
		function () {
		$(this).animate({zIndex: 1000}, 1000);}
	);
	$('.worker.benja').click( 
		function () {
			$(".worker").removeClass("hover")
			$(this).addClass("hover");
			$('#wrapper-nosotros .legend p').html("Es Director de Social Media de Zetabe. T&iacute;tulado como abogado en el ITAM y con una carrera en Publicidad. Su labor se centra en la estrateg&iacute;a de comunicaci&oacute;n y planning de marca en las redes sociales, Con su experiencia en Marketing y Comunicaci&oacute;n aporta una visi&oacute;n clave para el crecimiento comercial de la empresa.");
			$('#wrapper-nosotros .legend h2 span.desc').html("Benjam&iacute;n <span class='grisZB'>Malick</span>");
			});
});
//SEGUNDA BARRA DRAGABLE
function moverBarra(pos)
	{
		$( "#barraDrag1" ).animate({'left': pos+'px'}, tiempo,'easeOutBounce');
	}
function inicio()
	{
		resetearCirculos();
		moverBarra(240);
	}

$(document).ready(function (){
	inicio();
	//-------------variables para la barrita pikada-----------
	tiempo = 1000; //velocidad de transicion en milisegundos
	tam1 = 118; //tamaño en pixeles
	
	$("#barraDrag1").mousedown(
		function()
		{
      		$("#barraDrag1").css('cursor',"url(img/circulo/closedHand.png), pointer");
    	}
	).mouseup(
		function()
		{
			$("#barraDrag1").css('cursor',"url(img/circulo/hand.png), pointer");
		}
	);

	
	$( "#barraDrag1" ).draggable({ 
		axis: 'x',
		containment: 'barraHorizontal1',
		snapMode: 'inner',
		stop: function(event, ui) { 
			position = $( "#barraDrag1" ).position();
			if( position.left > -1000000 && position.left<(tam1+200) )
			{
				btn1();
				//$( "#barraDrag" ).html('<span class="textoBarra">INICIO</span>');
				//$( "#barraDrag" ).animate({'left': (tam*0)+'px'}, tiempo,'easeOutBounce');
			}
			if( position.left > (tam1+200) && position.left<((tam1*2)+200) )
			{
				btn2();
				//$( "#barraDrag" ).html('<span class="textoBarra">LANDING</span>');
				//$( "#barraDrag" ).animate({'left': (tam*1)+'px'}, tiempo,'easeOutBounce');
			}
			
			if( position.left > ((tam1*2)+200) && position.left<(tam1*300000000000) )
			{
				btn3();
				
				//$( "#barraDrag" ).animate({'left': (tam*2)+'px'}, tiempo,'easeOutBounce');
			}
			
			
		}
	});
});
	
	function btn1()
	{
		moverBarra(241);
		resetear();
		$( "#contenidoNosotros" ).slideDown('slow');
		$( "#contenidoNosotros" ).css('z-index', +1);
		$("#us").animate({ height : "610px"},400, 'easeOutSine');
		$(".textoBarra1").html("STAFF");
	}
	
	function btn2()
	{
		moverBarra(441);
		resetear();
		$( "#content2" ).slideDown('slow');
		$( "#content2" ).css('z-index', +1);
		$("#us").animate({ height : "750px"},400, 'easeOutSine');
		$(".textoBarra1").html("NOSOTROS");
	}
	
	function btn3()
	{
		moverBarra(641);
		resetear();
		$( "#content3" ).slideDown('slow');
		$( "#content3" ).css('z-index', +1);
		$("#us").animate({ height : "740px"},400, 'easeOutSine');
		$(".textoBarra1").html("EXPERTISE");
	}
	
	function resetear()
	{
		$("#contenidoNosotros").slideUp('slow');
		$("#content2").slideUp('slow');
		$("#content3").slideUp('slow');
	}
//_  SUPER DESPAPAYE DE PARALLAX
$(document).ready(function() {
	
// pero antes... overs de proyectos
$('.websites').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_one').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_one').animate({ 
	height	:	'50px',
	opacity: 1,
	backgroundPosition:'0px 50px'
	});
  }
);	
$('.websites').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_two').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_two').animate({ 
	height	:	'37px',
	opacity: 1,
	backgroundPosition:'0px 37px'
	});
  }
);	
$('.websites').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_three').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_three').animate({ 
	height	:	'25px',
	opacity: 1,
	backgroundPosition:'0px 25px'
	});
  }
);	
$('.redes-sociales').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_one').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_one').animate({ 
	height	:	'50px',
	opacity: 1,
	backgroundPosition:'0px 50px'
	});
  }
);	
$('.redes-sociales').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_two').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_two').animate({ 
	height	:	'37px',
	opacity: 1,
	backgroundPosition:'0px 37px'
	});
  }
);	
$('.redes-sociales').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_three').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_three').animate({ 
	height	:	'25px',
	opacity: 1,
	backgroundPosition:'0px 25px'
	});
  }
);	
$('.e-commerce').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_one').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_one').animate({ 
	height	:	'50px',
	opacity: 1,
	backgroundPosition:'0px 50px'
	});
  }
);	
$('.e-commerce').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_two').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_two').animate({ 
	height	:	'37px',
	opacity: 1,
	backgroundPosition:'0px 37px'
	});
  }
);	
$('.e-commerce').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_three').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_three').animate({ 
	height	:	'25px',
	opacity: 1,
	backgroundPosition:'0px 25px'
	});
  }
);	
$('.juegos-online').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_one').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_one').animate({ 
	height	:	'50px',
	opacity: 1,
	backgroundPosition:'0px 50px'
	});
  }
);	
$('.juegos-online').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_two').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_two').animate({ 
	height	:	'37px',
	opacity: 1,
	backgroundPosition:'0px 37px'
	});
  }
);	
$('.juegos-online').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_three').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_three').animate({ 
	height	:	'25px',
	opacity: 1,
	backgroundPosition:'0px 25px'
	});
  }
);	
$('.apps').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_one').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_one').animate({ 
	height	:	'50px',
	opacity: 1,
	backgroundPosition:'0px 50px'
	});
  }
);	
$('.apps').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_two').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_two').animate({ 
	height	:	'37px',
	opacity: 1,
	backgroundPosition:'0px 37px'
	});
  }
);	
$('.apps').stop().hover(
  function () {
    $('#'+ this.id + ' .fill_three').animate({
		opacity	: 	.9,
		height	:	'177px',
		backgroundPosition:'0px 177px'});
  }, 
  function () {
    $('#'+ this.id + ' .fill_three').animate({ 
	height	:	'25px',
	opacity: 1,
	backgroundPosition:'0px 25px'
	});
  }
);	

  (function($){
    $.fn.parallax = function(options){
        var $$ = $(this);
        offset = $$.offset();
        var defaults = {
            "start": 0,
            "stop": 100000,//offset.top + $$.height(),
            "coeff": 0.95
        };
        var opts = $.extend(defaults, options);
        return this.each(function(){
            $(window).bind('scroll', function() {
                windowTop = $(window).scrollTop();
                if((windowTop >= opts.start) && (windowTop <= opts.stop)) {
                    newCoord = windowTop * opts.coeff;
                    $$.css({
                        "background-position": "0px "+ newCoord + "px"
                        //"top": newCoord+"px"
                    });
                    //$("#contParallax").html(windowTop+' px<br>path: '+opts.stop/*$("#px4").css('background-position')*/);
                }
            });
        });
    };
})(jQuery);


(function($){
    $.fn.parallaxHorizontal = function(options){
        var $$ = $(this);
        offset = $$.offset();
        var defaults = {
            "start": 0,
            "stop": 100000,//offset.top + $$.height(),
            "coeff": 0.95
        };
        var opts = $.extend(defaults, options);
        return this.each(function(){
            $(window).bind('scroll', function() {
                windowTop = $(window).scrollTop();
                
                if((windowTop >= opts.start) && (windowTop <= opts.stop)) {
                    newCoord = windowTop * opts.coeff;
                    $$.css({
                        "background-position":  newCoord + "px 0px"
                        //"top": newCoord+"px"
                    });
                }
            });
        });
    };
})(jQuery);

	$('#px28').parallax({ "coeff"    :-.3 });
	
	$('#kayak').parallaxHorizontal({ "coeff"    :.17 });
	$('#rapel').parallax({ "coeff"    :.5 });
    $('#px27').parallaxHorizontal({ "coeff"    :.3 });
    $('#px29').parallax({ "coeff"    :.25, "stop":185});
    
    $('#px1').parallax({ "coeff"    :-.7});
    
    $('#px5').parallax({ "coeff"    :.18, "stop":2640});
    $('#burbuja2').parallax({ "coeff"    :-.2});
    
    $('#ipad').parallax({ "coeff"    :.18,"start":810,"stop":3290});
    $('#px7').parallaxHorizontal({ "coeff"    :.17 });
    
    $('#px10').parallax({ "coeff"    :.2, "start":2000});
    $('#px12').parallax({ "coeff"    :.2, "start":2000, "stop":4040});
    
    $('#px15').parallaxHorizontal({ "coeff"    :-.2, "start":2000});
    $('#px14').parallax({ "coeff"    :-.2, "start":2000});
    
    $('#px18').parallax({ "coeff"    :.2, "start":3000, "stop":6500});
    $('#px19').parallaxHorizontal({ "coeff"    :.3, "stop":6500});
    
    $('#px22').parallaxHorizontal({ "coeff"    :.3});
	
	$('#plato').parallaxHorizontal({ "coeff"    :.22,"stop":7200});
	$('#iphone').parallax({ "coeff"    :.21,"stop":7700});

});



//-- Menu de proyectos
jQuery(document).ready(function() {
 $('.menu-drop').toggle(
      function () {
		  $('img.arrow').attr('src', 'img/assets/uparrow.png');
       $('#menuProyectos ul.menu').stop(true, true).slideDown(function(){
		   	
});
      },
      function () {
		  $('img.arrow').attr('src', 'img/assets/downarrow.png');
        $('#menuProyectos ul.menu').stop(true, true).slideUp(function(){	
		
});
},
      function () {
  
      }
    );
//-- Menu contacto
$('.legendForm.tuita').stop(false, true).hover(function(){ 
       $(this) 
            .animate({backgroundPosition: '210px 57%'}, 900) 
            .animate({backgroundPosition: '190px 57%'}, 800) 
        ; 
   });
$('.legendForm.feisbac').stop(false, true).hover(function(){ 
       $(this) 
            .animate({backgroundPosition: '210px 66%'}, 900) 
            .animate({backgroundPosition: '190px 66%'}, 800) 
        ; 
   });
$('.legendForm.infa').stop(false, true).hover(function(){ 
       $(this) 
            .animate({backgroundPosition: '140px 70%'}, 900) 
            .animate({backgroundPosition: '120px 70%'}, 800) 
        ; 
   });
$('.legendForm.gogol').stop(false, true).hover(function(){ 
       $(this) 
            .animate({backgroundPosition: '174px 60%'}, 900) 
            .animate({backgroundPosition: '154px 60%'}, 800) 
        ; 
   });
$('.legendForm.farm').stop(false, true).hover(function(){ 
       $(this) 
            .animate({backgroundPosition: '277px 66%'}, 900) 
            .animate({backgroundPosition: '257px 66%'}, 800) 
        ; 
   });
//--
$('.legendForm.tuita').stop(false, true).click(function(){ 
$(".hideAll").css({ display: 'none'})
 $("#panelTweet").fadeIn( 400, 'easeOutBounce'); 
   });
$('#abrePanelFace').stop(false, true).click(function(){ 
$(".hideAll").css({ display: 'none'})
 $("#panelFace").fadeIn( 400, 'easeOutBounce'); 
    });
$('.legendForm.infa').stop(false, true).click(function(){ 
$(".hideAll").css({ display: 'none'})
 $("#panelInfo").fadeIn( 400, 'easeOutBounce'); 
   });
//$('.legendForm.gogol').stop(false, true).click(function(){ 
//$(".hideAll").css({ display: 'none'})
// $("#panelMap").fadeIn( 400, 'easeOutBounce'); 
 //  });
$('.legendForm.farm').stop(false, true).click(function(){ 
$(".hideAll").css({ display: 'none'})
 $("#panelForm").fadeIn( 400, 'easeOutBounce'); 
   });

 jQuery(function($){
        $(".twitter_list").tweet({
          avatar_size: 32,
          count: 4,
          username: "zetabe_agency",
          list: "crew",
          loading_text: "cargando..."
        });
      });

});
// JavaScript Document
