var SMScz_platmobilem =
{
  id_operator : '',
  id_account : '',
  id_price : '',
  price_min : 20,
  price_max : 600,

  inputOperator : function (name, value)
  {
     this.id_operator = name;

    document.write('<select name="' + name + '" style="width:10em">' + //
      '<option value="tmobile">T-Mobile</option>' + //
      '<option value="vodafone">Vodafone</option>' + //
      '<option value="o2">O2</option>' + //
    '</select>');
  },


  inputAccount : function (name, value)
  {
    this.id_account = name;

    document.write('<input type="text" name="' + name + '" id="' + name + '" value="+420" size="13" style="width:10em" maxlength="13">');
  },


  inputPrice : function (name, value, min, max)
  {
    this.id_price = name;
    if (parseInt(min) > 0) this.price_min = parseInt(min);
    if (parseInt(max) > 0) this.price_max = parseInt(max);

    document.write('<input type="text" name="' + name + '" id="' + name + '" value="' + value + '" size="13" style="width:10em" maxlength="13"> Kč');
  },


  logo : function ()
  {
    document.write('<img src="http://www.sms.cz/kategorie/kredit/bmp/platmobilem3D_66.png" style="margin-left:1em" />');
  },


  info : function ()
  {
    document.write('Poskytuje goNET s.r.o. Pro případné reklamace použijte reklamační formulář nebo volejte pondělí až pátek od 9 do 16 hodin na technickou podporu +420 608 977 289. Další informace o platbách na <a href="http://www.platmobilem.cz/" target="_blank">www.platmobilem.cz</a>');
  },


  checkSubmit : function ()
  {
    if (this.id_account != "")
    {
      if (!document.getElementById(this.id_account).value.match(/^[+]420[67][0-9]{8}$/))
      {
        alert('Telefonní číslo musí být zadáno ve tvaru +420xxxyyyzzz.');
        return false;
      }
    }

    if (this.id_price != "")
    {
      if ((parseInt(document.getElementById(this.id_price).value) < this.price_min) || (parseInt(document.getElementById(this.id_price).value) > this.price_max))
      {
        alert('Částka musí být v rozsahu ' + this.price_min + '-' + this.price_max + ' Kč.');
        return false;
      }
    }

    return true;
  }
}

