$(function()
{
   $.easing.custom = function (x, t, b, c, d) { 
       var s = 1.70158;  
       if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
       return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
   }    
    
    // initialize scrollable  
   oSlider = $("#speechSlider").scrollable({
      api: true,
      easing: 'custom',
      speed: 1000,
      size: '1',
      items: '#speechSliderSlides',
      loop: true,
      vertical: true,
      keyboard: true,
      clickable: true
//      navi: '#speechSliderMenu',
//      naviItem: 'a'
   });

   $('#speechSliderMenu a').click(function()
   {
      $(this).addClass('active').siblings().removeClass('active');
      oSlider.seekTo(parseInt($(this).attr('href')));
      return false;
   }).filter(':first').click();

   
   /*- Formulario de login -*/
   $('#frmWM').submit(function()
   {
      if ($('#txtUser', this).val() == '')
      {
         window.alert('Debes escribir tu nombre de usuario/cuenta de email');
         $('#txtUser', this).focus();
         return false;
      }
      else if ($('#txtPass', this).val() == '')
      {
         window.alert('Debes escribir tu contraseña');
         $('#txtPass', this).focus();
         return false;         
      }
      else
      {
         $('#txtUserName', this).val($('#txtUser', this).val() + '@' + $('#selServer', this).val());
         return true;
      }
   });

});
