function openWin(https,wid,hei,name){
shopWin = open(https, name, "scrollbars=no,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();
}

function openWinScroll(https,wid,hei,name){
shopWin = open(https, name, "scrollbars=yes,resizable=no,width="+wid+",height="+hei+"");
        shopWin.focus();
}

function checkMail(x)
{
        var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (filter.test(x)) return 1;
        else return 0;
}

function checkFormSendReg() {

  var _in = document.getElementById("innDiv");
  if (document.FormNameFeed.T11.value=="") {


      document.getElementById("T11").focus();
      _in.innerHTML = _conn[1];
      return false;

  }
  if (document.FormNameFeed.T11.value.length<8) {

      document.getElementById("T11").focus();
      _in.innerHTML = _conn[1];
      return false;


  }

  if (document.FormNameFeed.T51.value.length<6) {

      document.getElementById("T51").focus();
      _in.innerHTML = _conn[7];
      return false;

  }
  if (document.FormNameFeed.T61.value.length<6) {

      document.getElementById("T61").focus();
      _in.innerHTML = _conn[8];
      return false;

  }

  if (document.FormNameFeed.T61.value != document.FormNameFeed.T71.value) {

      document.getElementById("T61").focus();
      _in.innerHTML = _conn[9];
      return false;

  }

  if (document.FormNameFeed.S11.value=="") {

      document.getElementById("S11").focus();
      _in.innerHTML = _conn[2];
      return false;

  }
  if (document.FormNameFeed.T21.value=="") {

      document.getElementById("T21").focus();
      _in.innerHTML = _conn[3];
      return false;

  }
  if (document.FormNameFeed.T31.value=="") {

      document.getElementById("T31").focus();
      _in.innerHTML = _conn[4];
      return false;

  }
  if (document.FormNameFeed.T31.value != '') {
      _ret = checkMail(document.FormNameFeed.T31.value);
      if (!_ret) {
         _in.innerHTML = _conn[5];
         document.getElementById('T31').focus();
         return false;
      }


  }
  if (document.FormNameFeed.T41.value=="") {

      document.getElementById("T41").focus();
      _in.innerHTML = _conn[6];
      return false;

  }

  if (document.FormNameFeed.security.value=="") {

      document.getElementById("security").focus();
      _in.innerHTML = _conn[10];
      return false;

  }




  return true;


}

function confirmLink()
{
    confirmMsg  = 'Uzmanību! ';
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm('Uzmanību \ntiešām dzēst?');
    if (is_confirmed) {
       // theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
}

function chstyle(a, b) {

    var x = document.getElementById(b);
   // alert(x);
    x.className  = a;

}

function replaceAll( str, from, to ) {
    var idx = str.indexOf( from );


    while ( idx > -1 ) {
        str = str.replace( from, to );
        idx = str.indexOf( from );
    }

    return str;
}

function vis(a) {


    if (a == 0) {
        _sel = 'hidden';
        _sel2 = 'none';
    } else {
        _sel = 'visible';
        _sel2 = 'inline';
    }

    document.getElementById('search').style.visibility = _sel;
    document.getElementById('selvis').style.display = _sel2;
    document.getElementById('selvis').style.visibility = _sel;

}



function checkFormSendStudio() {
       if (document.form1.TT1.value=='') {

           document.getElementById('divinner').innerHTML='Ievadiet jūsu vārdu';
           document.getElementById('TT1').focus();
           return false;

       }
       if (document.form1.TT4.value=='') {

           //
           document.getElementById('divinner').innerHTML='Ievadiet jūsu e-pastu';
           document.getElementById('TT4').focus();
           return false;

       }
       if (document.form1.SS1.value=='') {

           //
           document.getElementById('divinner').innerHTML='Ievadiet komentāru';
           document.getElementById('SS1').focus();
           return false;

       }

       if (document.form1.TT4.value != '') {
           _ret = checkMail(document.form1.TT4.value);
           if (!_ret) {
              ///
              document.getElementById('divinner').innerHTML='Nepareiza e-pasta adrese';
              document.getElementById('TT4').focus();
              return false;
           }

       }


       return true;
}