var intervalo;
function volver(inicio){
	var y = 0
	var t = 0
	$('.menuHeader li').each(function(){
		if (!$(this).hasClass("Act"))
			t=t+$(this).width();
		else
			y= t;
	})
	if ($('.menuHeader').parents('body').hasClass('index'))
		$(".menuHeader .btnSlide").fadeOut(300);

	else{
		$(".menuHeader .btnSlide").animate({left: (y+"px")},250, function(){
	if (inicio ==1)
		$(".menuHeader .btnSlide").fadeIn(300)});
	clearInterval(intervalo);
}
}
$(document).ready(function(){
	volver(inicio=1);
	$(".ContenedorCol .CL1").mouseover(function(){
		$(this).addClass("CL1Hover");
	});
	$(".ContenedorCol .CL1").mouseout(function(){
		$(this).removeClass("CL1Hover");
	});
	$(".SUM").click(function(){
		$(".bottom").addClass("bottom2");
	});

	/*Funcion menu header*/
	function animacion(izquierda){
		$(".menuHeader .btnSlide").stop(true, true);
		$(".menuHeader .btnSlide").animate({left: izquierda + "px"}, 250);
	}
	var arrayLi = ["0", "93", "184", "276", "360", "439", "521", "610"];
	$(".menuHeader ul li").hover(function(){
		$(".menuHeader .btnSlide").show();
		animacion(arrayLi[$(this).index()]);
	});
	$(".menuHeader ul").mouseout(function(){
		clearInterval(intervalo);
		intervalo = setInterval("volver()",1500);
	});

	/*Funcion over clientes*/
	$(".imgClienteH").hover(function(){
		$(this).attr('src',$(this).attr('src').replace('g100','100'));
	})
	.mouseout(function(){
		$(this).attr('src',$(this).attr('src').replace('100','g100'));
	});

	$(".portfolio #select .act a").click(function(e){
		e.preventDefault();
		$("#select").addClass("open").removeClass("close");
	})
	$(".portfolio #select").mouseleave(function(){
		$("#select").addClass("close").removeClass("open");
	})

	$('.contacto #select li').click(function(){
		if ($(this).parent().parent().hasClass('close'))
		{
			$(this).parent().parent().addClass("open").removeClass("close");
			$('.contacto #select li#seleccionar').hide();
		}
		else
		{
			$('.contacto #select li#seleccionar').remove()
			$('.contacto #select li.act').removeClass("act")
			$(this).addClass("act");
			$("#select").addClass("close").removeClass("open");
		}
	});

	$('.contacto #select').mouseleave(function(){
		$('.contacto #select li#seleccionar').show();
		$("#select").addClass("close").removeClass("open");
	});
	/*centrar pop ups*/

});



//Funcion para mostrar redes sociales en el header
$(document).ready(function(){
						$(".header h1").mouseover(function(){
							$(".boxRedesCont").css('display','block')
							});
						$(".boxRedesCont").mouseleave(function(){
							$(".boxRedesCont").hide()
							});
						$(".showHide").mouseleave(function(){
							$(".boxRedesCont").hide()
							});
						});
