function defaultStatus(){
	var lec = document.all.menu;
	for (var i=0;i<lec.length;i++){
		document.all.menu[i].style.border = "1 solid #C6DF63";
		document.all.menu[i].style.backgroundColor = "#C6DF63";
	}
}

function mouseOnTD(obj)
{
	//obj.style.border = "1 solid #738E18";
	//obj.style.backgroundColor = "white";
	obj.style.cursor = "hand";
}

function ClickOnTD(obj, sub){
	//obj.style.border = "1 solid #738E18";
	//obj.style.backgroundColor = "white";
	obj.style.cursor = "hand";
	
	if (sub.style.display == "none"){
		sub.style.display = "block";
	}
	else{
		sub.style.display = "none";
	}
}

function defaultStatusMall(){
	var lec = document.all.menu;
	for (var i=0;i<lec.length;i++){
//		document.all.menu[i].style.border = "1 solid " & DSColor; //#C6DF63";
//		document.all.menu[i].style.backgroundColor = DSColor; //"#C6DF63";
	}	
}

// »õÃ¢¶ç¿ì±â
function newWindowOpen(URL,WinName,WinWidth,WinHeight,ScrollYN) {
	var NewWin = window.open(URL,WinName,'toolbar=no,width='+WinWidth+',height='+WinHeight+',resizable=yes,scrollbars='+ScrollYN)
	NewWin.focus();	
}

// »õÃ¢¶ç¿ì±â 2
function WinOpen(URL,WinName,WinWidth,WinHeight,WinLeft,WinTop,ScrollYN) {
	var NewWin = window.open(URL,WinName,'toolbar=no,width='+WinWidth+',height='+WinHeight+',top='+WinTop+',left='+WinLeft+',resizable=yes,scrollbars='+ScrollYN)
	NewWin.focus();
}

// »õÃ¢¶ç¿ì±â 3
function WinOpen2(URL,WinName,WinWidth,WinHeight,WinLeft,WinTop,ScrollYN,ResizeFlag) {
	var NewWin = window.open(URL,WinName,'toolbar=no,width='+WinWidth+',height='+WinHeight+',top='+WinTop+',left='+WinLeft+',resizable='+ResizeFlag+',scrollbars='+ScrollYN)
	NewWin.focus();
	
}

// ÀüÀÚ¿ìÆí Å¸´ç¼º Ã¼Å©
function IsValidEmail(strValue) {
    var invalidChars = " /:,;";
    if(strValue == "") {
        return false;
    }
    for(var i=0;i<invalidChars.length;i++) {
	var badchar = invalidChars.substring(i,i+1);
	if(strValue.indexOf(badchar, 0) > -1) {
	    return false;
	}
    }
    var atPos = strValue.indexOf("@",1);
    if(atPos == -1) {
	return false;
    }
    if(strValue.indexOf("@",atPos+1) > -1) {
	return false;
    }
    var periodPos = strValue.indexOf(".",atPos)
    if(periodPos == -1) {
	return false;
    }
    if(periodPos + 3 > strValue.length) {
	return false;
    }
    return true;
}

// ¼ýÀÚÀÔ·Â Å¸´ç¼º Ã¼Å©
function IsNumeric(nValue) {
    if(nValue == "") {
		return false;
    }
	if (nValue.substring(0,1) != "-"){
		for(var i=0; i<nValue.length; i++) {
			if(nValue.substring(i,i+1) < "0" || nValue.substring(i,i+1) > "9") {
				return false;
			}
		}
	}
	else{
		for(var i=1; i<nValue.length; i++) {
			if(nValue.substring(i,i+1) < "0" || nValue.substring(i,i+1) > "9") {
				return false;
			}
		}
	}
	
    return true;
}

// ÇØ´ç¿ù¿¡ ´ëÇÑ ¸¶Áö¸· ³¯±îÁö¿¡ ´ëÇÑ ¼¿·ºÆ® ¹Ú½º °ª ¹ÝÈ¯ ÇÔ¼ö
function makeSelectDate(strYear,strMonth,objName) { 
	var monarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	if (((strYear % 4 == 0) && (strYear % 100 != 0)) || (strYear % 400 == 0)) {
		monarr[1] = "29";
	}
	
	endDay = monarr[strMonth-1]
	
	for(var i=0;i<endDay;i++) {
		objName.length = endDay
		
		strDay = '0' + (i+1)
		strDayLen = strDay.length
		strDay = strDay.substr(strDayLen-2,strDayLen)
		
		objName.options[i].text	= strDay
		objName.options[i].value	= strDay
	}
	 
}
	
//¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
function numkey(){
	if ((event.keyCode<48)||(event.keyCode>57)){
		event.returnValue=false;
	}
}

