<!--
 function trim(str){
   str = str.replace(/^\s*/,'').replace(/\s*$/, ''); 
   return str;
 } 
 
function CheckSpace(str) {
	if ( str.search(/\s/) != -1 ) {
		return 1;
	} else {
		return "";
	}
}
function onlyNumber() {
        if((event.keyCode<48)||(event.keyCode>57))
            event.returnValue=false;
}

function isNull( text )  
{  
 if( text == null ) return true;  

 var result = text.replace(/(^\s*)|(\s*$)/g, "");  

 if( result )  
  return false;  
 else  
  return true;  
}


function key(obj, next, n) {
	if(obj.value.length == n) {
		next.focus();
	}
}


//ÁÖ¹Î¹øÈ£Ã¼Å©
function CheckJuminNo(JUMIN_NOM1, JUMIN_NOM2) {
	var check = true;

	var str_serial1 = JUMIN_NOM1;
	var str_serial2 = JUMIN_NOM2;

	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 ) ) {
		check= 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 ) ) {
		check= false ;
	 }

	if ( str_serial1.substring(2,3) > 1 ) {
		check= false ;
	}

	if ( str_serial1.substring(4,5) > 3 ) {
		check= false ;
	}

	if ( str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0 ) {
		check= 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 ) {
			check= false ;
	}

	return check;
}


function passwordChk(str){
	res1 = (/[a-z]/i).test(str);
	res2 = (/[0-9]/).test(str);
	res3 = (/^[0-9a-z_]*$/i).test(str);
	
	return res1 && res2 && res3;
}


function logout(){
	location.href = "/member/member_logic.jsp?mode=logout";
}
/* --- ¼ýÀÚ¸¸ ÀÔ·Â °¡´É (onKeyDown ÀÌº¥Æ®) --- */
function onlyNumberInput(){
 var code = window.event.keyCode;

 if ((code > 34 && code < 41) || (code > 47 && code < 58) || (code > 95 && code < 106) || code == 8 || code == 9 || code == 13 || code == 46)
 {
  window.event.returnValue = true;
  return;
 }
 window.event.returnValue = false;
}

/* --- ¼ýÀÚ¸¸ ÀÔ·Â °¡´É (onKeyDown ÀÌº¥Æ®) --- */
function onlyNumberInput2(){
 var code = window.event.keyCode;

 if ((code > 34 && code < 41) || (code > 47 && code < 58) || (code > 95 && code < 106) || code == 8 || code == 9 || code == 13 || code == 46 || code == 190 || code == 110)
 {
  window.event.returnValue = true;
  return;
 }
 window.event.returnValue = false;
}

function openwin(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  
}

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_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_swapImgRestore2() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) {alert(x.oSrc);x.src=x.oSrc;}
}

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 MM_swapImage2() { //v3.0
  var i,j=0,x,a=MM_swapImage2.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;  x.oSrc=x.src; x.src=a[i+2];}
}


function viewObj(ftype, width, height, src)
{
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + width + "\" height=\"" + height + "\">"); 
	document.write("<param name=\"movie\" value=\"" + src + "\">"); 
	document.write("<param name=\"quality\" value=\"high\" />");     
	document.write("<param name=\"wmode\" value=\"transparent\">"); 
	document.write("<param name=\"AllowScriptAccess\" value=\"always\">");
	document.write("<embed src=\"" + src + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\"  height=\"" + height + "\">"); 
	document.write("</object>");
} 


function imgChg(str){
	document.all.main_img.src = "/product/bookimg/"+str;
}


function chgtext(str){
	divnone();
	tabChg(str);
	if(str == 'm011'){
		document.all.d_intro.style.display = '';
		document.all.m011.src = "/images/sub/learning_m01ov.gif";
		MM_swapImage2('m011','','/images/sub/learning_m01ov.gif',1);
	}else if(str == 'm022'){
		document.all.d_special.style.display = '';
		document.all.m022.src = "/images/sub/learning_m02ov.gif";
		MM_swapImage2('m022','','/images/sub/learning_m02ov.gif',1);
	}else if(str == 'm033'){
		document.all.d_format2.style.display = '';
		document.all.m033.src = "/images/sub/learning_m03ov.gif";
		MM_swapImage2('m033','','/images/sub/learning_m03ov.gif',1);
	}else if(str == 'm044'){
		document.all.d_curriculum.style.display = '';
		document.all.m044.src = "/images/sub/learning_m04ov.gif";
		MM_swapImage2('m044','','/images/sub/learning_m04ov.gif',1);
	}else if(str == 'm055'){
		document.all.d_content.style.display = '';
		document.all.m055.src = "/images/sub/learning_m05ov.gif";
		MM_swapImage2('m055','','/images/sub/learning_m05ov.gif',1);
	}else if(str == 'm066'){
		document.all.d_levelformat.style.display = '';
		document.all.m066.src = "/images/sub/learning_m06ov.gif";
		MM_swapImage2('m066','','/images/sub/learning_m06ov.gif',1);
	}else if(str == 'm077'){
		document.all.d_list.style.display = '';
		document.all.m077.src = "/images/sub/learning_m07ov.gif";
		MM_swapImage2('m077','','/images/sub/learning_m07ov.gif',1);
	}else if(str == 'm088'){
		document.all.d_connection.style.display = '';
		document.all.m088.src = "/images/sub/learning_m08ov.gif";
		MM_swapImage2('m088','','/images/sub/learning_m08ov.gif',1);
	}
}




