function bluring() { try{ if(event.srcElement.tagName=='A'||event.srcElement.tagName=='IMG') { document.body.focus(); } }catch( e ) { } } try{ document.onfocusin=bluring; }catch( e ) { } var rurl = location.href; var purl = getUrl(rurl); function getUrl(url_str) { var real_url; if (url_str.indexOf('/') > 0) { real_url = url_str.split('/'); real_url = real_url[0]+'//'+real_url[2]+'/'+real_url[3]+'/'; } return real_url; } function goLocate(go_url) { document.location = purl + go_url; } $(document).ready(function(){ //½½¶óÀ̵å var firstImg = $("#slide ul>li:first").clone(), secondImg = $("#slide ul>li:nth-child(2)").clone(), lastImg = $("#slide ul>li:last").clone(), imgWidth = $("#slide").width(), img_num = -1; $("#slide ul").append(firstImg); $("#slide ul").append(secondImg); $("#slide ul").prepend(lastImg); $("#slide ul").prepend(secondImg); $("#slide ul").css("margin-left",-imgWidth); $(".prev_page").click(function(){ prev_slide(); }); $(".next_page").click(function(){ next_slide(); }); $("#remote p a").click(function(){ if(!$("#slide ul").is(':animated')){ img_num = $(this).attr("data-num"); $("#slide ul").animate({ marginLeft : imgWidth*img_num },700,function(){ slide_sel(); reset_interval(); }); } }); $(window).resize(function(){ imgWidth = $("#slide").width(); $("#slide ul").css("margin-left",(img_num*imgWidth) + "px"); }); start_interval(); var eq_num=0; $('.business.third .mid_box li').mouseover(function(){ eq_num = $(this).index(); $('.business.third .mid_box .img_box img').eq(eq_num).addClass('img_on'); $('.business.third .mid_box .img_box img').not(':eq('+eq_num+')').removeClass('img_on') }) //a ¸µÅ© ¾ÈµÇ°Ô $('.no_link').click(function(){return false;}); //ÇÔ¼ö function start_interval(){ interval = setInterval(function(){ next_slide(); },4000); }; function reset_interval(){ clearInterval(interval); start_interval(); }; function prev_slide(){ if(!$("#slide ul").is(':animated')){ img_num++; $("#slide ul").animate({ marginLeft : imgWidth*img_num },700,function(){ if(img_num == 0){ img_num = -3; $("#slide ul").css("margin-left",(img_num*imgWidth) + "px"); } slide_sel(); }); reset_interval(); }; }; function next_slide(){ if(!$("#slide ul").is(':animated')){ img_num--; $("#slide ul").animate({ marginLeft : imgWidth*img_num },700,function(){ if(img_num == -4){ img_num = -1; $("#slide ul").css("margin-left",(img_num*imgWidth) + "px"); } slide_sel(); }); reset_interval(); }; }; function slide_sel(){ if(img_num == -1){ $("#remote p:eq(0)").addClass("sel"); $("#remote p:not(':nth-child(1)')").removeClass("sel"); }else if(img_num == -2){ $("#remote p:eq(1)").addClass("sel"); $("#remote p:not(':nth-child(2)')").removeClass("sel"); }else if(img_num == -3){ $("#remote p:eq(2)").addClass("sel"); $("#remote p:not(':nth-child(3)')").removeClass("sel"); }; }; });