// Background fixo na Index
var urlIndex 	= "http://pimpolho.com.br/",
	urlIndexEs 	= "http://pimpolho.com.br/es/es_index",
	urlIndexEn 	= "http://pimpolho.com.br/us/us_index";
var urlFases 	= "http://pimpolho.com.br/fases",
	urlFasesEs 	= "http://pimpolho.com.br/es/es_fases",
	urlFasesEn 	= "http://pimpolho.com.br/us/us_phases";
var urlManu     = "http://pimpolho.com.br/manutencao",
    urlManuEs   = "http://pimpolho.com.br/es_manutencao",
	urlManuEn   = "http://pimpolho.com.br/us_manutencao";
var urlVovo 	= "http://pimpolho.com.br/category/calcados/bem-vindo-ao-mundo/vovo-nilza",
	urlVovoEn   = "http://pimpolho.com.br/category/us-shoes/us-welcome-to-the-world/us-vovo-nilza",
	urlVovoEs   = "http://pimpolho.com.br/category/es-calzados/es-bienvenido-al-mundo/es-vovo-nilza";

$(document).ready(function(){
	if (location.href==urlIndex || location.href==urlIndexEs || location.href==urlIndexEn){
		$("body").css({"background-image":"url(http://www.pimpolho.com.br/_files/_images/capa/capa-fundo.jpg)", "background-attachment":"scroll", "background-position":"top center", "background-repeat":"no-repeat", "background-color":"#0075c1"});
		$("div#geral").css({"width":"960px","min-height":"20px", "position":"relative", "top":"0", "left":"50%", "margin-left":"-480px", "height":"800px", "background":"url(http://www.pimpolho.com.br/_files/_images/capa/urso.png) no-repeat 450px 200px", "font-family":"'VAGRoundedStdBold', Arial, Helvetica, sans-serif"}); 	
		$("div.selo").css({"left" : "388px", "top" : "155px", "position" : "absolute"});
		$("div.selo span").css({"position" : "absolute"})
	}else if (location.href==urlFases || location.href==urlFasesEs || location.href==urlFasesEn){
		$("div.selo span").css({"position" : "fixed"});
	}else if ( location.href== urlManu || location.href== urlManuEs || location.href== urlManuEn ){
		$("div.selo").css({"display" : "none"});
	}else if (location.href == urlVovo || location.href == urlVovoEn || location.href == urlVovoEs ){
		$(".capa-vovo").show();
	};
});

// Shadowbox
Shadowbox.init({
    language:   "pt-BR",
	players:    ["flv", "html", "iframe", "img", "qt", "swf", "wmp"]
});

// Blank
	jQuery(document).ready(function() {
	$("a[rel=blank]").attr("target", "_blank");
	$("a[rel=parent]").attr("target", "_parent");
});

// Smoothscroll
$(function(){			
	$("a[href^=#]").smoothScroll(300,20,20,40);
})

// Estilizador da barra de rolagem
$(function()
	{
		$('.scroll-pane, #scroll-pane2, .scroll-produtos').jScrollPane();
	});

// FileStyle
$(function() {
      $("input#file").filestyle({ 
          image: "http://www.pimpolho.com.br/_files/_images/contato/bt_anexar.png",
          imageheight : 18,
          imagewidth : 65,
          width : 170
      });
});

// Placeholder
$(document).ready(function(){
	$(".news-mail").placeHolder({
        "text": "seu e-mail"
	});
});

// Hover das caracteristicas dos produtos
function mostraCaracteristica(){$('> span', this).fadeIn('slow');}
function someCaracteristica(){$('> span', this).fadeOut('slow');}

$(document).ready(function(){
	$('.produtos-caracteristicas li a').hoverIntent({
		over: mostraCaracteristica, 
		timeout: 250, 
		out: someCaracteristica
	});
});

// Hover do Carinho a Cada Passo
function mostraCarinho(){$("li#box_blog").fadeIn('slow');}
function someCainho(){$("li#box_blog").fadeOut('slow');}

$(document).ready(function(){
	$('a.blog').hoverIntent({
		over: mostraCarinho, 
		timeout: 150, 
		out: someCainho
	});
});

// Marketing
$(document).ready(function(){
	$(".aba_1").addClass("mktativo");
	$("div.content-mkt > dl").fadeOut();
	$(".titulo_mk1, #box_aba_1").fadeIn();
	
	$(".nav-mkt li").click(function(){
		$("div.content-mkt > h1, div.content-mkt > dl").hide();
		$(".nav-mkt li").removeClass("mktativo");
		$(this).addClass("mktativo")
	});

	$(".aba_1").click(function(){
		$(".titulo_mk1, dl#box_aba_1").fadeIn()
	});

	$(".aba_2").click(function(){
		$(".titulo_mk2, dl#box_aba_2").fadeIn();
		alert(clicou)
	});

	$(".aba_3").click(function(){
		$(".titulo_mk3, dl#box_aba_3").fadeIn()
	});

	$(".aba_4").click(function(){
		$(".titulo_mk4, dl#box_aba_4").fadeIn()
	});
});

