$(function(){

	$('a[rel~=external]').each(function(){
		$(this).attr('target','_blank');
	});

	$('.email').pMail();

	$('.paging').center();
	
	$('#BuscaProduto').initValue($('#BuscaProduto').prev('label').text());
	
	$.UtilAjax();
	$.addPlugin('treeview',null,function(){
		$('#produtos_menu ul:first').treeview({
			collapsed: true,
			animated: true,
			loadCss: false,
			persist: 'location'
		});
		$('#produtos_menu ul:first>li.expandable>div.hitarea').click();
	});
	
	if($('#capa').length > 0)
	{
		$.addPlugin('flash',null,function(){
			$('#banner-capa').flash({
				src: DEFAULT_URL + 'swf/capa/topo/banner.swf',
				width: 775,
				height: 166,
				flashVars: {
					defaultUrl: DEFAULT_URL+'swf/capa/topo/',
					links: [
					      DEFAULT_URL+'produtos/ver/1789/bota-cross-fox-f3-race-preta',
					      DEFAULT_URL+'produtos/marca/3/fox',
					      DEFAULT_URL+'produtos/buscar/produto:ff358',
					      DEFAULT_URL+'produtos/ver/1630/joelheira-articulada-pod-mx-k700-preto-vermelho'
					].join('|')
				}
			}).css({
				'margin-bottom': '25px'
			});
		});
	}
	
	$('#formNewsletter form div.input input').val('').each(function(){
		$(this).initValue($(this).prev('label').text());
	});
	
	$('#capa #conteudo ul.produtos_listagem li').normalizeHeight(null,3);
	$('#produtos.ver #conteudo .produtos_relacionados ul li').normalizeHeight(null,3);
	$('#produtos.index #conteudo ul.listagem li').normalizeHeight(null,4);
	
	if($(".exibe .imgs a img").length > 0)
	{
		$(".exibe .imgs a img").bind("contextmenu", cancelEvent);
	}
	
	$("#sb-body-inner img").live("contextmenu", cancelEvent);

});

$(window).load(function(){
	window.setTimeout(function(){
		$('.skype_pnh_container').html('');
		$('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
	}, 800);
});

function cancelEvent(e)
{
	e.preventDefault();
	return false;
}
