var tm=null
function newsScroll() {
if(scrollimg.parentNode.scrollLeft!=(scrollimg.clientWidth/2))
scrollimg.parentNode.scrollLeft++;
else
scrollimg.parentNode.scrollLeft=0
}
window.onload=function() {
simg1.innerHTML=simg.innerHTML
tm=setInterval('newsScroll()',30) 
}
function stop()
{
clearInterval(tm)
}
function start()
{
tm=setInterval('newsScroll()',30) 
}

//JS版的Server.UrlEncode编码函数
function urlEncode(str) 
{ 
    str = str.replace(/./g,function(sHex) 
    { 
        window.EnCodeStr = ""; 
        window.sHex = sHex; 
        window.execScript('window.EnCodeStr=Hex(Asc(window.sHex))',"vbscript"); 
        return window.EnCodeStr.replace(/../g,"%$&"); 
    }); 
    return str; 
} 

function trim(s){return  s.replace(/(^\s*)|(\s*$)/g,  "");} 

function checksearch(theform)
{
	var webdir = "/";
	if (trim(theform.key.value)=='')
	{alert('关键字不能为空');
	theform.key.focus();
	theform.key.value='';
	return false
	}
	if (theform.key.value=='请输入关键字')
	{alert('关键字不能为空');
	theform.key.focus();
	theform.key.value='';
	return false
	}
	if(navigator.userAgent.indexOf("MSIE")>0)
	{
		window.location.href=webdir+"s/?/"+urlEncode(trim(theform.key.value))+"/";
	}
	else
	{
		window.location.href=webdir+"s/?/"+trim(theform.key.value)+"/";
	}
	return false
}
