function ProdutoDetalhe()
{

    if(jQuery("#listagem-cores").length > 0)
    {
	jQuery("a.produtominiatura").click(function()
	{
	    var foto = jQuery(this).find("img:first");
	    jQuery("#imgAmpliada").attr(
	    {
		"src":foto.attr("src").replace("/miniatura",""),
		"alt":foto.attr("alt")
	    });
			
	    var linkLoja = jQuery(this).next().next().val();
	    jQuery("#linkLoja").attr("href", linkLoja);
			
	    if(linkLoja == "")
	    {
		jQuery("#linkLoja").hide();
	    }
	    else
	    {
		jQuery("#linkLoja").show();
	    }
			
	    jQuery("#corproduto").html(jQuery(this).next().val());
	    jQuery("#refproduto").html(foto.attr("alt"));
	    
	    var urlDetalhe = $(this).parents('li').find('a').attr('href');
	    var urlProduto = self.parent.document.location.href;
	    urlProduto = urlProduto.toString();
	    urlDetalhe = urlDetalhe.split("?");	
	    urlProduto = urlProduto.split("#");
	    self.parent.document.location = urlProduto[0]+"#"+urlDetalhe[1];
	    
	    return false;
	});
		
		
		
    }
	
	
    $('a.thumb-list-item, a.produtominiatura').live('click',function () {
	var urlDetalhe = $(this).attr('href');
	var urlProduto = self.parent.document.location.href;
	urlProduto = urlProduto.toString();
	urlDetalhe = urlDetalhe.split("?");	
	urlProduto = urlProduto.split("#");
	self.parent.document.location = urlProduto[0]+"#"+urlDetalhe[1];
    });
    
    $('.foto-produto a').live('click',function () {
        self.parent.document.location = $(this).attr('href');
    });
	
}

$(document).ready(function() {
    
	
    if ($("#hdnColecao").val() == 8) {
	$(".detalhe-produto .linha a[title=Primavera/Verão 2012]").addClass('ativo');
    }
    else if ($("#hdnColecao").val() == 9) {
	$(".detalhe-produto .linha a[title=Outono/Inverno 2011]").addClass('ativo');
    }
    else if ($("#hdnColecao").val() == 2) {
	$(".detalhe-produto .linha a[title=Fall]").addClass('ativo');
    }
    else if ($("#hdnColecao").val() == 1) {
	$(".detalhe-produto .linha a[title=Spring/Summer]").addClass('ativo');
    }
});
