function getElementsByClassName(x) {
    var all_elements = document.getElementsByTagName('*');
    var elements = [];
    for (var i = 0; i < all_elements.length; i++) {
      if (all_elements[i].className == x) {
        elements.push(all_elements[i]);
      }
    }
    return elements;
}

document.getElementById('menu1').onmouseover = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center -32px';
};

document.getElementById('menu2').onmouseover = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center -64px';
};

document.getElementById('menu3').onmouseover = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center -96px';
};

document.getElementById('menu4').onmouseover = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center -128px';
};

document.getElementById('menu5').onmouseover = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center -160px';
};

document.getElementById('menu6').onmouseover = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center -192px';
};

document.getElementById('menu1').onmouseout = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center 0';
};

document.getElementById('menu2').onmouseout = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center 0';
};

document.getElementById('menu3').onmouseout = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center 0';
};

document.getElementById('menu4').onmouseout = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center 0';
};

document.getElementById('menu4').onclick = function() {
    window.open(this.getElementsByTagName('a')[0].href, 'mwprivacy', 'width=468,height=450,scrollbars=no,status=no');
    return false;
};

document.getElementById('menu5').onmouseout = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center 0';
};

document.getElementById('menu6').onmouseout = function() {
    document.getElementById('navdesc').style.backgroundPosition = 'center 0';
};

document.getElementById('menu6').onclick = function() {
    // window.open(this.getElementsByTagName('a')[0].href, 'mwabout', 'width=350,height=450,scrollbars=no,status=no');
    // return false;
};

document.getElementById('menu6').getElementsByTagName('a')[0].target = '_blank';

document.getElementById('menu3').onclick = function() {
    window.open(this.getElementsByTagName('a')[0].href, 'mwcontact', 'width=500,height=340,scrollbars=no,status=no');
    return false;
};

var comments = getElementsByClassName('button comment');
var sends = getElementsByClassName('button send');
var links = getElementsByClassName('button link');
var view_add_comments = getElementsByClassName('view-add-comment');
for (var i = 0, l = comments.length; i < l; i++) {
    comments[i].onmouseover = function() {
        document.getElementById('navdesc').style.backgroundPosition = 'center -224px';
    };
    
    sends[i].onmouseover = function() {
        document.getElementById('navdesc').style.backgroundPosition = 'center -256px';
    };
    
    links[i].onmouseover = function() {
        document.getElementById('navdesc').style.backgroundPosition = 'center -288px';
    };
    
    comments[i].onmouseout = function() {
        document.getElementById('navdesc').style.backgroundPosition = 'center 0';
    };
    
    sends[i].onmouseout = function() {
        document.getElementById('navdesc').style.backgroundPosition = 'center 0';
    };
    
    links[i].onmouseout = function() {
        document.getElementById('navdesc').style.backgroundPosition = 'center 0';
    };
    
    view_add_comments[i].getElementsByTagName('a')[0].onclick = function() {
        return false;
    };
    
    view_add_comments[i].onclick = function() {
        window.open(this.getElementsByTagName('a')[0].href, 'mwco', 'width=660,height=360,scrollbars=no,status=no');
    };
    
    sends[i].getElementsByTagName('a')[0].onclick = function() {
        return false;
    };
    
    sends[i].onclick = function() {
        window.open(this.getElementsByTagName('a')[0].href, 'mwsend', 'width=500,height=340,scrollbars=no,status=no');
    };
    
    comments[i].getElementsByTagName('a')[0].onclick = function() {
        return false;
    };
    
    comments[i].onclick = function() {
        window.open(this.getElementsByTagName('a')[0].href, 'mwpro', 'width=350,height=450,scrollbars=no,status=no');
    };
    
    links[i].getElementsByTagName('a')[0].target = '_blank';
    
    /*
    links[i].getElementsByTagName('a')[0].onclick = function() {
        return false;
    };
    
    links[i].onclick = function() {
        window.open(this.getElementsByTagName('a')[0].href, 'mwind', 'width=1050,height=600,scrollbars=no,status=no');
    };
    */
}

var el_entry = document.getElementById('text');
scroller_entry = new Scrolling.Scroller(el_entry,202,105);

var scrollup_entry = document.getElementById('scrollup');
var scrolldown_entry = document.getElementById('scrolldn');

scrollup_entry.onmouseover = function() {
    scroller_entry.startScroll(0,-3);
};

scrollup_entry.onmouseout = function() {
    scroller_entry.stopScroll();
};

scrolldown_entry.onmouseover = function() {
    scroller_entry.startScroll(0,3);
};

scrolldown_entry.onmouseout = function() { 
    scroller_entry.stopScroll();
};

var results = getElementsByClassName('result');
for (var i = 0; i < results.length - 1; i++) {
    results[i].onmouseover = function() {
        this.style.backgroundColor = '#efad01';
        this.firstChild.style.color = '#111c22';
    };
    
    results[i].onmouseout = function() {
        this.style.backgroundColor = 'transparent';
        this.firstChild.style.color = '#fff';
    };
}

var autos = getElementsByClassName('movie auto');
for (var i = 0, l = autos.length; i < l; i++) {
    autos[i].style.left = 931 + i * 407 + 'px';
}

if (autos.length > 0) {
    var partners = document.getElementById('partners');
    partners.style.left = 931 + autos.length * 407 + 'px';
    partners.style.width = '73px';
}