// ============================ Cookie 관련 함수 =============================0 function delCookie(name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function setCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function getCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function setCookieA(name,name2,value,expire,domain){ // 배열 쿠키 저장 하기 //name-쿠키명 ,name2-name쿠키컬렉션 , value--쿠키 컬렉션의 값 , expire 만료일 var string=getCookie(name);//string - 전체 쿠키무자열 var flag=string.indexOf(name2 + '=') if (flag == -1){ // name2의 이름으로쿠키컬렉션의 값이 없으면 쿠키값 더함 . var tmp_cookie= string + "&" + name2 + "=" + escape(value); }else{ // name2의 이름으로쿠키컬렉션의 값이 있다면 쿠키값 수정 .. var tmp_cookie=ReplaceString(string,name2 + "=","&",value) } document.cookie = name + "=" + tmp_cookie //쿠키저장 + ((expire) ? ";expires=" + expire.toGMTString() : "") + ((domain) ? "; domain=" + domain : "") } function getCookieA(uName,uName2){ //쿠키열 중에 uName2의 값을 구한다 var string = getCookie(uName); if(string==null) string=""; var flag = string.indexOf(uName2+'='); if (flag != -1){ flag += uName2.length + 1 end = string.indexOf('&', flag) if (end == -1) end = string.length return unescape(string.substring(flag, end)) }else{ return "" } } function getCookie2(uName,uName2) { return getCookieA(uName,uName2); } // ============================ Cookie 관련 함수 =============================0 // ============================ Font 관련 함수 ============================= /* var article_fontSize = parseInt(getCookie("article_fontSize")); function setFont(article_fontSize) { document.getElementById("articleBody").style.fontSize = article_fontSize+"pt"; setFontCookie(article_fontSize); } function initFont() { if ( (article_fontSize < 10) || (article_fontSize > 18) || (isNaN(article_fontSize) == true)) { article_fontSize = 9; } setFont(article_fontSize); } function setFontCookie(article_fontSize){ var expiry = new Date(); var path = "/"; var domain = ".visitseoul.net"; var secure = ""; expiry.setTime(expiry.getTime() + 90 * (24 * 60 * 60 * 1000)); setCookie("article_fontSize",article_fontSize,expiry,path,domain,secure); } function fontPlus() { if (article_fontSize < 17) { article_fontSize = article_fontSize + 1; setFont(article_fontSize); } } function fontMinus() { if (article_fontSize > 9) { article_fontSize = article_fontSize - 1; setFont(article_fontSize); } } */ // ============================ Font 관련 함수 ============================= // ============================ 기타 유틸 함수 ============================= // 9. 좌측 공백 제거 함수 function Ltrim(strValue){ while (strValue.length>0){ if(strValue.charAt(0)==' '){ strValue=strValue.substring(1,strValue.length); } else return strValue; } return strValue; } // 10. 우측 공백 제거 함수 function Rtrim(strValue){ while (strValue.length>0){ if(strValue.charAt(strValue.length-1)==' '){ strValue=strValue.substring(0,strValue.length-1); } else return strValue; } return strValue; } // 11. 양쪽 공백 제거 함수 function Trim(strValue){ strValue = Ltrim(strValue); strValue = Rtrim(strValue); return strValue; } // "," 없애는 함수 function ClearComma(value1){ return replace(value1,",",""); } // Replace함수 function replace(str,otxt,rtxt){ if(otxt==rtxt) return str; while(str.indexOf(otxt)>0){ str = str.replace(otxt,rtxt); } return str; } // select box의 옵션들 없애기 function DelOption(objname){ var obj = document.getElementById(objname); while (obj.length>=1) obj.options[0]=null; } // select box에 option 추가 function AddOption(objname,value,strtext){ var obj = document.getElementById(objname); var optobj = new Option(strtext,value,true); obj.options[obj.length]=optobj; } // select box의 특정 option 선택 function SetSelectOption(objname,selectvalue){ var obj = document.getElementById(objname); var i; for(i=0;i"); } // Article Page 에서 플레이어 창 호출하기 _ 정적페이지 (동영상url과 이미지경로 필수) function showplayiframe_static(mov_url, mov_img) { document.write("
"); } // 원본문자열에서 지정한 문자열의 갯수 function StringCount(sourceStr,findstr){ var result = 0; var tmp = ""; tmp = sourceStr; while(tmp.indexOf(findstr)>=0){ result++; tmp = tmp.substring(tmp.indexOf(findstr)+1,tmp.length); } return result; } // 바이트 포함 길이체크 function chkLen(obj,maxlen){ var str,msg; var len = 0; var temp; var count = 0; var k; msg = obj.value; str = new String(msg); len = str.length; for (k=0 ; k 4){ count += 2; }else if (temp == 'r' && str.charAt(k+1) == 'n') { // rn일 경우 count += 2; }else if (temp != 'n') { count++; } if(count>=maxlen){ alert(maxlen + "Byte까지만 입력가능합니다"); obj.value = str.substring(0,k); return; } } } // 바이트 수 function getByte(strtext){ var str = new String(strtext); var len = str.length; var k,temp,count=0; for (k=0 ; k 4){ count += 2; }else if (temp == 'r' && str.charAt(k+1) == 'n') { // rn일 경우 count += 2; }else if (temp != 'n') { count++; } } return count; } function CheckEssential(formobj, obj){ var i; var tmpcnt; if((obj.type=="text") || (obj.type=="hidden") || (obj.type=="textarea") || (obj.type=="password")){ if(Trim(obj.value)=='') return false; else return true; }else if(obj.type=="select-one"){ if(obj.value=='') return false; else return true; }else if(obj.type=="radio"){ tmpcnt = getObjCnt(formobj, obj.name); if(tmpcnt==1){ return obj.checked; }else if(tmpcnt>1){ for(i=0;imaxlen) return false; else return true; } function CheckNumeric(obj){ obj.value = ClearComma(obj.value); if(isNaN(obj.value)) return false; else return true; } function CheckValid(formobj,obj){ var tmpstr = ''; var r_objname = ''; var r_maxlen = 0; var r_essent = false; var r_numeric = false; var txtvalid = obj.valid; for(var i=0;i0){ if(!CheckMaxLen(obj,r_maxlen)){ alert('"' + r_objname + '" 은(는) 최대 '+ r_maxlen+' byte 까지 입력가능합니다.\n\n현재길이: ' + getByte(obj.value) + ' byte'); obj.focus(); return false; } } if(r_numeric){ if(!CheckNumeric(obj)){ alert('"' + r_objname + '" 은(는) 숫자만 입력가능합니다.'); obj.focus(); return false; } } return true; } // 입력값들 체크후에 true,false 리턴 function checkForm(frmobj){ with(frmobj){ for(var i=0; ieval(obj.maxwidth)) obj.width=obj.maxwidth; if(obj.maxheight!=null) if(obj.height>eval(obj.maxheight)) obj.height=obj.maxheight; } // var imgResizingtimer = setInterval("setArticleImgSize()",100); function flash(url, width, height){ document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); } // 일간 기사중계 function openmlb(retv){ var x = 730 ; var y = 730; var url = "http://isplusapp.joins.com/mlb/mlb_textgame_P.asp?gmkey="+retv ; //alert('준비중입니다.'); window.open(url, "textgame", "width="+ x +", height="+ y +", top=0, left=0, scrollbars=0, resizable=1, toolbar=0, menubar= 0, location=0, ectories=0, status=0"); } // 일간 문자중계2 function winopen(retv){ var x = 730 ; var y = 730; //var url = "http://enportsapp.joins.com/mlb/mlb_textgame_P.asp?gmkey="+retv ; var url = "http://isplusapp.joins.com/mlb/mlb_textgame_P.asp?gmkey="+retv ; //alert('준비중입니다.'); window.open(url, "textgame", "width="+ x +", height="+ y +", top=0, left=0, scrollbars=0, resizable=1, toolbar=0, menubar= 0, location=0, ectories=0, status=0"); } function openkbo(retv){ var x = 730 ; var y = 730; var url = "http://isplusapp.joins.com/kbo/kbo_textgame_P.asp?gmkey="+retv ; //alert('준비중입니다.'); window.open(url, "textgame", "width="+ x +", height="+ y +", top=0, left=0, scrollbars=0, resizable=1, toolbar=0, menubar= 0, location=0, ectories=0, status=0"); } // 일간 비주얼 뉴스 갤러리 오픈용 function pop_open(url){ win = window.open(url , 'gallery' ,"scrollbars=no,width=725,height=707,left=50,top=50"); } // 뉴스 갤러리 팝업창(200607) function pop_newsGallery(url){ win = window.open(url , 'gallery' ,"scrollbars=no,width=668,height=660,left=50,top=50"); } // 조인스 영상뉴스 동영상 function win_open_mov(url) { win = window.open(url,'movie',"scrollbars=no,width=540,height=520,left=50,top=50"); } // 월드컵 3D VR function openvr(){ var vrwin = window.open("http://vr.joins.com/vrapp/vrpop.html","vrwin","status=no,scrollbars=no,width=770,height=590"); } // Joins TV팝업 function jointvPopup(mov_id) { var oPopWin; oPopWin = window.open('http://tv02.joins.com/movie_detail.asp?mov_id='+ mov_id,'joinstv','toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,top=50,left=150,width=664,height=570'); if(oPopWin) oPopWin.focus(); } function joinstvPopup(mov_id) { var oPopWin; oPopWin = window.open('http://tv02.joins.com/movie_detail.asp?mov_id='+ mov_id,'joinstv','toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,top=50,left=150,width=664,height=570'); if(oPopWin) oPopWin.focus(); } // cnn갤러리 팝업 함수 function openWindow (earl,name,widgets){ host = location.hostname; if (host.indexOf('customnews') != -1) { var url = 'http://customnews.cnn.com' + earl; } else { var url = earl; } popupWin = window.open (url,name,widgets); popupWin.opener.top.name="opener"; popupWin.focus(); } /*************************************** msn 관련 함수 ********************************************/ // (s) - 아티클 공유 관련 함수 function setCookie_domain(name ,value, expires, path, domain, secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function fn_CookieAdd(value) { var expiry = new Date(); var name = "joins_article_msn"; var path = "/"; var domain = "joins.com"; var secure = ""; var urlData = location.href; var start_point = ""; var end_point = ""; expiry.setTime(expiry.getTime() + 1 * (24 * 60 * 60 * 1000)); setCookie_domain(name, value, expiry, path, domain, secure); } function fn_GetCookie() { var name = "joins_article_msn"; var nameOfCookie = name + "="; var x = 0; while ( x <= document.cookie.length ) { var y = (x+nameOfCookie.length); if ( document.cookie.substring( x, y ) == nameOfCookie ) { if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length; return unescape( document.cookie.substring( y, endOfCookie ) ); } x = document.cookie.indexOf( " ", x ) + 1; if ( x == 0 ) break; } return ""; } var obj; function fn_CheckCookie() { if (!fn_GetCookie()) { alert ("쿠키설정가 허용되지 않은 경우 다른기사가 전송될 수 있습니다. \n\n인터넷옵션에서 쿠키허용을 확인해 주세요."); return false; } } function CheckMessenger() { eval ('try {obj = new ActiveXObject("MSNMessenger.P4QuickLaunch");} catch (e) {obj = null;}'); var strErrorPage = "http://www.joins.com"; } function LaunchApp(AppID, emailID) { if (obj != null) { obj.LaunchApp(AppID, emailID); } } function fn_TryMSN(total_id) { var AppID = "99995597"; fn_CookieAdd(total_id); fn_CheckCookie(); CheckMessenger(); LaunchApp(AppID, ""); } // (e) - 아티클 공유 관련 함수 // (s) - 뉴스 알림 서비스 function fn_TryAlert(Url) { window.open (Url, "_blank"); } // (e) - 뉴스 알림 서비스 // (s) - RSS 링크 function rss_joins(xrssurl,xrsstitle) { document.w.xurl.value=xrssurl; document.w.xtitle.value=xrsstitle; window.open("http://rss.joins.com/rss_popup.html","rss_popup", 'top=10,left=10 width=363 height=212 location=0,status=0,menubar=0,scrollbars=no,resizable=0,border=0'); } function rss_joins_asp(xrssurl,xrsstitle) { window.open("http://rss.joins.com/rss_popup.asp?rsstitle="+xrsstitle+"&rssxmlurl="+xrssurl,"rss_popup", 'top=10,left=10 width=363 height=212 location=0,status=0,menubar=0,scrollbars=no,resizable=0,border=0'); } // (e) - RSS 링크