/** ======================================================= 
기본사항 
------------------------------------------------------- 
작성자: 이준철
설 명: 공통사용 Java-Script 

-------------------------------------------------------  */ 
errMsg = "오류가 발생하였습니다. \n개발팀 이준철과장에게 문의하시기바랍니다\n내선 : 5023";

function fnPopup(theURL,winName,features) { var winpop; winpop=window.open(theURL,winName,features);winpop.focus();}
function fnIdValue(obj){ return document.getElementById(obj).value;}
function fnSetCookie( name, value, expiredays ) {var todayDate = new Date();todayDate.setDate( todayDate.getDate() + expiredays );document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";}
function fnGetCookie(name) {  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 "";}
function fnArrayChecked(obj,objname,objplus){	for (i=0; i < obj.length ; i++)	{	$("#"+objname+obj[i]).attr("checked","checked");	}}
function trim(obj){  obj = obj.replace(/^\s*/,'').replace(/\s*$/, '');  return obj; } 
function fnTextLimit(obj,maxbyte){ var msg = obj; var msg_len = 0; var i=0,l=0; var temp,lastl; while(i < msg.value.length) { temp = msg.value.charAt(i); if (escape(temp).length > 4)l+=2; else if (temp!='\r') l++; if(l>maxbyte) {   alert("허용 길이 이상의 글을 쓰셨습니다.\n한글 "+maxbyte/2+"자, 영문 "+maxbyte+"자까지만 쓰실 수 있습니다."); temp = msg.value.substr(0,i); msg.value = temp;l = lastl;  break; }lastl = l; i++; } msg_len.value=l;}
function fnCheckJumin(birth,code){var count =0;   for (var i = 0; i <=5 ; i++) {  count = count + ((i%8+2) * parseInt(birth.substring(i,i+1))); } for (var i = 6; i <=11 ; i++) { count = count + ((i%8+2) * parseInt(code.substring(i-6,i-5)));   }   count = 11 - (count %11);   count = count % 10;  if (count != code.substring(6,7)) { return false;} else {return true;  }}
function fnForeigner_RegNo_Check(regNo) {var sum = 0;var odd = 0; buf = new Array(13); for (i = 0; i < 13; i++) buf[i] = parseInt(regNo.charAt(i)); odd = buf[7]*10 + buf[8]; if (odd%2 != 0) {return false;} if ((buf[11] != 6)&&(buf[11] != 7)&&(buf[11] != 8)&&(buf[11] != 9)) {return false; }  multipliers = [2,3,4,5,6,7,8,9,2,3,4,5]; for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]); sum=11-(sum%11); if (sum>=10) sum-=10;sum += 2;    if (sum>=10) sum-=10; if ( sum != buf[12]) { return false;} else { return true;  }} 
function fnCheckSTR(str){  chk=true;for (i=0; i <= str.length -1 ; i++)	{ ch = str.substring(i,i+1);  if ((ch >= "0" && ch <= "9") || (ch >= "a"  && ch <= "z") || (ch >= "A"  && ch <= "Z")){chk=true;}else{                	chk=false;break;}}return chk;}
function fnOnlyNumber(){   if((event.keyCode<48)||(event.keyCode>57))event.returnValue=false;}

