//*公共函数***********************************************************************function AddFavorite(sURL,sTitle)
function AddFavorite(sURL,sTitle)
{
	try{
		window.external.addFavorite(sURL, sTitle);
	}
	catch (e){
		try{
			window.sidebar.addPanel(sTitle, sURL, "");
		}
		catch (e){
			alert("加入收藏失败，请使用Ctrl+D进行添加");
		}
	}
}
/*
 * 设为主页
 */
function AddHome(sURL)
{
	if (window.sidebar) {
		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",sURL);
	}else if(document.all){
		document.body.style.behavior="url(#default#homepage)";
		document.body.setHomePage(sURL);
    }
}
//分页
function page(Fname,p){
	document[Fname].page.value = p;
	document[Fname].submit();
}
function change_page(Fname){
	var el = document.getElementById("page_select");
	if(el != null){
		for(i=0;i<el.options.length;i++){
			if( el.options(i).selected ){
				var pager = el.options(i).value;
				document[Fname].page.value = pager;
				document[Fname].submit();
			}
		}
	}
}
//******************************************************************************
function nTabs(thisObj,Num){
	if(thisObj.className == "active")return;
	var tabObj = thisObj.parentNode.id;
	var tabList = document.getElementById(tabObj).getElementsByTagName("li");
	for(i=0; i <tabList.length; i++){
		if (i == Num){
			thisObj.className = "active"; 
			document.getElementById(tabObj+"_list"+i).style.display = "block";
		}else{
			tabList[i].className = ""; 
		document.getElementById(tabObj+"_list"+i).style.display = "none";
		}
	} 
}
function nTabsh(thisObj,Num){
	if(thisObj.className == "active")return;
	var tabObj = thisObj.parentNode.id;
	var tabList = document.getElementById(tabObj).getElementsByTagName("li");
	for(i=0; i <tabList.length; i++){
		if (i == Num){
		thisObj.className = "active"; 
	      document.getElementById(tabObj+"_cdetail"+i).style.display = "block";
		}else{
			tabList[i].className = ""; 
			document.getElementById(tabObj+"_cdetail"+i).style.display = "none";
		}
	} 
}
/*
 * 幻灯片
 * */
function ImageMovie(){
	this.width=100;
	this.height=100;
	this.textHeight=20;
	this.flashHeight=0;
	this.pics='';
	this.links='';
	this.texts='';
	this.add=function(pic,link,text){
		if(this.pics!='')this.pics+='|';
		this.pics+=pic;
		if(this.links!='')this.links+='|';
		this.links+=link;
		if(this.texts!='')this.texts+='|';
		this.texts+=text;
	}
	this.play = function(){
		this.flashHeight=this.height + this.textHeight;
		document.writeln('<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="'+ this.width +'" height="'+ this.flashHeight +'">');
		document.writeln('<param name="allowScriptAccess" value="sameDomain">');
		document.writeln('<param name="movie" value="flash/focus.swf">');
		document.writeln('<param name="quality" value="high">');
		document.writeln('<param name="bgcolor" value="#FFFFFF">');
		document.writeln('<param name="menu" value="false">');
		document.writeln('<param name=wmode value="Opaque">');
		document.writeln('<param name="FlashVars" value="pics='+this.pics+'&links='+this.links+'&texts='+this.texts+'&borderwidth='+this.width+'&borderheight='+this.height+'&textheight='+this.textHeight+'">');
		document.writeln('<embed src="flash/focus.swf" wmode="Opaque" FlashVars="texts='+this.texts+'&pics='+this.pics+'&links='+this.links+'&borderwidth='+this.width+'&borderheight='+this.height+'&textheight='+this.textHeight+'" menu="false" bgcolor="#FFFFFF" quality="high" width="'+ this.width +'" height="'+ this.flashHeight +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	    document.writeln('</object>');
	}
}

function ChangeLeft(){
	//取得右边高度
	if(document.getElementById('right_h')){
		var RH = document.getElementById('right_h').offsetHeight;
		var LH = document.getElementById('left_h').offsetHeight;
		//改变左边高度
		if( LH < RH ){
			document.getElementById("left_h").style.height = RH+"px";
		}
	}
}


var timerID = null;
var timerRunning = false;
function stopclock (){
	if(timerRunning)
	clearTimeout(timerID);
	timerRunning = false;
}
function startclock () {
	stopclock();
	showtime();
}
function gettime(shiqu){
	var time = new Date(shiqu);
	var hours 	= time.getHours();
	var minutes = time.getMinutes();
	var seconds = time.getSeconds();
	var timeValue = time.getYear()+"年"
		timeValue += (time.getMonth()+1)+"月"
		timeValue += time.getDate()+"日" 
		timeValue += ((hours < 10) ? ":0" : ":") + hours;
		timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
		timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
	return timeValue;
}
function showtime () {
	var now = new Date();
	localTime = now.getTime();	//当前时间毫秒数
	localOffset = now.getTimezoneOffset()*60000;	//当地时间偏移值
	utc = localTime + localOffset;	//本地时间与本地时区偏移值相加得到当前国际标准时间（UTC）。
	
	//获得目标城市的国际标准时间（UTC）小时偏移值，把它转换成毫秒，再加上国际标准时间（UTC）。
	zh = utc + (3600000*8);	//北京,东八区
	us = utc - (3600000*5);	//美国,西五区
	en = utc + (3600000*0);	//英国
	jp = utc + (3600000*9);	//东京,东八区
	
	//中国
	var china = gettime(zh);
	document.getElementById('time1').value = china;
	//美国
	var america = gettime(us);
	document.getElementById('time2').value = america;
	//英国
	var english = gettime(en);
	document.getElementById('time3').value = english;
	//日本
	var japan = gettime(jp);
	document.getElementById('time4').value = japan;
	
	timerID = setTimeout("showtime()",1000);
	timerRunning = true;
}






