//Happy New Year function Happy_New_Year() { if (__Cookie('pop_anounce') == 'checked') return; window.open("http://www.npagoda.com/etc/popup/20060126/newyear_popup.htm", "win1", "width=344, height=350, left=50, top=80") } function __Cookie(name) { var CookieName = name + "="; var DocuCookie = document.cookie; var validate = ""; if (DocuCookie.length > 0) { begin = DocuCookie.indexOf(CookieName); if (begin != -1) { begin += CookieName.length; end = DocuCookie.indexOf(";", begin); if (end == -1) end = DocuCookie.length; validate += unescape(DocuCookie.substring(begin, end)); } } return validate; } // ÆË¾÷ function OPEN_WIN(url, option) { window.open(url,'',option); } function option_select(el, value) { for(i = 0; i < el.options.length; i++){ if(el.options[i].value == value){ el.options[i].selected = true; break; } } } function toggle(element) { if( element) { if(element.length) { for(var i=0; i< element.length; i++) swap_checkbox(element[i]) } else swap_checkbox(element) } else alert("¼±ÅÃÇÒ Ç׸ñÀÌ ¾ø½À´Ï´Ù") } function toggle_new(element,flag_check) { // flag_check °ª¿¡ µû¶ó Àüü üũ, Àüü ÇØÁ¦ // all_toggle °ªÀ» º¯°æ // flag_check °ªÀÌ ¾ø´Ù¸é all_toggle °ªÀ» ±âÁØÀ¸·Î if(flag_check==null) { if( document.getElementById('all_toggle') ) { flag_check=document.getElementById('all_toggle').checked; } else flag_check=true; } if( element) { if(element.length) { for(var i=0; i< element.length; i++) { element[i].checked=flag_check; } } else { element.checked=flag_check; } if( document.getElementById('all_toggle') ) document.getElementById('all_toggle').checked=flag_check; } else { alert("¼±ÅÃÇÒ Ç׸ñÀÌ ¾ø½À´Ï´Ù") } } function setAllToggle(element) { // element °¡ ¸ðµÎ üũµÇ¸é all_toggle °ª º¯°æ // ¹Ý´ëµµ º¯°æ if( element) { var flag_all_check=true; if(element.length) { for(var i=0; i< element.length; i++) { if(element[i].checked==false) { flag_all_check=false;break; } } } else { if(element.checked==false) flag_all_check=false; } if( document.getElementById('all_toggle') ) document.getElementById('all_toggle').checked=flag_all_check; } else { } } function swap_checkbox(element) { if( !element.disabled) element.checked= !element.checked } function dupcheck_user(form, element,nothing) { Popup("/lib/User/check.php?el="+element+"&pf="+form,350,100); } function search_user(form, element,user_class) { Popup("/lib/User/search.php?user_class="+user_class+"&form="+form+"&element="+element,300,300,1) } function normal_content(class_id, normal_id, dir,width,height, start_file) { var url= "/Content/"+class_id+"/"+normal_id+"/"+dir+"/"+start_file var pattern= /\?/ if( start_file.match(pattern)) url+="&" else url+="?" url+="content_type=normal&normal_id="+normal_id Popup(url, width, height,1) } function vod_lecture_content(class_id, lecture_id, vod_id, width, height, start_file, skip, company_id) { var url= "/Content/"+class_id+"/"+start_file var pattern= /\?/ if( start_file.match(pattern)) url+="&" else url+="?" url+="content_type=vod&lecture_id="+lecture_id+"&vod_id="+vod_id if( skip) url+= "&skip="+skip if(skip == 'Y' && company_id == 'hanabank') { alert('ÀÌ¹Ì Áö³­ÁÖ ÇнÀÀ¸·Î \nÁøµµÀ² üũ´Â µÇÁö ¾Ê½À´Ï´Ù.'); } //alert(url); Popup(url, width, height,0) } function vod_lecture_past_content(class_id, lecture_id, vod_id, width,height, start_file) { var url= "/Content/"+class_id+"/"+start_file var pattern= /\?/ if( start_file.match(pattern)) url+="&" else url+="?" url+="content_type=vod&lecture_id="+lecture_id+"&vod_id="+vod_id+"&status=r" Popup(url, width, height,0) } function vod_content(class_id, vod_id, width,height, start_file,skip,status) { var url= "/Content/"+class_id+"/"+start_file var pattern= /\?/ if( start_file.match(pattern)) url+="&" else url+="?" url+="content_type=vod&vod_id="+vod_id if( skip) url+= "&skip="+skip if( status) url+= "&status="+status Popup(url, width, height,0) } function Popup(url,width,height,scroll,resizable) { var optsrt; if( !scroll ) scroll= 0; if( !resizable ) resizable= 0; optstr="height="+height+",width="+width+",location=0,menubar=0,resizable="+resizable+",scrollbars="+scroll+",status=1,titlebar=0,toolbar=0,screeny=0,left=0,top=0"; var npagoda_popup= window.open(url, '', optstr); return npagoda_popup } function isImage(img) { pattern= /\.(jpg|jpeg|gif)$/i if( img== '') return false else if( img.match(pattern)) return true else { alert('À̹ÌÁö¸¸ °¡´ÉÇÕ´Ï´Ù.'); return false } } function Trim(str) { var count = str.length, len = count, st = 0 while ((st < len) && (str.charAt(st) <= ' ')) st++ while ((st < len) && (str.charAt(len - 1) <= ' ')) len-- return ((st > 0) || (len < count)) ? str.substring(st, len) : str } function selected_option(el) { for(var i=1; i 0){ //alert(el.options.length); for(i=0; i 0 && value_array.length > 0){ for(i = 0; i < value_array.length; i++){ for(j = 0; j < coll.length; j++){ if(coll[j].value == value_array[i]){ coll[j].click(); } } } } } function blank_text(el) { re=true if( el.type=='text' || el.type=='textarea' || el.type=='password') { if( Trim(el.value).length < 1) { warning(el,'ºó Ä­À» ä¿ì¼¼¿ä') return false } } return re } function number_text(el) { if( isNaN(el.value)) { warning(el, '¼ýÀÚ¸¦ »ç¿ëÇϼ¼¿ä') el.value='' return false } else return true } function warning(el, msg) { el.focus() alert(msg) } function check_over_flow(el,check_byte_num){ var str = el.value; var str_byte = 0; for(i = 0; i"9") && (ch<"A"||ch>"Z") && ((code>255)||code<0)){ str_byte = str_byte + 2; }else{ str_byte = str_byte + 1; } } //alert(str_byte); if(str_byte > check_byte_num){ //el.value = str.substr(0,Math.ceil(check_byte_num/2)); warning(el,(check_byte_num/2)+'ÀÚ À̳»·Î ÀÔ·ÂÇϼ¼¿ä.'); return false; }else{ return true; } } /******************************************************************************* 1. ¼³¸í: *******************************************************************************/ function InsertItem(obj, value, text){ for(var i=0; i¿¡ °ªÀ» ÃʱâÈ­ÇØÁØ´Ù. 2. »ç¿ë¿¹:
*******************************************************************************/ function delsel(sel) { for (i=sel.length-1; i>=0; i--) sel.options[i] = null; } /****************************************************************************************** 1. ¼³¸í: checkbox¸¦ ÀÚµ¿À¸·Î üũÇÏ°í ½ÍÀº °æ¿ì( µ¥ÀÌŸ¼öÁ¤½Ã) ÀÚµ¿À¸·Î üũµÇ°Ô ÇÑ´Ù. 2. »ç¿ë¿¹:
******************************************************************************************/ function select_box(el, value){ if( el) { if( el.length) { for(var i=0; i< el.length; i++) { if(el[i].value==value) { el[i].checked= true break } } }else{ if(el.value==value) el.checked= true } } } /****************************************************************************************** 1. ¼³¸í: °¡ Çϳª¶óµµ ¼±ÅÃÀÌ µÇ¾î Àִ°¡ 2. »ç¿ë¿¹:
******************************************************************************************/ function is_box_selected(el){ re= false if( el) { if( el.length) { for(var i=0; i< el.length; i++) { if(el[i].checked) { re= true break } } } else { re= el.checked } } else { re= false } return re } function box_value(el){ var re=-1 if( el) { if( el.length) { for(var i=0; i< el.length; i++) { if(el[i].checked) { re= el[i].value break } } }else{ re= el.value } } return re } /****************************************************************************************** 1.¼³¸í : ÅØ½ºÆ®ÀÔ·ÂÀ» ¹Þ´Â ¿ä¼Ò¿¡¼­ ƯÁ¤ ±æÀÌ ÀÌ»ó ³ÑÁö ¾Ê°Ô üũÇÏ´Â°Í ******************************************************************************************/ function checklen(el,check_byte) { var msgtext = el.value var i=0,l=0 var temp,lastl //±æÀ̸¦ ±¸ÇÑ´Ù. while(i < msgtext.length) { temp = msgtext.charAt(i) if (escape(temp).length > 4) l+=2 else if (temp!='\r') l++ // OverFlow if(l> check_byte) { alert("ÀԷ¶õ¿¡ Çã¿ë ±æÀÌ ÀÌ»óÀÇ ±ÛÀ» ¾²¼Ì½À´Ï´Ù.\nÀԷ¶õ¿¡´Â ÇÑ±Û "+Math.round(check_byte/2)+"ÀÚ, ¿µ¹®"+check_byte+"ÀÚ±îÁö¸¸ ¾²½Ç ¼ö ÀÖ½À´Ï´Ù."); el.value = el.value.substr(0,i) l = lastl break } lastl = l i++ } return l } /*** * ¹®ÀÚ Â¥¸£±â ***/ function cutmessage(content,i){ var tmpStr; var temp=0; var onechar; var tcount; tcount = 0; tmpStr = new String(content); temp = tmpStr.length; for(k=0;k 4) tcount += 2; else if(onechar!="\r\n") tcount++; if(tcount>i){ tmpStr = tmpStr.substring(0,k); break; } } return tmpStr; } String.prototype.just= function(direction, space, value){ if( typeof space == 'undefined' || typeof space != 'number') return -1 if( typeof value == 'undefined' || typeof value != 'string') value = 0 var how_many= space - this.length var ext= '' for(var i=0; i< how_many; i++) ext+= value return direction ? this+ext : ext+this } String.prototype.ljust= function(space, value){ return this.just(false, space, value) } // '1111'.rjust(0,'+') ==> "1111++++++" String.prototype.rjust= function(space, value){ return this.just(true, space, value) } String.prototype.trim= function(){ return this.replace(/^\s+|\s+$/g,'') } // ¹è¿­¿¡ °Ë»öÇÑ °ªÀÌ ÀÖÀ¸¸é À妽º ¹øÈ£¸¦ ¸®ÅÏ, ¾øÀ¸¸é -1À» ¸®ÅÏ Array.prototype.indexOf = function(val) { var len = this.length for (var i=0; i < len; i++) { if (this[i] == val) return i } return -1 } /****************************************************************************************** 1. ¼³¸í: form³»¿¡ ¿¡ °³º°Àû ID¸¦ ºÎ¿©ÇÑ °æ¿ì