﻿


///加入收藏
function AddFavorite(sURL, sTitle) {
    try {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e) {
        try {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e) {
            alert("加入收藏失败，有劳您手动添加。");
        }
    }
}

/// 设为主页
function SetHome(obj, vrl) {
    try {
        obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(vrl);
    }
    catch (e) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage', vrl);
        }
    }
} 

/** 为空图片绑定默认图片 Begin **/
function BindImageOnError(obj, width, height)
{
    obj.src = '<%= ConfigurationManager.AppSettings["DefaultPictureUrl"].ToString() %>&W=' + width + '&H=' + height;
}
function BindImage_OnError(obj, header, width, height)
{
    obj.src = header + '<%= ConfigurationManager.AppSettings["DefaultPictureUrl"].ToString() %>&W=' + width + '&H=' + height;
}
/** 为空图片绑定默认图片 End **/


/* login.htm */ 
function goLogin()
{
	window.moveTo(-9999,-9999);
	var returnValue = window.showModalDialog("Modules/Commonpage/login.htm", "",  "dialogWidth:800px; dialogHeight:500px;status:No; ");
	
	if (returnValue == "close")
	{
		window.close();
	}
	else
	{
		window.location.replace ("Modules/Layout/Masterpage.htm");
		window.moveTo(-4,-4);
	}
}

/*commom*/
function Confirm()
{
	var ReturnValue = confirm("你确定要删除该记录吗?");
	if (ReturnValue == true)
		{alert("记录已删除!")}
	else
		{return null}
}

function OpenWin( sURL , sFeatures )
{
	window.open( sURL , null , sFeatures , null)
	//window.open("Sample.htm",null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
	//window.open( [sURL] [, sName] [, sFeatures] [, bReplace])
	//sName{_blank; _media; _parent; _search; _self; _top}
	//sFeatures{channelmode; directories; fullscreen; height; left; location; menubar; resizable; scrollbars; status; titlebar; toolbar; top; width} 
}

function ShowWin( sURL , sFeatures )
{
	window.showModalDialog( sURL , null , sFeatures)
	//window.showModalDialog("Sample.htm",null,"dialogHeight:591px;dialogWidth:650px;")
	//window.showModalDialog([sURL] [, vArguments] [, sFeatures])
	//sFeatures{dialogHeight; dialogLeft; dialogTop; dialogWidth; center; dialogHide; edge; help; resizable; scroll; status; unadorned}
}

