

function confirmSubmit() {
    return confirm('Are you sure you want to do this?');
}
 
 
function ensure(message) {
    return confirm(message);
}
 
 
function replytoid(id) {
    return $(document.getElementsByName('comm_replyto')[0]).val(id);
}
 
 
function hidetr(value, tID, trID) {
    $('#' + tID + ' tr').each(function () {
        if (this.id.indexOf(trID) > -1 && $(this).val == 0) $(this).addClass('hidden');
        else $(this).removeClass('hidden');
    });
}
 
 
function hideinput(value, input) {
    if (value) $('#' + input).addClass('hidden');
}
 
 
function FuncSelectAll() {
    if (document.serverlist.selectall.checked == 1) {
        val = 1;
    } else {
        val = 0;
    }
    dml = document.forms['serverlist'];
    len = dml.elements.length;
    var i = 0;
    for (i = 0; i < len; i++) {
        if (dml.elements[i].value == 'serverbox') {
            dml.elements[i].checked = val;
        }
    }
}
var tonormal;
 
function whatshot(id) {
    window.clearTimeout(tonormal);
    $('#matchinfo').html($('#' + id).html());
    $('#whatshot').hide();
    $('#matchinfo').css('display', 'inline');
}
 
 
function nothot() {
    tonormal = window.setTimeout("normalhot()", 2000);
}
 
 
function normalhot() {
    $('#matchinfo').hide();
    $('#whatshot').css('display', 'inline');
} 
 
function getTimeOffset(servertime) {
    expires = new Date();
    expires = new Date(expires.getTime() + 31536000000);
    clienttime = new Date();
    clienttime = new Date(clienttime.getTime() + clienttime.getTimezoneOffset() * -60000);
    clienttime = clienttime.getTime() / 1000;
    offset = Math.round((clienttime - servertime) / 1800) / 2;
    document.cookie = 'timeoffset=' + offset + '; expires=' + expires.toGMTString() + '; path=/;';
    return offset;
}

if(!Array.indexOf){
    Array.prototype.indexOf = function(obj){
        for(var i=0; i<this.length; i++){
            if(this[i]==obj){
                return i;
            }
        }
        return -1;
    }
}