﻿function moveUrl(url)
{		
		this.location.href = url;
}
	function moveDel(url){

		ans = confirm("삭제 하시겠습니까?")
		if(ans == true){
			this.location.href = url;
		}else{	
			//return false;
		}

	}
function fc_chk_byte(aro_name,ari_max)

{

	var ls_str     = aro_name.value; // 이벤트가 일어난 컨트롤의 value 값

	var li_str_len = ls_str.length;  // 전체길이



	// 변수초기화

	var li_max      = ari_max; // 제한할 글자수 크기

	var i           = 0;  // for문에 사용

	var li_byte     = 0;  // 한글일경우는 2 그밗에는 1을 더함

	var li_len      = 0;  // substring하기 위해서 사용

	var ls_one_char = ""; // 한글자씩 검사한다

	var ls_str2     = ""; // 글자수를 초과하면 제한할수 글자전까지만 보여준다.



	for(i=0; i< li_str_len; i++){

		// 한글자추출

		ls_one_char = ls_str.charAt(i);



		// 한글이면 2를 더한다.

		if (escape(ls_one_char).length > 4)

			li_byte += 2;

		else

			li_byte++;



		// 전체 크기가 li_max를 넘지않으면

		if(li_byte <= li_max)

		li_len = i + 1;

	}



	// 전체길이를 초과하면

	if(li_byte > li_max){

		alert( li_max + " 글자를 초과 입력할수 없습니다. \n초과된 내용은 자동으로 삭제 됩니다. ");

		ls_str2 = ls_str.substr(0, li_len);

		aro_name.value = ls_str2;

	}



	aro_name.focus();   

}

    function openCalendar(reform)
	{
		var popwin = window.open("/control?act=commcalendar&reform="+reform, "calendar" , "toolbar=no , directories=no, status=no resizable=no, width=235, height=225 scrollbars=no");
		try{
			popwin.focus();
		}
		catch(e)	{}
	}


function namosw_goto_byselect(sel, targetstr)
{
  var index = sel.selectedIndex;
  if (sel.options[index].value != '') {
     if (targetstr == 'blank') {
       window.open(sel.options[index].value, 'win1');
     } else {
       var frameobj;
       if (targetstr == '') targetstr = 'self';
       if ((frameobj = eval(targetstr)) != null)
         frameobj.location = sel.options[index].value;
     }
  }
}



     function insertTitle(strText)
	{
	  var newObj=document.createTextNode(strText);
	  var replaceObj=spanObj.childNodes(0);
	  replaceObj.replaceNode(newObj);
	}

     function insertParentTitle(strText)
	{
	  var newObj=document.createTextNode(strText);
	  var replaceObj=parent.document.spanObj2.childNodes(0);
	  replaceObj.replaceNode(newObj);
	}

     function resetReLoad()
	{
	  this.window.location.reload();
	  
	}

    function openMailSend()
	{
		
		var popwin = window.open("/navigator?act=commmailsend", "openMailSend" , "toolbar=no , directories=no, status=no, resizable=yes, width=530, height=460, scrollbars=yes");
		try{
			popwin.focus();
		}
		catch(e)	{}
	}
/*
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //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 MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
/*
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	*/
	function addOnLoad(func) {
		var oldOnload = window.onload;
		if(typeof(oldOnload) == 'function') {
			window.onload = function() {
				oldOnload();
				func();
			}
		} else {
			window.onload = func;
		}
	}
