function doSubscription(hotel, roomtype, roomsnumber, checkin, checkout, language)
{
  if(language=='') language = 'ES';

  if(checkin=='' || checkout=='') 
  {
    alert(getErrorMessage(NODATES));
    return false;
  }

  if(compareDates(checkin,checkout)!=-1)
  {
    alert(getErrorMessage(DATEOUTBEFOREIN));
    return false;
  }

  var now = new Date;
  var today = '' + now.getDate() + '/' + now.getMonth() + '/' + now.getFullYear();
  if(compareDates(today, checkin)==1)
  {
    alert(getErrorMessage(DATEINPAST));
    return false;
  }

  displayLoading('messagesubscription', true);
  JUser.doSubscription(objectEval("'"+hotel+"'"), objectEval("'"+roomtype+"'"), objectEval("'"+roomsnumber+"'"), objectEval("'"+checkin+"'"), objectEval("'"+checkout+"'"), objectEval("'"+language+"'"), replydoSubscription);
}

var replydoSubscription = function(data)
{
  displayLoading('messagesubscription', false);
  if (data != null && typeof data == 'object') 
  {
    alert('No se pudo procesar. Int&eacute;ntelo m&aacute;s tarde, por favor.');  
  }
  else 
  { 
    var response = DWRUtil.toDescriptiveString(data, 1);
    DWRUtil.setValue('messagesubscription', response);
  }
}
