// IE6, IE7 ±¸ºÐ ...
var nav = window.navigator.userAgent;

var ie6_flag = false;
ie6_flag = (nav.indexOf("MSIE 6") != -1);
var ie7_flag = false;
ie7_flag = (nav.indexOf("MSIE 7") != -1);
var ie8_flag = false;
ie8_flag = (nav.indexOf("MSIE 8") != -1);
var Opera_flag = false;
Opera_flag = (nav.indexOf("Opera") != -1);
var Chrome_flag = false;
Chrome_flag = (nav.indexOf("Chrome") != -1);
var Firefox_flag = false;
Firefox_flag = (nav.indexOf("Firefox") != -1);
var Safari_flag = false;
Safari_flag = (nav.indexOf("Safari") != -1);

var Domain = document.URL ; Domain = Domain.split("//") ; Domain = Domain[1].substr(0, Domain[1].indexOf("/"));

SetCookie('screen_xy',screen.width +'x'+ screen.height,1)

function open_window(name, url, left, top, width, height, scrollbar) {
	if(ie7_flag==true){
		height = parseInt(height)
	}
	var injas
	
	if(left==''){
		left = (screen.width-width)/2
	}
	if(top==''){
		top = (screen.height-height)/2
	}
	injas = 'left='+left+',top='+top+',width='+width+',height='+height+',scrollbars='+scrollbar+',toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no';
  if(scrollbar!=0){
    width = width + 20
  }
	
	eval(name+"st=window.open('"+url+"','"+name+"','"+injas+"')")
	eval(name+"st.focus()")

}
function open_window_submit(name, url, left, top, width, height, scrollbar) {
	if(ie7_flag==true){
		height = parseInt(height)
	}
	var injas
	
	if(left==''){
		left = (screen.width-width)/2
	}
	if(top==''){
		top = (screen.height-height)/2
	}
	injas = 'left='+left+',top='+top+',width='+width+',height='+height+',scrollbars='+scrollbar+',toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no';
  if(scrollbar!=0){
    width = width + 20
  }
	
	
	eval(name+"st=window.open('','"+name+"','"+injas+"')")
	obj = eval(name+"st")
	obj.focus()
	obj.name=name
	
	
	form_submit('form0','T',url,name,'post')

}

function form_submit(FrmName, encoding_type, actionPage, target_value, method_value) {
	if (encoding_type == 'T'){
		encoding_value = 'application/x-www-form-urlencoded';
	}else if (encoding_type == 'F'){
		encoding_value = 'multipart/form-data';
	}
  var form = eval("document." + FrmName);

  form.method = method_value;
  form.target = target_value;
  form.action = actionPage;
  form.encoding = encoding_value;
  form.submit();
}

function form_submit_para(FrmName, encoding_type, actionPage, target_value, method_value,para) {
    var arr_para, arr_arr_para, table_html
    var form = eval("document." + FrmName);
    var table_html = "";
    var encoding_value

    if (encoding_type == 'T') {
      encoding_value = 'application/x-www-form-urlencoded'
    }else if (encoding_type == 'F') {
     encoding_value = 'multipart/form-data'
    }

		table_html = "";
    arr_para = para.split('|');
    
  	for(i=0;i<arr_para.length;i++){
  	  arr_arr_para = arr_para[i].split('=');
			try{
    		//¿¤¸®¸ÕÆ®°¡ ÀÖÀ¸¸é ±âÁ¸ ¿¤¸®¸ÕÆ®¿¡ °ª »ðÀÔ
    		eval("form."+arr_arr_para[0]+".value='"+arr_arr_para[1]+"'")
	   	}catch(e){
    		//¿¤¸®¸ÕÆ®°¡ ¾øÀ¸¸é »õ·Î »ý¼º
    		table_html = table_html + "<input type='hidden' name='"+arr_arr_para[0]+"' value='"+arr_arr_para[1]+"'>";
  		}
  	}

  	
    document.getElementById("hidden_para").innerHTML = table_html;
    
    
    form.method = method_value;
    if(target_value=='opener'){
    	opener.name = "opener_action";
   		form.target = opener.name;
    }else{
    	form.target = target_value;
  	}
    form.action = actionPage;
    form.encoding = encoding_value;
    
    form.submit();
    document.getElementById("hidden_para").innerHTML = '';//°ªÃÊ±âÈ­
  }


