/*******************************************************************************
 FILE          : common.js
 DESCRIPTIONS  : ÀÚ¹Ù½ºÅ©¸³Æ® °øÅë ¸ðµâ
 REMARKS       : °øÅëÀûÀ¸·Î ¾²ÀÌ´Â ÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼ö
 DATE          : 2006-08-??

 *******************************************************************************/

/*ºê¶ó¿ìÀú XP¿©ºÎ Ã¼Å© */
var isXp = navigator.userAgent.indexOf('Windows NT 5.1') > 0;
var isVista = navigator.userAgent.indexOf('Windows NT 6.0') > 0;


//=============================================================================
// ¼³  ¸í: ¼ýÀÚ¸¸ ÀÔ·Â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function numberCheck(){
	 if((event.keyCode < 48)||(event.keyCode > 57))  event.returnValue=false;
}



/**
 * Å°º¸µå ´­¸² (¼ýÀÚ) Ã¼Å©.('.'±îÁö ±¦ÂúÀ½)
 * ¿£ÅÍÅ° Á¦¿Ü
 * param : sVal ÀÔ·Â½ºÆ®¸µ
 * return : Boolean  TrueÀÌ¸é ¼ýÀÚ°ª
 */
function getOnlyNumberIncludeDot() {
	if((event.keyCode < 48)||(event.keyCode > 57))  {
		if(event.keyCode==13 || event.keyCode == 110 || event.keyCode == 190 || event.keyCode == 46 ) {
		}else {
			event.returnValue=false;
		}
	}
}

/**
 * Å°º¸µå ´­¸² (¼ýÀÚ) Ã¼Å©.('.'±îÁö ±¦ÂúÀ½)
 * ¿£ÅÍÅ° Á¦¿Ü
 * param : sVal ÀÔ·Â½ºÆ®¸µ
 * return : Boolean  TrueÀÌ¸é ¼ýÀÚ°ª
 */
var prev = ""; 
var regexpFix = /^\d*(\.\d{0,1})?$/; 

function getOnlyNumberIncludeDotFixed(obj, fixValue) {

	if((event.keyCode < 48)||(event.keyCode > 57))  {
		if(event.keyCode==13 || event.keyCode == 110 || event.keyCode == 190 || event.keyCode == 46 ) {
		}else {
			event.returnValue=false;
		}
	}
	var replaceVal = obj.value.replace(/,/gi,"");

	if(replaceVal.search(regexpFix)==-1) { 
			obj.value = prev; 
	} 
	else { 
			prev = obj.value; 
	} 
}


//=============================================================================
// ¼³  ¸í: ¼±ÅÃµÈ ¹Ú½º »ö»ó º¯°æ/º¹±¸
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function FocusColor(This) { 
	This.style.backgroundColor = "#F3F9F4"; 
}

function BlurColor(This) { 
	This.style.backgroundColor = "#FFFFFF";
}

//=============================================================================
// ¼³  ¸í: ÁöÁ¤µÈ À§Ä¡¿¡ »õÃ¢ ¿­±â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function fn_clickWin(newPage,winNm,width,height){
	var iLeft;
	var iTop;
	iLeft = (window.screen.width/2) - ((width/2) + 10); 
	iTop = (window.screen.height/2) - ((height) + 50); 
	var winPopup;
	winPopup = window.open(newPage,winNm,'width='+width+',height='+height+',scrollbars=yes,resizable=no,menubar=no,status=no,toolbar=no,left='+iLeft+',top='+iTop+',screenX='+iLeft+',screenY='+iTop);
	winPopup.focus();
} 

function fn_clickWinNS(newPage,winNm,width,height){ //½ºÅ©·Ñ¹Ù ¾øÀ½
	var iLeft;
	var iTop;
	iLeft = (window.screen.width/2) - ((width/2) + 10); 
	iTop = (window.screen.height/2) - ((height) + 50); 
	var winPopup;
	winPopup = window.open(newPage,winNm,'width='+width+',height='+height+',scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no,left='+iLeft+',top='+iTop+',screenX='+iLeft+',screenY='+iTop);
	winPopup.focus();
} 

function fn_clickWinNSTop(newPage,winNm,width,height){ //½ºÅ©·Ñ¹Ù ¾øÀ½
	var iLeft;
	var iTop;
	iLeft = (window.screen.width/2) - ((width/2) + 10); 
	iTop = (window.screen.height/2) - ((height) + 50); 
	var winPopup;
	winPopup = window.open(newPage,winNm,'width='+width+',height='+height+',scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no,left='+iLeft+',top=0,screenX='+iLeft+',screenY='+iTop);
	winPopup.focus();
} 

function fn_clickWinWithAll(newPage,winNm,width,height){
	var iLeft;
	var iTop;
	iLeft = (window.screen.width/2) - ((width/2) + 10); 
	iTop = (window.screen.height/2) - ((height) + 50); 
	var winPopup;
	winPopup = window.open(newPage,winNm,'width='+width+',height='+height+',scrollbars=yes,resizable=yes,menubar=yes,status=yes,toolbar=yes,left='+iLeft+',top='+iTop+',screenX='+iLeft+',screenY='+iTop);
	winPopup.focus();
} 

//=============================================================================
// ¼³  ¸í: ÀÚµ¿À¸·Î ¼±ÅÃµÈ À§Ä¡¿¡ Æ÷Ä¿½º
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function moveTab(from, leng,  dest) {	
	var obj = from.value;
	var len = leng;
	var destination = dest;
	var l = from.value.length;

	if(eval(l) == len){
		destination.focus();
	}
}

//=============================================================================
// ¼³  ¸í: ¼±ÅÃ ÅäÅ¬
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function selectToggle(what){
	if(document.all[what] == null) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}
	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++) document.all[what][i].checked=!document.all[what][i].checked;
	}else document.all[what].checked=!document.all[what].checked;
}

// Åä±ÛÀÌ Ã¼Å©¹Ú½ºÀÓ
function selectToggleCheckbox(what, cbox){
	if(document.all[what] == null) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		document.all[cbox].checked = false;
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++) {
			document.all[what][i].checked=document.all[cbox].checked;
		}
	}else document.all[what].checked=document.all[cbox].checked;
}

