window.setHome = function( href ) {
    href.style.behavior='url(#default#homepage)';
    href.setHomePage('http://www.kukutv.com/');
};

window.setFav = function(  ) {
    window.external.AddFavorite("http://www.kukutv.com/","kukuTV剧集站");
};

window.bookmark = function(){
    var title=document.title
    var url=document.location.href
    if ( window.sidebar ) {
        window.sidebar.addPanel(title, url,"");
    } else if( window.opera && window.print ) {
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    } else if( document.all ) { 
        window.external.AddFavorite( url, title);
    }
}
window.copyUrl = function(){
    var clipBoardContent=""; 
    clipBoardContent+=document.title; //获取标题 
    clipBoardContent+="\r\n"; 
    clipBoardContent+=document.location.href; //获取地址
    if (window.clipboardData){
        window.clipboardData.setData("Text", clipBoardContent);
    } else if (window.netscape){
        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
        var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
        if (!clip) return;
        var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
        if (!trans) return;
        trans.addDataFlavor('text/unicode');
        var str = new Object();
        var len = new Object();
        var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
        var copytext=clipBoardContent;
        str.data=copytext;
        trans.setTransferData("text/unicode",str,copytext.length*2);
        var clipid=Components.interfaces.nsIClipboard;
        if (!clip) return false;
        clip.setData(trans,null,clipid.kGlobalClipboard);
    }
    alert("复制成功,您可以发送给你的好友啦!");
};

window.tuiSwap = {
    curr : 'zuixindianshiju',
    action : function( name ) {
        if ( this.curr !== name ) {
            document.getElementById( "btn_" + name ).className = "ac";
            document.getElementById( name ).className = "P1 show";
            document.getElementById( "btn_" + this.curr ).className = "";
            document.getElementById( this.curr ).className = "P1";
            this.curr = name;
        }
    }
};
