﻿function showads(at)
{
    switch(at) {
        case 0:
            ads728x90();
            break;
        case 1:
            ads468x15();
            break;
     }
}


function setMenu(menuid)
{
	document.getElementById(menuid).className='menu_s_td';
	document.getElementById(menuid+'_div').className='menu_s_div';
	document.getElementById(menuid+'_title').className='menu_title';
}


function ads468x15() {
    google_ad_client = "pub-2766498197753827";
    /* 小遊戲Game876TW通欄_468x15 */
    google_ad_slot = "2190841287";
    google_ad_width = 468;
    google_ad_height = 15;
    document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');

}

function ads728x90() {
    google_ad_client = "pub-2766498197753827";
    // 876TW_728x90 
    google_ad_slot = "5275252373";
    google_ad_width = 728;
    google_ad_height = 90;
    document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');

}


function displayFlash(path, width, height)
{

    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" WIDTH="' + width+'" HEIGHT="' + height + '" id="flash876">');
    document.write('<PARAM NAME="movie" VALUE="' + path + '"><PARAM NAME="quality" VALUE="high">');
    document.write('<PARAM NAME="AllowScriptAccess" VALUE="never"><EMBED src="' + path + '"');
    document.write(' quality="high" WIDTH="' + width + '" HEIGHT="' + height + '" NAME="FlashContent"');
    document.write(' AllowScriptAccess="never" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
    document.write('</EMBED></OBJECT><input name="gurl" id="gurl" type="hidden" value="'+path+'" />');
}

function displayDirector(path, width, height)
{
    if(mylanguage.indexOf('zh-cn')<0)path='http://flashgames.wapdisk.com/'+path;
    document.write('<OBJECT classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"');
    document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,0,11"');
    document.write(' ID="DirectorContent" WIDTH="' + width + '" HEIGHT="' + height + '">');
    document.write('<PARAM NAME=src VALUE="' + path + '">');
    document.write('<EMBED SRC="' + path + '"');
    document.write(' WIDTH="' + width + '" HEIGHT="' + height + '"');
    document.write(' TYPE="application/x-director" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveDirector">');
    document.write('</EMBED>');
    document.write('</OBJECT>');
}




function addBookmark() 
{
    if (window.sidebar)
    {
        window.sidebar.addPanel('免費好玩小遊戲基地-Game.876.TW', 'http://Game.876.tw', ""); 
    }
    else if( document.all )
    {
        window.external.AddFavorite('http://Game.876.tw', '免費好玩小遊戲基地-Game.876.TW');
    }
    else if( window.opera && window.print )
    {
        alert("press Ctrl+T to add a bookmark!");
    }
}

function homePage() 
{
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage('http://Game.876.tw');
    }
    else if (window.sidebar)
    {
        if(window.netscape)
        {
             try
            {  
                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');  
            }  
             catch (e)  
             {  
                alert('please visite "about:config", and set the key "signed.applets.codebase_principal_support" value for true');  
             }
        } 
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage', 'http://Game.876.tw');
   }
}
