var ele_n=$("#crcoll_1 img").length;var ws=Math.ceil(ele_n/3);var po=0,m=0,scro_v=true;var goplay,prevpaly,time_out;for(i=0;i<ws;i++){$("#check_box").append("<span onmouseover='check_img("+i+")'>&nbsp;</span>");$("#check_box span").eq(0).addClass("check");}time_out=setTimeout("go_scroll('right')",5000);$("#crcoll_2").html($("#crcoll_1").html());function control(){clearTimeout(time_out);clearInterval(goplay);clearInterval(prevpaly);}function scroll_img(dir){if(dir=='right'){po+=52;if(po==312*ele_n){po=0;}}else if(dir=='left'){po-=52;}$("#scroll_box").scrollLeft(po);puse();}function puse(){if(po%936==0&&po!==(ws-1)*936&&scro_v==true||po==ele_n*312-936||scro_v==false&&po==(m+1)*936){control();scro_v=true;m=(m==ws-1)?0:m+1;set_check();time_out=setTimeout("go_scroll('right')",5000);}}function set_check(){for(i=0;i<$("#check_box span").length;i++){$("#check_box span").eq(i).removeClass("check");$("#check_box span").eq(m).addClass("check");}}function go_scroll(steps){if(steps=='left'){goplay=setInterval("scroll_img('left')",20);}else if(steps=='right'){prevpaly=setInterval("scroll_img('right')",20);}}function check_img(n){if(scro_v==true){control();scro_v=false;if(m>n){m=n-1;go_scroll('left');}else if(m<n){m=n-1;go_scroll('right');}else{scro_v=true;}}}