var actionList = ["search.do","searchproduct.do","picsearch.do","searchdownload.do"];    
function so(dd){    
act = actionList[dd];    
document.f1.action = "http://search.yesky.com/"+act;    
}
function selectf(id){
document.getElementById("ss"+id+"").style.color = "#000000"
}
//选择器
function $a(id,tag){var re=(id&&typeof id!="string")?id:document.getElementById(id);if(!tag){return re;}else{return re.getElementsByTagName(tag);}}
//标签切换效果[标题框子元素("id/li"),内容框子元素("id/li"),事件(mouseover/click),默认显示第几条(-1表示在鼠标移出全部隐藏,仅在事件mouseover有效),轮播时间(1秒=1000)]
function SwitchTag(tit,box,s,show,time)
{
	var t=tit.split('/'),b=box.split("/"),ts=$a(t[0],t[1]),bs=$a(b[0],b[1]),s=s||"onmouseover",now=show=show||0,c;
	for(var i=0;i<ts.length;i++){ts[i].old=ts[i].className.replace("show","");bs[i].old=bs[i].className.replace("show","");reg(i);}
	function init(){for(var i=0;i<ts.length;i++){ts[i].className=ts[i].old;bs[i].className=bs[i].old;};if(now!=-1){ts[now].className+=(t[2]||"")+" show";bs[now].className+=(b[2]||"")+" show";}}
	function reg(i){ts[i][s]=function(){clearInterval(c);now=i;init();}
	if(show!=-1&&time){bs[i].onmouseover=function(){clearInterval(c);};bs[i].onmouseout=function(){go();};ts[i].onmouseout=function(){go();}}
	if(show==-1&&s=="onmouseover"){ts[i].onmouseout=function(){now=-1;init();}}}
	function go(){c=setInterval(function(){(now<ts.length-1)?now++:now=0;init();},time);}
	if(show!=-1&&time){go();};init();
}
//图片滚动
	function $(id,tag){if(!tag){return document.getElementById(id);}else if(typeof id=='string'){return document.getElementById(id).getElementsByTagName(tag);}else{return id.getElementsByTagName(tag);}}//$(id,tag):返回容器下某标签的集合,id可为obj,如TAG为空返回容器
YK=window.YK||{};
YK.IE=function(){return navigator.userAgent.search('MSIE')>0;}//是否为IE浏览器

//窗体属性
YK.W=function(id){if(!id){return document.body.offsetWidth;}else if(typeof id=='string'){return $(id).offsetWidth;}else{return id.offsetWidth;}} //容器宽,[id可为string或obj],id为空,返回body宽
YK.H=function(id){if(!id){return Math.max(document.body.clientHeight,document.body.offsetHeight);}else if(typeof id=='string'){return $(id).offsetHeight;}else{return id.offsetHeight;}}//容器高，[id可为string或obj]id为空,返回body高
YK.T=function(){return (document.documentElement.scrollTop||document.body.scrollTop);}//返回竖滚动条现在位置与页顶的距离
YK.Hs=function(){return Math.min(document.documentElement.clientHeight,document.body.clientHeight);} //返回网页可用区域的高


//鼠标坐标
YK.mouseX=function(event){return (event.pageX || (event.clientX +(document.documentElement.scrollLeft || document.body.scrollLeft)));}//返回鼠标的X座标
YK.mouseY=function(event){return (event.pageY || (event.clientY +(YK.T() || document.body.scrollTop)));}//返回鼠标的Y座标


YK.HtmlCycleMove=function(id,tag,scroll,num,atime,sp,btup,btdwn)
{
	var tags=tag.split('/');
	var obj=$(id);
		obj.tag=$(obj,tags[1]);											//获得所有子元素
		obj.wh=YK.W(obj.tag[0]);if(scroll=="scrollTop"){obj.wh=YK.H(obj.tag[0]);}//子无素的宽或高
		obj.pg=Math.floor((obj.tag.length+(num-1))/num);				//可切换的页数
		obj.sp=obj.wh*num;												//每次切换的宽或高
		obj.now=obj.nowpx=0;											//当前像素，目标像素，当前页值初试化
		obj.mous=false;													//鼠标是否移上去
		obj.scroll=scroll;												//滚动方向
		obj.spt=(!sp)?3:sp;												//滚动步长
		obj.atime=(!atime)?9000000:atime;								//自动滚动时间
		obj.onmouseover=function(){obj.mous=true;}						//鼠标移上清楚滚动
		obj.onmouseout=function(){obj.mous=false;}						//鼠标移开继续滚动
	var obj1=$(id,tags[0])[0];obj1.innerHTML+=obj1.innerHTML;
		obj.ainterval=setInterval(function(){go_to("-")},obj.atime);     //自动滚动
	//按钮效果
	if(btup){$(btup)["onclick"]=function(){clearInterval(obj.ainterval);go_to("+");obj.ainterval=setInterval(function(){go_to("+")},obj.atime);}}
	if(btdwn){$(btdwn)["onclick"]=function(){clearInterval(obj.ainterval);go_to("-");obj.ainterval=setInterval(function(){go_to("-")},obj.atime);}}
	//执行移动
	function go_to(move)
	{
		if(obj.mous){return;}
		var c;
		if(move=="+"){
		if(obj.now<obj.pg){obj.now++;}else{obj.now=1;obj[obj.scroll]=0;}obj.nowpx=obj.now*obj.sp;
		c=setInterval(function(){(obj[obj.scroll]+obj.spt<obj.nowpx)?(obj[obj.scroll]+=obj.spt):obj[obj.scroll]=obj.nowpx;if(obj[obj.scroll]==obj.nowpx){clearInterval(c);}},10);}
		else if(move=="-"){if(obj.now>0){obj.now--;}else{obj.now=obj.pg-1;obj[obj.scroll]=obj.pg*obj.sp;}obj.nowpx=obj.now*obj.sp;
		c=setInterval(function(){(obj[obj.scroll]-obj.spt>obj.nowpx)?(obj[obj.scroll]-=obj.spt):obj[obj.scroll]=obj.nowpx;if(obj[obj.scroll]==obj.nowpx){clearInterval(c);}},10);}
	}
}
