//Pension Main function pentionTabM(tit,obj,num,total) { for ( i=1 ; i<=total ; i++ ){ var objT = document.getElementById(tit+i); var objI = document.getElementById(obj+i); if(num==i){ objT.className="on"; objI.src="/pension/img/pen_mainmenu0"+i+"_on.gif"; } else { objT.className="off"; objI.src="/pension/img/pen_mainmenu0"+i+"_off.gif"; } } } function gnbover( idx ) { if(idx) { var obj; for (var z=1; z<8; z++){ obj = document.getElementById('gnb' + z); if (z == idx){ obj.className= "on"; } else { obj.className = ""; } } } return; } function gnbMenu(a,b) { for (var i=1 ; i <= a ; i++ ){ var obj_gnb = document.getElementById("gnb" + a); if(i == a) { obj_gnb.className = "on"; if (b) { for ( var j=1; j<=b ; j++ ){ var obj_gnbs = document.getElementById("gnb" + a + b); if(j == b) { obj_gnbs.className = "on"; } } } } } } function lnbMenu(a,b) { document.getElementById("lnb").className="loadscript"; for (var i=1 ; i <= a ; i++ ){ var obj_lnb = document.getElementById("lnb" + a); if(i == a) { obj_lnb.className = "on"; if (b) { for ( var j=1; j<=b ; j++ ){ var obj_lnbs = document.getElementById("lnb" + a + b); if(j == b) { obj_lnbs.className = "on"; } } } } } } function sDetail(obj) { document.getElementById('detailView').className ='off'; var objt = document.getElementById(obj); objt.style.display = (objt.style.display=='' ? 'block':''); } //Main function tabM(tit,obj,num,total) { for ( i=1 ; i<=total ; i++ ){ var objT = document.getElementById(tit+i); var objC = document.getElementById(obj+i); if(num==i){ objT.className="on"; objC.className="on"; } else { objT.className=""; objC.className=""; } } } function tabM2(obj,num,total) { for ( i=1 ; i<=total ; i++ ){ var objC = document.getElementById(obj+i); if(num==i){ objC.className="on"; } else { objC.className=""; } } if (obj == "ann") { loopA = num; loopA--; if(loopA < 1) loopA = total; } } function tabAlim(total,modNum) { var curNum = 0; var tarNum = 0; //for ( i=1 ; i<=total ; i++ ){ for(i = total; i > 0; i--){ var objC = document.getElementById("ann"+i); if (objC.className=="on") { curNum = i; objC.className=""; //alert(objC.className); break; } } tarNum = curNum + modNum; if (tarNum < 1) { tarNum = total; } if (tarNum > total) { tarNum = 1; } var objT = document.getElementById("ann"+tarNum); //var objS = document.getElementById("ann"+curNum); //objS.className=""; objT.className="on"; //alert(objT.className); //objT.className="on"; //tabM2("ann",tarNum,total); loopA = tarNum; loopA--; if(loopA < 1) loopA = total; } function load(obj) { document.getElementById(obj).className='loadscript'; } //banner function banS() { document.getElementById('banS2').style.display='none'; document.getElementById('banS3').style.display='none'; document.getElementById('banS4').style.display='none'; } //totalmenu function totalMenu(num) { if (num==1) { document.getElementById('rTotMenu').className='totalmenu on'; } else if (num==0) { document.getElementById('rTotMenu').className='totalmenu'; } } function totalMenu2() { var clsName = document.getElementById('rTotMenu').className; if (clsName=='totalmenu') { document.getElementById('rTotMenu').className='totalmenu on'; } else { document.getElementById('rTotMenu').className='totalmenu'; } } function faS(num) { if (num==1) { document.getElementById('faSer').className='fav-search on'; } else if (num==0) { document.getElementById('faSer').className='fav-search'; } } function pnChange2(objname, cnt, type) { var curIndex = 0; for (i =0; i (cnt-1)) curIndex = 0; document.getElementById(objname+curIndex).style.display=''; } /* ÅëÇÕ°Ë»ö */ function f_geomsaeg(frmSearch) { var errSchMsg = null; var schObj = null; if(frmSearch.query.value.length == 0 || frmSearch.query.value == " ÅëÇÕ°Ë»ö ") { errSchMsg = "°Ë»ö¾î¸¦ ÀÔ·ÂÇϼ¼¿ä."; schObj = frmSearch.query; } if (errSchMsg != null) { alert(errSchMsg); schObj.focus(); return false; } return true; } /* ´ñ±Û Iframe ³ôÀÌ ¼³Á¤ ½ºÅ©¸³Æ®ÀÔ´Ï´Ù */ function resizeIfr(obj, minHeight) { minHeight = minHeight || 10; try { var getHeightByElement = function(body) { var last = body.lastChild; try { while (last && last.nodeType != 1 || !last.offsetTop) last = last.previousSibling; return last.offsetTop+last.offsetHeight; } catch(e) { return 0; } } var doc = obj.contentDocument || obj.contentWindow.document; if (doc.location.href == 'about:blank') { obj.style.height = minHeight+'px'; return; } //var h = Math.max(doc.body.scrollHeight,getHeightByElement(doc.body)); //var h = doc.body.scrollHeight; if (/MSIE/.test(navigator.userAgent)) { var h = doc.body.scrollHeight; } else { var s = doc.body.appendChild(document.createElement('DIV')) s.style.clear = 'both'; var h = s.offsetTop; s.parentNode.removeChild(s); } //if (/MSIE/.test(navigator.userAgent)) h += doc.body.offsetHeight - doc.body.clientHeight; if (h < minHeight) h = minHeight; obj.style.height = h + 'px'; if (typeof resizeIfr.check == 'undefined') resizeIfr.check = 0; if (typeof obj._check == 'undefined') obj._check = 0; // if (obj._check < 5) { // obj._check++; setTimeout(function(){ resizeIfr(obj,minHeight) }, 200); // check 5 times for IE bug // } else { //obj._check = 0; // } } catch (e) { //alert(e); } } /* ÁÜ & Page Load */ /* ±ÛÀÚÈ®´ëÃà¼Ò */ var currentFontSize = 1; function zoomUtil(state, e){ var idx; var arrFontSize = new Array(); arrFontSize[0] = "65%"; arrFontSize[1] = "75%"; arrFontSize[2] = "85%"; arrFontSize[3] = "100%"; arrFontSize[4] = "110%"; var e = e || window.event; if (e) { if (state == "plus") { if (currentFontSize < 6 ) { idx = currentFontSize + 1; currentFontSize = idx; }else{ idx = 6; currentFontSize = idx; } } else if (state == "default") { idx = 1; currentFontSize = idx; } else if (state == "minus") { if ( currentFontSize >= 1) { idx = currentFontSize - 1; currentFontSize = idx; }else{ idx = 0; currentFontSize = idx; } } } alert(document.body.style.fontSize); //document.body.style.fontSize = document.body.style.fontSize*1.1; //$("body").css("font-size", arrFontSize[idx]); //alert($("body")); //return false; } //var zoomRate = 5; //var maxRate = 150; //var minRate = 100; var zoomRate = 5; // È®´ë/Ãà¼Ò½Ã Áõ°¨·ü var maxRate = 150; //ÃÖ´ëÈ®´ë·ü var minRate = 100; //ÃÖ¼ÒÃà¼Ò·ü function goZoom(how) { if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){ //parent.document.body.style.zoom = GetCookie("zoomVal"); document.body.style.zoom = GetCookie("zoomVal"); currZoom=GetCookie("zoomVal"); } else{ //parent.document.body.style.zoom = '100%'; document.body.style.zoom = '100%'; currZoom = '100%'; } //alert(parent.document.body.style.zoom); //alert(currZoom); if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) { return; } //alert(parseInt(parent.document.body.style.zoom)+zoomRate+'%'); if (how == "in") { document.body.style.zoom = parseInt(document.body.style.zoom)+zoomRate+'%'; } else if (how == "out") { document.body.style.zoom = parseInt(document.body.style.zoom)-zoomRate+'%'; } SetCookie("zoomVal",document.body.style.zoom); } function SetCookie(name,value){ document.cookie = name + "=" + escape( value ) + "; path=/; " } function GetCookie(name){ if (document.cookie != "") { chips = document.cookie.split("; "); for (var i=0; i < chips.length; i++) { crumb = chips[i].split("="); if (crumb[0] == name) { return unescape(crumb[1]); } } }else{ return ""; } } function SetCookie2(name,value){ document.cookie = name + "=" + escape (value)+";"; } /*****Zoom In & Zoom Out Script*****/ function GoZoom2(contentid){ var zrr = GetCookie("zoomVal"); var zrr2 = removeChar(zrr); if(zrr2 < 100){ document.getElementByld("contentid").style.zoom = '100%'; currZoom = '100%'; SetCookie("zoomVal",currZoom); } else { if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){ document.all[contentid].style.zoom = GetCookie("zoomVal"); currZoom=GetCookie("zoomVal"); } /*else { document.getElementByld["contentid"].style.zoom='100%'; currZoom = '100%'; } */ } } //Zoom In & Zoom Out function zoomInOut(how) { var currZoom; if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){ //document.all["wrap"].style.zoom = GetCookie("zoomVal"); currZoom=GetCookie("zoomVal"); //alert(currZoom); } else { //document.all["wrap"].style.zoom = '100%'; currZoom = '100%'; } if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) { return; } //alert(currZoom); //alert( parseInt(currZoom)); //alert(parseInt(currZoom)+zoomRate+'%'); if (how == "in") { //document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%'; //document.all["wrap"].style.zoom = parseInt(document.all["wrap"].style.zoom)+zoomRate+'%'; //document.all["wrap"].style.zoom = parseInt(currZoom)+zoomRate+'%'; //document.all["container"].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%'; currZoom = parseInt(currZoom)+zoomRate+'%'; } else { //document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'; //document.all["wrap"].style.zoom = parseInt(currZoom)-zoomRate+'%'; //document.all["container"].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'; currZoom = parseInt(currZoom)-zoomRate+'%'; } document.all["wrap"].style.zoom = currZoom; SetCookie2("zoomVal",currZoom); } function zoomDefault(){ document.all["wrap"].style.zoom = '100%'; SetCookie2("zoomVal",document.all["wrap"].style.zoom); zoomInOut("out"); } // +, - key event document.onkeypress = getKey; function getKey(keyStroke) { isNetscape=(document.layers); eventChooser = (isNetscape) ? keyStroke.which : event.keyCode; which = String.fromCharCode(eventChooser).toLowerCase(); which2 = eventChooser; var el=event.srcElement; if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA")) //input,textarea ¾È¿¡¼­ÀÇ +.-°ªÀº ½ÇÇà¾ÈµÇµµ·Ï { if(which == "+" ) zoomInOut('in'); else if(which == "-" ) zoomInOut('out'); else if(which == "0" ) zoomDefault(); } } //function initMoving(target, position, topLimit, btmLimit) { function quickAutoMov() { var obj = document.getElementById("quick_new"); obj.initTop = 180; obj.topLimit = 180; obj.bottomLimit = document.documentElement.scrollHeight - 100; obj.style.position = "absolute"; obj.top = obj.initTop; obj.left = obj.initLeft; if (typeof(window.pageYOffset) == "number") { // FF / OP obj.getTop = function() { return window.pageYOffset; } } else if (typeof(document.documentElement.scrollTop) == "number") { // IE obj.getTop = function() { return document.documentElement.scrollTop; } } else { obj.getTop = function() { return 0; } } if (self.innerHeight) { 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() / 2 - 10; } 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"; }, 100) }