//=============================================================================
// ¼³  ¸í: ÆÄÀÏ Ã·ºÎ½Ã ÀÌ¹ÌÁö¸¸ °¡´É
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function display_image(what){
	var file = what.value;
	var allowSubmit = false;
	var extArray = new Array(".gif", ".jpg", ".png");

	extArray.join(" ");

	if (!file) return;

	while (file.indexOf("\\") != -1)
			file = file.slice(file.indexOf("\\") + 1);

	var ext = file.slice(file.indexOf(".")).toLowerCase();

	for (var i = 0; i < extArray.length; i++) {
			if (extArray[i] == ext) {
					allowSubmit = true;
					break;
			}
	}

	if (allowSubmit) {
	}
	else {
			alert("±×¸² »ðÀÔÀº GIF, JPG, PNG ÆÄÀÏ¸¸ °¡´ÉÇÕ´Ï´Ù. ´Ù½Ã ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
			what.select();
			document.selection.clear();
			return;
	}
}

function extTypeCheck(what, extExcept, delfile) {
	var fileobj = what.value;

	if (!fileobj) return;

	while(fileobj.indexOf("\\") != -1) {
		ext			= fileobj.slice(fileobj.lastIndexOf (".")+1).toLowerCase();
		fileobj = fileobj.substring(fileobj.indexOf("\\")+1);
		lowerFileName = fileobj.toLowerCase();

	}        

	if( (fileobj.indexOf("\'") != -1) || (fileobj.indexOf("/") != -1) ||  (fileobj.indexOf("\"") != -1) || (fileobj.indexOf(":") != -1) || (fileobj.indexOf("\\") != -1) || (fileobj.indexOf("#") != -1) || (fileobj.indexOf("*") != -1) || (fileobj.indexOf("?") != -1) || (fileobj.indexOf("\,") != -1) || (fileobj.indexOf("&") != -1) || (fileobj.indexOf("<") != -1) || (fileobj.indexOf(">") != -1) ) {
		alert('ÆÄÀÏ ÀÌ¸§¿¡ Æ¯¼ö¹®ÀÚ(\\,\',\",/,?,*,&,<,>,#,:)µéÀÌ µé¾î ÀÖÀ¸¸é ¾ÈµË´Ï´Ù') 
		what.select();
		document.selection.clear();
		return;
	}
	/* SQLInjection Àû¿ë  */
	if( (lowerFileName.indexOf("script") != -1) || (lowerFileName.indexOf("exec") != -1) ||  (lowerFileName.indexOf("insert") != -1) || (lowerFileName.indexOf("update") != -1) || (lowerFileName.indexOf("delete") != -1) || (lowerFileName.indexOf("union") != -1) || (lowerFileName.indexOf("drop") != -1) || (lowerFileName.indexOf("create") != -1) || (lowerFileName.indexOf("sp_") != -1) || (lowerFileName.indexOf("xp_") != -1) ) {
		alert('ÆÄÀÏ ÀÌ¸§¿¡ ´ÙÀ½¹®ÀÚ(script,exec,insert,update,delete,union,drop,create,sp_,xp_)µéÀÌ µé¾î ÀÖÀ¸¸é ¾ÈµË´Ï´Ù') 
		what.select();
		document.selection.clear();
		return;
	}

	if(ext != "") {
		if(extExcept == '') {
		}else {
			if(extExcept.indexOf(ext) != -1) {
				alert(ext+" È®ÀåÀÚ´Â »ç¿ëÇÏ½Ç¼ö ¾ø½À´Ï´Ù.");
				what.select();
				document.selection.clear();
				return;
			}
		}
	}


	if(document.getElementById(delfile)) {
		document.getElementById(delfile).checked = true;
	}
}

//=============================================================================
// ¼³  ¸í: Æ¯Á¤°Ç¿¡ ´ëÇÑ ÀÏ°ý Àû¿ë
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function actionTarget(form, what){
	var sData = "";
	var flag=0;
	var j = 0;
	var dData = "";
	
	if(document.all[what] == undefined) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++){
			if(document.all[what][i].checked){
				dData += document.all[what][i].value+"^";
				j++;
				flag=1;
			}
		}
	}else{
		if(document.all[what].checked) {
			flag=1;
			dData += document.all[what].value+"^";
		}
	}

	if(!flag){
		alert("´ë»óÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return;
	}

	if(confirm("½ÇÇàÇÏ½Ã°Ú½À´Ï±î?")){
		form.targetData.value=dData;
		form.submit();
	}else{
		return;
	}
	return;
}

//=============================================================================
// ¼³  ¸í: Æ¯Á¤°Ç¿¡ ´ëÇÑ ÀÏ°ý »èÁ¦
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function listdelete(form, what){
	var sData = "";
	var flag=0;
	var j = 0;
	var dData = "";
	
	if(document.all[what] == undefined) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++){
			if(document.all[what][i].checked){
				dData += document.all[what][i].value+"^";
				j++;
				flag=1;
			}
		}
	}else{
		if(document.all[what].checked) {
			flag=1;
			dData += document.all[what].value+"^";
		}
	}

	if(!flag){
		alert("´ë»óÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return;
	}
	if(confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
		form.targetData.value=dData;
		form.submit();
	}else{
		return;
	}
	return;
}


//=============================================================================
// ¼³  ¸í: Æ¯Á¤°Ç¿¡ ´ëÇÑ ÀÏ°ý »èÁ¦
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function actionTargetDel(form, what){
	var sData = "";
	var flag=0;
	var j = 0;
	var dData = "";
	
	if(document.all[what] == undefined) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++){
			if(document.all[what][i].checked){
				dData += document.all[what][i].value+"^";
				j++;
				flag=1;
			}
		}
	}else{
		if(document.all[what].checked) {
			flag=1;
			dData += document.all[what].value+"^";
		}
	}

	if(!flag){
		alert("´ë»óÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return;
	}

	if(confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
		form.targetData.value=dData;
		form.submit();
	}else{
		return;
	}
	return;
}

//=============================================================================
// ¼³  ¸í: ÀÌ¹ÌÁö³ª ÆÄÀÏÀ» ÀÔ·ÂÇÏ±â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function add_file(obj, gubun, place) {
	winobj = window.open('/common/upload_form.jsp?obj='+obj+'&gubun='+gubun, 'event', 'width=400, height=150, top=200, left=200');
	winobj.focus();
}


function empImgUpload(){
	window.open('../common/img_upload_regist_form.jsp?prefile1='+strTrim(document.form1.file1.value), "empImgUpload", "width=420,height=120,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}


function empFileUpload(seq, dir){
	if(seq == 1) {
		window.open("../common/file_upload_regist_form.jsp?prefile1="+strTrim(document.getElementById("file"+seq).value)+"&seq="+seq+"&uploadDir="+dir, "empFileUpload", "width=420,height=120,menubar=0,location=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	}else if(seq == 2) {
		window.open("../common/file_upload_regist_form.jsp?prefile2="+strTrim(document.getElementById("file"+seq).value)+"&seq="+seq+"&uploadDir="+dir, "empFileUpload", "width=420,height=120,menubar=0,location=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	}
}

function empFileUpload2(seq, dir){
	window.open("../common/file_upload_regist_form.jsp?prefile2="+strTrim(document.getElementById("file"+seq).value)+"&seq="+seq+"&uploadDir="+dir, "empFileUpload", "width=420,height=120,menubar=0,location=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}


ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

//=============================================================================
// ¼³  ¸í: ±ÛÀÚ¼ö Ç¥½Ã ¹× textarea ÃÖ´ë nÀÚ Ã¼Å©
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function checkLength(form, str,limit) {
	var obj = form;
	tlength = str.length+(escape(str)+"%u").match(/%u/g).length-1;
	
	var li_byte = 0;
	var i = 0;

	for (i=0; i<str.length; i++) {
		li_byte += (str.charCodeAt(i) > 128) ? 2 : 1;
		if(li_byte > limit) break;
	}

	if(li_byte > limit) {
		alert("ÃÖ´ë " + limit +" ÀÚ ±îÁö¸¸ °¡´ÉÇÕ´Ï´Ù. ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿ »èÁ¦ µË´Ï´Ù.");
		TempVal = obj.content.value.substring(0,i);
		obj.content.value = ""
		obj.content.value = TempVal;
		var tvalue = limit;
		layerWrite('textlen',null,tvalue);
		return false;
	} else { 
		var tvalue = li_byte;
		layerWrite('textlen',null,tvalue);
	}
	var tvalue = li_byte;
	layerWrite('textlen',null,tvalue);
	if(obj.content.value == "") layerWrite('textlen',null,0);
}

function layerWrite(id,nestref,text) {
	if (ns4) {
		var lyr = (nestref)? eval('document.'+nestref+'.document.'+id+'.document') : document.layers[id].document
		lyr.open()
		lyr.write(text)
		lyr.close()
	}
	else if (ie4) document.all[id].innerHTML = text
}

function submit_com(str,limit) {
	var obj = document.frmcomment;

	if(obj.comments.value == "") {
		alert('³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä');
		obj.comments.focus();
		return;
	}
	
	tlength = str.length+(escape(str)+"%u").match(/%u/g).length-1;
	var li_byte = 0;
	var i = 0;

	for (i=0; i<str.length; i++) {
		li_byte += (str.charCodeAt(i) > 128) ? 2 : 1;
		if(li_byte > limit) break;
	}

	if(li_byte > limit) {
		alert("ÃÖ´ë " + limit +" ÀÚ ±îÁö¸¸ °¡´ÉÇÕ´Ï´Ù");
		TempVal = obj.comments.value.substring(0,i);
		obj.comments.value = ""
		obj.comments.value = TempVal;
		return;
	}
	obj.submit();
}


//=============================================================================
// ¼³  ¸í: ÀÌ¹ÌÁö ·Ñ¿À¹ö / ·Ñ¾Æ¿ô
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function fnRollOver(oImg) {
	newSrc	= (oImg.src).replace(/_2.gif/g,"") + '.gif';
	oImg.src = newSrc;
}

function fnRollOut(oImg) {
	newSrc	= (oImg.src).replace(/.gif/g,"") + '_2.gif';
	oImg.src = newSrc;
}

function fnRollOver2(oImg) {
	newSrc	= (oImg.src).replace(/.gif/g,"") + '_2.gif';
	oImg.src = newSrc;
}

function fnRollOut2(oImg) {
	newSrc	= (oImg.src).replace(/_2.gif/g,"") + '.gif';
	oImg.src = newSrc;
}

function changePhotoImg(oImg, oCont) {
	if(oImg=="../images/common/blank.gif") {
	}else {
		newSrc = oImg;
		document.getElementById("bigImg").src=newSrc;
		document.getElementById("bigContent").innerHTML=oCont;
	}
	
}

//=============================================================================
// ¼³  ¸í: ´Þ·Â ¶Ù¿ì±â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function openCalendar(frm, obj, fdate) {
	var arrCal = fdate.split("-");
	curYear = arrCal[0];
	curMonth= arrCal[1];
	winobj = window.open('/common/small_calendar.jsp?frm='+frm+'&obj='+obj+'&curYear='+curYear+'&curMonth='+curMonth, 'openCalendar', 'scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no,width=246, height=240, top=200, left=200');
	winobj.focus();
}



//=============================================================================
// ¼³  ¸í: ÁöÁ¤µÈ À§Ä¡¿¡ ÆË¾÷ ¿­±â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function openPopup(id, top,left,width,height){
	var iLeft;
	var iTop;
	iLeft = left; 
	iTop = top; 
	var winPopup;
	winPopup = window.open('/common/popup.jsp?id='+id,id,'width='+width+',height='+height+',scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no,left='+iLeft+',top='+iTop+',screenX='+iLeft+',screenY='+iTop);
	winPopup.focus();
} 



//=============================================================================
// ¼³  ¸í: ÀÌ¸ÞÀÏ Ã¼Å©
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function email_chk(email) {
  var invalidChars = "\"|&;<>!*\'\\"   ;
  for (var i = 0; i < invalidChars.length; i++) {
    if (email.indexOf(invalidChars.charAt ) != -1) {
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù.");
      return false;
    }
  }
  if (email.indexOf("@")==-1){
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù. '@'°¡ ¾ø½À´Ï´Ù..");
    return false;
  }
  if (email.indexOf(" ") != -1){
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù.");
    return false;
  }
  if (window.RegExp) {
    var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
    var reg1 = new RegExp (reg1str);
    var reg2 = new RegExp (reg2str);
 
    if (reg1.test(email) || !reg2.test(email)) {
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù.");
      return false;
    }
  }
  return true;
}


//=============================================================================
// ¼³  ¸í: ÁÖ¹Î¹øÈ£ Ã¼Å©
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
 function juminCheck(form){ 
  var strs = form.juminno1.value + form.juminno2.value;
  if((form.juminno1.value.length >= 6) && (form.juminno2.value.length >= 7)) { 
    juminno1 = form.juminno1.value; 
    juminno2 = form.juminno2.value; 
    check = false; 
    total = 0; 
    temp = new Array(13); 
 
    for(i=1; i<=6; i++) 
     temp[i] = juminno1.charAt(i-1); 
 
    for(i=7; i<=13; i++) 
     temp[i] = juminno2.charAt(i-7); 
 
    for(i=1; i<=12; i++)  { 
     k = i + 1; 
     if(k >= 10) 
     k = k % 10 + 2; 
 
     total = total + temp[i] * k; 
    } 
 
    mm = temp[3] + temp[4]; 
    dd = temp[5] + temp[6]; 
    totalmod = total % 11; 
    chd = 11 - totalmod; 
 
    if(chd ==11) { 
     chd =1; 
    }else if(chd==10) { 
     chd =0; 
    }; 

    if(chd == temp[13] && mm < 13 && dd < 32 && (temp[7]==1 || temp[7]==2|| temp[7]==3|| temp[7]==4)) check = true; 
 
    if((!check) &&(temp[7]!=5)&&(temp[7]!=6)){ 
     //alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù."); 
     //form.juminno1.value=""; 
     //form.juminno2.value=""; 
     //form.juminno1.select(); 
 
     return false; 
    } 
   } else { 
    //alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇÏÁö ¾Ê¾Ò½À´Ï´Ù."); 
    //form.juminno1.value = ""; 
    //form.juminno2.value = ""; 
    //form.juminno1.select(); 
    return false; 
   } 
  return true; 
 } 

//=============================================================================
// ¼³  ¸í: resizeTo¿¡¼­ Æø°ú ³ôÀÌ ¼ýÀÚ´Â ¿ÜºÎÃ¢ÀÇ Å©±â,  status ÀÖÀ» °æ¿ì
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function resizeToXP(reWidth, reHeight) {
 reWidth += 10;
 if (isXp) {
  reHeight += 58;
 } else {
  reHeight += 49;
 }
 self.resizeTo(reWidth, reHeight);
}

//=============================================================================
// ¼³  ¸í: resizeTo¿¡¼­ Æø°ú ³ôÀÌ ¼ýÀÚ´Â ¿ÜºÎÃ¢ÀÇ Å©±â,  status ¾øÀ» °æ¿ì
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function resizeToXPnostatus(reWidth, reHeight) {
 reWidth += 10;
 if (isXp) {
  reHeight += 58;
 } else {
  reHeight += 29;
 }
 self.resizeTo(reWidth, reHeight);
}


//=============================================================================
// ¼³  ¸í: ¸Þ´º º¯È­
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function menuSet(id) {
	document.all(id).style.display = '' ;
}


function menuClear() {
	document.all("layer_01").style.display = 'none' ;
	document.all("layer_02").style.display = 'none' ;
	document.all("layer_03").style.display = 'none' ;
	document.all("layer_04").style.display = 'none' ;
	document.all("layer_05").style.display = 'none' ;
	document.all("layer_06").style.display = 'none' ;
	document.all("layer_07").style.display = 'none' ;
}



//=============================================================================
// ¼³  ¸í: »óÇ° Ä«Å×°í¸® º¯È­
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function overM(obj,num) {
	var mtype = eval('mtype_' + num);
	mtype.style.display = 'block';
}

function outM(obj,num) {
	var mtype = eval('mtype_' + num);
	mtype.style.display = 'none';
}

function overMS(obj) {
	obj.style.background = '#f5f5f5';
}
function outMS(obj) {
	obj.style.background = 'FFFFFF';
}


//=============================================================================
// ¼³  ¸í: ÅÇ º¯È­
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function sectTab(n, total, imgName) {
	for(var i = 1; i < total; i++) {
		obj = document.getElementById('sectTab'+i);
		img = document.getElementById('sectTab_roll'+i);
		if ( n == i ) {
			obj.style.display = "block";
			img.src = imgName+"_"+i+"_2.gif";
		} else {
			obj.style.display = "none";
			img.src = imgName+"_"+i+".gif";
		}
	}
}

function sectTabA(n, total, imgName) {
	for(var i = 1; i < total; i++) {
		obj = document.getElementById('sectTabA'+i);
		img = document.getElementById('sectTabA_roll'+i);
		if ( n == i ) {
			obj.style.display = "block";
			img.src = imgName+"_"+i+"_2.gif";
		} else {
			obj.style.display = "none";
			img.src = imgName+"_"+i+".gif";
		}
	}
}

function sectTabB(n, total, imgName) {
	for(var i = 1; i < total; i++) {
		obj = document.getElementById('sectTabB'+i);
		img = document.getElementById('sectTabB_roll'+i);
		if ( n == i ) {
			obj.style.display = "block";
			img.src = imgName+"_"+i+"_2.gif";
		} else {
			obj.style.display = "none";
			img.src = imgName+"_"+i+".gif";
		}
	}
}

function sectTabC(n, total, imgName) {
	for(var i = 1; i < total; i++) {
		obj = document.getElementById('sectTabC'+i);
		img = document.getElementById('sectTabC_roll'+i);
		if ( n == i ) {
			obj.style.display = "block";
			img.src = imgName+"_"+i+"_2.gif";
		} else {
			obj.style.display = "none";
			img.src = imgName+"_"+i+".gif";
		}
	}
}

//=============================================================================
// ¼³  ¸í: È¸»ç¼Ò°³,À§Ä¡, ÁÖ¼Ò·Ï ÆË¾÷
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function openComIntro() {
	winobj = window.open('/company/company_popup.htm', 'com', 'width=690, height=500, top=10, left=10,scrollbars=auto,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}

function openComMap() {
	winobj = window.open('/company/map_popup.htm', 'com', 'width=710, height=600, top=10, left=10,scrollbars=yes,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}

function openMonthlySchedule(id) {
	winobj = window.open('/admin/schedule_detail.jsp?ScheduleID='+id, 'schedule', 'width=335, height=360, top=10, left=10,scrollbars=auto,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}


function openMonthlyScheduleRegist() {
	winobj = window.open('/admin/schedule_regist_form.jsp', 'scheduler', 'width=335, height=360, top=10, left=10,scrollbars=auto,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}

function openReadNotMessage() {
	winobj = window.open('/message/message_popup.jsp', 'notreadmessage', 'width=430, height=380, top=10, left=10,scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}

//=============================================================================
// ¼³  ¸í: ¼ýÀÚ ÀÔ·Â½Ã ÀÚµ¿ , »ðÀÔ
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function substrThree2(num){ 
	var sign=""; 
	if(isNaN(num)) {
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return 0;
	} 
	if(num==0) {
		return num;
	}

	if(num<0){ 
		num=num*(-1);
		sign="-";
	}else{ 
		num=num*1;
	} 
	num = new String(num) 
	var temp="";
	var pos=3;
	num_len=num.length;
	while (num_len>0){ 
		num_len=num_len-pos;
		if(num_len<0) {
			pos=num_len+pos;
			num_len=0;
		} 
		temp=","+num.substr(num_len,pos)+temp;
	} 
	return sign+temp.substr(1); 
} 

function substrThree(num){
	num = num.replace(/^\s+|\s+$/g, '');
	if(num == "") num = 0;
	num=new String(num); 
	num=num.replace(/,/gi,"");
	return substrThree2(num);
} 




//=============================================================================
// ¼³  ¸í: ID Ã¼Å©
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function idCheck() {
	var id=document.form1.id.value;
	var res= '0123456789abcdefghijklmnopqrstuvwxyz_';
	for(i = 0; i<id.length; i++){  
		if(res.indexOf(id.substring(i,i+1)) < 0){
			alert("»ç¿ëÀÚ ¾ÆÀÌµð´Â  a~z, 0~9,'_' ¹®ÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.");
			document.form1.id.focus();
			return;
		}
	}
	window.open("/user/user_id_check_form.jsp?id="+id, "id_check", "width=400,height=180,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function masterIDCheck() {
	var masterid=document.form1.masterid.value;
	var res= '0123456789abcdefghijklmnopqrstuvwxyz_';
	for(i = 0; i<masterid.length; i++){  
		if(res.indexOf(masterid.substring(i,i+1)) < 0){
			alert("»ç¿ëÀÚ ¾ÆÀÌµð´Â  a~z, 0~9,'_' ¹®ÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.");
			document.form1.masterid.focus();
			return;
		}
	}
	window.open("/superadmin/company_id_check_form.jsp?masterid="+masterid, "id_check", "width=400,height=180,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function pwCheck() {
	window.open("/user/user_password_login_form.jsp", "pwCheck", "width=400,height=230,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}


function openLock(siteid, userid) {
	if(confirm("È­¸é Àá±Ý±â´ÉÀ» ¼³Á¤ÇÏ½Ã°Ú½À´Ï±î?")) {
		window.open("/user/user_lock_login_form.jsp?siteid="+siteid+"&userid="+userid, "openLock", "width=400,height=230,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	}else {
	}
}

//=============================================================================
// ¼³  ¸í: ID Ã£±â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function showIdFind(siteid) {
	window.open("/user/user_id_find_form.jsp?siteid="+siteid, "id_check", "width=400,height=230,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

//=============================================================================
// ¼³  ¸í: ºñ¹Ð¹øÈ£ Ã£±â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function showPasswordFind(siteid) {
	window.open("/user/user_password_find_form.jsp?siteid="+siteid, "id_check", "width=400,height=230,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

//=============================================================================
// ¼³  ¸í: È¸¿ø°¡ÀÔ
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function showApplyForm(siteid) {
	window.open("/user/user_regist_form.jsp?siteid="+siteid, "apply", "width=735,height=170,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function showProfileForm(userid) {
	window.open("/basic/user_profile_list.jsp?userid="+userid, "profile", "width=735,height=405,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

//=============================================================================
// ¼³  ¸í: ÁÖ¼Ò·Ï, Á¶Á÷µµ
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function openEmployeeList() {
	window.open("/user/address_list.jsp", "employee", "width=850,height=600,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openOrganization() {
	window.open("/user/organization_list.jsp", "organization", "width=500,height=390,menubar=0,resizable=1,scrollbars=0,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openDepartment(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1016", "department", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openDepartmentKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1016&keyword=Y", "department", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openProductCategory(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1010", "product_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openProductCategoryKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1010&keyword=Y", "product_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openServiceCategory(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1008", "service_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openServiceCategoryKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1008&keyword=Y", "service_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openProjectCategory(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1030&deptCol=CategoryCodeID", "project_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openProjectCategoryKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1030&deptCol=CategoryCodeID&keyword=Y", "project_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openIssueCategory(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1033&deptCol=CategoryCodeID", "issue_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openIssueCategoryKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1033&deptCol=CategoryCodeID&keyword=Y", "issue_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openRiskCategory(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1034&deptCol=CategoryCodeID", "risk_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openRiskCategoryKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1034&deptCol=CategoryCodeID&keyword=Y", "risk_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openPointCategory(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1027&deptCol=CategoryCodeID", "point_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openPointCategoryKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1027&deptCol=CategoryCodeID&keyword=Y", "point_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openPMSProposeCategory(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1044&deptCol=CategoryCodeID", "propose_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openPMSProposeCategoryKeyword(siteid) {
	window.open("/common/category_select_list.jsp?siteid="+siteid+"&menuid=1044&deptCol=CategoryCodeID&keyword=Y", "propose_category", "width=220,height=320,menubar=0,resizable=0,scrollbars=no,status=yes,titlebar=0,toolbar=0,top=30,left=200");
}

function openProduct(siteid) {
	window.open("/common/product_select_list.jsp?siteid="+siteid, "product_category", "width=510,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMultiProduct(siteid) {
	window.open("/common/product_select_multi_list.jsp?siteid="+siteid, "product_category", "width=510,height=420,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openProductTransfer(siteid) {
	window.open("/product/product_stock_transfer_list.jsp?siteid="+siteid, "product_stock_transfer_list", "width=500,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openProductStockTransferHistory(id) {
	window.open("/product/product_stock_transfer_history_list.jsp?id="+id, "product_stock_transfer_history_list", "width=330,height=280,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMultiProductForMaeip(siteid) {
	window.open("/common/product_select_multi_list.jsp?siteid="+siteid+'&fromMenu=maeip', "openMultiProductForMaeip", "width=510,height=420,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMultiProductWithStatus(siteid, status) {
	window.open("/common/product_select_multi_list.jsp?siteid="+siteid+'&status='+status, "openMultiProductWithStatus", "width=510,height=420,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openUserList(target) {
	window.open("/common/employee_select_list.jsp?target="+target, "openUserList", "menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,width=525,height=395");
}

function openMultiUserList(frm, obj, obj2) {
	window.open("/common/employee_multi_select_list.jsp?frm="+frm+'&obj='+obj+'&obj2='+obj2, "openUserList", "menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,width=525,height=395");
}

function openAccountList() {
	window.open("/common/account_select_list.jsp", "account", "width=275,height=395,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openThemeAccountList() {
	window.open("/common/account_select_list.jsp?from=keyword", "account", "width=275,height=395,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openThemeUserList() {
	window.open("/common/user_select_list.jsp?from=keyword", "user", "width=415,height=400,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openService(siteid) {
	window.open("/common/service_select_list.jsp?siteid="+siteid, "service_category", "width=310,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openContactList(accountName, accountID) {
	if(accountID== "all") {
	}else {
		if(accountID == "") {
			accountID = "all";
			/* ¾Æ·¡»çÇ×Àº °Å·¡Ã³¸¦ ¸ÕÀú ¼±ÅÃÇØ¾ßÁö¸¸ ÇØ´ç °Å·¡Ã³ÀÇ °í°´À» °¡Á®¿À´Â °æ¿ì */
			//alert(accountName+"¸¦ ¸ÕÀú ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
			//return;
		}
	}
	window.open("/common/contact_popup_select_list.jsp?accountID="+accountID, "openContactList", "width=445,height=395,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openRecommendList(accountName, accountID, from) {
	if(accountID== "all") {
	}else {
		if(accountID == "") {
			alert(accountName+"¸¦ ¸ÕÀú ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
			return;
		}
	}
	window.open("/common/contact_popup_select_list.jsp?accountID="+accountID+"&from="+from, "openContactList", "width=445,height=395,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function contactAlertSelectForm(frm, obj, obj2) {
	window.open('/common/contact_alert_select_list.jsp?frm='+frm+'&obj='+obj+'&obj2='+obj2, "code", "width=445,height=395,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function peopleSelectForm(frm, obj, obj2) {
	window.open('/common/user_multi_select_list.jsp?frm='+frm+'&obj='+obj+'&obj2='+obj2, "code", "width=485,height=395,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function peopleSelectOneForm(frm, obj, obj2) {
	window.open('/common/user_select_list.jsp?frm='+frm+'&obj='+obj+'&obj2='+obj2, "code", "width=415,height=400,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function selectAddress(gubun, frm, obj, obj2, type) {
	window.open('/common/sms_multi_select_list.jsp?frm='+frm+'&obj='+obj+'&obj2='+obj2+'&gubun='+gubun+'&type='+type, "code", "width=425,height=400,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}


function openHelpPage(id, code, name) {
	window.open('/help/help_detail.jsp?HelpFolderID='+id+'&Code='+code+'&Name='+name, "openHelpPage", "width=820,height=650,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}


function openHelpRegistPage() {
	window.open('/admin/help_regist_form.jsp', "openHelpRegistPage", "width=935,height=650,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMultiPMSResource(siteid) {
	window.open("/common/pmsresource_select_list.jsp?siteid="+siteid, "pmsresource", "width=525,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMultiPMSIssue(siteid) {
	window.open("/common/pmsissue_select_list.jsp?siteid="+siteid, "pmsissue", "width=385,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMultiPMSRisk(siteid) {
	window.open("/common/pmsrisk_select_list.jsp?siteid="+siteid, "pmsrisk", "width=375,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openPMSProject() {
	window.open("/common/pmsproject_select_list.jsp", "pmsproject", "width=385,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMultiPMSProject() {
	window.open("/common/pmsproject_select_multi_list.jsp", "pmsproject", "width=385,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openPMSWbs(name) {
	var pmsprojectid = document.form1.PmsProjectID.value;
	if(pmsprojectid == "" || pmsprojectid == null) {
		//alert(name+" ¸¦ ¸ÕÀú ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		//return;
	}
	window.open("/common/pmswbs_select_list.jsp?pmsprojectid="+pmsprojectid, "pmswbs", "width=375,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openPMSTask() {
	window.open("/common/pmstask_select_list.jsp", "pmswbs", "width=375,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openPMSWbsWithCheck(name) {
	var pmsprojectid = document.form1.PmsProjectID.value;
	var pmswbsid = document.form1.PmsWbsID.value;
	if(pmsprojectid == "" || pmsprojectid == null) {
		//alert(name+" ¸¦ ¸ÕÀú ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		//return;
	}
	window.open("/common/pmstask_select_check_list.jsp?pmsprojectid="+pmsprojectid+"&pmswbsid="+pmswbsid, "pmstask", "width=375,height=395,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openServiceManList() {
	window.open("/common/serviceman_select_list.jsp", "openServiceManList", "width=485,height=395,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}


//=============================================================================
// ¼³  ¸í: ÀüÀÚ°áÁ¦ µî·Ï 
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function eapproveRegist(id) {
	window.open('/eapprove/eapprove_regist_form.jsp?idx='+id, "", "width=880,height=700,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}

function eapproveModify(id) {
	window.open('/eapprove/eapprove_modify_form.jsp?idx='+id, "", "width=880,height=700,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}

function eapproveDetail(id) {
	window.open('/eapprove/eapprove_detail.jsp?idx='+id, "", "width=880,height=700,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}

function eapproveDetailPrint(id) {
	window.open('/eapprove/eapprove_detail_print.jsp?idx='+id, "", "width=655,height=500,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}


//=============================================================================
// ¼³  ¸í: ÀÌ¸ÞÀÏ ÀÔ·Â¹æ¹ý
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function useEmail(flag) {
	if(flag == 1) {//Á÷Á¢ ÀÌ¸ÞÀÏ ÀÔ·Â
		document.all.ourEmail.style.display = "none";
		document.all.myEmail.style.display = "";
		document.all.whatEmail.value = 2;
		document.all.directEmail.checked = !document.all.directEmail.checked
	}
	if(flag == 2) {//Á¦°øµÈ ÀÌ¸ÞÀÏ ÀÔ·Â
		document.all.ourEmail.style.display = "";
		document.all.myEmail.style.display = "none";
		document.all.whatEmail.value = 1;
		document.all.noEmail.checked = !document.all.noEmail.checked
	}
}


//=============================================================================
// ¼³  ¸í: ¿ìÆí¹øÈ£ Ã£±â
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function zipcodeFind(gubun) {
	//window.open('/user/user_zipcode_list.jsp?gubun='+gubun, "zipcodeFind", "width=420,height=180,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	window.open('/common/zipcode_list.jsp?gubun='+gubun, "zipcodeFind", "width=420,height=320,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

//=============================================================================
// ¼³  ¸í: ÀÌ¸ÞÀÏ Á÷Á¢ÀÔ·Â 
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function emailRegist(val) {
	if(val == "D") window.open('/user/user_email_regist_form.jsp?email='+document.form1.email1.value, "email", "width=400,height=180,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

//=============================================================================
// ¼³  ¸í: ÄÚµå µî·Ï 
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function codeRegist(groupid) {
	window.open('/admin/code_regist_form.jsp?codegroupid='+groupid, "code", "width=331,height=130,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function codeGroupRegist() {
	window.open('/admin/code_group_regist_form.jsp', "code", "width=331,height=155,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function peopleInfoSelectForm(frm, obj, obj2) {
	window.open('/common/person_info_select_list.jsp?frm='+frm+'&obj='+obj+'&obj2='+obj2, "code", "width=500,height=400,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function employeeInfoSelectForm(frm, obj, obj2) {
	window.open('/common/employee_info_select_list.jsp?frm='+frm+'&obj='+obj+'&obj2='+obj2, "code", "width=525,height=400,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=300");
}

function peopleSelectForm2(frm, obj1,obj2,obj3) {
	window.open('/common/people_select_form2.jsp?frm='+frm+'&obj1='+obj1+'&obj2='+obj2+'&obj3='+obj3, "code", "width=250,height=100,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function showPeople(id) {
	window.open('/message/message_read_time.jsp?id='+id, "code", "width=390,height=280,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function showSlide(gubun, code) {
	window.open('/board/photo_slide_show.jsp?gubun='+gubun+'&code='+code, "slide", "width=700,height=600,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function showAlert() {
	var win = window.open('/common/alert_regist_form.jsp', "showAlert", "width=500,height=305,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	win.focus();
}

function showAlertDIV() {
	popAlertFrame.style.display = "";
	alert(popAlertFrame.style.display);
	alertFrameForm.target="popAlert";
	alertFrameForm.submit();
}

//=============================================================================
// ¼³  ¸í: ÀüÀÚ°áÁ¦ µî·Ï 
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function ereportRegist(id) {
	window.open('/ereport/ereport_regist_form.jsp?id='+id, "", "width=880,height=700,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}

function ereportModify(id) {
	window.open('/ereport/ereport_modify_form.jsp?id='+id, "", "width=880,height=700,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}

function ereportDetail(id) {
	window.open('/ereport/ereport_detail.jsp?id='+id, "", "width=880,height=700,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}

function ereportDetailPrint(id) {
	window.open('/ereport/ereport_detail_print.jsp?id='+id, "", "width=655,height=500,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,top=0,left=100");
}

//=============================================================================
// ¼³  ¸í: ÄÃ·¯¼¼ÆÃ µî·Ï 
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function showColor(obj) {
	window.open('/admin/admin_setting_color.jsp?obj='+obj, "color", "width=610,height=280,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

//=============================================================================
// ¼³  ¸í: SMS, ¸Þ¼¼Áö µî·Ï 
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function messageRegist() {
	window.open('/message/message_popup_regist_form.jsp', "messageRegist", "width=360,height=335,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=100,left=100");
}

function smsRegist() {
	window.open('/message/sms_popup_regist_form.jsp', "smsRegist", "width=360,height=300,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=100,left=100");
}

function showClient() {
	window.open('/job/client_select_list.jsp', "showClient", "width=400,height=300,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=100,left=100");
}


function listTemp(form, what){
	var sData = "";
	var flag=0;
	var j = 0;
	var dData = "";
	
	if(document.all[what] == undefined) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++){
			if(document.all[what][i].checked){
				dData += document.all[what][i].value+"^";
				j++;
				flag=1;
			}
		}
	}else{
		if(document.all[what].checked) {
			flag=1;
			dData += document.all[what].value+"^";
		}
	}

	if(!flag){
		alert("´ë»óÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return;
	}

	if(confirm("ÂÊÁö¸¦ º¸°üÇÏ½Ã°Ú½À´Ï±î?")){
		form.action = "message_temp_regist.jsp";
		form.targetData.value=dData;
		form.submit();
	}else{
		return;
	}
	return;
}

/*
function smsSend(form, what, pcsno) {
	var sData = "";
	var flag=0;
	var j = 0;
	var userid = "";
	var name = "";
	var pcs = "";
	
	if(document.all[what] == undefined) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++){
			if(document.all[what][i].checked){
				userid += document.all["userid"][i].value+",";
				name += document.all["name"][i].value+",";
				pcs += document.all["pcs"][i].value+",";
				j++;
				flag=1;
			}
		}
	}else{
		if(document.all[what].checked) {
			flag=1;
			userid += document.all["userid"][i].value+",";
			name += document.all["name"][i].value+",";
			pcs += document.all["pcs"][i].value+",";
			j++;
		}
	}

	if(!flag){
		alert("´ë»óÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return;
	}else {
		userid = userid.substring(0,userid.length-1);
		name = name.substring(0,name.length-1);
		pcs = pcs.substring(0,pcs.length-1);
		window.open('/message/sms_popup_regist_form.jsp?userid='+userid+'&name='+name+'&pcs='+pcs+'&cnt='+j, "sms", "width=360,height=335,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	}
	return;
}
*/
function smsAddressSend(form, what, pcsno) {
	var sData = "";
	var flag=0;
	var j = 0;
	var dData = "";
	
	if(document.all[what] == undefined) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++){
			if(document.all[what][i].checked){
				dData += document.all[pcsno][i].value+",";
				j++;
				flag=1;
			}
		}
	}else{
		if(document.all[what].checked) {
			flag=1;
			dData += document.all[pcsno].value+",";
		}
	}

	if(!flag){
		alert("´ë»óÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return;
	}else {
		window.open('/message/sms_address_popup_regist_form.jsp?id='+dData, "sms", "width=400,height=270,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	}
	return;
}


function smsOneSend() {
	var sData = "";
	var flag=0;
	var j = 0;
	var userid = "";
	var name = "";
	var pcs = "";
	
	if(document.all["userid"].value == "") {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	userid += document.all["userid"].value;
	name += document.all["name"].value;
	pcs += document.all["pcs"].value;
	j++;

	window.open('/message/sms_popup_regist_form.jsp?userid='+userid+'&name='+name+'&pcs='+pcs+'&cnt='+j, "sms", "width=360,height=335,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	return;
}

function messageSend(form, what,idname) {
	var sData = "";
	var flag=0;
	var j = 0;
	var dData = "";
	
	if(document.all[what] == undefined) {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	if(document.all[what].length > 0){
		for(i=0;i<document.all[what].length;i++){
			if(document.all[what][i].checked){
				//dData += document.all[id][i].value+",";
				var arrIDName = document.all[idname][i].value.split("^");
				dData += arrIDName[0]+",";
				sData += arrIDName[1]+",";
				j++;
				flag=1;
			}
		}
	}else{
		if(document.all[what].checked) {
			flag=1;
			var arrIDName = document.all[idname][i].value.split("^");
			dData += arrIDName[0]+",";
			sData += arrIDName[1]+",";
		}
	}

	if(!flag){
		alert("´ë»óÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return;
	}else {
		window.open('/message/message_popup_regist_form.jsp?id='+dData+'&name='+sData, "message", "width=360,height=270,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	}
	return;
}

function messageOneSend() {
	var sData = "";
	var flag=0;
	var j = 0;
	var dData = "";
	
	if(document.all["idname"].value == "") {
		alert("´ë»óÀÌ ¾ø½À´Ï´Ù.");
		return;
	}

	var arrIDName = document.all["idname"].value.split("^");
	dData = arrIDName[0]+",";
	sData = arrIDName[1]+",";

	window.open('/message/message_popup_regist_form.jsp?id='+dData+'&name='+sData, "message", "width=360,height=270,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
	return;
}


//=============================================================================
// ¼³  ¸í: ÃâÅð±Ù µî·Ï 
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================
function chulgunRegist(gubun) {
	window.open('/user/chulgun_regist_form.jsp?gubun='+gubun, "chulgun", "width=300,height=210,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function chulgunManageRegist() {
	window.open('/user/chulgun_manage_regist_form.jsp', "chulgun", "width=300,height=240,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function chulgunManage(id) {
	window.open('/user/chulgun_manage_modify_form.jsp?id='+id, "chulgun", "width=300,height=210,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function chulgunRegistManager() {
	window.open('/chulgun/chulgun_regist_form.jsp', "chulgun", "width=300,height=240,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function chulgunModfyManager(id) {
	window.open('/supportadmin/chulgun_modify_form.jsp?id='+id, "chulgunm", "width=300,height=240,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,top=30,left=200");
}

function openMonthlyChulgun(sday) {
	winobj = window.open('/chulgun/chulgun_calendar_detail.jsp?sday='+sday, 'schedule', 'width=400, height=300, top=10, left=10,scrollbars=yes,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}

function openMyMonthlyChulgun(sday) {
	winobj = window.open('/user/chulgun_month_detail.jsp?sday='+sday, 'schedule', 'width=400, height=300, top=10, left=10,scrollbars=yes,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}

function openSchedule() {
	winobj = window.open('/admin/schedule_popup_list.jsp', 'schedulelist', 'width=755, height=590, top=10, left=10,scrollbars=yes,resizable=no,menubar=no,status=no,toolbar=no');
	winobj.focus();
}

//=============================================================================
// ¼³  ¸í: ÀÌ¸ÞÀÏ Ã¼Å©
// ÀÛ¾÷ÀÏ: 2006-08-??
// ÀÛ¾÷ÀÚ: ¹Ú¿µ¼ú
//=============================================================================

function emailChk(email) {
  var invalidChars = "\"|&;<>!*\'\\"   ;
  for (var i = 0; i < invalidChars.length; i++) {
    if (email.indexOf(invalidChars.charAt ) != -1) {
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù.");
      return false;
    }
  }
  if (email.indexOf("@")==-1){
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù. '@'°¡ ¾ø½À´Ï´Ù..");
    return false;
  }
  if (email.indexOf(" ") != -1){
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù.");
    return false;
  }
  if (window.RegExp) {
    var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
    var reg1 = new RegExp (reg1str);
    var reg2 = new RegExp (reg2str);
 
    if (reg1.test(email) || !reg2.test(email)) {
    //alert("Àß¸øµÈ ÀÌ¸ÞÀÏ ÁÖ¼ÒÀÔ´Ï´Ù.");
      return false;
    }
  }
  return true;
}


function isCheckResidentID(id0, id1) {
	var id0 = String(id0);
	var id1 = String(id1);
	var id = id0+id1;
	var sum = 0;
	var digit = id.substring(12, 13);
	for (var i = 0; i<12; i++) {
		if (i<8) {
						sum += id.substring(i, i+1)*(i+2);
		} else {
						sum += id.substring(i, i+1)*(i-6);
		}
	}
	var magicDigit = (11-sum%11)%10;
	if (magicDigit == digit) {
		return true;
	} else {
		return false;
	}
}


function removelist() {
	fromAttender = document.form1.fromUser;
	toAttender = document.form1.toUser;

	var attLen_1 = fromAttender.options.length;
	var attLen_2 = toAttender.options.length;

	for (i=0; i<attLen_2; i++) {
		if(toAttender.options[i].selected) {
			fromAttender[attLen_1] = new Option(toAttender[toAttender.selectedIndex].text, toAttender.value );
			toAttender.options[i] = null;
			attLen_2--;
			i--;
			continue;
		}
	}
	attLen_2 = toAttender.options.length;
	if(attLen_2 >= 0) toAttender.options[0].selected = true;
	//return true;
}

function removelist2(val) {
	fromAttender = document.form1.fromUser;
	toAttender = document.form1.toUser;

	var attLen_1 = fromAttender.options.length;
	var attLen_2 = toAttender.options.length;

	for (i=0; i<attLen_2; i++) {
		if(toAttender.options[i].selected) {
			fromAttender[attLen_1] = new Option(toAttender[toAttender.selectedIndex].text, toAttender.value );
			toAttender.options[i] = null;
			attLen_2--;
			i--;
			continue;
		}
	}
	//return true;
}


function addlist() {
	fromAttender = document.form1.fromUser;
	toAttender = document.form1.toUser;

	var attLen_1 = fromAttender.options.length;
	var attLen_2 = toAttender.options.length;

	for (i=0; i<attLen_1; i++) {
		if(fromAttender.options[i].selected) {
			toAttender[attLen_2] = new Option(fromAttender[fromAttender.selectedIndex].text, fromAttender.value );
			fromAttender.options[i] = null;
			attLen_1--;
			i--;
			continue;
		}
	}
	attLen_1 = fromAttender.options.length;
	if(attLen_1 >= 0) fromAttender.options[0].selected = true;
	//return true;
}


function addlist2(val) {
	fromAttender = document.form1.fromUser;
	toAttender = document.form1.toUser;

	var attLen_1 = fromAttender.options.length;
	var attLen_2 = toAttender.options.length;

	for (i=0; i<attLen_1; i++) {
		if(fromAttender.options[val].selected) {
			toAttender[attLen_2] = new Option(fromAttender[fromAttender.selectedIndex].text, fromAttender.value );
			fromAttender.options[val] = null;
			attLen_1--;
			i--;
			continue;
		}
	}
	//return true;
}

function addUserlist(department, userid, username, rank, userpcs) {
	toAttender = document.form1.toUser;
	var attLen_2 = toAttender.options.length;
	for (i=0; i<attLen_2; i++) {
		if(userid+'|'+username+'|'+userpcs == toAttender.options[i].value) {
			alert('ÀÌ¹Ì ¼±ÅÃµÇ¾îÁ® ÀÖ½À´Ï´Ù.');
			return;
		}
	}
	toAttender[attLen_2] = new Option('['+department+'] '+username+' '+rank, userid+'|'+username+'|'+userpcs);
	//return true;
}

function removeUserlist(val) {
	if(confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) {
		toAttender = document.form1.toUser;
		var attLen_2 = toAttender.options.length;

		for (i=0; i<attLen_2; i++) {
			if(toAttender.options[i].selected) {
				toAttender.options[i] = null;
				attLen_2--;
				i--;
				continue;
			}
		}
	}else {
	}
	//return true;
}


//iframe Å©±â µ¿ÀûÀ¸·Î º¯°æ
function resize_it(f_height, position){
  document.all[position].style.height=f_height; //iframe »çÀÌÁî Á¶Àý
}


//°ø¹éÁ¦°Å
function strTrim(str) {
	return str.replace(/(^\s*)|(\s*$)/g, "");
}


//Æ¯¼ö¹®ÀÚ
function checkSpecialChar(expression) {
 var strSpecial = " `~!@#$%^&*()_+|\;\\/:=-<>.'\" "; 
 for(i=0;i<expression.length;i++) {
	for(j=0;j<strSpecial.length;j++) {
		if(expression.charAt(i) == strSpecial.charAt(j)) {
			return false;   // Æ¯¼ö¹®ÀÚ°¡ ÀÖÀ¸¸é.. false
		}
	 }
	}
}

//Æ¯¼ö¹®ÀÚ
function checkSpecialCharForSMS(expression) {
 var strSpecial = "&;<>'\""; 
 for(i=0;i<expression.length;i++) {
	for(j=0;j<strSpecial.length;j++) {
		if(expression.charAt(i) == strSpecial.charAt(j)) {
			return false;   // Æ¯¼ö¹®ÀÚ°¡ ÀÖÀ¸¸é.. false
		}
	 }
	}
	return true;
}

//Æ¯¼ö¹®ÀÚ
function checkSpecialCharForImage(expression) {
	var strSpecial = " ,`~!@?%#$%^&*+|\;\\/:=-<>'\" "; 
	for(i=0;i<expression.length;i++) {
		for(j=0;j<strSpecial.length;j++) {
			if(expression.charAt(i) == strSpecial.charAt(j)) {
				return false;   // Æ¯¼ö¹®ÀÚ°¡ ÀÖÀ¸¸é.. false
			}
		}
	}
	return true;
}


function isUndefined(a) {
	if(typeof a == 'undefined' || a == null) return true;
	else return false;
 } 

function isValidFormat(input,format) {
	if (input.search(format) != -1) {
			return true; //¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
	}
	return false;
}

function isValidPhone(input) {	
	var format = /^(\d+)-(\d+)-(\d+)$/;
	return isValidFormat(input,format);
}

function isValidYYYYMM(input) {	
	var format = /^(\d+)-(\d+)$/;
	return isValidFormat(input,format);
}

function isValidYYYYMMDD(input) {	
	var format = /^(\d+)-(\d+)-(\d+)$/;
	return isValidFormat(input,format);
}

//¹®ÀÚ ¹Ù²Ù±â, »ç¿ë¹ý var str = ¹®ÀÚ¿­.replaceAll("a", "1");  
String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/gi, "");
}

String.prototype.replaceAll = function(str1, str2) {
	var temp_str = "";
	if (this.trim() != "" && str1 != str2) {
		temp_str = this.trim();
		while (temp_str.indexOf(str1) > -1){
				temp_str = temp_str.replace(str1, str2);
		}
	}
	return temp_str;
}


//º¹»ç ±ÝÁö
function ctrlVRestrict() {
	if(event.ctrlKey  && event.keyCode ==86){ 
		alert("ºÙ¿©³Ö±â´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù");
		event.returnValue = false; 
	}    
}

// tool tip º¸ÀÌ±â
function showmenuExtend(e1, e2) {
	if (typeof(e2) != "undefined") {
			e2.style.display = "";
			e2.style.height = e1.offsetHeight;
			e2.style.width = e1.offsetWidth;
			e2.style.left = e1.offsetLeft-740;
			e2.style.top = e1.offsetTop + e1.offsetHeight-5;
	}
}
// tool tip ¼û±â±â
function hiddenmenuExtend(e) {
	if (typeof(e) != "undefined") {
			e.style.display = "none";   
	}
}


function ctrlV(source) {
	window.clipboardData.setData('Text',source);
	alert('¼Ò½º°¡ »ý¼º ¹× º¹»çµÇ¾ú½À´Ï´Ù.\n\nCTRL+v ¸¦ ÀÌ¿ëÇÏ¿© ºÙ¿©³Ö±â¸¦ ÇÏ½Ã¸é µË´Ï´Ù.');
}

function MM_preloadImages() { file://v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function openAccountRegistForm() {
	window.open("../common/account_regist_form.jsp", "openAccountRegistForm", "width=770,height=600,menubar=0,location=0,resizable=0,scrollbars=1,status=1,titlebar=0,toolbar=0,top=30,left=200");
}

function openContactRegistForm(accountName) {
	if(strTrim(document.getElementById("AccountName").value) == "") {
		alert(accountName+"À» ¸ÕÀú ¼±ÅÃÇØ ÁÖ¼¼¿ä");
		return;
	}
	window.open("../common/contact_regist_form.jsp?AccountID="+document.getElementById("AccountID").value, "openContactRegistForm", "width=770,height=650,menubar=0,location=0,resizable=0,scrollbars=1,status=1,titlebar=0,toolbar=0,top=30,left=200");
}

// max°ª ±¸ÇÏ±â
function getMax(a,b) {
	if(a > b) return a;
	else return b
}

// °èÁ¤ÇÁ·ÎÇÊ ´õ º¸ÀÌ±â
function showaccountExtend(e1, e2) {
	if (typeof(e2) != "undefined") {
			e2.style.display = "";
			e2.style.height = e1.offsetHeight;
			e2.style.width = e1.offsetWidth;
			e2.style.left = e1.offsetLeft-50;
			e2.style.top = e1.offsetTop + e1.offsetHeight-1;
	}
}
// °èÁ¤ÇÁ·ÎÇÊ ¼û±â±â
function hiddenaccountExtend(e) {
	if (typeof(e) != "undefined") {
			e.style.display = "none";   
	}
}


/**
 * ÄÞ¸¶Á¦°Å
 * param : val
 * return : ±Ý¾×
 */
function removeComma(val){ 
	val = new String(val); 
	val = val.replace(/,/gi,"");	
	return val;
} 


/**
 * 3ÀÚ¸®¸¶´Ù ÄÞ¸¶
 * param : val
 * return : ±Ý¾×
 */
function signMoneyType(val){ 
	val = new String(val); 
	val = val.replace(/,/gi,"");	
	return signMoneyDetailType(val);
} 

function signMoneyDetailType(val){ 
 	var sign=""; 
	
	if(val == "") val = 0;

 	if(val == 0) {
		return val;
	}

 	val = new String(val)

	var temp="";
	var pos=3;
	val_len=val.length;

	while(val_len>0) {
		val_len=val_len-pos;
		if(val_len < 0) {
			pos=val_len+pos;
			val_len=0;
		} 
    temp=","+val.substr(val_len,pos)+temp;
  } 
  return sign+temp.substr(1); 
} 



function iFrameResize(obj) {
	try {
		if ( window.navigator.appName.indexOf("Explorer") !=-1 ) {
			var doc = obj.contentWindow.document;
			var h = doc.body.scrollHeight;
		}else {
			var doc = obj.contentWindow.document;
			var s = doc.body.appendChild(document.createElement('DIV'));
			s.style.clear = 'both';
			var h = s.offsetTop;
			s.parentNode.removeChild(s);
		}
		obj.style.height = h + 'px';
		setTimeout(function(){ iFrameResize(obj) }, 200); // check 5 times for IE bug
	}catch (e){ 
		//alert(e);
	}
}


function resizeImage(img, maxWidth){

   // ¿øº» ÀÌ¹ÌÁö »çÀÌÁî ÀúÀå
   var width = img.width;

   var maxWidth = maxWidth;

   if(width > maxWidth){
     resizeWidth = maxWidth;
   }else{
      resizeWidth = width;
   }

   // ¸®»çÀÌÁîÇÑ Å©±â·Î ÀÌ¹ÌÁö Å©±â ´Ù½Ã ÁöÁ¤
   img.width = resizeWidth;
}

//¼Ò¼öÁ¡ÀÌ ÀÖ´Â°æ¿ì Æ÷ÇÔ 3ÀÚ¸®¸¶´Ù ÄÞ¸¶ Âï±â
function commify(n) {
  var reg = /(^[+-]?\d+)(\d{3})/;   // Á¤±Ô½Ä
  n += '';                          // ¼ýÀÚ¸¦ ¹®ÀÚ¿­·Î º¯È¯

  while (reg.test(n))
    n = n.replace(reg, '$1' + ',' + '$2');

  return n;
}


function addCommaDot(obj,fLen) { 
	if(event.keyCode == 37 || event.keyCode == 39 ){                                              
		 return;
	}

	var fLen = fLen || 2; 


	var strValue = obj.value.replace(/,|\s+/g,'');
	var strBeforeValue = (strValue.indexOf('.') != -1)? strValue.substring(0,strValue.indexOf('.')) :strValue ;
	var strAfterValue  = (strValue.indexOf('.') != -1)? strValue.substr(strValue.indexOf('.'),fLen+1) : '' ;

 
	if(isNaN(strValue)) {
		alert(strValue.concat(' -> ¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù.'));
		return false;
	}


	var intLast =  strBeforeValue.length-1;


	var arrValue = new Array;
	var strComma = '';

	for(var i=intLast,j=0; i >= 0; i--,j++) {
		if( j !=0 && j%3 == 0) {   
			strComma = ',';
		}else {
			strComma = '';
		}		 
		arrValue[arrValue.length] = strBeforeValue.charAt(i) + strComma  ;
	}																		 

	obj.value=  arrValue.reverse().join('') +  strAfterValue; 

}


function overProfileM(id) {
	var obj = document.getElementById(id);
	obj.style.color = 'F74D00';
	//obj.style.textDecoration = 'underline';
	//obj.style.fontWeight = 'bold';
	obj.style.letterSpacing = -1;
	obj.style.zIndex = 999;
	obj.style.display = 'block';
}

function outProfileM(id) {
	var obj = document.getElementById(id);
	obj.style.color = '595959';
	obj.style.textDecoration = 'none';
	obj.style.fontWeight = 'normal';
	obj.style.letterSpacing = 0;
	obj.style.display = 'none';
}

function overProfileTopMenu(id) {
	var obj = document.getElementById(id);
	obj.style.color = 'F74D00';
	//obj.style.textDecoration = 'underline';
	//obj.style.fontWeight = 'bold';
	obj.style.letterSpacing = -1;
	obj.style.zIndex = 999;
	obj.style.display = 'block';
}

function outProfileTopMenu(id) {
	var obj = document.getElementById(id);
	obj.style.color = '595959';
	obj.style.textDecoration = 'none';
	obj.style.fontWeight = 'normal';
	obj.style.letterSpacing = 0;
	obj.style.display = 'none';
}

