function adaptarLogo()
{
 var imgx = 1442; 
 var imgy = 1245; 
 var anchura = jQuery(window).width();
 var altura = jQuery(window).height()+20;

 nimgx = anchura;
 nimgy = anchura*imgy/imgx;
 
 if (nimgy>altura)
 {
  nimgy = altura;
  nimgx = altura*imgx/imgy;
 }
 
 jQuery('#logo').width(nimgx).height(nimgy);
 getLogo(nimgx);
}

function getLogo(imgx)
{ 
 img = 'logo800.png';
 if (imgx>800)
  img = 'logo1024.png';
 else
 if (imgx>1024)
  img = 'logo1280.png';
 else
 if (imgx>1280)
  img = 'logo1440.png';
  
  //alert(img);
  
 jQuery('#logo').attr('src',img)
}

jQuery(document).ready( function() {

adaptarLogo();

jQuery(window).resize(function(){ adaptarLogo(); });
jQuery('#logo').show(2500);
window.setTimeout( function(){ jQuery('#texto').fadeIn(1000) }, 1500);


});
