/*
********************************************************************************************
***函数名  : setHomePage
***函数说明: 将当前网页设为首页
***参数    : 
			 sURL : URL地址
***返回值  : NULL
*/
function setHomePage(sURL) {
	if (document.all) {
		document.body.style.behavior = "url(#default#homepage)";
		document.body.setHomePage(sURL);
	}
	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", sURL);
	}
}

/*
********************************************************************************************
***函数名  : addFavorite
***函数说明: 将当前网页添加到收藏夹(书签)
***参数    : 
'            sTitle		: 标题
'            sUrl		: URL地址
***返回值  : NULL
*/
function addFavorite(sTitle, sUrl) {
	if (window.navigator.userAgent.indexOf("MSIE")>=1) {	//IE
		window.external.AddFavorite(sUrl, sTitle);
	}
	else if (window.navigator.userAgent.indexOf("Firefox")>=1) {	//Firefox
		window.sidebar.addPanel(sTitle, sUrl, "");
	}
	else {
		alert("未知浏览器,请您更换其它类型浏览器!");
	}
}




/*
********************************************************************************************
***函数说明: 新闻内容自动滚屏及字体大小控制
*/
function click() {
if (event.button==2) {
	if(document.all.auto.status==true){document.all.auto.status=false;alert("自动滚屏已经停止了！")}
	scroller();
	}
}
document.onmousedown=click

var position = 0; 
function scroller() {
if (document.all.auto.status==true){ 
	position++; 
	scroll(0,position); 
	clearTimeout(timer); 
	var timer = setTimeout("scroller()",50); 
	timer;
	}
else{
	clearTimeout(timer);
	}
}

function doZoom(size){
	document.getElementById('zoom').style.fontSize=size+'px'
}
// -->

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->

/*
********************************************************************************************
***函数说明: 首页第一屏中部新闻切换效果
*/
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//-->


