﻿//
// Main Menu Code
//
function HighlightText(e) {
    target = e ? e.target : window.event.srcElement;
    target.style.textDecoration = "underline";
    target.style.color = 0x5599cc;
}
function RestoreText(e) {
    target = e ? e.target : window.event.srcElement;
    target.style.textDecoration = "none";
    target.style.color = 0x336699;
}
function HighlightBackground(e) {
    target = e ? e.target : window.event.srcElement;
    target.style.backgroundColor = "#5376b9";
}
function RestoreBackground(e) {
    target = e ? e.target : window.event.srcElement;
    target.style.backgroundColor = "#336699";
}
function ClickBackground(e) {
    target = e ? e.target : window.event.srcElement;
    target.style.backgroundColor = "#ff6699";
}
function MainMenu_Init() {
    var buttons = new Array();
    buttons[0] = 'me1';
    buttons[1] = 'me2';
    buttons[2] = 'me3';
    buttons[3] = 'me4';
    buttons[4] = 'me5';
    buttons[5] = 'me6';
    buttons[6] = 'me7';
    buttons[7] = 'me8';
    buttons[8] = 'me9';
    var links = new Array();
    links[0] = function() { parent.location = '/Desktop.aspx'; }
    links[1] = function() { parent.location = '/Default.aspx'; }
    links[2] = function() { parent.location = '/About.aspx'; }
    links[3] = function() { parent.location = '/Browse.aspx'; }
    links[4] = function() { parent.location = '/Search.aspx'; }
    links[5] = function() { parent.location = '/News.aspx'; }
    links[6] = function() { parent.location = '/forums/index.php'; }
    links[7] = function() { parent.location = '/Help/Help.aspx'; }
    links[8] = function() { parent.location = '/WebDirectory.aspx'; }
    for (t = 0; t < buttons.length; t++) {
        var me = document.getElementById(buttons[t]);
        me.onmouseover = HighlightText;
        me.onmouseout = RestoreText;
        me.onclick = links[t];
    } 
}

function SharetopsBrowser_Init() {
    var buttons = new Array();
    buttons[0] = 'ctl00_cpMain_SponsoredButton';
    buttons[1] = 'ctl00_cpMain_LatestButton';
    buttons[2] = 'ctl00_cpMain_PopularButton';
    buttons[3] = 'ctl00_cpMain_UpdatedButton';
    for (t = 0; t < buttons.length; t++) {
        var me = document.getElementById(buttons[t]);
        me.onmouseover = HighlightText;
        me.onmouseout = RestoreText;
    }
}
