
// carrousel en el destacado de la portada
 $(document).ready(function(){ 
      $("#slider").easySlider({
        auto: false,
        pause: 12000, 
        continuous: true
      });
      $("#slider-single").easySlider({
        auto: false, 
        continuous: true,
        nextId: "noticiasnext",
        prevId: "noticiasprev"
      });
    });
 
// desplegable en el menú de navegación 
$(document).ready(function() {
  function megaHoverOver(){
    $(this).find(".sub").stop().fadeTo('fast', 1).show();
    $(this).calcSubWidth();
    var rowWidth = 952; 
    $(this).find(".sub").css({'width' : rowWidth});
  }
  
  function megaHoverOut(){ 
    $(this).find(".sub").stop().fadeTo('fast', 0, function() {
      $(this).hide(); 
    });
  }

  var config = {    
     sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
     interval: 100, // number = milliseconds for onMouseOver polling interval    
     over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
     timeout: 500, // number = milliseconds delay before onMouseOut    
     out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
  };

  $("ul#topnav li .sub").css({'opacity':'0'});
  $("ul#topnav li").hoverIntent(config);
  
  // borrar el valor por defecto
  $('.default-value').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
  });
  
});
