<!--

	var topGap =0;
	var leftGap =0;
	var mouseDown = false;
	var box;
	var control = false;

	var boxOpa, backBoxOpa = 0; //박스 투명도

	 //숫자 검사
 function test_number(str)
 {
	if(!/^[0-9]+$/.test(str))
		return false;
	return true;
 }
	function getBoxLocation(boxName){
		mouseDown = true;
		box = document.getElementById(boxName);
		topGap=box.style.top.replace("px","")-window.event.clientY;
		leftGap=box.style.left.replace("px","")-window.event.clientX;
		window.event.returnValue=false;
//		window.event.cancelBubble=true;
		
	}

	function setBoxLocation(){
		if (	mouseDown){
	
			box.style.top=window.event.clientY+topGap+"px";

			box.style.left=window.event.clientX+leftGap+"px";
		}
		//window.event.returnValue=false;

	}

	function showBox(boxName, isLocation){
		box = document.getElementById(boxName);
		boxOpa=0;
		box.filters.alpha.opacity=boxOpa;
		box.style.display='';
		if(isLocation!=true){
			box.style.top=document.body.clientHeight/2-box.clientHeight/2-50;
			box.style.left=document.body.clientWidth/2-box.clientWidth/2;
		}
		
		setTimeout("showBoxSub()",10) ;
	}

	function showDefaultBox(width,height,subject,src){
		showBackBox();
		box = document.getElementById("defaultBox");	
		subjectTd = document.getElementById("defaultBoxTitle");	
		content = document.getElementById("defaultBoxContent");	
		//제목쓰기
		subjectTd.innerHTML='<b>'+subject+'</b>';
		//보이고 크기 조정
		box.style.display='';
		box.style.width=width+'px';
		content.style.height=height+'px';
		content.innerHTML="<center><img src='/image/loader.gif'></center>";
		iframe.location=src;
		//위치 설정
		box.style.top='90';
		box.style.left=document.body.clientWidth/2-box.clientWidth/2;

	}


	function showBoxSub(){
	//	boxOpa+=20;
		box.filters.alpha.opacity=100;//boxOpa;
	//	if (boxOpa<100)
	//		setTimeout("showBoxSub()",10) ;
	 }

	function closeBox(boxName){
		closeBackBox();
		box = document.getElementById(boxName);
		box.style.display='none';
	}

	function showBackBox(){
		document.getElementById("backBoxTable").height=document.getElementById("page").offsetHeight+20;
		backBoxOpa=0;
		document.getElementById("backBox").filters.alpha.opacity=backBoxOpa;
		document.getElementById("backBox").style.display='';
		
		setTimeout("showBackBoxSub()",10) ;
	 }

	 function showBackBoxSub(){
		backBoxOpa+=10;
		document.getElementById("backBox").filters.alpha.opacity=backBoxOpa;
		if (backBoxOpa<45)
			setTimeout("showBackBoxSub()",10) ;
	 }

	 function closeBackBox(){
		document.getElementById("backBox").style.display='none';
	 }


	//-- 문서내 모든 링크에 blur 걸어 주기
	function allblur() {
	  for (i = 0; i < document.links.length; i++) {
		var obj = document.links[i];
		if(obj.addEventListener) obj.addEventListener("focus", oneblur, false);
		else if(obj.attachEvent) obj.attachEvent("onfocus", oneblur);
	  }
	}	 

	function oneblur(e) {
	  var evt = e ? e : window.event;
	  if(evt.target) evt.target.blur();
	  else if(evt.srcElement) evt.srcElement.blur();
	}
	//-----------------------------------

	//--버튼 만들기 (모든 해당 클래스에 이벤트 주기)
	function makeButton(className){
		var obj = document.all;
		for (i=0; i<obj.length; i++) {		
			if(obj(i).className==className){
				obj(i).onmousedown=function(){
					changeClassName(className+'_s');
				}
				obj(i).onmouseout=function(){
					changeClassName(className);
				}
				obj(i).onmouseup=function(){
					changeClassName(className);
				}
		
			}
		}
	}

	//--지금 선택된 엘리먼트 클래스 이름 바꾸기
	function changeClassName(className){
		var evt = window.event;
	  if(evt.target) evt.target.className=className;
	  else if(evt.srcElement) evt.srcElement.className=className;
	}

	function load(){
		allblur(); 
		makeButton('nomalbutton');
	}

	function openImgWindow (filename)
	{
		newImage=new Image();
		newImage.src=filename;
		

		if (newImage.width>900)
			winWidth=900;
		else
			winWidth=newImage.width+17;

		if (newImage.height>600)
			winHeight=600;
		else
			winHeight=newImage.height;

		win=window.open("","이미지뷰어","scrollbars=yes,resizable=yes,status=yes,top=100,left=100,width="+winWidth+",height="+winHeight);
		win.document.write("<body leftmargin='0' marginwidth='0' topmargin='0' marginheight='0'><img src='"+filename+"'></body>");
		win.focus();

	}

	 function startVocaViewer(selectFolderId) {
		window.open("/vocabook/vocaViewer.php?selectFolderId="+selectFolderId,"보카뷰어"+selectFolderId,"left=100, top=100, width=205, height=95,scrollbars=no");
	 }



 	function jSetCookie(cookieName,cookieValue,expireDays,domainName) {
		var domainString = (domainName==null||domainName=="") ? "" : " domain="+domainName+";";
		var expire = new Date();
		expire.setDate(expire.getDate() + expireDays);
		expire = expire.toGMTString();
		document.cookie=cookieName+"="+escape(cookieValue)+"; path=/;"+domainString+" expires="+expire;
	}

	function jGetCookie(cookieName) {
		var cookieList = document.cookie.split(";");
		var cookieValue = "";
		for (i = 0; i < cookieList.length; i++) {
			if (cookieList[i].indexOf(cookieName+"=") > -1) {
				if (cookieList[i].split("=")[0].replace(/\s/g,"") == cookieName) {
					cookieValue = unescape(cookieList[i].split("=")[1]);
					break;
				}
			}
		}
		return cookieValue;
	}

	function replace(str,s,d){
	 var i=0;
	 while(str.indexOf(s) > -1){
	  i = str.indexOf(s);
	  str=str.replace(s,d);	  
	 }
	 return str;
	}
