jQuery(function(){
    //Inputs
    jQuery('.focus, #txtNome, #txtEmail, #CEP, .stCupom').focus(function() {
        if(jQuery(this).val() == jQuery(this).attr('defaultValue')) {
	        jQuery(this).val('');
        }
    })
    .blur(function() {
        if(jQuery(this).val().length == 0) {
	        jQuery(this).val(jQuery(this).attr('defaultValue'));
        }
    });
    if ( !jQuery(".bannerLateralEsquerda div")[0] ) {
        jQuery("#banner_barra_navegacao").css('display','none');
    }
    //menu
	
        //Todos os itens       
        jQuery("#header_menu_category dd").each(function(i){   
            if(i!=0){
                jQuery("<dd class='borda png_bg'></dd>").insertBefore(this);
            }
        });
        
        //primeiro item
        jQuery("#header_menu_category dd:first").addClass("first");

		jQuery("#header_menu_category dd").hover(function() {
			jQuery('a:first',this).addClass("active");
			jQuery(this).addClass("hover");
			if(jQuery.browser.msie){
			           jQuery('div:first',this).css('display','block');
		    }
			jQuery('div:first',this).fadeIn('fast');	
		}, function() {	
		    if(jQuery.browser.msie){
			   jQuery('div:first',this).css('display','none');
		    }
			jQuery('div:first',this).fadeOut('fast');
			jQuery(this).removeClass("hover");
			jQuery('a:first',this).removeClass("active");
		});
			
    jQuery("dd.ico_conta").hover(function() {
	        jQuery("#box_minhaconta").show();
	        jQuery("#header_menu_category").addClass('hover')
		}, function() {	
            jQuery("#box_minhaconta").hide();
            jQuery("#header_menu_category").removeClass('hover')
		});
	//telefones
	jQuery(".tel1").html("(65) 3615-5000");
	jQuery(".tel2").html("0800-647 7800");
	
	//redes sociais
    jQuery(".lnk-face").attr("href", "http://www.facebook.com/pages/Babycombr/168101096556921");
    jQuery(".lnk-twt").attr("href", "http://www.twitter.com/babynaweb");
    jQuery(".lnk-blog").attr("href", "#");
    jQuery(".lnk-ork").attr("href", "#");          

    jQuery("#ordena_pesquisa_drpOrdem option[value='MaisVendidos']").html("Mais Vendidos");
    jQuery("#ordena_pesquisa_drpOrdem option[value='Preco']").html("Pre&ccedil;o");
    jQuery("#ordena_pesquisa_drpOrdem option[value='MaisRecente']").html("Mais Recentes");
    jQuery("ul.lstProdutos_juntos:last").addClass("lstProdutos_juntos_last");
    
    jQuery('#txtDescricao').each(function() {
        // Stores the default value for each textarea within each textarea
        jQuery.data(this, 'default', this.value);
    }).focus(function() {
        // If the user has NOT edited the text clear it when they gain focus
        if (!jQuery.data(this, 'edited')) {
            this.value = "";
        }
    }).change(function() {
        // Fires on blur if the content has been changed by the user
        jQuery.data(this, 'edited', this.value != "");
    }).blur(function() {
        // Put the default text back in the textarea if its not been edited
        if (!jQuery.data(this, 'edited')) {
            this.value = jQuery.data(this, 'default');
        }    
    });
     jQuery(".form_comprar_container a input").hover(function() {
            var src = this.src;
            src = src.replace( '/bt_comprar_produto.gif', '/bt_comprar_produto_on.gif'); 
            this.src = src;
		}, function() {	
             this.src = this.src.replace( '/bt_comprar_produto_on.gif', '/bt_comprar_produto.gif');
             this.src = src;
		});
});