function tabChg(str){
	if(document.all.m011 != null && str != "m011"){
		document.all.m011.src = "/images/sub/learning_m01.gif";
	}
	if(document.all.m022 != null && str != "m022"){
		document.all.m022.src = "/images/sub/learning_m02.gif";
	}
	if(document.all.m033 != null && str != "m033"){
		document.all.m033.src = "/images/sub/learning_m03.gif";
	}
	if(document.all.m044 != null && str != "m044"){
		document.all.m044.src = "/images/sub/learning_m04.gif";
	}
	if(document.all.m055 != null && str != "m055"){
		document.all.m055.src = "/images/sub/learning_m05.gif";
	}
	if(document.all.m066 != null && str != "m066"){
		document.all.m066.src = "/images/sub/learning_m06.gif";
	}
	if(document.all.m077 != null && str != "m077"){
		document.all.m077.src = "/images/sub/learning_m07.gif";
	}
	if(document.all.m088 != null && str != "m088"){
		document.all.m088.src = "/images/sub/learning_m08.gif";
	}
}

function chgtext2(str){
	divnone();
	tabChg(str);
	if(str == 'm011'){
		document.all.d_intro.style.display = '';
		document.all.m011.src = "/images/sub/complete_m01ov.gif";
		MM_swapImage2('m011','','/images/sub/complete_m01ov.gif',1);
	}else if(str == 'm022'){
		document.all.d_special.style.display = '';
		document.all.m022.src = "/images/sub/complete_m02ov.gif";
		MM_swapImage2('m022','','/images/sub/complete_m02ov.gif',1);
	}else if(str == 'm033'){
		document.all.d_format2.style.display = '';
		document.all.m033.src = "/images/sub/complete_m03ov.gif";
		MM_swapImage2('m033','','/images/sub/complete_m03ov.gif',1);
	}else if(str == 'm044'){
		document.all.d_curriculum.style.display = '';
		document.all.m044.src = "/images/sub/complete_m04ov.gif";
		MM_swapImage2('m044','','/images/sub/complete_m04ov.gif',1);
	}else if(str == 'm055'){
		document.all.d_content.style.display = '';
		document.all.m055.src = "/images/sub/complete_m05ov.gif";
		MM_swapImage2('m055','','/images/sub/complete_m05ov.gif',1);
	}else if(str == 'm066'){
		document.all.d_levelformat.style.display = '';
		document.all.m066.src = "/images/sub/complete_m06ov.gif";
		MM_swapImage2('m066','','/images/sub/complete_m06ov.gif',1);
	}else if(str == 'm077'){
		document.all.d_list.style.display = '';
		document.all.m077.src = "/images/sub/complete_m07ov.gif";
		MM_swapImage2('m077','','/images/sub/complete_m07ov.gif',1);
	}else if(str == 'm088'){
		document.all.d_connection.style.display = '';
		document.all.m088.src = "/images/sub/complete_m08ov.gif";
		MM_swapImage2('m088','','/images/sub/complete_m08ov.gif',1);
	}
}

function chgtext3(str){
	divnone();
	tabChg(str);
	if(str == 'm011'){
		document.all.d_intro.style.display = '';
		document.all.m011.src = "/images/sub/dictionary_m01ov.gif";
		MM_swapImage2('m011','','/images/sub/dictionary_m01ov.gif',1);
	}else if(str == 'm022'){
		document.all.d_special.style.display = '';
		document.all.m022.src = "/images/sub/dictionary_m02ov.gif";
		MM_swapImage2('m022','','/images/sub/dictionary_m02ov.gif',1);
	}else if(str == 'm033'){
		document.all.d_format2.style.display = '';
		document.all.m033.src = "/images/sub/dictionary_m03ov.gif";
		MM_swapImage2('m033','','/images/sub/dictionary_m03ov.gif',1);
	}else if(str == 'm044'){
		document.all.d_curriculum.style.display = '';
		document.all.m044.src = "/images/sub/dictionary_m04ov.gif";
		MM_swapImage2('m044','','/images/sub/dictionary_m04ov.gif',1);
	}else if(str == 'm055'){
		document.all.d_content.style.display = '';
		document.all.m055.src = "/images/sub/dictionary_m05ov.gif";
		MM_swapImage2('m055','','/images/sub/dictionary_m05ov.gif',1);
	}else if(str == 'm066'){
		document.all.d_levelformat.style.display = '';
		document.all.m066.src = "/images/sub/dictionary_m06ov.gif";
		MM_swapImage2('m066','','/images/sub/dictionary_m06ov.gif',1);
	}else if(str == 'm077'){
		document.all.d_list.style.display = '';
		document.all.m077.src = "/images/sub/dictionary_m07ov.gif";
		MM_swapImage2('m077','','/images/sub/dictionary_m07ov.gif',1);
	}else if(str == 'm088'){
		document.all.d_connection.style.display = '';
		document.all.m088.src = "/images/sub/dictionary_m08ov.gif";
		MM_swapImage2('m088','','/images/sub/dictionary_m08ov.gif',1);
	}
}


