var vNum = 0, vMax, isMove = false; var vInterval, vDuration="8000", isVstop = false; var bNum = 0, bMax, isBstop = false, bInterval, bDuration = "3500"; $(function(){ // vMax = jQuery(".visualDiv .visual").size()-1; vInterval = setInterval("visual()", vDuration); jQuery(".visualDiv .controller>a").each(function(q){ jQuery(this).click(function(e){ if(!isMove) { isMove = true; if(e.target.alt == "prev") { //이전 -> prev 로 고치니 움직임 jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:"-100%"}, "normal"); vNum++; if(vNum > vMax) vNum = 0; jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:"100%"}, 0); jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:0}, "normal", function(){isMove = false;}); } else if(e.target.alt == "next") { //다음 -> next 로 고치니 움직임 jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:"100%"}, "normal"); vNum--; if(vNum < 0) vNum = vMax; jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:"-100%"}, 0); jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:0}, "normal", function(){isMove = false;}); } else { if(!isVstop) { //정지시키기 isVstop = true; isMove = false; clearInterval(vInterval); jQuery(this).find("img").attr("src", jQuery(this).find("img").attr("src").replace(".png", "_on.png")); } else { //재생시키기 isVstop = false; isMove = false; clearInterval(vInterval); vInterval = setInterval("visual()", vDuration); jQuery(this).find("img").attr("src", jQuery(this).find("img").attr("src").replace("_on.png", ".png")); } } } }).hover(function(){ clearInterval(vInterval); }, function(){ clearInterval(vInterval); if(!isVstop) vInterval = setInterval("visual()", vDuration); }) }) //banner bMax = jQuery("#banner").find(".rollDiv").find("p").size()-1; bInterval = setInterval("banner()", bDuration); jQuery("#banner").find(".bts").find("a").each(function(q){ jQuery(this).click(function(){ if(q == 0) { jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:-160}, "normal"); bNum++; if(bNum > bMax) { bNum = 0; } jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:160}, 0); jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:0}, "normal"); } else if(q == 1) { jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:160}, "normal"); bNum--; if(bNum < 0) { bNum = bMax; } jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:-160}, 0); jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:0}, "normal"); } else { //정지, 재생 if(jQuery(this).find("img").attr("src").indexOf("_on") > -1) { //재생 isBstop = false; jQuery(this).find("img").attr("src", jQuery(this).find("img").attr("src").replace("_on.gif", ".gif")); clearInterval(bInterval); bInterval = setInterval("banner()", bDuration); } else { //정지 isBstop = true; jQuery(this).find("img").attr("src", jQuery(this).find("img").attr("src").replace(".gif", "_on.gif")); clearInterval(bInterval); } } }).hover(function(){ clearInterval(bInterval); }, function(){ clearInterval(bInterval); if(!isBstop) bInterval = setInterval("banner()", bDuration); }) }) //160px씩 옮기기 jQuery("#banner").find(".rollDiv").find("p").each(function(q){ jQuery("#banner").find(".rollDiv").find("p").eq(q).css("left", q*160); }) }) function visual() { jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:"-100%"}, "normal"); vNum++; if(vNum > vMax) vNum = 0; jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:"100%"}, 0); jQuery(".visualDiv .visual").eq(vNum).stop().animate({left:0}, "normal", function(){isMove = false;}); } function banner() { jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:-160}, "normal"); bNum++; if(bNum > bMax) { bNum = 0; } jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:160}, 0); jQuery("#banner").find(".rollDiv").find("p").eq(bNum).stop().animate({left:0}, "normal"); } $(function(){ // 썸네일 jQuery(".mainCon1 .con a").each(function(q){ jQuery(this).hover(function(){ jQuery(this).find(".over").stop(true, true).fadeIn('fast'); }, function(){ jQuery(this).find(".over").stop(true, true).fadeOut('fast'); }) }) }) // 점프메뉴 function jumpMenu(){ var frm = document.form if( frm.jump.options.selectedIndex != 0 ){ window.open(frm.jump.options[frm.jump.selectedIndex].value,"new",""); } } /*소스 막기*/ document.onmousedown=right; document.onkeydown=keypressed; document.oncontextmenu=keypressed; function right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) { return false; } else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) { return false; } return true; } function keypressed() { return false; } function processKey() { if( (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || (event.keyCode >= 112 && event.keyCode <= 123)) { event.keyCode = 0; event.cancelBubble = true; event.returnValue = false; } } document.onkeydown = processKey; window.status = '**** 다양한 업종으로 변경가능합니다. http://postweb.co.kr ****';