var speed = 10; //速度(毫秒) var space = 10; //每次移动(px) var pagewidth = 197; //翻页宽度 var fill = 0; //整体移位 var movelock = false; var movetimeobj; var comp = 0; var autoplayobj = null; //getobj("list2").innerhtml = getobj("list1").innerhtml; // getobj('isl_cont').scrollleft = fill; // getobj("isl_cont").onmouseover = function () { // clearinterval(autoplayobj); // } // getobj("isl_cont").onmouseout = function () { // autoplay(); // } //autoplay(); function getobj(objname) { if (document.getelementbyid) { return eval('document.getelementbyid("' + objname + '")') } else { return eval ('document.all.' + objname) } } function autoplay() { //自动滚动 clearinterval(autoplayobj); autoplayobj = setinterval('isl_godown();isl_stopdown();', 9999999); //间隔时间 } function isl_goup() { //上翻开始 if (movelock) return; clearinterval(autoplayobj); movelock = true; movetimeobj = setinterval('isl_scrup();', speed); } function isl_stopup() { //上翻停止 clearinterval(movetimeobj); if (getobj('isl_cont').scrollleft % pagewidth - fill != 0) { comp = fill - (getobj('isl_cont').scrollleft % pagewidth); compscr(); } else { movelock = false; } autoplay(); } function isl_scrup() { //上翻动作 if (getobj('isl_cont').scrollleft <= 0) { getobj('isl_cont').scrollleft = getobj ('isl_cont').scrollleft + getobj('list1').offsetwidth } getobj('isl_cont').scrollleft -= space; } function isl_godown() { //下翻 clearinterval(movetimeobj); if (movelock) return; clearinterval(autoplayobj); movelock = true; isl_scrdown(); movetimeobj = setinterval('isl_scrdown()', speed); } function isl_stopdown() { //下翻停止 clearinterval(movetimeobj); if (getobj('isl_cont').scrollleft % pagewidth - fill != 0) { comp = pagewidth - getobj('isl_cont').scrollleft % pagewidth + fill; compscr(); } else { movelock = false; } autoplay(); } function isl_scrdown() { //下翻动作 if (getobj('isl_cont').scrollleft >= getobj('list1').scrollwidth) { getobj('isl_cont').scrollleft = getobj('isl_cont').scrollleft - getobj('list1').scrollwidth; } getobj('isl_cont').scrollleft += space; } function compscr() { var num; if (comp == 0) { movelock = false; return; } if (comp < 0) { //上翻 if (comp < -space) { comp += space; num = space; } else { num = -comp; comp = 0; } getobj('isl_cont').scrollleft -= num; settimeout('compscr()', speed); } else { //下翻 if (comp > space) { comp -= space; num = space; } else { num = comp; comp = 0; } getobj('isl_cont').scrollleft += num; settimeout('compscr()', speed); } } function swap_az(n){ for(var i=1;i<=14;i++){ var curb=document.getelementbyid("az"+i); if(n==i){ //curb.classname ="az1"; if (!hasclass(curb, 'az1')) curb.classname = 'az1'; } else{ //curb.classname ="az2"; curb.classname = curb.classname.replace(new regexp('az1'), 'az2'); } } } function hasclass(element, classname) {                              return element.classname.match(new regexp('(\\s|^)' + classname + '(\\s|$)'));                     }