  function MM_openBrWindow(theURL,winName,features) { //v2.0
     window.open(theURL,winName,features);
  }

  function tbl_hover(id) {
    document.getElementById('id'+id).className="tbl_over";
  }

  function hidden_fast() {
    document.getElementById('fast_prod').style.visibility="hidden";
  }

  function show_fast() {
    document.getElementById('fast_prod').style.visibility="visible";
  }

  function win_open(url,win_name,features) {
    window.open(url,win_name,features,'top=452', 'left=1003');
  }

  function order(mode)  {
     if (mode == "catalog") {
       top.document.location="index.php?page=33";
      } else {
       if (mode == 'clear') {
          top.document.location="/zakaz/?mode="+mode;
         } else {
          top.document.location="/zakaz/?mode="+mode;
        }
     }
     
  }


function checkLen() {

var maxLen = 1000;

var arrRight = new Array('символ','символа','символов');
var arrLeft = new Array('Остался <span id="lenghtSms">1000</span>','Осталось <span id="lenghtSms">1000</span>');
var count0 = "Объявление не может быть больше, <br/>чем";
var str = document.getElementById('message').value;
var len = str.length;
var rusLen = 0;
var count = 0;

fullLen = maxLen - rusLen;
 if ( len > fullLen) { document.forms.f1.message.value = str.substring(0,fullLen);
  }
count = (fullLen - document.forms.f1.message.value.length);
 if(count == 0) {
    document.getElementById('countChar').innerHTML = count0+' '+maxLen+' '+arrRight[2];
 } else {
  if(count % 10 == 1 && count != 11) {
    document.getElementById('countChar').innerHTML = 'Остался <span id="lenghtSms">1000</span> <span id="right"></span>';  }else{
    document.getElementById('countChar').innerHTML = 'Осталось <span id="lenghtSms">1000</span> <span id="right"></span>'; }

   if (document.getElementById('lenghtSms')) {
      document.getElementById('lenghtSms').innerHTML = count;
    }
  }

}

