over30liststar = {};

over30liststar.sel = function (id,num)
{
    for(var i=1;i<=num;i++) {
        var el = document.getElementById('s' + i + 'g' + id);
        if(el) {
            el.storedClassName = el.className;
            el.className = 'over30liststar over30lists_selected';
        }
    }
}

over30liststar.restore = function (id,num)
{
    for(var i=1;i<=num;i++) {
        var el = document.getElementById('s' + i + 'g' + id);
        if(el && el.storedClassName) {
            el.className = el.storedClassName;
        }
    }
}

over30liststar.disable = function (id,num)
{
    for(var i=1;i<=num;i++) {
        var el = document.getElementById('s' + i + 'g' + id);
        if(el) {
            if(el.storedClassName) el.className = el.storedClassName;
            el.onmouseout = function(){};
            el.onmouseover = function(){};
            el.onclick = function(){};
        }
    }
}

over30liststar.vote = function (id,num,count)
{
    var xhr = null;
    if (window.ActiveXObject) {
        try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); }
        catch (e) { try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); }
        catch (e) { xhr = null; }}
    }else if (document.implementation && document.implementation.createDocument) {
        xhr = new XMLHttpRequest(); 
    }
    if(xhr == null) return;
    xhr.open('GET', 'http://www.over30list.com/cgi-bin/vote.cgi?' + id + '-' + num + '-' + count,  false);
    try {xhr.send(null);} catch(e) {}

    if(xhr.readyState  == 4 && xhr.status == 200) {
        over30liststar.disable(id,count);
    }
}