var CUR_GEOIP;
var JS_LIST_COUNTRY_CODE = 'RU';

$(document).ready(function() { 
  showSelectedCountry(CUR_GEOIP);
  ch_link_stoim();
});

function showSelectedCountry(idCountry)
{
  CUR_GEOIP = idCountry;
  var cntr_code = new Array();
  cntr_code = JS_LIST_COUNTRY_CODE.split(',');
  var l = cntr_code.length;
  for (i=0;i<l;i++) { hide(cntr_code[i]); hide('stoimost_'+cntr_code[i]); hide('appendhtml_'+cntr_code[i]); }
  hide('rules-text-div');
  show(idCountry);
  show('stoimost_'+idCountry);
  show('appendhtml_'+idCountry);
  
  /*
  var opt = byID('appendhtml_'+idCountry);
  if (opt)
  {
    var valss = jQuery.trim(opt.innerHTML);
    if (valss != '')
    {
      //alert('"' + valss + '"');
      $('#mts_sel_oper_in').html(valss);
      show('content_sel_oper');
    } else { hide('content_sel_oper'); }
  } else { hide('content_sel_oper'); }
  */
  ch_link_stoim();
  
  var postFieldGeoIP = byID('id-geoipcode');
  if (postFieldGeoIP) { postFieldGeoIP.value = idCountry; }
}

function showEnterDiv()
{
  hide('login-form-div-no');
  show('login-form-div-yes');
}

function showRulesText()
{
  ua_rules();
  hide('total-div');
  show('rules-text-div');
  //sendActionRulesOpen();
}

function acceptRules()
{
  show('total-div');
  showSelectedCountry(CUR_GEOIP);
}
