function $(oid) {
    return document.getElementById(oid);
}

function addBookmark() {
    if (window.sidebar) {
        window.sidebar.addPanel(top.document.title.toString(), top.location, "");
    }
    else if (document.all) {
        window.external.AddFavorite(top.location, top.document.title.toString());
    }
    else if (window.opera && window.print) {
        alert("press Ctrl+T to add a bookmark!");
    }
}

function contactUs() {
    self.location = 'mailto:webmaster@uufashion.com';
}

function homePage() {
    if (document.all) {
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage('http://www.uufashion.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.uufashion.com');
    }
}

function showSP(swf_width, swf_height, config, files, links, texts) {
    //config 設置分別爲: 自動播放時間(秒)|文字顔色|文字背景色|文字背景透明度|按鍵數字色|當前按鍵色|普通按鍵色
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + swf_width + '" height="' + swf_height + '">');
    document.write('<param name="movie" value="/images/sp.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="menu" value="false" />');
    document.write('<param name=wmode value="opaque" />');
    document.write('<param name="FlashVars" value="config=' + config + '&bcastr_flie=' + files + '&bcastr_link=' + links + '&bcastr_title=' + texts + '" />');
    document.write('<embed src="/images/sp.swf" wmode="opaque" FlashVars="config=' + config + '&bcastr_flie=' + files + '&bcastr_link=' + links + '&bcastr_title=' + texts + '" menu="false" quality="high" width="' + swf_width + '" height="' + swf_height + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
}


function showads(at) {
    switch (at) {
        case 0:
            banners();
            break;
        case 1:
            ads300x250();
            break;
        case 2:
            ads468x60();
            break;
    }
}

function banners() {
    var curl = top.location.href.toLowerCase();
    if (curl.indexOf('fitness') > -1) {
        document.write('<a href="/fitness/"><img src="/images/banners/a_fitness.gif" style="width:728px;height:90px" alt="" /></a>');
    }
}

function ads300x250() {
    google_ad_client = "pub-2766498197753827";
    /* UUFashion減肥館_300x250 */
    google_ad_slot = "3420702860";
    google_ad_width = 300;
    google_ad_height = 250;
    document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}


function ads468x60() {
    google_ad_client = "pub-2766498197753827";
    /* UUFashion減肥瘦身_468x60 */
    google_ad_slot = "6908449786";
    google_ad_width = 468;
    google_ad_height = 60;
    document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}