function setFoto(foto) {
		$(foto).mouseover(function () {
			
			  function getWidth()  {  
			       return window.innerWidth ? window.innerWidth : /* For non-IE */  
			              document.documentElement ? document.documentElement.clientWidth : /* IE 6+ (Standards Compilant Mode) */  
			              document.body ? document.body.clientWidth : /* IE 4 Compatible */  
			              window.screen.width; /* Others (It is not browser window size, but screen size) */  
			}  
			
			// Brilha a estrelinha no cantinho da foto e exibe sua descrição //
			var _top = $(this).offset().top;
			var _left = $(this).offset().left;
		
			var _centro = (getWidth()/2);
			var _limite_left = (_centro-400);
			var _limite_right = (_centro+200);
			
			$("#brilho_foto").css({ top: _top - 10, left: _left - 20, visibility: "visible" });
			
			// Escreve "Recente" conforme a posição
			if(_top < 600) {
				
				// Escreve na esquerda
				if(_left < _limite_left) {
					$("#recente_left").css({ top: (_top+5), left: (_left-27), visibility: "visible" }).fadeIn("slow");
				}
				
				// Escreve na direita
				if(_left > _limite_right) {
					$("#recente_right").css({ top: (_top+5), left: (_left+157), visibility: "visible" });
				}
			}
			
			
			// Escreve "Destaque" conforme a posicao
			if(_top > 600 && _top < 1024) {
				
				// Escreve na esquerda
				if(_left < _limite_left) {
					$("#destaque_left").css({ top: (_top+60), left: (_left-25), visibility: "visible" });
				}
				
				// Escreve na direita
				if(_left > _centro) {
					$("#destaque_right").css({ top: (_top+60), left: (_left+447), visibility: "visible" });
				}
			}
			
	
			$(this).css({ border : "1px solid #999999" });
			
		}).mouseout(function () {
			
			// Remove o brilho e descrição
		
			$("#brilho_foto").css({ visibility: "hidden" });
			$("#recente_left").css({ visibility: "hidden" });
			$("#recente_right").css({ visibility: "hidden" });
			$("#destaque_left").css({ visibility: "hidden" });
			$("#destaque_right").css({ visibility: "hidden" });
			//
			
			$(this).css({ border : "1px solid #333333" });
		})
}

$(document).ready(function () {
	$('.a_topo_menu').mouseover(function () {
		$(this).css({ backgroundImage : "url('/images/bot_topo_over.png')" });
	}).mouseout(function () {
		$(this).css({ backgroundImage : "url('/images/bot_topo.png')" });
	})
	
	setFoto('.fotoGreen');
	setFoto('.fotoRed');
	setFoto('.foto');
	
	
	$('#slideshow').cycle({ 
	    fx:     'fade', 
	    speedy: 600, 
	    pager:  '#nav', 
	    pagerAnchorBuilder: function(idx, slide) { 
	        // return selector string for existing anchor 
	        return '#nav li:eq(' + idx + ') a'; 
	    } 
	});
	

	/*
	 *  TELA DE LOGIN
	 */
	
	$(".signin").click(function(e) { 

    	e.preventDefault();
		$(".signin").toggleClass("menu-open");
		$("fieldset#signin_menu").fadeIn('slow', function() {
			$("#signin_menu").dropShadow({left: 5, top: 5, blur: 5, opacity: 2, color: "#000000", swap: false});
			//$("fieldset#signin_menu").fadeIn('slow');
		});

	});
		
	$("fieldset#signin_menu").mouseup(function() {
		return false
	});
	
	$(document).mouseup(function(e) {
		$("#signin_menu").removeShadow();
		if($(e.target).parent("a.signin").length==0) {
			$(".signin").removeClass("menu-open");
			$("fieldset#signin_menu").fadeOut('slow', function() { 
				
			});
			
			
		}
	
	});			
	
	/*
	 * ALT no LINK com BALAOZINHO 
	 */
	
    $(function() {
    	$('#resend_password_link').tipsy({gravity: 'w'});   
    });
    
    
    $("#nav").css({ display: "inline" });

});


