$(function(){

	$('a[rel~=external]').each(function(){
		$(this).attr('target','_blank');
	});
	
	$('.email').pMail();
	
	var _biggerlink = [
	   '#noticias.index #conteudo ul li'
	].join(',');
	if($(_biggerlink).length){
		$.addPlugin('biggerlink');
		$(_biggerlink).biggerlink();
	};
	
	if($('#index').length){
		$('#index #conteudo').prepend('<div id="banner"></div>');
		$.addPlugin('flash');
		$.addPlugin('ads');
		links = [DEFAULT_URL+'produtos/ver/202/monitor-com-tv-samsung-2033m',DEFAULT_URL+'contato',DEFAULT_URL+'#computador-intelbras'];
		$.ads({banner: {
			'#banner': {
				size : '791x170',
				src: ['banner_capa.swf?1'],
				params: {
					wmode: 'transparent'
				},
				flashVars: {
					links: links.join('|')
				}
			}
		}});
	}	
	
	$('#produtos #conteudo ul.listagem li,#index #conteudo div.produtos ul.listagem li').normalizeHeight(null,4);
	$('#noticias.index #conteudo ul.listagem li').normalizeHeight(null,2);
	
	$.fn.myToggler = function(){
		return this;
	}
	$('#topo #topo_barra .telefone div ul li strong').show();
	$('#topo #topo_barra .telefone div').jcarousellite({
		auto: 3000,
		speed: 1000,
		vertical: 1,
		visible: 1
	});
	$('#rodape div.fone div ul li').show();
	$('#rodape div.fone div').jcarousellite({
		auto: 3000,
		speed: 1000,
		vertical: 1,
		visible: 1
	});
	
	$.UtilAjax();

});
$(window).load(function(){
	//border-radius fix
	$('#paginas #conteudo p.left img,#paginas #conteudo p.right img').each(function(){
		$this = $(this);
		$this.parent().css({
			'width': $this.attr('width'),
			'height': $this.attr('height'),
			'background': 'url('+$this.attr('src')+') center center no-repeat'
		}).empty();
	});
});
//ie6 fixes =/
if($.browser.msie && parseInt($.browser.version) < 7){
	//image flickr
	try{document.execCommand('BackgroundImageCache',false,true)}catch(e){};
	//png
	$(window).load(function(){
		var _ifixpng = [
		   '#topo h1 a',
		   '#topo #topo_barra .telefone',
		   '#topo #topo_barra .orcamento'
		].join(',');
		if($(_ifixpng).length){
			$.addPlugin('ifixpng','ifixpng/ifixpng2');
			$(_ifixpng).ifixpng();
		};
	});
}
