//version 4.3
// this page should never load inside of another frame
if (top != self){
    top.location  = self.location;
}


function checkmail(sbuf){
    // 0=correct, 1=wrong, 2=empty
    if(sbuf!="") {
        re=/(\.@)|(^[\.\-]{1})|(\.\-\.+)|(@\.\-)|(@.*_)/;
        result = re.test(sbuf);
        if(!result) {
            re=/^[(\w)\.\-]+[@]{1}[(\w)\.\-]+[\.\-]{1}[^(\d\W|_|\.\-)]{2,6}$/;
            result = re.test(sbuf);
            if(!result)
                return 1;
            return 0;
        }
        return 1;
    }
    return 2;
}

function jstrim(sbuf) {
    //trim left and right
    if( sbuf !="") {
        sbuf = sbuf.replace(/^\s+/gi, '');
        sbuf = sbuf.replace(/\s+$/gi, '');
    }
    return sbuf;
}

function goredir(_this){
    if(_this.options[_this.selectedIndex].value!='') location.href=_this.options[_this.selectedIndex].value; else _this.selectedIndex=0;
}

function add2favorites() {
    if (document.all){
        window.external.AddFavorite(location.href, document.title);
    }else{
        alert("Этот обозреватель не поддерживает эту функцию, попробуйте комбинации клавиш, например [Ctrl+D], [Ctrl+F] или для Opera [Ctrl+T]");
    }
}

function prnt(str){
    document.write(str);
}

function iif(bool, valtrue, valfalse){
    return bool ? valtrue : valfalse;
}

function send2friend(){
    document.location.href="mailto:?subject=Fwd:["+document.location.href+"]-"+document.title.replace(/\s+/gi, '_')+"&body="+escape(top.parent.location.href);
}

function usual_version(){
}


function win_open(){
    if (arguments.length==1) {
        window.open (arguments[0]);
    }
    if(arguments.length==2) {
        window.open (arguments[0], arguments[1]);
    }
    if(arguments.length>=3) {
        window.open (arguments[0], arguments[1], arguments[2]);
    }
}
