// JavaScript Document
function OOO(obj,ele){
	if (obj&&!ele){return document.getElementById(obj);}
	else if (obj&&ele){return document.getElementById(obj).getElementsByTagName(ele);}
	else {return false;}
}
//提交热门关键字
function submitKey(str)
{
	if(str!=""){
		window.location.href="article.asp?searchkey="+encodeURI(str);
	}else{
		return false;
	}
}
//搜索提交
function submitSearch1()
{
	if(OOO("keyword1").value!=""){
		window.location.href="article.asp?searchkey="+encodeURI(OOO("keyword1").value);
	}else{
		alert("请输入关键字");
		return false;
	}
}
function submitSearch2()
{
	if(OOO("sName").value!="" && OOO("bornDate").value!=""){
		window.location.href="pointsearch.asp?key1="+encodeURI(OOO("sName").value)+"&key2="+encodeURI(OOO("bornDate").value);
	}else{
		alert("请输入关键字");
		return false;
	}
}
//对Url进行编码,让查询字符串可以有特殊字符
function URLencode(sStr) 
{
    return escape(sStr).
             replace(/\+/g, '%2B').
                replace(/\"/g,'%22').
                   replace(/\'/g, '%27').
                     replace(/\//g,'%2F');
}
function gotowhere(s)
		 { var d=s.options[s.selectedIndex].value;
		window.open(d,"_blank");
		s.selectedIndex=0;
	     }
//显示日期时间
function tick() {
var hours, minutes, seconds, ap;
var intHours, intMinutes, intSeconds,intYear,intMonth,intDay,strDate;
var today;
today = new Date();
intYear=today.getYear();
intMonth=today.getMonth();
intDay=today.getDay();
strDate=intMonth+"月"+intDay+"号&nbsp;&nbsp;"
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
} else if (intHours < 12) {
hours = intHours+":";
} else if (intHours == 12) {
hours = "12:";
} else {
hours = intHours + ":";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = hours+minutes+seconds;
document.getElementById("timeId").innerHTML = strDate+timeString;
window.setTimeout("tick();", 1000);
}
window.onload = tick;