// Marketing transição de texto
$(document).ready(function(){	
		$("#mkt_slider_1").easySlider({
			auto: false, 
			continuous: true,
			numeric: true
		});
// Marketing galeria de imagens	
        $("#mkt_slider_2").easySlider({
            auto: false,
            continuous: true 
        });
});

$(document).ready(function(){
	/* EMPRESA DISPLAY */
	/* MASCARA TODOS*/
	$("dl.historico_texto").fadeOut("fast",function(){
			$("dl#display_empresa01").fadeIn();
			});
	$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeOut();
	$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeIn();
	$("h2.empresa_titulo, h2.empresa_titulo_es").html("HistÃ³rico");
	$("h2.empresa_titulo_en").html("History");
	
	/* DISPLAY 1*/
	$("li.nav-01").click(function(){
		$("dl.historico_texto").fadeOut();
		$("dl#display_empresa01").fadeIn();
		$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeOut("fast", function(){
			$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeIn();
			$("h2.empresa_titulo, h2.empresa_titulo_es").html("HistÃ³rico");
			$("h2.empresa_titulo_en").html("History");
			});
		$(this).css({"background-position":"0 0"});
		$("li.nav-02, li.nav-03, li.nav-04, li.nav-05, li.nav-06, li.nav-07").css({"background-position":"0 0"});
		});
		
	/* DISPLAY 2*/
	$("li.nav-02").click(function(){
		$("dl.historico_texto").fadeOut();
		$("dl#display_empresa02").fadeIn();
		$("h2.empresa_titulo, h2.empresa_titulo_es").fadeOut("fast", function(){
			$("h2.empresa_titulo").fadeIn();
			$("h2.empresa_titulo, h2.empresa_titulo_es").html("ProduÃ§Ã£o");
			});
		$(this).css({"background-position":"0 -30px"});
		$("li.nav-03, li.nav-04, li.nav-05, li.nav-06, li.nav-07").css({"background-position":"0 0"});
		$("li.nav-01").css({"background-position":"0 -30px"});
		});
	
	/* DISPLAY 3*/
	$("li.nav-03").click(function(){
		$("dl.historico_texto").fadeOut();
		$("dl#display_empresa03").fadeIn();
		$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeOut("fast", function(){
			$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeIn();
			$("h2.empresa_titulo").html("Tecnologia e Design");
			$("h2.empresa_titulo_es").html("Tecnolog&#237;a y Dise&#241;o");
			$("h2.empresa_titulo_en").html("Technology and Design");
			});
		$(this).css({"background-position":"0 -30px"});
		$("li.nav-02, li.nav-04, li.nav-05, li.nav-06, li.nav-07").css({"background-position":"0 0"});
		$("li.nav-01").css({"background-position":"0 -30px"});
		});
	
	/* DISPLAY 4*/
	$("li.nav-04").click(function(){
		$("dl.historico_texto").fadeOut();
		$("dl#display_empresa04").fadeIn();
		$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeOut("fast", function(){
			$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeIn();
			$("h2.empresa_titulo").html("Filosofia");
			$("h2.empresa_titulo_es").html("Filosof&#237;a");
			$("h2.empresa_titulo_en").html("Philosophy");
			});
		$(this).css({"background-position":"0 -30px"});
		$("li.nav-02, li.nav-03, li.nav-05, li.nav-06, li.nav-07").css({"background-position":"0 0"});
		$("li.nav-01").css({"background-position":"0 -30px"});
		});
	
	/* DISPLAY 5*/
	$("li.nav-05").click(function(){
		$("dl.historico_texto").fadeOut();
		$("dl#display_empresa05").fadeIn();
		$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeOut("fast", function(){
			$("h2.empresa_titulo, h2.empresa_titulo_es,  h2.empresa_titulo_en").fadeIn();
			$("h2.empresa_titulo").html("Responsabilidade Social");
			$("h2.empresa_titulo_es").html("Responsabilidad Social");
			$("h2.empresa_titulo_en").html("Social Responsibility");
			});
		$(this).css({"background-position":"0 -30px"});
		$("li.nav-02, li.nav-03, li.nav-04, li.nav-06, li.nav-07").css({"background-position":"0 0"});
		$("li.nav-01").css({"background-position":"0 -30px"});
		});
		
	/* DISPLAY 6*/
	$("li.nav-06").click(function(){
		$("dl.historico_texto").fadeOut();
		$("dl#display_empresa06").fadeIn();
		$("h2.empresa_titulo, h2.empresa_titulo_es,  h2.empresa_titulo_en").fadeOut("fast", function(){
			$("h2.empresa_titulo, h2.empresa_titulo_es,  h2.empresa_titulo_en").fadeIn();
			$("h2.empresa_titulo").html("ExportaÃ§Ã£o");
			$("h2.empresa_titulo_es").html("Exportaci&#243;n");
			$("h2.empresa_titulo_en").html("Exports");
			});
		$(this).css({"background-position":"0 -30px"});
		$("li.nav-02, li.nav-03, li.nav-04, li.nav-05, li.nav-07").css({"background-position":"0 0"});
		$("li.nav-01").css({"background-position":"0 -30px"});
		});
	
	/* DISPLAY 7*/
	$("li.nav-07").click(function(){
		$("dl.historico_texto").fadeOut();
		$("dl#display_empresa07").fadeIn();
		$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeOut("fast", function(){
			$("h2.empresa_titulo, h2.empresa_titulo_es, h2.empresa_titulo_en").fadeIn();
			$("h2.empresa_titulo").html("Nosso maior patrimÃ´nio");
			$("h2.empresa_titulo_es").html("Nuestro mayor patrimonio");
			$("h2.empresa_titulo_en").html("Our greatest asset");
			});
		$(this).css({"background-position":"0 -30px"});
		$("li.nav-02, li.nav-03, li.nav-04, li.nav-05, li.nav-06").css({"background-position":"0 0"});
		$("li.nav-01").css({"background-position":"0 -30px"});
		});
		
	
	/* CONTATO */
	/*ENTRAR JÃ ABERTO*/
	$("dl.mensagem").animate({height:"402px"}, "normal", function(){
		$("ul.form-mensagem, dl.mensagem p").fadeIn();
		});
	$("dl.curriculo").css({"z-index":"1"});
	/* CURRICULO */
	$("dt#contato_bt1").click(function(){
		$("dl.curriculo").animate({height:"400px"});
		$("dl.curriculo").css({"z-index":"999"});
		$("ul.form-curriculo, dl.curriculo p").css({"display":"block"});
		$("dl.representante, dl.mensagem").animate({height:"60px"});
		$("dl.representante, dl.mensagem").css({"z-index":"1"});
		$("ul.form-representante, dl.representante p, ul.form-mensagem, dl.mensagem p").fadeOut("fast");
		});
	/* representante */
	$("dt#contato_bt2").click(function(){
		$("dl.curriculo, dl.mensagem").animate({height:"60px"});
		$("dl.curriculo, dl.mensagem").css({"z-index":"1"});
		$("dl.representante").animate({height:"400px"});
		$("dl.representante").css({"z-index":"999"});
		$("ul.form-representante, dl.representante p").css({"display":"block"});
		$("ul.form-mensagem, dl.mensagem p, ul.form-curriculo, dl.curriculo p").fadeOut("fast");
		});
	/* mensagem */
	$("dt#contato_bt3").click(function(){
		$("dl.curriculo, dl.representante").animate({height:"60px"});
		$("dl.curriculo, dl.representante").css({"z-index":"1"});
		$("ul.form-representante, dl.representante p, ul.form-curriculo, dl.curriculo p").fadeOut("fast");
		$("dl.mensagem").animate({height:"400px"});
		$("dl.mensagem").css({"z-index":"999"});
		$("ul.form-mensagem, dl.mensagem p").css({"display":"block"});
		});
	
	/* BOXES */
	/* TABELA  */
	
	$("li#bt-tabela, a#bt-tabela, .bt-tabela").click(function(){
		$("li#box_tabela, div.fechar_tabela").fadeIn("normal");
		$("li#box_tabela").css({"z-index":"9999"});
		});
	$("div.fechar_tabela").click(function(){
		$("li#box_tabela, div.fechar_tabela").fadeOut("normal");
		$("li#box_tabela").css({"z-index":"1"});
		});
	
	/* FASES NOVA */
	$("li.faze_bt_01").click(function(){
		$("div.fase_modal_01, div.fase_modal_02, div.fase_modal_03").fadeOut();
		$("div.fase_modal_01").fadeIn();
		});
	$("li.faze_bt_02").click(function(){
		$("div.fase_modal_01, div.fase_modal_02, div.fase_modal_03").fadeOut();
		$("div.fase_modal_02").fadeIn();
		});
	$("li.faze_bt_03").click(function(){
		$("div.fase_modal_01, div.fase_modal_02, div.fase_modal_03").fadeOut();
		$("div.fase_modal_03").fadeIn();
		});
		
	$("button.fecha_modal_fase_01, button.fecha_modal_fase_02, button.fecha_modal_fase_03").click(function(){
		$("div.fase_modal_01, div.fase_modal_02, div.fase_modal_03").fadeOut();
		});
	
});

// Some capa Vovo Nilza
$(document).ready(function(){
	$(".capa-vovo").click(function(){
        $(this).fadeOut();
	});
});