//ÆäÀÌÁö ÀÌµ¿
function JumpPage(gPage) {	
	document.JumpPage.page.value = gPage;
	document.JumpPage.submit();
}
function JumpPage1(gPage) {	
	document.JumpPage.s_page.value = gPage;
	document.JumpPage.submit();
}

//ÆË¾÷Ã¢ ¶ç¿ì±â(ÆÄÀÏ¸í,width,height,scrollbar,ÄíÅ°Ç×¸ñ,top¿©¹é,left¿©¹é)
function onload_popup(a,b,c,d,e,f,g) {	
	var pop_win
	pop_win = window.open(a,e,'width='+parseInt(b)+',height='+parseInt(c)+',scrollbars='+parseInt(d)+',toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,top='+parseInt(f)+',left='+parseInt(g)+'');
	pop_win.focus();
	return;
}

// ¼­¹öÀÇ ½Ã°£À» ±¸ÇÏ´Â °Ì´Ï´Ù.
var timer_id = null
var diff_hours = 0
var diff_minutes = 0
var diff_seconds = 0
var ampm = ""
var flag=0
            
// ¼­¹öÀÇ ½Ã°£°úÀÇ Â÷ÀÌ¸¦ ±¸ÇÏ´Â ÇÔ¼ö
function getDate (now_day) {
    var now = new Date()
    var hours = now.getHours()
    var minutes = now.getMinutes()
    var seconds = now.getSeconds()
    var sv_ampm = now_day.substr(11,2)
    if (now_day.substr(15,1) == ":") {
       var sv_hours = now_day.substr(13,2)
       var sv_minutes = now_day.substr(16,2)
       var sv_seconds = now_day.substr(19,2)
    }
    else {
       var sv_hours = now_day.substr(14,2)
       var sv_minutes = now_day.substr(17,2)
       var sv_seconds = now_day.substr(20,2)
    }


    //if ( sv_ampm == "¿ÀÈÄ"){
      //sv_hours = parseInt(sv_hours) + 12
    //}
    ampm = sv_ampm

    diff_hours = sv_hours - hours
    diff_minutes = sv_minutes - minutes
    diff_seconds = sv_seconds - seconds
    //diff_minutes = parseInt(sv_minutes) - parseInt(minutes)
    //diff_seconds = parseInt(sv_seconds) - parseInt(seconds)
   showTime()
}

// ÇöÀç ½Ã°£ ±¸ÇØ ÅØ½ºÆ® ÀÔ·Â ¾ç½Ä¿¡ º¸¿©ÁÖ´Â ÇÔ¼ö
function showTime () {
    var now = new Date()
    var hours = now.getHours()
    var minutes = now.getMinutes()
    var seconds = now.getSeconds()
    // color_form ¿¡ ÀÖ´Â time ÅØ½ºÆ® ÀÔ·Â ¾ç½Ä¿¡ ÀÔ·Â

		hours = hours + diff_hours
		minutes = minutes + diff_minutes
		seconds = seconds + diff_seconds + 1

    if (seconds < 0) {
       minutes -= 1
       seconds = 60 + seconds
    }
    if (minutes < 0) {
       hours -= 1
       minutes = 60 + minutes
    }
    if (hours < 0){
      hours += 24
    }
    if (seconds >= 60){
      minutes += 1
      seconds -= 60
    }
    if (minutes >= 60){
      hours += 1
      minutes -=60
    }
    if (hours >=24){
      hours -= 24
    }
    if (hours == 0){
      hours = 12
    }
    if (hours == 12 ){
      if (minutes == 00){
        if (seconds == 00 ){
          if (ampm == "¿ÀÀü"){
            ampm = "¿ÀÈÄ"
          }
          else{
            ampm = "¿ÀÀü"
          }
        }
      }
    }
    var time_str = ((hours >12) ? hours -12 : hours)
    time_str += ((minutes < 10) ? ":0" : ":") + minutes
    time_str += ((seconds < 10) ? ":0" : ":") + seconds
    //time_str += ":" + seconds
    //time_str += (hours >= 12) ? " p.m." : " a.m."
    time_str += " "
    if (ampm == "¿ÀÀü"){
      time_str = "¿ÀÀü" + time_str }
    else {
      time_str = "¿ÀÈÄ" + time_str }

    //time_str += ampm
    // color_form ¿¡ ÀÖ´Â time ÅØ½ºÆ® ÀÔ·Â ¾ç½Ä¿¡ ÀÔ·Â
    timer.innerText = time_str

    // showTime() ÇÔ¼ö°¡ 1ÃÊ ÈÄ ½ÇÇàµÇµµ·Ï ¼³Á¤
    timer_id = setTimeout("showTime()",1000)
}

