///// String 관련 //get파라미터가져오기 function request(param) { try { var aParams = new Array(); var sUrlParam = document.location.search.substring(1); for(var nIdx=0; nIdx 4) { nbytes += 2; } else if(ch =="\n") { if(orgText.charAt(i-1) != "\n") { nbytes +=1; } } else if(ch == "<" || ch == ">") { nbytes += 4; } else { nbyte += 1; } } return nbytes; } //글자수 잘라내기 function fnSetLength(orgText, maxLen, addStr) { var inc = 0; var nbytes = 0; var msg = ""; var msglen = orgText.length; for(i=0;i 4) { inc = 2; } else if(ch == "\n") { if(orgText.charAt(i-1) != "\n") { inc = 1; } } else if(ch == "<" || ch == ">") { inc = 4; } else { inc = 1; } if((nbytes + inc) > maxLen) { msg += addStr; break; } nbytes += inc; msg += ch; } return msg; } //왼쪽 공백문자 제거(별로 안좋아보이므로 담에 다시 바꾸자) function fn_Ltrim(strValue) { try { while (strValue.length>0) { if(strValue.charAt(0) == ' ') { strValue=strValue.substring(1,strValue.length); } else { return strValue; } } return strValue; } catch(e) { alert(e.description); } } //오른쪽 공백문자 제거(별로 안좋아보이므로 담에 다시 바꾸자) function fn_Rtrim(strValue) { try { while (strValue.length>0) { if(strValue.charAt(strValue.length-1)==' ') { strValue=strValue.substring(0,strValue.length-1); } else { return strValue; } } return strValue; } catch(e) { alert(e.description); } } //String 의 공백을 모두 제거한다. function fn_Trim(sourceString) { var strResult ; try { strResult = sourceString.replace(/\s/g,""); return strResult; } catch(exception){} } //String 의 양쪽공백을 모두 제거한다. function fn_RLTrim(strSource) { try { return strSource.replace(/(^\s*)|(\s*$)/g, ""); } catch(exception){} } //문자열 바꿈 function fn_ReplaceAll(oldStr,findStr,repStr) { try { var srchNdx = 0; var newStr = ""; while (oldStr.indexOf(findStr,srchNdx) != -1) { newStr += oldStr.substring(srchNdx,oldStr.indexOf(findStr,srchNdx)); newStr += repStr; srchNdx = (oldStr.indexOf(findStr,srchNdx) + findStr.length); } newStr += oldStr.substring(srchNdx,oldStr.length); return newStr; } catch(exception){} } //숫자 포맷.. 세자리수마다.. 콤마 표시 function fn_ReturnMoneyFormatString(numValue) { var strValue = ""; var retValue = ""; try { strValue = "" + numValue + ""; for(i=0; i 0 && (i%3)==0) retValue = strValue.charAt(strValue.length - i -1) + "," + retValue; else retValue = strValue.charAt(strValue.length - i -1) + retValue; } return retValue; } catch(exception){} } //// 윈도우 창 관련 //윈도우창 모니터화면 가운데 띄우기 function fn_OpenCenterWindow(url, width, height, winName, feature) { var nTop = 0; var nLeft = 0; var nHeight = height; var nWidth = width; var strFeature = ""; var oWindow = null; try { if(feature != null && feature.length > 0) strFeature = "," + feature; else strFeature = strFeature; nTop = (window.screen.height / 2) - (nHeight / 2); nLeft = (window.screen.width / 2) - (nWidth / 2); oWindow = window.open(url, winName, "width=" + nWidth + ",height=" + nHeight + ",top=" + nTop + ",left=" + nLeft + strFeature); oWindow.focus(); } catch(e) { alert(e.description); } finally { oWindow = null; } } //윈도우창 클릭한 브라우져의 가운데에 띄우기 function fn_OpenCenterBrowserWindow(url, width, height, winName, feature) { var nTop = 0; var nLeft = 0; var nHeight = height; var nWidth = width; var strFeature = ""; var oWindow = null; try { if(feature != null && feature.length > 0) strFeature = "," + feature; else strFeature = strFeature; if(window.document.body.offsetHeight > height && window.document.body.offsetWidth > width) { nTop = ((window.document.body.offsetHeight - height) / 2) + window.screenTop; nLeft = ((window.document.body.offsetWidth - width) / 2) + window.screenLeft; if(nTop < (window.screen.height - height) && nLeft < (window.screen.width - width)) { oWindow = window.open(url, winName, "width=" + nWidth + ",height=" + nHeight + ",top=" + nTop + ",left=" + nLeft + strFeature); oWindow.focus(); } else { //새창이 모니터 화면을 벗어나면 가운데 열기 fn_OpenCenterWindow(url, width, height, winName, feature); } } else { //새창이 더 크면 모니터화면 가운데에 열기 fn_OpenCenterWindow(url, width, height, winName, feature); } } catch(e) { alert(e.description); } finally { oWindow = null; } } //마우스 클릭한데서 띄우기 function fn_OpenMousePointWindow(url, width, height, winName, feature, MouseEvent) { var nTop = 0; var nLeft = 0; var nHeight = height; var nWidth = width; var strFeature = ""; var oWindow = null; var nMouseTop = 0; var nMouseLeft = 0; try { nMouseTop = MouseEvent.screenY; nMouseLeft = MouseEvent.screenX; if(feature != null && feature.length > 0) strFeature = "," + feature; else strFeature = strFeature; if((nMouseTop + height) > window.screen.height) nTop = (window.screen.height - height) - 90; else nTop = nMouseTop; if((nMouseLeft + width) > window.screen.width) nLeft = (window.screen.width - width) - 10; else nLeft = nMouseLeft; oWindow = window.open(url, winName, "width=" + nWidth + ",height=" + nHeight + ",top=" + nTop + ",left=" + nLeft + strFeature); oWindow.focus(); } catch(e) { alert(e.description); } finally { oWindow = null; } } //모달팝업창을 띠운다. function fn_OpenModalDialog(sUrl,sParam, sFeature) { try { var strReturn = ""; strReturn = window.showModalDialog("/_include/html/ModalDialog.html?" + sUrl, sParam, sFeature); return strReturn; } catch(exception){} } //모달리스팝업창을 띠운다. function fn_OpenModelessDialog(sUrl,sParam, sFeature) { try { var strReturn = ""; strReturn = window.showModelessDialog("/_include/html/ModelessDialog.html?" + sUrl, sParam, sFeature); return strReturn; } catch(exception){} } //리스트 화면에서 쓰는 함수이다.. //날짜 관련함수 (선택된 월의 마지막날짜 구하고 출력) function GetLastDay(oYear, oMonth, oDay, currentDay) { try { oDay.options.length=1; month_day = new Array(31,28,31,30,31,30,31,31,30,31,30,31); if(parseInt(oYear.value) % 4 == 0) month_day[1] = 29; for(i=0; i<12; i++) { if(oMonth[i].selected) { print_day = month_day[i]; break; } } for(i=0; i"); } /*************************************************** interactive 관련 함수 2010.7.21 추가 ***************************************************/ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab
"); var flashvars = {xmlPath:"http://web.archive.org/web/20110530221846/http://static.joinsmsn.com/joongang/data/interactive/_xml/"+strDir+"/"+strAid+".xml", id:"swfId"+sid}; var attributes = {id:"swfId"+sid}; var params = {wmode:"opaque", allowfullscreen:"true", allowscriptaccess:"always"}; //고정 swfobject.embedSWF("http://web.archive.org/web/20110530221846/http://static.joinsmsn.com/joongang/ui/swf/interactive/chart_pie_a.swf", "swfdiv"+sid, "250", "308", "10.0.0", "http://web.archive.org/web/20110530221846/http://static.joinsmsn.com/joongang/ui/swf/interactive/expressInstall.swf", flashvars, params, attributes); } //interactive flash 에서 호출하는 함수 function setSwfHeight(swfID,swfH) { swfobject.getObjectById(swfID).height = swfH; } function interactive_flash(url, width, height){ //단품형 플레쉬 호출 var flashvars = {xmlPath:"", id:"swfIdstamdalone"}; var attributes = {id:"swfIdstamdalone"}; var params = {wmode:"opaque", allowfullscreen:"true", allowscriptaccess:"always"}; //고정 document.write ("
"); swfobject.embedSWF(url, "swfIdstamdalone", width, height, "10.0.0", "http://web.archive.org/web/20110530221846/http://static.joinsmsn.com/joongang/ui/swf/interactive/expressInstall.swf", flashvars, params, attributes); } function interactive_swf_chart(sid,swfurl,width,height) { //chart_type 은 추후에 그래프 이외로 들어갈때 사용하자 var strAid = sid; var cntAid = strAid.length; var strDir = strAid.substring(cntAid-3, cntAid); // 끝에서 세번째 숫자(디렉토리)를 읽어오자 if (strDir.length == 2){ strDir = "0"+strDir } if (strDir.length == 1){ strDir = "00"+strDir } if (width=="250") { document.write ("
"); } else { document.write ("
"); } var flashvars = {xmlPath:"http://web.archive.org/web/20110530221846/http://static.joinsmsn.com/joongang/data/interactive/_xml/"+strDir+"/"+strAid+".xml", id:"swfId"+sid}; var attributes = {id:"swfId"+sid}; var params = {wmode:"opaque", allowfullscreen:"true", allowscriptaccess:"always"}; //고정 swfobject.embedSWF(swfurl, "swfdiv"+sid, width, height, "10.0.0", "http://web.archive.org/web/20110530221846/http://static.joinsmsn.com/joongang/ui/swf/interactive/expressInstall.swf", flashvars, params, attributes); } function skip_html(string) { var objStrip = new RegExp(); objStrip = /[<][^>]*[>]/gi; return string.replace(objStrip, ""); } //두 날짜 사이의 간격을 리턴한다. function fnDateDiff(sDate, eDate) { var arrDate; var dtStart, dtEnd, dtDiff; var iDays; try { arrDate = sDate.split("-"); dtStart = new Date( fn_GetInt(arrDate[0]), fn_GetInt(arrDate[1]) - 1, fn_GetInt(arrDate[2]) ); arrDate = eDate.split("-"); dtEnd = new Date( fn_GetInt(arrDate[0]), fn_GetInt(arrDate[1]) - 1, fn_GetInt(arrDate[2]) ); dtDiff = dtEnd.getTime() - dtStart.getTime(); iDays = Math.floor(dtDiff/1000/60/60/24); return iDays; } catch (exception) { return null; } } function fn_GetInt(sNum) { try{ for ( var i =0 ; i < sNum ; i++ ){ if ( sNum.substring(0, 1) == 0 ) sNum = sNum.substring(1, sNum.length); else return parseInt(sNum); } return parseInt(sNum); } catch (exception){} } /* FILE ARCHIVED ON 22:18:46 May 30, 2011 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 08:26:58 Sep 22, 2017. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */