var ArticleArr = new Array(); ArticleArr.push(new Array('content.asp?artid=22863','2012年全球水产品消费量','http://www.bbwfish.com/UploadFiles/ArticleFiles/2012/2/201223999513/2012239840986.jpg')); ArticleArr.push(new Array('content.asp?artid=22702','海大薛华董事长率队前往六和','http://www.bbwfish.com/UploadFiles/ArticleFiles/2012/1/201213152054557/201213152045241.jpg')); ArticleArr.push(new Array('content.asp?artid=22666','2011年国家虾产业技术体','http://www.cxfish.com/UploadFiles/ArticleFiles/2011/12/2011123116456255/2011123116425547.jpg')); ArticleArr.push(new Array('content.asp?artid=22555','吴斌:虾壳破解医学难题','http://www.cxfish.com/UploadFiles/ArticleFiles/2011/12/20111216102252229/20111216102232975.jpg')); ArticleArr.push(new Array('content.asp?artid=22368','国联水产发布放心虾诚信宣言','http://www.cxfish.com/UploadFiles/ArticleFiles/2011/11/2011112115755937/2011112115737915.jpg')); window.onload = function(){ var now = 1; ChangeBar(ArticleTop,ArticleText,ArticleBar,0); SetAuto('ArticleTop','ArticleText','ArticleBar'); } function SetAuto(TheObj,TheObjText,TheObjBt){ auto = setInterval('SetChange(\''+ TheObj +'\',\'' + TheObjText + '\',\'' + TheObjBt + '\')',3000); } function ClearAuto(){clearInterval(auto)} function SetChange(TheObj,TheObjText,TheObjBt){ var TheObj = document.getElementById(TheObj); var TheObjText = document.getElementById(TheObjText); var TheObjBt = document.getElementById(TheObjBt); var count = 5; if(now < count){ ChangeBar(TheObj,TheObjText,TheObjBt,now); }else{ now = 0; ChangeBar(TheObj,TheObjText,TheObjBt,now); } } function ChangeBar(TheObj,TheObjText,TheObjBt,v){ var BtArr = TheObjBt.getElementsByTagName('div'); TheObj.onmouseover = function(){ClearAuto()} TheObjText.onmouseover = function(){ClearAuto()} for(i = 0;i < BtArr.length;i++){ BtArr[i].SelectCount = i; BtArr[i].innerText = i+1; BtArr[i].style.cssText = 'cursor:hand; color: #000000; background-image:url(images/topartimg/an_index03a.gif); width:14px; line-height:18px; float:left; margin:3px; text-align:center;'; BtArr[i].onclick = function (){ChangeBar(TheObj,TheObjText,TheObjBt,this.SelectCount)} BtArr[i].onmouseover = function(){ClearAuto()} BtArr[i].onmouseout = function(){SetAuto(TheObj.id,TheObjText.id,TheObjBt.id)} } BtArr[v].style.cssText = 'cursor:hand; color: #FFFFFF; background-image:url(images/topartimg/an_index03b.gif); width:14px; line-height:18px; float:left; margin:3px; text-align:center;' SetImg(TheObj,TheObjText,TheObjBt,v); now = v + 1; } function SetImg(TheObj,TheObjText,TheObjBt,v){ var ImgWidth = TheObj.style.width; var ImgHeight = TheObj.style.height; try{ TheObj.filters[0].Apply(); TheObj.innerHTML = ''; TheObjText.innerHTML = '' + ArticleArr[v][1] + ''; TheObj.filters[0].play(); } catch(e){ TheObj.innerHTML = ''; TheObjText.innerHTML = '' + ArticleArr[v][1] + ''; } }