﻿document.write('<script type="text/javascript" src="/images/adunit.js"></script>'+
               '<script type="text/javascript" src="/images/ajax.js"></script>');


function addBookmark() 
{
    if (window.sidebar)
    { 
     window.sidebar.addPanel('手機巴士——免費手機遊戲、鈴聲、主題、軟體、桌布、視頻下載！', 'http://www.mpbus.com',""); 
    }
    else if( document.all )
    {
     window.external.AddFavorite('http://www.mpbus.com','手機巴士——免費手機遊戲、鈴聲、主題、軟體、桌布、視頻下載！');
    }
    else if( window.opera && window.print )
    {
        alert("請按下CTRL+T加入“我的最愛”");
    }
}

function homePage() 
{
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage('http://www.mpbus.com');
    }
    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://www.mpbus.com');
         alert("設為首頁成功！");
   }
}

function send2friends()
{
    self.location='mailto:myFriend@emailAddress.com?subject=Hello,%CD%C6%CB%5D%BA%C3%82%80%96%7C%CE%F7%BDo%C4%E3%E0%B8%A3%&body=%BF%C9%D2%D4%C3%E2%D9M%CF%C2%DDd%B5%BD%CA%D6%99C%D1e%B5%C4%A3%AC%BEW%D6%B7%CA%C7%A3%BA'+top.location;
}



function wo(url,w,h,m)
{
	var left=(screen.width-w)/2;
	var top=m?(screen.height-h)/2:0;
	window.open(url,'','width='+w+',height='+h+',top='+top+',left='+left+',menubar=no,toolbar=no,location=yes,directories=no,status=no,resizable=no,scrollbars=yes');
	return false;
}

var cuhost = top.location.host.toLowerCase();
//if (cuhost=="mpbus.com") top.location = "http://www.mpbus.com/";
//if (cuhost.indexOf('http://www3.mpbus.com') > -1) top.location = cuhost.replace('http://www3.','http://www.');