function divnone(){
	if(document.all.d_intro != null){
		document.all.d_intro.style.display = 'none';
	}
	if(document.all.d_special != null){
		document.all.d_special.style.display = 'none';
	}
	if(document.all.d_format2 != null){
		document.all.d_format2.style.display = 'none';
	}
	if(document.all.d_curriculum != null){
		document.all.d_curriculum.style.display = 'none';
	}
	if(document.all.d_content != null){
		document.all.d_content.style.display = 'none';
	}
	if(document.all.d_levelformat != null){
		document.all.d_levelformat.style.display = 'none';
	}
	if(document.all.d_list != null){
		document.all.d_list.style.display = 'none';
	}
	if(document.all.d_connection != null){
		document.all.d_connection.style.display = 'none';
	}
}




/*
 *
 * String src : ÇÃ·¡½¬ ÁÖ¼Ò [ÇÊ¼ö]
 * int w : ÇÃ·¡½¬ Æø [ÇÊ¼ö]
 * int h : ÇÃ·¡½¬ ³ôÀÌ [ÇÊ¼ö]
 * wmode : [¼±ÅÃ]
 * menu : [¼±ÅÃ]
 */
function writeFlash(src,width,height,wmode,menu) {
  html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
  html = html + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ width + '" height="' + height + '">';
  html = html + '<param name="movie" value="' + src + '">';
  if(wmode != null) {html = html + '<param name="wmode" value="' + wmode + '">';  }
  if(menu != null) {  html = html + '<param name="menu" value="' + menu+ '">';  }
  html = html + '<param name="quality" value="high">';
  html = html + '<embed src="' + src + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>';
  html = html + '</object>';

  document.write(html);
}

function menuOnClick(arg0, arg1) {
    if (arg0 == "0" && arg1 == "1") {
        location.href = "/gnuboard4.utf8/bbs/login.php";
    } else if (arg0 == "0" && arg1 == "2") {
        location.href = "/gnuboard4.utf8/bbs/register.php";
    } else if (arg0 == "0" && arg1 == "3") {
        location.href = "/php/info/personal.php";
    } else if (arg0 == "0" && arg1 == "4") {
        location.href = "/php/info/email.php";
    } else if (arg0 == "0" && arg1 == "5") {
        location.href = "/php/info/sitemap.php";
    } else if (arg0 == "1" && arg1 == "1") {
        location.href = "/php/about/about01.php";
    } else if (arg0 == "1" && arg1 == "2") {
        location.href = "/php/about/about02.php";
    } else if (arg0 == "1" && arg1 == "3") {
        location.href = "/php/about/about03.php";
    } else if (arg0 == "2" && arg1 == "1") {
        location.href = "/php/vision/vision01.php";
    } else if (arg0 == "2" && arg1 == "2") {
        location.href = "/php/vision/vision02.php";
    } else if (arg0 == "2" && arg1 == "3") {
        location.href = "/php/vision/vision03.php";
    } else if (arg0 == "3" && arg1 == "1") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=2";
    } else if (arg0 == "3" && arg1 == "2") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=3";
    } else if (arg0 == "3" && arg1 == "3") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=4";
    } else if (arg0 == "3" && arg1 == "4") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=5";
    } else if (arg0 == "3" && arg1 == "5") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=6";
    } else if (arg0 == "3" && arg1 == "6") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=7";
    } else if (arg0 == "3" && arg1 == "7") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=8";
    } else if (arg0 == "4" && arg1 == "1") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=9";
    } else if (arg0 == "4" && arg1 == "2") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=10";
    } else if (arg0 == "5" && arg1 == "1") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=11";
    } else if (arg0 == "5" && arg1 == "2") {
        location.href = "/gnuboard4.utf8/bbs/board.php?bo_table=12";
    } else {
        location.href = "/";
    }

    return false;
}
