jQuery.noConflict();
jQuery(document).ready(function() {
    jQuery("<li class='ie_cb'></li>").insertBefore("ul.lstProdutos li.fst");    

	/* cria bordas arredondadas */
	jQuery("head").prepend('<style>.rounded {  position:relative; } .lt, .lb, .rt, .rb, .lthome, .lbhome, .rthome, .rbhome { position:absolute; z-index:1;display:block;text-indent:-9999px; height:10px;width:10px; background-repeat:no-repeat; } .lt, .lthome { left:0; top:0; background-position:left top; } .lb, .lbhome { left:0; bottom:0; background-position:left bottom; } .rt, .rthome { right:0; top:0; background-position:right top; }.rb, .rbhome {right:0; bottom:0; background-position:right bottom; }</style>');
	jQuery(".rounded").append('<span class="lt"></span><span class="rt" /><span class="rb" /><span class="lb" />');
	jQuery(".roundedForm").append('<span class="lthome"></span><span class="rthome" /><span class="rbhome" /><span class="lbhome" />');
    jQuery(".rodape").append('<span class="rb">&nbsp;</span><span class="lb">&nbsp;</span>');
    jQuery(".titSection.detail").append('<span class="left"></span><span class="right"></span>');
    jQuery(".titSection.detail-left").append('<span class="left"></span>');
    
    
	/* abas de navegacao internas */
	var itemsAbas = jQuery(".lst_menu_detalhes_produto dd a");
		itemsAbas.click(function() {
		var css = jQuery(this).attr("class").split(' ');
		jQuery(".detales_produto_content .content").hide();
		jQuery("." + css[1]).show();
		jQuery.each(itemsAbas, function(index, item) {
			var current = jQuery(item).attr("class");
			jQuery(item).attr("class", current.replace("-on", "-off"));
		});
		jQuery(this).attr("class", css.join(" ").replace("-off", "-on"));
		return false;
    });
    
    /* MENU */
	jQuery("#header_menu_category dd:last").addClass('last');
	jQuery("#header_menu_category dd:last").prev().addClass('penult');
    jQuery("#header_menu_category dd").hover(function() {
		            jQuery('a:first',this).addClass('active');
		            jQuery('div.submenu',this).css('display','block');
            		
	            }, function() {	
		            jQuery('a:first',this).removeClass('active');
		            jQuery('div.submenu',this).css('display','none');
	            });
    
	jQuery("#header_menu_category dd.fst").hover(function() {
					jQuery("#header_menu_category dt.borda_left").css('backgroundPosition','0 -40px');
            		
	            }, function() {	
					jQuery("#header_menu_category dt.borda_left").css('backgroundPosition','0 0');
	            });
	jQuery("#header_menu_category dd.last").hover(function() {
					jQuery("#header_menu_category dt.borda_right").css('backgroundPosition','right -40px');
            		
	            }, function() {	
					jQuery("#header_menu_category dt.borda_right").css('backgroundPosition','right 0');
	            });
	jQuery(".box-img").each(function (i) {
        if (jQuery(this).html() == "") {
          jQuery(this).css('display','none');
          jQuery(this).parent("div").addClass("larg_sub"); 
        }
    }); 
	
    jQuery(".campo").addClass("idleField");
	jQuery(".campo").focus(function() {
		jQuery(this).removeClass("idleField").addClass("focusField");
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	jQuery(".campo").blur(function() {
		jQuery(this).removeClass("focusField").addClass("idleField");
		if (jQuery.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
	
});
