/* ANIMATE ".notfocused" */	
objectred = { 
    func: function() { 
        $(".notfocused").css("background","transparent url(../img/bcg/bcg-qa.png) no-repeat scroll 50% 50%")  
        clearTimeout(timeout_id)    
        timeout_id = setTimeout( function() { object.func.call(object) } , 800)  
    }
}
object = { 
    func: function() { 
        $(".notfocused").css("background","transparent url(../img/bcg/bcg-qa1.png) no-repeat scroll 50% 50%")  
        clearTimeout(timeout_id)    
        timeout_id = setTimeout( function() { objectred.func.call(objectred) } , 800)  
    }
}
objectred_cursor = { 
    func: function() { 
        $(".notfocused").css("color","#EFCD6E")  
        clearTimeout(timeout_id_cursor)    
        timeout_id_cursor = setTimeout( function() { object_cursor.func.call(object_cursor) } , 300)  
    }
}
object_cursor = { 
    func: function() { 
        $(".notfocused").css("color","#A1E628")  
        clearTimeout(timeout_id_cursor)    
        timeout_id_cursor = setTimeout( function() { objectred_cursor.func.call(objectred_cursor) } , 300)  
    }
}
var timeout_id = setTimeout( function() { object.func.call(object) } , 800)
var timeout_id_cursor = setTimeout( function() { object_cursor.func.call(object_cursor) } , 300)		
/* END ANIMATE ".notfocused" */	 
	 function openWin(width, height, link) {
		window.open(link, 'window1', 'width = '+width+', height = '+height+', resizable=1, scrollbars=0');
	 }
	 

	 $(document).ready(function(){ 
	 	$("#text").text("I")
	 	
		$("#aLoad").bind("ajaxSend", function(){
		    $(this).show(); 
	    }).bind("ajaxComplete", function(){
		    $(this).hide(); 
		});
	 	
	 	
	 	$('#addUserBut').click(function() {
	 		$('#add_user_block').slideToggle('normal');
	 	});
	 	
	 	
	 	$('#cancel_but').click(function() {
			$('#add_user_block').slideToggle('normal');
	 	})
	 	

		$('#signin_sub').click(function() {

			$('#log_error').hide();
			$('#pass_error').hide();

		    $.ajax({
			    url:'/ajax/consult.php',
		        type: 'POST',
		        data: 'authCheck=1&login='+$('#login_f').attr('value')+'&password='+$('#password').attr('value'),
		        cache: false,
		        dataType : "json",
		        success: function(data){
		        	
		        	if (data == 1) {
		        		$('#log_error').show();
		        	} else if (data == 2) {
		        		$('#pass_error').show();
		        	} else {
		        		location.reload();
		        	}
		        	
		        },
		        error: function(){
		          //  alert('ERROR');
		        } 
		    });
			
		});
		
    });
