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 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 windOpen(a) {

    window.open(a, '_self')

}

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 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 checkFormSendStudio() {
       if (document.FormNameFeed.T1.value=='') {

           alert('Ievadiet jūsu vārdu');
           document.getElementById('T1').focus();
           return false;

       }
       if (document.FormNameFeed.T3.value=='') {

           //
           alert('Ievadiet jūsu e-pastu');
           document.getElementById('T3').focus();
           return false;

       }
       if (document.FormNameFeed.S1.value=='') {

           //
           alert('Ievadiet komentāru');
           document.getElementById('S1').focus();
           return false;

       }

       if (document.FormNameFeed.T3.value != '') {
           _ret = checkMail(document.FormNameFeed.T3.value);
           if (!_ret) {
              ///
              alert('Nepareiza e-pasta adrese');
              document.getElementById('T3').focus();
              return false;
           }

       }


       return true;
}