function check_input(form,name,name_txt,type,s_num,e_num){
//0 select
//1 checkbox
//2 radio
//3 text
	var obj = eval('document.'+form+'.'+name)
	var check_num
	check_num = 0
	var temp_message
	try{
		obj_len = obj.length
	}catch(e){
		temp_message = "´ë»óÀÌ ¾ø½À´Ï´Ù."
		window.alert(temp_message)
		return true
	}

  var return_value = true;
  switch(type){
    case "0":
    	//select_arr = document.all.tags ( "SELECT" ) ;
    	select_arr = document.getElementsByTagName( "SELECT" ) ;
    	
			for(i=0;i<select_arr.length;i++){
				if(select_arr[i].name==name){
					
						if(select_arr[i].value==""){
							temp_message = name_txt + "¼±ÅÃÇØÁÖ¼¼¿ä!"
      			  alert(temp_message)
      			  select_arr[i].focus()
      				return_value = true;
      				break;
						}else{
						 	return_value = false;
						}
				}
				
			}
			
    break;
    case "1":
    	if(obj_len == undefined){
    		if(obj.checked==true){
    			check_num++
    		}
    	}else{
    		for(i=0;i<obj_len;i++){
    			if(obj[i].checked==true){
    				check_num++
    			}
    		}
    	}

      if(check_num < s_num){
        alert(name_txt + ' ' + s_num + '°³ ÀÌ»óÀ¸·Î Ã¼Å©ÇØÁÖ¼¼¿ä');
        return_value = true;
      }else if(check_num > e_num){
        alert(name_txt + ' ' + e_num + '°³ ÀÌÇÏ·Î Ã¼Å©ÇØÁÖ¼¼¿ä');
        return_value = true;
      }else{
        return_value = false;
      }

    break;
    case "2":
    	if(obj_len == undefined){
    		if(obj.checked==true){
    			check_num++
    		}
    	}else{
    		for(i=0;i<obj_len;i++){
    			if(obj[i].checked==true){
    				check_num++
    			}
    		}
    	}

      if(check_num < s_num){
        alert(name_txt + ' ¼±ÅÃÇØÁÖ¼¼¿ä');
        return_value = true;
      }else if(check_num > e_num){
        alert(name_txt + ' ' + e_num + '°³ ÀÌÇÏ·Î Ã¼Å©ÇØÁÖ¼¼¿ä');
        return_value = true;
      }else{
        return_value = false;
      }
    break;
    case "3":
    	if(obj.length==undefined){
      	if(obj.value.length < s_num){
      		if(s_num==1){
      			alert(name_txt + ' ' + 'ÀÔ·ÂÇØÁÖ¼¼¿ä');
      		}else{
      	  	alert(name_txt + ' ' + s_num + 'ÀÚ ÀÌ»óÀ¸·Î ÀÔ·ÂÇØÁÖ¼¼¿ä');
      	  }
      	  return_value = true;
      	  obj.focus()
      	}else if(obj.value.length > e_num){
      	  alert(name_txt + ' ' + e_num + 'ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇØÁÖ¼¼¿ä');
      	  return_value = true;
      	  obj.focus()
      	}else{
      	  return_value = false;
      	}
      }else{
				for(i=0;i<obj.length;i++){
      		if(obj[i].value.length < s_num){
      		  alert(name_txt + ' ' + s_num + 'ÀÚ ÀÌ»óÀ¸·Î ÀÔ·ÂÇØÁÖ¼¼¿ä');
      		  return_value = true;
      		  try{
      		  obj[i].focus()
      			}catch(e){}
      		  break;
      		}else if(obj[i].value.length > e_num){
      		  alert(name_txt + ' ' + e_num + 'ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇØÁÖ¼¼¿ä');
      		  return_value = true;
      		  try{
      		  obj[i].focus()
      			}catch(e){}
      		  break;
      		}else{
      		  return_value = false;
      		}
				}
      }
  }
  return return_value
}

function Left(str, n){
  if (n <= 0)
    return "";
  else if (n > String(str).length)
    return str;
  else
    return String(str).substring(0,n);
}

function Right(str, n){
  if (n <= 0)
    return "";
  else if (n > String(str).length)
    return str;
  else {
    var iLen = String(str).length;
    return String(str).substring(iLen, iLen - n);
  }
}


function month_last_day(iyyyy,imonth){
  var last_day;
  last_day = new Date(iyyyy,imonth,0);

  return last_day.getDate();
}

function selectbox_write(select_name,start_num,end_num,selected_num,onchange_action,gubun){
  var i, temp_html

  temp_html = "<select name='"+select_name+"' onchange=\""+onchange_action+"\" style='margin:0 0 0 7px;'>";
  for(i=start_num;i<=end_num;i++){
    if(i==selected_num){
      temp_html = temp_html + "<option value='"+i+"' selected>"+i+"</option>";
    }
    else{
      temp_html = temp_html + "<option value='"+i+"'>"+i+"</option>";
    }
  }
  temp_html = temp_html + "</select>"+gubun;

  document.write(temp_html)
}


function selectbox_write2(select_name,start_num,end_num,selected_num,onchange_action,gubun,style_text){
  var i, temp_html

  temp_html = "<select name='"+select_name+"' onchange=\""+onchange_action+"\" style='"+style_text+"'>";
  for(i=start_num;i<=end_num;i++){
    if(i==selected_num){
      temp_html = temp_html + "<option value='"+i+"' selected>"+i+"</option>";
    }
    else{
      temp_html = temp_html + "<option value='"+i+"'>"+i+"</option>";
    }
  }
  temp_html = temp_html + "</select>"+gubun;

  document.write(temp_html)
}


function select_date_end(form_name,select_name){
	
  var temp_yyyy, temp_month, temp_date_obj, temp_date_value

  temp_yyyy       = eval("document."+form_name+"."+select_name+"_1.value");
  temp_month      = eval("document."+form_name+"."+select_name+"_2.value");
  temp_date_obj   = eval("document."+form_name+"."+select_name+"_3");
  temp_date_value = temp_date_obj.value

  last_day = month_last_day(temp_yyyy,temp_month);

  selectbox_clear(temp_date_obj,0);
  selectbox_rewrite(temp_date_obj,1,last_day,temp_date_value);
}

function selectbox_clear(obj,start_clear_num){
  var temp_len;
  temp_len = obj.length;
  for(var i = start_clear_num ; i <= temp_len ; i ++){
    obj.options[start_clear_num] = null;
  }
}

