/* * 시스템에 공통으로 사용하는 함수를 정의한 js * * @author 권중규 */ // 상수 var Constants = {}; // 페이지 로딩시 onLoadCompleted() 함수 실행 jQuery(document).ready(function() { if(typeof onLoadCompleted !== "undefined" && jQuery.isFunction(onLoadCompleted)) { onLoadCompleted(); } }); // 중첩 매개변수 직렬화가 아닌 shallow 방식의 매개변수 직렬화를 수행하도록 설정 jQuery.ajaxSettings.traditional = true; /* ie6 png */ function setPng24(obj) { obj.width = obj.height = 1; obj.className = obj.className.replace(/\bpng24\b/i, ''); obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + obj.src + "',sizingMethod='image');" obj.src = ''; return ''; } function isValidEmail(el) { var value = value ? value : el.value; var pattern = /^[_a-zA-Z0-9-\.]+@[\.a-zA-Z0-9-]+\.[a-zA-Z]+$/; return (pattern.test(value)) ? true : false; } function isValidUserid(el) { var pattern = /^[a-z0-9_]{4,10}$/; return (pattern.test(el.value)) ? true : false; } // Tab Content function initTabMenu(tabContainerID) { var tabContainer = document.getElementById(tabContainerID); var tabAnchor = tabContainer.getElementsByTagName("a"); var i = 0; for(i = 0; i < tabAnchor.length; i++) { if(tabAnchor.item(i).className == "tab") thismenu = tabAnchor.item(i); else continue; thismenu.container = tabContainer; thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]); thismenu.targetEl.style.display = "none"; thismenu.imgEl = thismenu.getElementsByTagName("img").item(0); thismenu.onclick = function tabMenuClick() { currentmenu = this.container.current; if(currentmenu == this) return false; if(currentmenu) { currentmenu.targetEl.style.display = "none"; if(currentmenu.imgEl) { currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif"); } else { currentmenu.className = currentmenu.className.replace(" on", ""); } } this.targetEl.style.display = ""; if(this.imgEl) { this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif"); } else { this.className += " on"; } this.container.current = this; return false; }; if(!thismenu.container.first) thismenu.container.first = thismenu; } if(tabContainer.first) tabContainer.first.onclick(); } // family site function Go_global(obj) { window.open(obj.value, "", "") } // familysite function MM_preloadImages() { // v3.0 var d = document; if(d.images) { if(!d.MM_p) d.MM_p = new Array(); var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for(i = 0; i < a.length; i++) if(a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } } } function init() {// �ʱ�ȭ $.each(function() { /* * //add mouseOver $(this).mouseover(function(){ var on = imgsrc.replace(/_off.gif/,"_on.gif"); * $(image).attr("src",on); }); * * //add mouseOut $(this).mouseout(function(){ var off = imgsrc.replace(/_on.gif/,"_off.gif"); * $(image).attr("src",off); }); * * //add mouseDown $(this).mousedown(function(){ var dn = imgsrc.replace(/_off.gif/,"_on.gif"); * $(image).attr("src",dn); }); */ }); } // Quick Menu ��ũ�� function initMoving(target, position, topLimit, btmLimit) { if(!target) return false; var obj = target; obj.initTop = position; obj.topLimit = topLimit; obj.bottomLimit = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - btmLimit - obj.offsetHeight; obj.style.position = "absolute"; obj.top = obj.initTop; obj.left = obj.initLeft; if(typeof (window.pageYOffset) == "number") { // WebKit obj.getTop = function() { return window.pageYOffset; } } else if(typeof (document.documentElement.scrollTop) == "number") { obj.getTop = function() { return Math.max(document.documentElement.scrollTop, document.body.scrollTop); } } else { obj.getTop = function() { return 0; } } if(self.innerHeight) { // WebKit obj.getHeight = function() { return self.innerHeight; } } else if(document.documentElement.clientHeight) { obj.getHeight = function() { return document.documentElement.clientHeight; } } else { obj.getHeight = function() { return 500; } } obj.move = setInterval(function() { if(obj.initTop > 0) { pos = obj.getTop() + obj.initTop; } else { pos = obj.getTop() + obj.getHeight() + obj.initTop; // pos = obj.getTop() + obj.getHeight() / 2 - 15; } if(pos > obj.bottomLimit) pos = obj.bottomLimit; if(pos < obj.topLimit) pos = obj.topLimit; interval = obj.top - pos; obj.top = obj.top - interval / 3; obj.style.top = obj.top + "px"; }, 30) } function onopen() { var url = "http://www.ftc.go.kr/info/bizinfo/communicationViewPopup.jsp?wrkr_no=1028123012"; window.open(url, "communicationViewPopup", "width=750, height=700;"); }