//숫자 금액 포멧으로 바꿔주는 함수
 function formatPrice( num ){
 var len,point,str;		
 num = num+"";
 point = num.length%3
 len = num.length;

 str = num.substring(0,point);
 while( point < len){
  if( str != "" ) str += ",";
  str += num.substring( point , point+3);
  point +=3;
 }
 return str;
}

//------------게시판 관련 js

	function startNewWord(){
	  var f = document.vocaForm;
	  f.word.value="";
	  f.mean.value="";
	  f.type.value="insert";
	  document.getElementById('barTitle').innerHTML="새 단어 등록";
		document.getElementById('insertButton').style.display="";
		document.getElementById('updateButton').style.display="none";
	// showBackBox();
	 showBox("wordBox");
	 setTimeout("document.vocaForm.word.focus()",100) ;
	 
	}
	function closeWordBox(){
	 var f = document.vocaForm;
	 
	 if(f.iscontinue.value=="true")
	    document.location.reload();

	 closeBox('wordBox');	
	 closeBackBox();
	}


	function wordConfirm(iscontinue){
	  var f = document.vocaForm;
	  if (f.word.value==""){
		alert("단어를 입력해주세요");
		return;
	  }
	  if (f.mean.value==""){
		alert("뜻을 입력해주세요");
		return;
	  }
	  f.iscontinue.value=iscontinue;
	  closeBox('wordBox');	
	  f.submit();
	}

	 function vocaEdit(id, voca, mean){
		var f = document.vocaForm;
		f.word.value=voca;
		f.id.value=id;
		f.mean.value=replace(mean,"<br />","\n");
		f.type.value='edit';
		document.getElementById('barTitle').innerHTML="단어 수정";
		document.getElementById('insertButton').style.display="none";
		document.getElementById('updateButton').style.display="";
		showBackBox();
		showBox("wordBox");
		setTimeout("document.vocaForm.word.focus()",100) ;
	 }

	 function vocaDelete(id){

	 if (confirm("정말로 지우시겠습니까?")) {
		var f=document.vocaForm;
		f.id.value=id;
		f.type.value="del";
		f.submit();
				
	}
 }

	function saveOption(){
		var f=document.frmAutoOption;

		if(!test_number(f.default_term.value)){
			alert("단어반복속도는 숫자만 입력가능 합니다");
			f.default_term.focus();
			return;
		}
		if(parseInt(f.default_term.value)>60){
			alert("단어반복속도는 60초까지 입력가능 합니다");
			f.default_term.focus();
			return;
		}
		if(f.hidetype_rdo[0].checked==true)
			f.default_hide.value="A";
		else if (f.hidetype_rdo[1].checked==true)
			f.default_hide.value="B";
		else if (f.hidetype_rdo[2].checked==true)
			f.default_hide.value="C";
		else if (f.hidetype_rdo[3].checked==true)
			f.default_hide.value="D";

		if(f.alwaystop_rdo[0].checked==true)
			f.default_top.value="Y";
		else if (f.alwaystop_rdo[1].checked==true)
			f.default_top.value="N";

		f.submit();
		closeBox('defaultBox');

	}
	
	function memberLogin(){
		var f = document.loginForm;
		if(f.login_id.value==""){
			alert("아이디를 입력해 주세요.");
			return;
		}
		
		if(f.password.value==""){
			alert("비밀번호를 입력해 주세요.");
			return;
		}
		if(f.saveidck.checked==true){
			f.saveid.value="Y";
		}else{
			f.saveid.value="N";
		}
		f.submit();
	}

	function autovoca_main(){
		document.getElementById("process").contentWindow.location.href="/myvoca/autovoca_start.php?type=previous";
	}
	
	function autovoca_sample()
	{
		window.open("/myvoca/autovoca_sample.php","오토보카","left=100,top=100,width=300,height=150,scrollbars=no,resizable=yes");
	}

//-->