function selectbox_rewrite(obj,start_num,end_num,selected_num){
	
  var select_count = null;
  for(var i = start_num ; i <= end_num ; i ++){
    obj.options[i-1] = new Option(i,i);
    if(i==selected_num){
      select_count = i;
    }
  }
  if(select_count==null){
    select_count = end_num;
  }
  obj.options[select_count-1].selected = true;
}

function selectbox_selected(obj,selected_value){
  for(i=0;i<obj.length;i++){
    if(obj.options[i].value==selected_value){
      obj.options[i].selected = true;
    }
  }
}

function page_move(Folder1,File1){//a0 Ä¿¸®Å§·³ Æ¯¼ö
	var arr_File = File1.split("_")
	if(File1=='edupure'){
		window.external.AddFavorite('http://'+server_name, mname+'-¿Â¶óÀÎ±³À°')
	}else if(File1!=''){

		if(arr_File.length==1){
			File1 = arr_File[0]+".asp"
		}else{
			File1 = arr_File[0]+".asp?course_type_no="+arr_File[1]
		}

		if(Folder1==''){
			location="/"+mfolder+"/"+File1;
		}else{
			location="/"+mfolder+"/"+Folder1+"/"+File1;
		}
	}
}
function page_move_ori(Folder1,File1){//ÀÏ¹ÝÀû
	var arr_File = File1.split("_")
	if(File1=='edupure'){
		window.external.AddFavorite('http://'+server_name, mname+'-¿Â¶óÀÎ±³À°')
	}else if(File1!=''){
		File1 = arr_File[0]+".asp"
		if(Folder1==''){
			location="/"+mfolder+"/"+File1;
		}else{
			location="/"+mfolder+"/"+Folder1+"/"+File1;
		}
	}
}


function dateadd(add_type,add_num,datetime){
	var temp_datetime, temp_add_num, datetime
	//var datetime2 = new Date();
	//temp_datetime = datetime.getTime()

	switch(add_type){
		case 'yyyy': //³âµµ
			temp_add_num = add_num*365*24*60*60*1000
		break;
		case 'm': //¿ù
			temp_add_num = add_num*(30*24*60*60*1000)
		break;
		case 'd': //ÀÏ
			temp_add_num = add_num*(24*60*60*1000)
		break;
	}
	
	datetime.setTime(datetime.getTime()+(temp_add_num));
	//datetime2.setTime(temp_datetime)

	return datetime
}

function login_ok(){
	

	
	roolback_url = undefined_del(arguments[0])
	course_id    = undefined_del(arguments[1])
	yyyy         = undefined_del(arguments[2])
	degree       = undefined_del(arguments[3])
	restore_type = undefined_del(arguments[4])
	site_id      = undefined_del(arguments[5])
	pop_open     = undefined_del(arguments[6])
	
	
	
	course_id = GetCookie('course_id')
	restore_type = GetCookie('restore_type')
	roolback_url = GetCookie('roolback_url')
	//alert(roolback_url)
	
	//SetCookie('course_id','',-1)   
	//SetCookie('roolback_url','',-1)
	//SetCookie('restore_type','',-1)
	


	if((document.form0.user_id.value=='¾ÆÀÌµð ÀÔ·Â'||document.form0.user_id.value=='')&&document.form0.upassword.value==''){
		alert('¾ÆÀÌµð¿Í ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.')
		return
	}
	
	if(document.form0.user_id.value=='¾ÆÀÌµð ÀÔ·Â'||document.form0.user_id.value==''){
		alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.')
		return
	}
	if(document.form0.upassword.value==''){
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.')
		return
	}
	
	if(typeof(document.form0.id_save)=='object'){
		if(document.form0.id_save.checked){
			SetCookie('user_id',document.form0.user_id.value,30)
		}
	}	
	if(pop_open=='Y'){
	  t_target = 'opener';
	}else{
		t_target = '_self';
	}
	
	
	if(last_domain=='local'||(server_name=='test.edupure.kr')||(main_domain=='everu')||(main_domain=='naksigaja')){
		form_submit_para('form0','T','/common/login_ok.asp',t_target,'post','roolback_url='+roolback_url+'|course_id='+course_id+'|restore_type='+restore_type+'|mfolder='+mfolder+'|site_id='+site_id);
		if(pop_open=='Y'){
			self.close();
		}
	}else{
		
		form_submit_para('form0','T','https://www.'+main_domain+'.'+last_domain+'/common/login_ok.asp',t_target,'post','roolback_url='+roolback_url+'|course_id='+course_id+'|restore_type='+restore_type+'|mfolder='+mfolder+'|site_id='+site_id);
		if(pop_open=='Y'){
			self.close();
		}
	}
}

function undefined_del(value){
	if(value==undefined){
		value = ''
	}
	return value
}

function button_action(){
	action_type  = undefined_del(arguments[0])
	roolback_url = undefined_del(arguments[1])

	switch(action_type){
		case 1: //°³ÀÎÁ¤º¸ ¼öÁ¤
			form_submit_para('form0','T','/'+mfolder+'/c0/n0301.asp','_self','post','roolback_url='+roolback_url)
		break;
		case 2: //Áö¿ø°¡´É¿©ºÎÈ®ÀÎ
			open_window("studypop", '/'+mfolder+'/b0/p0101.asp',"100","100","400","405","1")
		break;
	}
}

