﻿// JScript File

function addBookmark() {
    title = '源码搜搜';
    url = 'http://www.codesoso.com/';
    if (window.sidebar) { 
        window.sidebar.addPanel(title, url,""); 
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
}

function sethomepage() {

}

function ExpandSubFastNavigator(submenuid)
{
    if(submenuid != 'divLeftMenuSubCpp')
        document.getElementById("divLeftMenuSubCpp").style.display = "none";
    if(submenuid != 'divLeftMenuSubCsharp')
        document.getElementById("divLeftMenuSubCsharp").style.display = "none";
    if(submenuid != 'divLeftMenuSubAsp')
        document.getElementById("divLeftMenuSubAsp").style.display = "none";
    if(submenuid != 'divLeftMenuSubVb')
        document.getElementById("divLeftMenuSubVb").style.display = "none";
    if(submenuid != 'divLeftMenuSubMatlab')
        document.getElementById("divLeftMenuSubMatlab").style.display = "none";
    if(submenuid != 'divLeftMenuSubOther')
        document.getElementById("divLeftMenuSubOther").style.display = "none";

    var elem = document.getElementById(submenuid);
    if(elem.style.display == "block")
        elem.style.display = "none";
    else
        elem.style.display = "block";
}

function ShowMenuPage(pageId)
{
    //var     webHost = "http://www.codesoso.com/";
    var     webHost = "http://www.codesoso.com/";
    switch(pageId)
    {
        case 0:
            window.location = webHost;
        break;
        case 1:
            window.location = webHost+"category.aspx?CategoryId=1";
        break;
        case 2:
            window.location = webHost+"category.aspx?CategoryId=2";
        break;
        case 3:
            window.location = webHost+"category.aspx?CategoryId=3";
        break;
        case 4:
            window.location = webHost+"category.aspx?CategoryId=4";
        break;
        case 5:
            window.location = webHost+"category.aspx?CategoryId=5";
        break;
        case 10:
            window.location = webHost+"cantdownload.aspx";
        break;
        default:
        break;
    }
}

