
function OpenBuyWin(ph,pid,pname){ var p = ph+"order/?p="+pid+"&pn="+escape(pname); window.open(p,'BuyNow','width=620,height=420,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');}

function Zoom(pid, pname) { var p = "../image.aspx?pid=" + pid; window.open(p, 'ZoomOut', 'width=500,height=450,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes'); }

function ChangeImage(p,n){document.getElementById("imgCurrent").src = p; document.getElementById("ltlName").innerText = n;}

function OpenVipWin(ph){var p = ph+"Order/VIP.aspx";window.open(p,'VIP','width=620,height=600,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');}

function OpenFeedbackWin(ph){var p = ph +"order/Feedback.aspx";window.open(p,'Feedback','width=520,height=350,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');}

function OpenReadNewsWin(ph,id){var p = ph +"Read.aspx?id="+id;window.open(p,'_blank');}

function OpenhuiWin(ph){var p = ph+"Order/huishou.aspx";window.open(p,'huishou','width=620,height=600,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');}

//添加到收藏夹，兼容火狐和ie
function addBookmark() {
	var url="http://www.dellwx.com/";
	var title="中网通，配件中心";
	if(document.all){
		window.external.AddFavorite(url,title)
	}
	else if(window.sidebar){
		window.sidebar.addPanel(title,url,"")
	}else{
		alert("对不起，您的浏览器不支持此操作!\n请您使用菜单栏或Ctrl+D收藏本站。")
	}
}

//设为首页，兼容火狐和ie
function setHomepage()
{
    if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage(window.location.href);
    }
    else if (window.sidebar)
    {
        if(window.netscape)
        {
            try
            {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e)
            {
                alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" );
            }
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',window.location.href);
    }
}