//ÁÖ¹Î¹øÈ£ Ã¼Å© ÇÔ¼ö
function regnumcheck(ssn1,ssn2){ 
	if (ssn1.length != 6){ 
		return false;
	} 
	else if (ssn2.length != 7){ 
		return false;
	} 
	else { 
		var str_serial1 = ssn1; 
		var str_serial2 = ssn2; 
		var digit=0 
		
		for (var i=0;i<str_serial1.length;i++){ 
		var str_dig=str_serial1.substring(i,i+1); 
		
		if (str_dig<'0' || str_dig>'9'){ 
			digit=digit+1 
		} 
	} 
	
	if ((str_serial1 == '') || ( digit != 0 )){ 
		return false;   
	}
	 
	var digit1=0 
	
	for (var i=0;i<str_serial2.length;i++){ 
	var str_dig1=str_serial2.substring(i,i+1); 	
		if (str_dig1<'0' || str_dig1>'9'){ 
			digit1=digit1+1 
		} 
	}
	 
	if ((str_serial2 == '') || ( digit1 != 0 )){ 
		return false;   
	}
	 
	if (str_serial1.substring(2,3) > 1){ 
		return false;   
	}
	 
	if (str_serial1.substring(4,5) > 3){ 
		return false;   
	}
	 
	if (str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0){ 
		return false;   
	}
	 
	var a1=str_serial1.substring(0,1) 
	var a2=str_serial1.substring(1,2) 
	var a3=str_serial1.substring(2,3) 
	var a4=str_serial1.substring(3,4) 
	var a5=str_serial1.substring(4,5) 
	var a6=str_serial1.substring(5,6) 
	var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7 
	var b1=str_serial2.substring(0,1) 
	var b2=str_serial2.substring(1,2) 
	var b3=str_serial2.substring(2,3) 
	var b4=str_serial2.substring(3,4) 
	var b5=str_serial2.substring(4,5) 
	var b6=str_serial2.substring(5,6) 
	var b7=str_serial2.substring(6,7) 
	var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
	check_digit = check_digit%11 
	check_digit = 11 - check_digit 
	check_digit = check_digit%10 
	if (check_digit != b7){ 
		return false;   
	} 
	else{ 
		return true;
	} 
	} 
} 

//»ç¾÷ÀÚ ¹øÈ£ Ã¼Å© ÇÔ¼ö
function chkWorkNum(cnum1, cnum2, cnum3){ 
	strNumb = cnum1 + cnum2 + cnum3

	if (strNumb.length != 10){ 
		return false; 
	} 
         
	sumMod = 0; 
	sumMod += parseInt(strNumb.substring(0,1)); 
	sumMod += parseInt(strNumb.substring(1,2)) * 3 % 10; 
	sumMod += parseInt(strNumb.substring(2,3)) * 7 % 10; 
	sumMod += parseInt(strNumb.substring(3,4)) * 1 % 10; 
	sumMod += parseInt(strNumb.substring(4,5)) * 3 % 10; 
	sumMod += parseInt(strNumb.substring(5,6)) * 7 % 10; 
	sumMod += parseInt(strNumb.substring(6,7)) * 1 % 10; 
	sumMod += parseInt(strNumb.substring(7,8)) * 3 % 10; 
	sumMod += Math.floor(parseInt(strNumb.substring(8,9)) * 5 / 10); 
	sumMod += parseInt(strNumb.substring(8,9)) * 5 % 10; 
	sumMod += parseInt(strNumb.substring(9,10)); 
         
	if (sumMod % 10 != 0){ 
        return false; 
	}
	else{
		return true; 
	}
}
// Ä³¸¯ÅÍ°¡ ÀÖ´ÂÁö Ã¼Å©
function InChar(nValue,char) {
    if(nValue == "") {
		return false;
    }
    for(var i=0; i<nValue.length; i++) {
	if(nValue.substring(i,i+1) == char ) {
	    return true;
	}
    }
    return false;
}

//blink 
function doBlink() {
	var blink = document.all.tags("blink")
	for (var i=0; i<blink.length; i++)
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
	}

	function startBlink() {
	 if (document.all)
	  setInterval("doBlink()",500)
	}
	window.onload = startBlink;
	
//·Î±×ÀÎ Ã¼Å© ÇÔ¼ö
function id_chehk(ths){
	var user_id=ths.user_id.value;
	var user_pwd=ths.user_pwd.value;				

		
	if (ths.user_id.value==""){
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		ths.user_id.focus();
		return false;
	}
		
	if (ths.user_pwd.value==""){
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		ths.user_pwd.focus();
		return false;
	}
}
	
function Enter() {
   if(event.keyCode == 13){ 
      check();
   } 
}


//°Ë»öÃ¢ Ã¼Å©ÇÔ¼ö	
function searchchk(ths){		
	if(ths.search_txt.value==""){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		ths.search_txt.focus();
		return false;
    }
}

