function open_window(url) {
    myWin1 = window.open(url, "myWin2", "width=500,height=500,status=no,toolbar=no,resizable=no,scrollbars=yes,menubar=no");
    if (navigator.appName != "Microsoft Internet Explorer") {
        if (window.focus) myWin1.focus()
    }
}
function Popup(url) {
    window.open(url, 'window', 'width=600, height=600, resizable=yes, scrollbars=yes, location=no,  toolbar=no, menubar=no, status=no')
}
function Validate() {
    if (document.forms.search.q.value.length < 4) {
        alert('Only words that have more then 4 caracters!');
        return false
    }
    return true
}
function refresh() {
    window.opener.location.reload(true);
    window.close()
}
function bgcolor(nr) {
    document.getElementById("rand" + nr).style.backgroundColor = '#baf3c2'
}
function removebg(nr) {
    document.getElementById("rand" + nr).style.backgroundColor = '';
    
}
function cek_box(nr) {
    if (document.getElementById("mem" + nr).checked == true) {
        document.getElementById("mem" + nr).checked = false
    } else {
        document.getElementById("mem" + nr).checked = true
    }
}
function MM_jumpMenu(selObj, restore) {
    eval("window.location='" + selObj.options[selObj.selectedIndex].value + "'");
    if (restore) selObj.selectedIndex = 0
}
var http = false;
if (navigator.appName == "Microsoft Internet Explorer") {
    http = new ActiveXObject("Microsoft.XMLHTTP")
} else {
    http = new XMLHttpRequest()
}
function validate_user(value) {
    http.abort();
    http.open("GET", "sources/ajax/validate.php?name=" + value, true);
    http.onreadystatechange = function () {
        if (http.readyState == 4) {
            document.getElementById('username_er').innerHTML = http.responseText
        }
    }
    http.send(null)
}
function validate_pass(value) {
    http.abort();
    http.open("GET", "sources/ajax/validate.php?pass=" + value, true);
    http.onreadystatechange = function () {
        if (http.readyState == 4) {
            document.getElementById('pass').innerHTML = http.responseText
        }
    }
    http.send(null)
}
function validate_re_pass(value1, value2) {
    http.abort();
    http.open("GET", "sources/ajax/validate.php?pass=" + value1 + "&re_pass=" + value2, true);
    http.onreadystatechange = function () {
        if (http.readyState == 4) {
            document.getElementById('re_pass').innerHTML = http.responseText
        }
    }
    http.send(null)
}
function validate_email(value) {
    http.abort();
    http.open("GET", "sources/ajax/validate.php?email=" + value, true);
    http.onreadystatechange = function () {
        if (http.readyState == 4) {
            document.getElementById('email').innerHTML = http.responseText
        }
    }
    http.send(null)
}
function validate_resend_email(value) {
    http.abort();
    http.open("GET", "sources/ajax/validate.php?resend_email=" + value, true);
    http.onreadystatechange = function () {
        if (http.readyState == 4) {
            document.getElementById('username').innerHTML = http.responseText
        }
    }
    http.send(null)
}
function change(id) {
    ID = document.getElementById(id);
    if (ID.style.display == "") ID.style.display = "none";
    else ID.style.display = ""
}
function select_all(value) {
    var text_val = eval(document.getElementById(value));
    text_val.focus();
    text_val.select()
}

