$(document).ready(function() {		
        $('#fecharPopup').click(function(){
            $('#popup').fadeOut(700);
        });
        
	$('#apre div').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout: 8000,
		speed: 1000,
		random: true
	});
	
	hs.registerOverlay({
		overlayId: 'closebutton',
		position: 'top right',
		fade: 2 // fading the semi-transparent overlay looks bad in IE
	});

        $(".Over").hover(function(){
           $(this).find(".nivel2").fadeIn('fast');
        },
        function (){
            $(this).find(".nivel2").fadeOut('fast');
        });
		
	//BIND PARA CAMPOS LOGIN E SENHA, RECOLOCANDO SEUS TITULOS
	$('#campoLogin').live('focus',function(e){
		if ($(this).val() == 'Login')
			$(this).val('');
	});
	$('#campoLogin').live('blur',function(e){
		if ($(this).val() == '')
			$(this).val('Login');
	});
	$('#campoSenha').live('focus',function(e){
		if ($(this).val() == 'Senha')
			$(this).val('');
	});
	$('#campoSenha').live('blur',function(e){
		if ($(this).val() == '')
			$(this).val('Senha');
	});
	
	
	logar=function(){
		var login = $('#campoLogin').val();
		var senha = $('#campoSenha').val();
		$('#headerLogin').append('<img id="carregandoGif" src="img/padrao/carregando.gif" />');	
		
		$('#formLogin').fadeOut(100);
		$('#menuAluno').fadeOut(100);
				
		$.post("aluno/aluno/logar", { 'data[Aluno][ds_login]': login, 'data[Aluno][ds_senha]': senha },
			function(data) {
				$('#carregandoGif').remove();
				$('#headerLogin').html(data);
						
				if (jQuery.browser['msie'] && jQuery.browser['version'] == '6.0' || jQuery.browser['msie'] && jQuery.browser['version'] == '7.0' || jQuery.browser['msie'] && jQuery.browser['version'] == '8.0')
					location.reload();
			}
		);			
	}
	
	
	
	$('#campoLogin').live('keypress', function(e){
		if(e.keyCode == 13)
			logar();
	});
	$('#campoSenha').live('keypress', function(e){
		if(e.keyCode == 13)
			logar();
	});
		
	
	
	//LOGANDO
	$('#btnLogar').live('click',function(e){
		logar();
	});
	
	
});

0