//Top, BottÇü ½ºÅ² ¸Þ´º µð½ºÇÃ·¹ÀÌ
function showmenu(num,count){
	for(var i=0; i<count+1; i++){
		menu = eval("sub" + i)
   		if (i == num){
   			menu.style.display = '';
   		}
   		else{
   			menu.style.display = 'none';
   		}
	}
}

//ÅØ½ºÆ® ÇÊµå ÀÔ·Âµ¥ÀÌÅÍ ÀÚµ¿ Æ÷Ä¿½º ÀÌµ¿
//autoTab(ÇÊµå¸í, ÇÊµåÀÇ ÀÔ·Â ±æÀÌ, event)ÇüÅÂ·Î »ç¿ë
// onkeyup="return autoTab(this, 6, event);"
var isNN = (navigator.appName.indexOf("Netscape")!=-1); 

function autoTab(input,len, e) { 
    var keyCode = (isNN) ? e.which : e.keyCode; 
    var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; 
    if(input.value.length >= len && !containsElement(filter,keyCode)) { 
        input.value = input.value.slice(0, len); 
		if (len!=7){
			input.form[(getIndex(input)+1) % input.form.length].focus(); 
		}
		else{
			input.form[(getIndex(input)+3) % input.form.length].focus();
		}
	}

	function containsElement(arr, ele) { 
		var found = false, index = 0; 
		while(!found && index < arr.length) 
			if(arr[index] == ele) 
				found = true; 
			else 
				index++; 
			return found; 
	} 

	function getIndex(input) { 
		var index = -1;
		var i = 0;
		var found = false; 
	    
		while (i < input.form.length && index == -1) 
			if (input.form[i] == input)
				index = i; 
			else
				i++; 
			return index; 
	} 

	return true; 
}  	

//Enter¸¦ Ä¡¸é ´ÙÀ½ ÄÁÆ®·Ñ·Î ³Ñ¾î°¡´Â ÇÔ¼ö
// onkeyup="return autoEnter(this, event);" ÇüÅÂ·Î »ç¿ë

function autoEnter(input,e) { 
    var keyCode = (isNN) ? e.which : e.keyCode;
    var filter = (isNN) ? [0,8,9] : [13]; 
    if(containsElementEnter(filter,keyCode)) { 
		input.form[(gotIndex(input)+1) % input.form.length].focus(); 
	}	
	return true; 
	
	function containsElementEnter(arr, ele) { 
		var found = false, index = 0; 
		while(!found && index < arr.length) 
			if(arr[index] == ele) 
				found = true; 
			else 
				index++; 
			return found; 
	} 

	function gotIndex(input) { 
		var index = -1;
		var i = 0;
		var found = false; 
	    
		while (i < input.form.length && index == -1) 
			if (input.form[i] == input)
				index = i; 
			else
				i++; 
			return index; 
	} 
}

	
function PopupColorPicker(DestObj){			// »ö»óÇ¥ ¼±ÅÃÇÏ¸é ÁöÁ¤ÇÑ ¹Ú½ºÀÇ ¹ÙÅÁ»ö ¹Ù²Ù°í »ö»ó°ª ¾²±â
	var boxWidth, boxHeight, boxLeft, boxTop;
			
	boxWidth = 358
	boxHeight = 380
	boxLeft = (screen.width - boxWidth) / 2;
	boxTop = (screen.height - boxHeight) / 2;

	var vReturnValue = window.showModalDialog("/admin/common/colpicker.htm","Popup","status:no; dialogWidth:" + boxWidth + "px;dialogHeight:" + boxHeight + "px;dialogLeft:" + boxLeft + "px;dialogTop:" + boxTop + "px");
			
	if (typeof(vReturnValue) != "undefined" && vReturnValue != "out"){
		DestObj.value = vReturnValue;
		DestObj.style.backgroundColor = vReturnValue;
	}
}

function help_view(){
	if (document.all.spacer.style.display == "none" ){
		document.all.spacer.style.display = ""
		document.all.help_contents.style.display = ""
		help_label.innerText = "µµ¿ò¸» °¨Ãß±â¡ã"
	}
	else{
		document.all.spacer.style.display = "none"
		document.all.help_contents.style.display = "none"
		help_label.innerText = "µµ¿ò¸» º¸±â¡å"
	}
}	

//
//
//
//»ç¿ëÀÚ ÀÌ¹ÌÁö Æú´õÀÇ ¸ñ·ÏÀ» ÇØ´ç ¸®½ºÆ®¿¡ º¸ÀÌ±â (ÀÛ¾÷é©)
//
//
//	 

function newWindowOpenToolBar(URL,WinName,WinWidth,WinHeight,ScrollYN) {
	var NewWin = window.open(URL,WinName,'menubar=yes,status=yes,toolbar=yes,width='+WinWidth+',height='+WinHeight+',resizable=yes,scrollbars='+ScrollYN)
	NewWin.focus();
}