// ================================== 
// Cleartype fade fix by Mike Alsup

jQuery.fn.fadeIn = function(speed, callback) { 
     return this.animate({
          opacity: 'show' }, speed, function() { 
               if (jQuery.browser.msie) 
                    this.style.removeAttribute('filter'); 
               if (typeof callback == 'function') 
                    callback();
     }); 
};

jQuery.fn.fadeOut = function(speed, callback) { 
     return this.animate({
           opacity: 'hide' }, speed, function() { 
               if (jQuery.browser.msie) 
                    this.style.removeAttribute('filter'); 
               if (typeof callback == 'function') callback();
     }); 
}; 

jQuery.fn.fadeTo = function(speed,to,callback) { 
     return this.animate({opacity: to }, speed, function() { 
          if (to == 1 && jQuery.browser.msie) 
               this.style.removeAttribute('filter'); 
          if (typeof callback == 'function') callback(); 
     }); 
}; 

// General jQuery AJAX calls
//http://docs.jquery.com/

$(document).ready(function(){
       updateScreen();
    });
    
    function updateScreen() {
    $.ajax({
          url: 'random.php',
          type: 'GET',
          dataType: 'html',
          timeout: 10000,
          error: function(){
            alert('Error loading file');
          },
          success: function(res){
			$('#RandomContainer').fadeTo(200, 0, function() { $('#RandomContainer').html(res); }).fadeTo(350,1);
            //$('#RandomContainer').html(res);
          }
         });   
    }

