// JavaScript Document
this.screenshotPreview = function(){	
	xOffset = -15;
	yOffset = 15;
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot' style='color:#999999'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");								
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");					
	},
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
	});	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function(){


	// OCULTAR O LINK DE FECHAR
	$('#fechar').hide();
	
	// ABRIR MENU PARA OUTROS SITES DA FEB
	$('#abrir').click(function(){
		// Corrigindo no IE6 SUCKS
		var versao = $.browser.version; // Indentifica o browser e a versão
		if($.browser.msie && versao == 6) { // Testa se é IE6 SUCKS
			 // Corrige o fechamento da div
			$("#siteFeb").animate({ marginTop:"-45px" }, 500 );
		} 
		else{ 
			$("#siteFeb").animate({ marginTop:"-35px" }, 500 );
		} 
							   
		$('#abrir').hide();
		$('#fechar').show();
	});

	// FECHAR MENU PARA OUTROS SITES DA FEB
	$('#fechar').click(function(){
		// Corrigindo no IE6 SUCKS
		var versao = $.browser.version; // Indentifica o browser e a versão
		if($.browser.msie && versao == 6) { // Testa se é IE6 SUCKS
			 // Corrige o fechamento da div
			$("#siteFeb").animate({ marginTop:"-150px" }, 500 );
		} 
		else{ 
			$("#siteFeb").animate({ marginTop:"-120px" }, 500 );
		} 
		$('#abrir').show();
		$('#fechar').hide();
	});
	screenshotPreview();
	
})