﻿function addBookmark(title, url) {
    if (document.all) {
        window.external.AddFavorite(url, title);
    } else if (window.sidebar) {
        window.sidebar.addPanel(title, url, "");
    } else if (window.opera && window.print) {
        return true;
    }
}

function SetHome(obj, url) {
    try {
        obj.style.behavior = 'url(#default#homepage)';
        obj.setHomePage(url);
    } catch (e) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            } catch (e) {
                alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
            };
        } else {
            alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'" + url + "'设置为首页。");
        };
    };
};

function piclist(focus_width, focus_height, text_height, txt) {
    var swf_height = focus_height + text_height;
    var rpics = "";
    var rlinks = "";
    var rtexts = "";
    var tmpstr = txt;
    if (tmpstr != "") {
        var pp = tmpstr.split("||");
        rpics = pp[0];
        rlinks = pp[1];
        rtexts = pp[2];
    }

    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="' + focus_width + '" height="' + swf_height + '">');
    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/webinfo/img/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">');
    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('<param name="FlashVars" value="pics=' + rpics + '&links=' + rlinks + '&texts=' + rtexts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">');
    document.write('<embed src="/webinfo/img/focus.swf" wmode="opaque" FlashVars="pics=' + rpics + '&links=' + rlinks + '&texts=' + rtexts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '" menu="false" ?bgcolor="#ffffff" quality="high" width="' + focus_width + '" height="' + swf_height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
}

function loadPng(o) {
    var MiniSite = new Object();
    MiniSite.Browser = {
        ie: /msie/.test(window.navigator.userAgent.toLowerCase()),
        moz: /gecko/.test(window.navigator.userAgent.toLowerCase()),
        opera: /opera/.test(window.navigator.userAgent.toLowerCase()),
        safari: /safari/.test(window.navigator.userAgent.toLowerCase())
    };
    if (MiniSite.Browser.ie) {
        try {
            var img = o; var imgName = o.src.toUpperCase(); if (imgName.substring(imgName.length - 3, imgName.length) == "PNG")
            { var imgID = (img.id) ? "id='" + img.id + "' " : ""; var imgClass = (img.className) ? "class='" + img.className + "' " : ""; var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "; var imgStyle = "display:inline-block;" + img.style.cssText; if (img.align == "left") imgStyle = "float:left;" + imgStyle; if (img.align == "right") imgStyle = "float:right;" + imgStyle; if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle; var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>"; img.outerHTML = strNewHTML; }
        } catch (e) { }
    }
}
