var version = "other"
browserName = navigator.appName;   
browserVer = parseInt(navigator.appVersion);

if (browserName == "Netscape" && browserVer >= 3) version = "n3";
else if (browserName == "Netscape" && browserVer < 3) version = "n2";
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "e4";
else if (browserName == "Microsoft Internet Explorer" && browserVer < 4) version = "e3";

//***********显示时间*****************
function clock()
  {
crtdate=new Date();
crthours=crtdate.getHours();
crtminutes=crtdate.getMinutes();
crtSeconds=crtdate.getSeconds();

if (crthours >= 7 && crthours < 12)
  apm="上午";
else if (crthours >= 12 && crthours < 19)
  apm="下午";
else
  apm="晚上";

if (crthours >12 )
  crthours=crthours % 12;
if (crtminutes < 10)
  crtminutes="0"+crtminutes;
if (crtSeconds < 10)
 crtSeconds="0" + crtSeconds;

viewtime="现在是" + apm + crthours + "点" + crtminutes + "分" + crtSeconds + "秒";

esh.innerText=viewtime;

setTimeout("clock()",1000);

}

//********新闻的打开窗口***********
function OpenWin(url) {
  var newwin=window.open(url,"NewWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=400,top=20,left=100");
  newwin.focus();
  return false;
}


//********网上搜索**************
function startsearch()
{
	var sf = document.searchform;
	var skey = sf.searchText.value;

	url = new Array();

url[0]="http://site.search.sohu.com/sitesearch.jsp?key_word=" + skey +  "&page_index=0";
url[1]="http://search.chinese.yahoo.com/search/gb?p=" + skey;
url[2]="http://search.sina.com.cn/cgi-bin/search/search.cgi?_ss=sina&_searchkey="+skey+"&_andor=and";
url[3]="http://nisearch.163.com/Search?q=" + skey;
url[4]="http://www.google.com/search?q=" + skey +  "&hl=zh-CN&btnG=Google搜索&lr="
url[5]="http://search.yahoo.com/bin/search?p="+skey;
url[6]="http://search.excite.com/search.gw?search="+skey;
url[7]="http://www.baidu.com/baidu?w=" + skey;

	if(skey == "")
	{
		alert("请输入搜索关键词!");
		sf.searchText.focus();
		return false;
	}
	window.open(url[sf.website.selectedIndex]);

}

//******************写日期****************************
function WriteDate(){
todayDate = new Date(); 
date = todayDate.getDate(); 
month= todayDate.getMonth() +1; 
year= todayDate.getYear(); 
 
if(navigator.appName == "Netscape") 
{ 
	document.write(1900+year); 
	document.write("年"); 
	document.write(month); 
	document.write("月"); 
	document.write(date); 
	document.write("日"); 
	document.write("<br>") 
} 
if(navigator.appVersion.indexOf("MSIE") != -1) 
{ 
document.write(year); 
document.write("年"); 
document.write(month); 
document.write("月"); 
document.write(date); 
document.write("日"); 
 
} 

document.write("&nbsp;");
if (todayDate.getDay() == 5) document.write("周五") 
if (todayDate.getDay() == 6) document.write("周六") 
if (todayDate.getDay() == 0) document.write("周日") 
if (todayDate.getDay() == 1) document.write("周一") 
if (todayDate.getDay() == 2) document.write("周二") 
if (todayDate.getDay() == 3) document.write("周三") 
if (todayDate.getDay() == 4) document.write("周四") 

document.write("&nbsp;"); 
if ((month == 1) && (date == 1)) document.write("元旦");
if ((month == 5) && (date == 1)) document.write("国际劳动节");
if ((month == 5) && (date == 4)) document.write("青年节");
if ((month == 6) && (date == 1)) document.write("国际儿童节");
if ((month == 12) && (date == 25)) document.write("圣诞节"); 
}