function course_apply(){  //Á¢¼ö
	step         = undefined_del(arguments[0])
	course_id    = undefined_del(arguments[1])
	yyyy         = undefined_del(arguments[2])
	degree       = undefined_del(arguments[3])
	restore_type = undefined_del(arguments[4])
	receipt_id   = undefined_del(arguments[5])
	mcourse_type = undefined_del(arguments[6])

  switch(step){
    case 0: //¸Àº¸±â
    	open_window("studypop", "/common/studybegin.asp?course_id="+encodeURIComponent(course_id)+"&step="+step,"0","0","800","600","1")
    break;
    case 1: //°ü½É°úÁ¤´ã±â
    	form_submit_para('form0','T','/common/course_shop_basket.asp','hidden_frame1','post','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type)
    break;
    case 2: //ÇÐ½À»ó¼¼ÆäÀÌÁö
    	//2
    	//studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=2024,height=1768");
    	studywindow.focus()
    	//1
    	//open_window("studywindow", "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step,"0","0","0","0","NO")
    break;
    case 3: //ÇÐ½À½ÃÀÛ
    	//studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");

	    //var args = new Object;
	    //args.window = window;
	    //args.id = 'studywindow';
	    //showModalDialog("/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step, args);
	    //args.focus()
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow.focus()
    break;
    case 4: //½ºÅ©·¦
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow.focus()
    break;
    case 5: //¸Þ¸ð
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow.focus()
    break;
    case 6: //½ºÄÉÁÙ
			alert('½ºÄÉÁÙ')
    break;
    case 51: //½ÃÇè
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow.focus()
    break;
    case 52: //°úÀç
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow.focus()
    break;
    case 53: //¼³¹®
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow.focus()
    break;
    case 54: //ÇÐ½À¹®ÀÇ³»¿ª
    	studywindow = window.open( "/common/studybegin.asp?receipt_id="+encodeURIComponent(receipt_id)+"&step="+step , 'studywindow', ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='1',height='1'");
    	studywindow.focus()
    break;

    case 100: //Ä¿¸®Å§·³ step 1
			form_submit_para('form0','T','/'+mfolder+'/a0/n0102.asp','_self','post','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type+'|mcourse_type='+mcourse_type)
    break;
    case 101: //½ÅÃ» step 1
			form_submit_para('form0','T','/'+mfolder+'/b0/n0202.asp','_self','post','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type)
    break;
    case 102: //½ÅÃ» step 2
			form_submit_para('form0','T','/'+mfolder+'/b0/n0203.asp','_self','get','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type)
    break;
    case 103: //½ÅÃ» step 3
			form_submit_para('form0','T','/'+mfolder+'/b0/n0204.asp','_self','get','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type)
    break;
    case 104: //½ÅÃ» step 4
			form_submit_para('form0','T','/'+mfolder+'/b0/n0205.asp','_self','post','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type)
    break;
    
    case 200: //°áÁ¦ 1´Ü°è
			form_submit_para('form0','T','/'+mfolder+'/q0/n0101.asp','_self','get','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type)
    break;
    case 201: //°áÁ¦ 2´Ü°è
			form_submit_para('form0','T','/'+mfolder+'/q0/n0201.asp','_self','get','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type)
    break;

    case 299: //°ü¸®ÀÚ ½ÂÀÎÀ¸·Î °áÁ¦¹æ½ÄÀÌ ÁöÁ¤µÇ¾îÀÖÀ»°æ¿ì °áÁ¦ 1´Ü°è°¡ ¾Æ´Ï°í ¹Ù·Î ¼ö°­½ÅÃ»ÀÌ µÈ´Ù.
    	var goods_id
			goods_id = ''
    	if(restore_type!='A'){
    		if(GetCookie(course_id+'book')=='true'){
    			goods_id = document.form0.goods_id.value
    		}
    		open_window('tu_pop'+course_id, '/common/p1001.asp?course_id='+course_id+'&yyyy='+yyyy+'&degree='+degree+'&restore_type='+restore_type+'&return1=Y&action_type=299&goods_id='+goods_id,1,1, 630, 600, "1")
    	}else{
    		
    		//open_window("n0202_admission", "/common/b0/n0202_admission.asp?course_id="+course_id+"&yyyy="+yyyy+"&degree="+degree+"&restore_type="+restore_type,"","","800","600","1")
    		//form_submit_para('form0','T','/common/b0/n0202_admission.asp','n0202_admissionst','post','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type+'|hidden_frame_action=Y')
    		open_window_submit("n0202_admission", "/common/b0/n0202_admissionn.asp","","","800","600","1")
    	}
    break;
    case 300: //°ü¸®ÀÚ ½ÂÀÎÀ¸·Î °áÁ¦¹æ½ÄÀÌ ÁöÁ¤µÇ¾îÀÖÀ»°æ¿ì °áÁ¦ 1´Ü°è°¡ ¾Æ´Ï°í ¹Ù·Î ¼ö°­½ÅÃ»ÀÌ µÈ´Ù.

    	if(restore_type!='A'){
    		open_window('tu_pop'+course_id, '/common/p1001.asp?course_id='+course_id+'&yyyy='+yyyy+'&degree='+degree+'&restore_type='+restore_type+'&return1=Y&action_type=300',1,1, 630, 600, "1")
    	}else{
    		
    		//open_window("n0202_admission", "/common/b0/n0202_admission.asp?course_id="+course_id+"&yyyy="+yyyy+"&degree="+degree+"&restore_type="+restore_type,"","","800","600","1")
    		//form_submit_para('form0','T','/common/b0/n0202_admission.asp','n0202_admissionst','post','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type+'|hidden_frame_action=Y')
    		open_window_submit("n0202_admission", "/common/b0/n0202_admissiona.asp","","","800","600","1")
    	}
    break;
    case 301: //·Î±×ÀÎÇÏ¶ó°í ÇÔ
			//SetCookie('course_id',course_id,0);
			//SetCookie('restore_type',restore_type,0);
			SetCookie('roolback_url',document.location.href,0);
			
    	//alert('·Î±×ÀÎÀ» ÇÏ¼Å¾ß ¼ö°­½ÅÃ»ÀÌ °¡´ÉÇÕ´Ï´Ù.');
    	//open_window("loginpop", "/common/z0/p0101.asp?pop_open=Y","","","610","360",0)
	
			
			width=610;
			height=360;
			loginpopupst=window.open('/common/z0/p0101.asp?pop_open=Y','poginpopup','left='+(screen.width-width)/2+',top='+(screen.height-height)/2+',width='+width+',height='+height+',scrollbars=false,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no');
			if(loginpopupst==null){
			  if(confirm('·Î±×ÀÎÈÄ Æ¯°­ ½ÅÃ»ÀÌ °¡´ÉÇÕ´Ï´Ù.\n\nÁö±Ý ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?')){
				  location='/'+mfolder+'/z0/n0701.asp'
			  }
			}else{
				loginpopupst.focus();
			}
    break;
    case 400: //¿ÀÇÁ¶óÀÎ
    	if(restore_type!='A'){
    		open_window('tu_pop'+course_id, '/common/p1001.asp?course_id='+course_id+'&yyyy='+yyyy+'&degree='+degree+'&restore_type='+restore_type+'&return1=y',1,1, 600, 600, 0)
    	}else{
    		form_submit_para('form0','T','/common/b0/n0202_admission_off.asp','hidden_frame1','post','course_id='+course_id+'|yyyy='+yyyy+'|degree='+degree+'|restore_type='+restore_type+'|hidden_frame_action=Y')
    	}
    break;
	}
}

function GetCookie(cookieName){
  allCookies=document.cookie.split('; ');  // cookies are separated by semicolons
  for (i=0;i<allCookies.length;i++){
    cookieArray=allCookies[i].split('='); // a name/value pair (a crumb) is separated by an equal sign
    if (cookieName==cookieArray[0]) return(cookieArray[1])//str+=unescape(allCookies[i]+'<BR>');
  }
}

function SetCookie(cookieName,cookieVal,validity){
	var temp_domain
	if(typeof(main_domain)=='undefined'){
		temp_domain = Domain
	}else{
		temp_domain = main_domain+'.'+last_domain
	}
	
  date=new Date();
  date.setDate(date.getDate()+validity);
  if(validity==0){
  	document.cookie=cookieName+'='+escape(cookieVal)+'; path=/; domain='+temp_domain+';'
  }
  else{
  	document.cookie=cookieName+'='+escape(cookieVal)+'; expires='+date.toGMTString()+'; path=/; domain='+temp_domain+';'
  }
}

function sleep(sec) {
    var now = new Date();
    var exitTime = now.getTime() + (sec);
    while (true) {
          now = new Date();
          if (now.getTime() > exitTime) return;
    }
}

function window_resizeTo(width,height){
  if(ie7_flag==true||ie8_flag==true){
    height2 = parseInt(height)+50
  }else{
    height2 = parseInt(height)
  }
  window.resizeTo(width,height2);
}



function custom_popup(pop_name,turl,top,left,width,height,alpha,frame_alpha_s,frame_alpha_style,frame_alpha_e){ //»ç¿ëºÎºÐ 
	var sh, sw 
	width = parseInt(width) 
	height = parseInt(height) 
	
	sh = screen.height; 
	sw = screen.width; 
	
	if(left=='' || left==null){ 
		if(sw>2000){//2000º¸´Ù Å©¸é µà¾ó¸ð´ÏÅÍ·Î º¾´Ï´Ù. 
			sw = sw / 2; 
		} 
		left = ( sw - width ) / 2 
	} 
	
	if(top=='' || top==null){ 
	top = ( ( sh - height ) / 2 ) - 60 
	} 

	oDiv=document.createElement("div"); 
	
	document.body.appendChild(oDiv); 
	oDiv.id=pop_name+"_div"; 
	
	oDiv.style.position="absolute"; 
	oDiv.style.top=top; 
	oDiv.style.left=left; 
	oDiv.style.zIndex="1000"; 
	
	oDiv.innerHTML = "<IFRAME name='"+pop_name+"' frameborder=no width="+width+" height="+height+" src='/common/pop_frame.asp?urlgo="+turl+"&ele_id="+pop_name+"_div' style='FILTER: alpha(opacity="+frame_alpha_s+", style="+frame_alpha_style+", finishopacity="+frame_alpha_e+")'></IFRAME>" 
} 

function custom_popup_frame_url(turl){ 
	custom_popup_frame.main.location=turl 
} 

function move_mouse(ele_id,start_x,start_y,now_x,now_y){ //¿òÁ÷ÀÓ 
	var body_left, body_top 

	oDiv = document.getElementById(ele_id) 
	body_left = parseInt(oDiv.style.left.replace('px','')) 
	body_top = parseInt(oDiv.style.top.replace('px','')) 
	oDiv.style.left = body_left+(now_x-start_x) 
	oDiv.style.top = body_top+(now_y-start_y) 
} 

var start_t, start_l, start_w, start_h //ÃÖ´ëÈ­½Ã ÀÌÀü »çÀÌÁî ±â·Ï 

function min_max(image_url){//ÃÖ´ëÈ­, ÀÌÀüÀ¸·Î 
	var arr_image_url, now_file_name, cut_url 

	arr_image_url = image_url.split("/") 
	
	now_file_name = arr_image_url[arr_image_url.length-1] 
	
	cut_url = "" 
	for(i=0;i<arr_image_url.length-1;i++){ 
		if(i!=0){ 
			cut_url = cut_url + "/" 
		} 
		cut_url = cut_url + arr_image_url[i] 
	} 
	//alert(cut_url) 
	
	oDiv = document.getElementById('custom_popup_div') 
	oDiv2 = document.getElementById('custom_popup_frame') 

	if('c_pop_2.gif'==now_file_name){ 
		start_t = parseInt(oDiv.style.top.replace('px','')) 
		start_l = parseInt(oDiv.style.left.replace('px','')) 
		start_w = parseInt(oDiv2.width.replace('px','')) 
		start_h = parseInt(oDiv2.height.replace('px','')) 
		
		
		oDiv.style.top = "0" 
		oDiv.style.left = "0" 
		oDiv.style.width = "100%" 
		oDiv.style.height = "100%" 
		
		oDiv2.width = "100%" 
		oDiv2.height = "100%" 
		
		custom_popup_frame.head.document.all.min_max.src = cut_url + "/c_pop_1.gif" 
	}else{ 

		//oDiv2.width = start_w 
		//oDiv2.height = start_h 
		
		oDiv.style.top = start_t 
		oDiv.style.left = start_l 
		oDiv.style.width = start_w 
		oDiv.style.height = start_h 
		
		custom_popup_frame.head.document.all.min_max.src = cut_url + "/c_pop_2.gif" 
	} 
} 


function close_action(){ //´Ý´Â¾×¼Ç 
	//»ç¿ë¹ý 
	//parent.parent.close_action() //ÇÁ·¹ÀÓÀ» ¶Ç¾²¸é ÀÌ°Å 
	//parent.close_action() //ÇÁ·¹ÀÓÀ» ¾È¾²¸é ÀÌ°Å 
	oDiv = document.getElementById('custom_popup_div') 
	document.body.removeChild(oDiv);//IE,FF (»èÁ¦ÇÒ °³Ã¼ÀÇ ºÎ¸ð¿¡¼­ »èÁ¦) 
	
	oDiv = document.getElementById('custom_popup_div2') 
	document.body.removeChild(oDiv);//IE,FF (»èÁ¦ÇÒ °³Ã¼ÀÇ ºÎ¸ð¿¡¼­ »èÁ¦) 
	
	//all_box.style.filter = "Alpha(Opacity=100)"; 
	//menu_box.style.filter = "Alpha(Opacity=100)"; 

} 


function getBounds(element){
	if(typeof element!='object') 
	element=document.getElementById(element); 
	var ret = new Object(); 
	
	ret.top=0;
	ret.left=0;
	ret.width=0;
	ret.height=0;


	if(document.all) { 
		var rect = element.getBoundingClientRect(); 
		ret.width = rect.right - rect.left; 
		ret.height = rect.bottom - rect.top; 
	} else { 
		if(Opera_flag||Chrome_flag||Safari_flag||Firefox_flag){
			var rect = element.getBoundingClientRect(); 
			ret.width = rect.right - rect.left; 
			ret.height = rect.bottom - rect.top; 
		}else{
			var box = document.getBoxObjectFor(element); 
			ret.width = box.width; 
			ret.height = box.height; 
		}
	}


	if(element.parentNode==null || element.style.display=='none')    { return false } 
	
	var parent=null, pos=[], box; 
	if(document.getBoxObjectFor)         
	{ 
		box = document.getBoxObjectFor(element); 
		pos = [box.x, box.y];                 
	} 
	else                             
	{ 
	  pos        = [element.offsetLeft, element.offsetTop]; 
	  parent    = element.offsetParent; 
	  if(parent!=element) 
	  { 
	    while(parent) 
	    { 
	      pos[0]    += parent.offsetLeft; 
	      pos[1]    += parent.offsetTop; 
	      parent     = parent.offsetParent; 
	    } 
	  } 
	  if(window.navigator.userAgent.indexOf('opera')!=-1 || window.navigator.userAgent.indexOf('safari')!=-1 && element.getStyle('position')=='absolute') { pos[1]    -= document.body.offsetTop } 
	} 
	parent = (element.parentNode) ? element.parentNode : null; 
	while(parent && parent.tagName!='BODY' && parent.tagName!='HTML') 
	{ 
	  pos[0]    -= parent.scrollLeft; 
	  pos[1]    -= parent.scrollTop; 
	  parent = (parent.parentNode) ? parent.parentNode : null; 
	} 
	
	ret.left = pos[0]
	ret.top = pos[1]
		
	
	return ret; 
}

function clipboard_write(temp_txt){
  window.clipboardData.setData('Text', temp_txt);
}

function code_clip(temp_txt){
  if((event.button==2) || (event.button==3)) {
    //clipboard_write(temp_txt) ¾îµå¹Î¸¸ ¿­¾î¾ß ÇÏ´Âµ¥.
  }
}
//¼ýÀÚ¸¸ ÀÔ·Â
String.prototype.isInteger = function() {
  var pattern = /^\d+$/;
  return this != "" && pattern.test(this);
}

function SetNum(object){
  if (eval("object.value")!=''){
    if (!eval("object.value.isInteger()")) {
      alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä." );//ERR

      object.value = Left(object.value,object.value.length-1);
      object.focus();
    }
  }
}
function Instr(strSearch, charSearchFor) { for (i = 0; i < strSearch.length; i++) { if (charSearchFor == strSearch.substring(i, i + 1)) { return i; } } return -1; }

function roundTable(objID) {
var obj = document.getElementById(objID);
var Parent, objTmp, Table, TBody, TR, TD;
var bdcolor, bgcolor, Space;
var trIDX, tdIDX, MAX;
var styleWidth, styleHeight;

// get parent node
Parent = obj.parentNode;
objTmp = document.createElement('SPAN');
Parent.insertBefore(objTmp, obj);
Parent.removeChild(obj);

// get attribute
bdcolor = obj.getAttribute('rborder');
bgcolor = obj.getAttribute('rbgcolor');
radius = parseInt(obj.getAttribute('radius'));
if (radius == null || radius < 1) radius = 1;
else if (radius > 6) radius = 6;

MAX = radius * 2 + 1;

/*
create table {{
*/
Table = document.createElement('TABLE');
TBody = document.createElement('TBODY');

Table.cellSpacing = 0;
Table.cellPadding = 0;

for (trIDX=0; trIDX < MAX; trIDX++) {
TR = document.createElement('TR');
Space = Math.abs(trIDX - parseInt(radius));
for (tdIDX=0; tdIDX < MAX; tdIDX++) {
TD = document.createElement('TD');

styleWidth = '1px'; styleHeight = '1px';
if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
else if (radius > 2) {
if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
}

if (styleWidth != null) TD.style.width = styleWidth;
if (styleHeight != null) TD.style.height = styleHeight;

if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
else if (tdIDX > Space && Space < MAX - tdIDX - 1) TD.style.backgroundColor = bgcolor;

if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
TR.appendChild(TD);
}
TBody.appendChild(TR);
}

/*
}}
*/

Table.appendChild(TBody);

// insert table and remove original table
Parent.insertBefore(Table, objTmp);
}


///common/common_pop/addr_search.asp
function addr_search(pop_name,post1_1,post1_2,addr1){
	open_window(pop_name,'/common/common_pop/addr_search.asp?post1_1='+post1_1+'&post1_2='+post1_2+'&addr1='+addr1,'','',400,400,2);
}
///common/common_pop/addr_search2.asp °áÁ¦
function addr_search2(pop_name,post1_1,post1_2,addr1){
	open_window(pop_name,'/common/common_pop/addr_search2.asp?post1_1='+post1_1+'&post1_2='+post1_2+'&addr1='+addr1,'','',400,400,2);
}


function check_ResidentNO(str_f_num,str_l_num){  
    var i3=0
    for (var i=0;i<str_f_num.length;i++) {
        var ch1 = str_f_num.substring(i,i+1);
            if (ch1<'0' || ch1>'9') i3=i3+1;
    }
    if ((str_f_num == '') || ( i3 != 0 )) return false;
    var i4=0;
    for (var i=0;i<str_l_num.length;i++){
        var ch1 = str_l_num.substring(i,i+1);
        if (ch1<'0' || ch1>'9') i4=i4+1; 
    }
    if ((str_l_num == '') || ( i4 != 0 )) return false;
    if(str_f_num.substring(0,1) < 4) return false;
    if(str_l_num.substring(0,1) > 2) return false;
    if((str_f_num.length > 7) || (str_l_num.length > 8)) return false;
    if ((str_f_num == '72') || ( str_l_num == '18'))  return false;

    var f1=str_f_num.substring(0,1)
    var f2=str_f_num.substring(1,2)
    var f3=str_f_num.substring(2,3)
    var f4=str_f_num.substring(3,4)
    var f5=str_f_num.substring(4,5)
    var f6=str_f_num.substring(5,6)
    var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
    var l1=str_l_num.substring(0,1)
    var l2=str_l_num.substring(1,2)
    var l3=str_l_num.substring(2,3)
    var l4=str_l_num.substring(3,4)
    var l5=str_l_num.substring(4,5)
    var l6=str_l_num.substring(5,6)
    var l7=str_l_num.substring(6,7)
    hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
    hap=hap%11
    hap=11-hap
    hap=hap%10
    if (hap != l7) return false;
    return true; 
}

function containsChars(str) {
  var chars = "`~!@#$%^&*()+={}|[]\;':\",./<>?\\";
  for (var inx = 0; inx < str.length; inx++) {
    if(chars.indexOf(str.charAt(inx)) != -1){
      return true;
    }
  }
  return false;
}

function chkChars(obj){
  if(containsChars(obj.value)){
    alert("Æ¯¼ö¹®ÀÚ¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
    obj.value = Left(obj.value,obj.value.length-1);
    obj.focus();
  }
}
function com_board_view(draw_id,sURL){
	
	form_submit_para('form0','T','/'+mfolder+'/'+sURL+'_2.asp','_self','post','draw_id='+draw_id)
}

function fn_event(draw_id){
	draw_id   = undefined_del(arguments[0])
	
	
	switch(draw_id){
	  case '87':
			open_window("event_pop"+draw_id, "/"+mfolder+"/event/event87.asp", '0', '0', 425, 595, 0)
	  break;
	  case 'c':
	  
	  break;
	  case 's':
	
	  break;
	}
}

function all_check(FrmName,check_box_name,check_y_n){
  var form = eval("document." + FrmName);
	if(eval("document."+FrmName+"."+check_box_name+".length")==undefined){
		eval("document."+FrmName+"."+check_box_name+".checked = "+check_y_n)
	}else{
  	for(i=0;i<eval("document."+FrmName+"."+check_box_name+".length");i++){
	    eval("document."+FrmName+"."+check_box_name+"["+i+"].checked = "+check_y_n);
	  }
	}
}

function ExternalWrite(strTag)
{
var strHTML=strTag; 
document.write(strHTML); 
}

function fn_download(request_type,draw_id){
	form_submit_para('form0','T','/common/download.asp','_self','post','type='+request_type+'|draw_id='+draw_id);
}
function fn_lic_download(request_type,draw_id){
	form_submit_para('form0','T','/common/lic_download.asp','_self','post','type='+request_type+'|draw_id='+draw_id);
}

function FlashObject(swf, width, height, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';        
        strFlashTag += '<param name="FlashVars" value="' + flashvars + '"/>';
        strFlashTag += '<param name="quality" value="best"/>';
        //strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        //strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'menu="false" ';
        strFlashTag += 'scale="noscale" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="always" ';
        strFlashTag += 'flashvars="' + flashvars + '" ';
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }
	//alert(strFlashTag)
 	document.write(strFlashTag);
}


function FlashObject2(swf, width, height, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';        
        strFlashTag += '<param name="FlashVars" value="' + flashvars + '"/>';
        strFlashTag += '<param name="quality" value="best"/>';
        //strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        //strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        //strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'menu="false" ';
        //strFlashTag += 'scale="noscale" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="always" ';
        strFlashTag += 'flashvars="' + flashvars + '" ';
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }
	//alert(strFlashTag)
 	document.write(strFlashTag);
}


function fn_logout(){
	form_submit_para('form0','T','/common/logout_ok.asp','_self','post','roolback_url=/'+mfolder+'/n0101.asp');
}

//°­ÀÇ»ó¼¼º¸±â-ÅÇÀÌµ¿ ½ºÅÍµð»ç¶÷ÀÎ Ã¹Àû¿ë
function fn_tab_lecture_action(tab_num){
	var temp_obj_tab1, temp_obj_tab2, now_tab_top, now_wraf_height
	
	temp_obj_tab    = getBounds("wrap")
	now_wraf_height = temp_obj_tab.height 
	temp_obj_tab    = getBounds("tab_lucture_"+tab_num)
	now_tab_top     = temp_obj_tab.top 

	scroll(0,now_tab_top-100)
}

function FormatNumber(num){

 fl=""
 if(isNaN(num)) { alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");return 0}
 if(num==0) return num
 
 if(num<0){ 
  num=num*(-1)
  fl="-"
 }else{
  num=num*1 
 }
 num = new String(num)
 temp=""
 co=3
 num_len=num.length
 while (num_len>0){
  num_len=num_len-co
  if(num_len<0){co=num_len+co;num_len=0}
   temp=","+num.substr(num_len,co)+temp
 }
 return fl+temp.substr(1)
}


function fn_radio_value(obj){
	var obj_len,obj_value
	obj_len = obj.length
	obj_value = ''
	
	if(obj_len == undefined){
		if(obj.checked==true){
			obj_value = obj.value
		}else{
			obj_value = obj.value
		}
	}else{
		for(i=0;i<obj_len;i++){
			if(obj[i].checked==true){
				obj_value = obj[i].value
			}
		}
	}
	
	return obj_value
}

function fn_select_value(obj){
	var obj_len,obj_value
	obj_len = obj.length
	obj_value = ''
	
	if(obj_len == undefined){
	  
		if(obj.options.selected==true){
			obj_value = obj.options.value
		}else{
			obj_value = ''
		}
	}else{
		for(i=0;i<obj_len;i++){
			if(obj.options[i].selected==true){
				obj_value = obj.options[i].value
			}
		}
	}
	
	return obj_value
}

function byteCheck(code){
 var code_byte = 0;
    for (var inx = 0; inx < code.value.length; inx++) {
        var oneChar = escape(code.value.charAt(inx));
        if ( oneChar.length == 1 ) {
            code_byte ++;
        } else if (oneChar.indexOf("%u") != -1) {
            code_byte += 2;
        } else if (oneChar.indexOf("%") != -1) {
            code_byte += oneChar.length/3;
        }
    }
    return code_byte;
}


String.prototype.trim = function () {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}


function fn_com_left_menu_over(obj){
  var ret,subbox_obj
  ret = getBounds(obj)
  //alert(ret.top)
  //alert(ret.left)
  subbox_obj = document.getElementById("div_left_lv_3_"+obj.id)
  if(subbox_obj!=null){
    subbox_obj.style.left = (ret.left+190) + 'px'
    subbox_obj.style.top = (ret.top-3) + 'px'
    subbox_obj.className = 'left_lv_3_box_on'
  }
}

function fn_com_left_menu_out(obj){

  subbox_obj = document.getElementById("div_left_lv_3_"+obj.id)
  if(subbox_obj!=null){
    subbox_obj.className = 'left_lv_3_box'
  }
}

