jQuery.noConflict();
jQuery(document).ready(function() {
	/* 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 */
    var menuPrincipal = jQuery("dl#header_menu_category dd a");
    menuPrincipal.hover(
        function() {
            jQuery(this).parent().children("ul").css("display", "block");
            var classLink = jQuery(this).parent().children("a").attr("class");
            jQuery(this).addClass(classLink + "_on");
       //     jQuery(this).css("background-position", "0 -33px");
        },
        function() {
            jQuery(this).parent().children("ul").css("display", "none");
            listaClass = jQuery(this).attr('class').split('_');
            jQuery(this).removeClass();
            jQuery(this).addClass(listaClass[0]);
       //     jQuery(this).css("background-position", "0px 0px");
        }
    );
    var menuPrincipalUl = jQuery("dl#header_menu_category dd ul");
    menuPrincipalUl.hover(
        function() {
            jQuery(this).css("display", "block");
            var classLink = jQuery(this).parent().children("a").attr("class");
            jQuery(this).parent().children("a").addClass(classLink + "_on");
             //jQuery(this).parent().children("a").css("background-position", "0 -33px");
        },
        function() {
			jQuery(this).css("display", "none");
            jQuery(this).parent().children("ul").css("display", "none");
            listaClass = jQuery(this).parent().children("a").attr('class').split('_');
            jQuery(this).parent().children("a").removeClass();
            jQuery(this).parent().children("a").addClass(listaClass[0]);
            // jQuery(this).parent().children("a").css("background-position", "0px 0px");
        }
    );
    
    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 : '');
		}
	});
});