var hotPage; var tuiPage; var dazePage; var newPage; var hotRuning=false; var tuiRuning=false; var dazeRuning=false; var newRuning=false; function loadIndexSortProducts() {  $("#hotShop_ul").bind("mouseover",function (){changeRuning('hotShop_ul',true)}); $("#hotShop_ul").bind("mouseleave",function (){changeRuning('hotShop_ul',false)}); $("#newShop_ul").bind("mouseover",function (){changeRuning('newShop_ul',true)}); $("#newShop_ul").bind("mouseleave",function (){changeRuning('newShop_ul',false)}); $("#tuiShop_ul").bind("mouseover",function (){changeRuning('tuiShop_ul',true)}); $("#tuiShop_ul").bind("mouseleave",function (){changeRuning('tuiShop_ul',false)}); $("#dazeShop_ul").bind("mouseover",function (){changeRuning('dazeShop_ul',true)}); $("#dazeShop_ul").bind("mouseleave",function (){changeRuning('dazeShop_ul',false)}); showProducts(); } function showProducts() { showBySort("hotShop_ul",1); showBySort("newShop_ul",1); showBySort("tuiShop_ul",1); showBySort("dazeShop_ul",1); setTimeout("hotSetTimeOut()",8*1000); setTimeout("tuiSetTimeOut()",8*1000); setTimeout("dazeSetTimeOut()",8*1000); setTimeout("newSetTimeOut()",8*1000); } function changeRuning(type,bool) { if(type=="hotShop_ul") { hotRuning=bool; } else if(type=="newShop_ul") { newRuning=bool; } else if(type=="tuiShop_ul") {  tuiRuning=bool; } else if(type=="dazeShop_ul") { dazeRuning=bool; } } function hotSetTimeOut() { if(!hotRuning) { var p=hotPage; if(p==3) { p=1; } else { p+=1; } showBySort("hotShop_ul",p); } setTimeout("hotSetTimeOut()",8*1000); } function tuiSetTimeOut() { if(!tuiRuning){ var p=tuiPage; if(p==3) { p=1; } else { p+=1; } showBySort("tuiShop_ul",p); } setTimeout("tuiSetTimeOut()",8*1000); } function dazeSetTimeOut() { if(!dazeRuning){ var p=dazePage; if(p==3) { p=1; } else { p+=1; } showBySort("dazeShop_ul",p); } setTimeout("dazeSetTimeOut()",8*1000); } function newSetTimeOut() { if(!newRuning){ var p=newPage; if(p==3) { p=1; } else { p+=1; } showBySort("newShop_ul",p); } setTimeout("newSetTimeOut()",8*1000); } function showBySort(type,page) { var sort_li; var sort_li_su; if(type=="hotShop_ul") { sort_li="hotShop_li_"; sort_li_su="hotShop_li_su_"; hotPage=page; for(var i=1;i<=3;i++) { if(i==page) { var dom=document.getElementById("hot_num"+i); if(null!=dom) { dom.className="mover"; } } else { var dom=document.getElementById("hot_num"+i); if(null!=dom) { dom.className="mout"; } } } } else if(type=="newShop_ul") { sort_li="newShop_li_"; sort_li_su="newShop_li_su_"; newPage=page; for(var i=1;i<=3;i++) { if(i==page) { var dom=document.getElementById("new_num"+i); if(null!=dom) { dom.className="mover"; } } else { var dom=document.getElementById("new_num"+i); if(null!=dom) { dom.className="mout"; } } } } else if(type=="tuiShop_ul") { sort_li="tuiShop_li_"; sort_li_su="tuiShop_li_su_"; tuiPage=page; for(var i=1;i<=3;i++) { if(i==page) { var dom=document.getElementById("tui_num"+i); if(null!=dom) { dom.className="mover"; } } else { var dom=document.getElementById("tui_num"+i); if(null!=dom) { dom.className="mout"; } } } } else if(type=="dazeShop_ul") { sort_li="dazeShop_li_"; sort_li_su="dazeShop_li_su_"; dazePage=page; for(var i=1;i<=3;i++) { if(i==page) { var dom=document.getElementById("free_num"+i); if(null!=dom) { dom.className="mover"; } } else { var dom=document.getElementById("free_num"+i); if(null!=dom) { dom.className="mout"; } } } } var start=(page-1)*6; var end=start+6; if(end>18) { end=18; } if(start<0) { start=0; } var lis=new Array(); for(var i=start;i<end;i++) { $("#"+sort_li+""+(i+1)).show(); $("#"+sort_li_su+""+(i+1)).show(); lis[lis.length]=i; } for(var i=0;i<18;i++) { var isExist=false; for(var j=0;j<lis.length;j++) { if(i==lis[j]) { isExist=true; } } if(!isExist) { $("#"+sort_li+""+(i+1)).hide(); $("#"+sort_li_su+""+(i+1)).hide(); } } }