(function($){
	// browser detection
	$[/a/[-1]=='a'?'Firefox':'\v'=='v'?'IE':/a/.__proto__=='//'?'Safari':/s/.test(/a/.toString)?'Chrome':'Opera'] = 1;
	
	//OS detection (...)
	var ua=navigator.userAgent.toLowerCase();
	$[~ua.indexOf('mac')?'mac':'windows'] = 1;
	
	$.fn.shows = function(id){
		var tgt = $(id);
		this.click(function(){
			tgt.show();
			return false;
		});
		tgt.find('a.fechar').click(function(){
			tgt.hide();
			return false;
		});
	};
	
	// favoritos/home
	if (($.opera || $.Safari) && $.mac)
	{
		$('#keys-safari').text('Cmd+D');
		$('#mouse-safari').text('Cmd+click');
	}
		
	if ($.IE)
	{
		$('#lnk-favoritos').click(function(){
			window.external.AddFavorite('http://www.queronoticia.com.br', 'Quero Notícia');
		});
		
		if (window.XMLHttpRequest) //IE7 +
		{
			$('#lnk-home').shows('#info-home-IE');
		}
		else // IE6-
		{
		$('#lnk-home').click(function(){
				alert(this.tagName);
				this.style.behavior='url(#default#homepage)';
				this.setHomePage('http://www.queronoticia.com.br');
			});
		}
	}
	
	else if ($.Firefox)
	{
		$('#lnk-favoritos').shows('#info-favoritos-ff');
		$('#lnk-home').shows('#info-home-ff');
	}
	else if ($.Safari || $.Chrome)
	{
		$('#lnk-favoritos').shows('#info-favoritos-safari');
		
		$('#lnk-home').shows('#info-home-safari');
		
		if ($.Chrome)
			$('#mouse-chrome').hide();
	}
	else if ($.opera)
	{
		$('#lnk-favoritos').attr('rel', 'sidebar');
		$('#lnk-home').shows('#info-home-safari');
	};
	
})(jQuery);