function slideSwitch() {
    var $active = jQuery('#cabecera canvas.active');

    if ( $active.length == 0 ) $active = jQuery('#cabecera canvas:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : jQuery('#cabecera canvas:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
 
function slideSwitch_sponsors() {
    var $active = jQuery('#cabecera_sponsor IMG.active');

    if ( $active.length == 0 ) $active = jQuery('#cabecera_sponsor IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : jQuery('#cabecera_sponsor IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    var $sibs  = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length );
    var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
 
function detectBrowserVersion(){
   var userAgent = navigator.userAgent.toLowerCase();
   //alert(userAgent);
   $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
   var version = 0;
   
   // Is this a version of IE?
   if($.browser.msie){
   userAgent = $.browser.version;
   userAgent = userAgent.substring(0,userAgent.indexOf('.'));
   version = "msie " + $.browser.version;
   }
   
   // Is this a version of Chrome?
   if($.browser.chrome){
   userAgent = userAgent.substring(userAgent.indexOf('chrome/') +7);
   userAgent = userAgent.substring(0,userAgent.indexOf('.'));
   version = "chrome";
   // If it is chrome then jQuery thinks it's safari so we have to tell it it isn't
   $.browser.safari = false;
   }
   
   // Is this a version of Safari?
   if($.browser.safari){
   userAgent = userAgent.substring(userAgent.indexOf('safari/') +7);
   userAgent = userAgent.substring(0,userAgent.indexOf('.'));
   version = "safari";
   }
   
   // Is this a version of Mozilla?
   if($.browser.mozilla){
   //Is it Firefox?
   if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1){
   userAgent = userAgent.substring(userAgent.indexOf('firefox/') +8);
   userAgent = userAgent.substring(0,userAgent.indexOf('.'));
   version = "mozilla";
   }
   // If not then it must be another Mozilla
   else{
   }
   }
   
   // Is this a version of Opera?
   if($.browser.opera){
   userAgent = userAgent.substring(userAgent.indexOf('version/') +8);
   userAgent = userAgent.substring(0,userAgent.indexOf('.'));
   version = "opera";
   }
   //alert(version + " " + $.browser.version);
   return version;
} 


