var scrollNewsCt=1;
var pauseTime=15*1000;
var timer1;

function hideAllClips() {
	for (i=1; i<7; i++){
		var allClips="topNews_"+i;
		var clipNum="clipNum"+i;
		document.getElementById(allClips).style.display="none";
		document.getElementById(clipNum).className="topNewsClip_OFF";
		}
	}
	
function clip_Switch(n) {
	var curClip="topNews_"+n;
	var curClipNum="clipNum"+n;
	hideAllClips();
	document.getElementById(curClip).style.display="block";
	document.getElementById(curClipNum).className="topNewsClip_ON";
	scrollNewsCt=n; 
	}
	
function fwdScroll() {
	stopScroll();
	clip_Switch(scrollNewsCt);
	scrollNewsCt+=1;
	if (scrollNewsCt==7) {
		scrollNewsCt=1;
		}
		timer1=setTimeout("fwdScroll()",pauseTime);
	}
	
function stopScroll() {
	clearTimeout(timer1);
	}

function bwdScroll() {
	stopScroll();
	scrollNewsCt-=1;
	if (scrollNewsCt==0) {
		scrollNewsCt=6;
		}
		clip_Switch(scrollNewsCt);
		timer1=setTimeout("bwdScroll()",pauseTime);
	}


function validmail(){
//window.open('http://mail.china.com/extend/gb/notice.html','noticewin','width=360,height=300');
if (document.maillogin.LoginName.value == ""){
window.open("http://mail.china.com/");
return false;
}
else {
if (document.maillogin.LoginName.value !== ""){
if (document.maillogin.passwd.value == "")
{
window.open("http://mail.china.com/extend/gb/");
return false;
//document.maillogin.passwd.focus();
//alert ("请输入密码");
return false;
}
if (document.maillogin.mailtype[0].selected || document.maillogin.mailtype[1].selected){
if (document.maillogin.LoginName.value.indexOf("*") != -1) {
window.open("http://mail.china.com/extend/gb/SignIn.html");
return false;
}
else {document.maillogin.action="http://mail.china.com/extend/gb/NULL/NULL/NULL/SignIn.gen";
document.maillogin.submit();
setTimeout('document.maillogin.reset()',1000);
return false;
}
}
if (document.maillogin.mailtype[2].selected){
if (document.maillogin.LoginName.value.indexOf("*") != -1) {
window.open("http://freemail.china.com/extend/gb/SignIn.html");
return false;
}
else {document.maillogin.action="http://freemail.china.com/extend/gb/NULL/NULL/NULL/SignIn.gen";
document.maillogin.submit();
setTimeout('document.maillogin.reset()',1000);
return false;
}
}
/*if (document.maillogin.mailtype[3].selected){
if (document.maillogin.LoginName.value.indexOf("*") != -1) {
window.open("http://stud.china.com/extend/gb/SignIn.html");
return false;
}
else {document.maillogin.action="http://stud.china.com/extend/gb/NULL/NULL/NULL/SignIn.gen";
document.maillogin.submit();
setTimeout('document.maillogin.reset()',1000);
return false;
}
}*/
}
}
}


function adsearchcity(){
if (document.adsearch.city.value ==""){
alert ("请输入地区名称");
document.adsearch.city.focus();
return false;
}
else {
document.adsearch.action="http://app0.china.com/editor/searchadcity.php";
document.adsearch.submit();
}
}
function adsearchkeyword(){
if (document.adsearch.keyword.value ==""){
alert ("请输入关键字");
document.adsearch.keyword.focus();
return false;
}
else {
document.adsearch.action="http://app0.china.com/editor/searchad2.php";
document.adsearch.submit();
}
}


function checkform() {
	if(document.queryForm.query.value == "中华搜索"){
		window.open("http://sou.china.com/")
		return false;
	}
	else {
			document.queryForm.submit();
			return false;	
		}
}
function search_news(){
	if (document.queryForm.query.value == "中华搜索"){
		window.open("http://sou.china.com/search/news.html");
		return false;		
		}
		else {
	var search_news_lnk="http://searchi.china.com/cgi-bin/allsearch?cdtype=GB&word="+document.queryForm.query.value;
	window.open(search_news_lnk);
	return false;
}
	}
	
function search_bbs(){
	if (document.queryForm.query.value == "中华搜索"){
		window.open("http://sou.china.com/bbssearch/");
		return false;
		}
		else {
			var search_bbs_lnk="http://sou.china.com/bbssearch/search.php?word="+document.queryForm.query.value;
			window.open(search_bbs_lnk);
			return false;
			}
	}


