function addFav(){
	var url      = location.href;
	var title    = document.title;
	if (navigator.appName!='Microsoft Internet Explorer'){
		if (window.sidebar) window.sidebar.addPanel(title, url,'');
		else if(window.opera && window.print){
			var mbm = document.createElement('a');
			mbm.setAttribute('rel','sidebar');
			mbm.setAttribute('href',url);
			mbm.setAttribute('title',title);
			mbm.click();
		}
	}else if (document.all){window.external.AddFavorite(url, title);}
}

function slideshowOutput() { 
	$('#galPlayer .panel .title').html($(this).find('img').attr('title')).attr('href',$(this).attr('href'));
	$('#galPlayer .content p').html($(this).find('img').attr('alt'));
}
$(function(){
	$(document).pngFix();

	$('.slidea')
		.bind('mouseenter',function(){ $(this).find('.updown').animate({ marginTop: ($(this).height()-136), height: 0 },'slow'); })
		.bind('mouseleave',function(){ $(this).find('.updown').animate({ marginTop: -136, height: 145 },'slow'); });
	
	$('.menu-proj .wid-menu a')
		.bind('mouseenter',function(){ $(this).find('.frame').animate({ width: 0 },'fast'); })
		.bind('mouseleave',function(){ $(this).find('.frame').animate({ width: 45 },'fast'); });

	// Adiciona movimento em botões butSlide
	$('#butSlide .button').prepend('<span>&nbsp;</span>')
		.bind("mouseenter",function(){ $(this).find('span').animate({ height: 5, marginTop: 30 },'slow'); })
		.bind("mouseleave",function(){ $(this).find('span').animate({ height: 30, marginTop: 5 },'slow'); });


	$('.news-further span').eq(0).css('marginLeft','20px');
	$('.eventos-further span').eq(0).css('marginLeft','20px');
	// Retira excesso de margens dos menus de navegação
	$('#nav .nav a:last-child, #nav .top-icons a:last-child').css('margin','0');
	$('a[href$="#goto"').click(function(){ return false; });

	$('#sliderOffers .slider').cycle({ 
		fx: 'scrollHorz', 
		speed: 'slow', 
		timeout: 3000, 
		next: ".slider .product, .slider .produto", 
		pause: 1
	});
				
	$('#sliderTips .slider').cycle({ 
		fx: 'scrollHorz', 
		speed: 'slow', 
		timeout: 3500, 
		next: "#sliderTips .panel a[href='#gotoNext']", 
		prev: "#sliderTips .panel a[href='#gotoPrev']",
		pause: 1
	});
	
	$('#galPlayer .slider').cycle({ 
		fx: 'scrollHorz', 
		speed: 'slow', 
		timeout: 6000, 
		next: "#galPlayer  a[href='#gotoNext']", 
		prev: "#galPlayer  a[href='#gotoPrev']",
		before: slideshowOutput,
		after: slideshowOutput,
		pause: 1
	});
		
	$('.dropdown .iten').hover(function () {
		$('.sub_menu', this).show();
	  },function () {
		$('.sub_menu', this).hide();
	  });
	
	$('a.contatobox').colorbox({transition:'fade', width:'600px', height:'500px'});
});
