// Flash Embed ½ºÅ©¸³Æ® -- »ç¿ë¿¹ : <script>embed_flash("/images/flash/a.swf", 100, 50) 
function swf(src, w, h) {
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}




// movie embed ½ºÅ©¸³Æ®
/*-------------------------------------------------------
 * ÀÏ¹Ý asf, wmv ÆÄÀÏ Ãâ·Â
--------------------------------------------------------*/
function vod_play(play_url, width, height) {

    var width_val = 320;
    var height_val = 310;
    if(width) width_val = width;
    if(height) height_val = height;
	str = "<object id=\"vodPlay\" width="+width_val+" height="+height_val+" viewastext style=\"z-index:1\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" standby=\"Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\">"
        + "<param name=\"URL\" value=\""+play_url+"\">"
        + "<param name=\"ANIMATIONATSTART\" value=\"0\">"
        + "<param name=\"AUTOSTART\" value=\"1\">"
        + "<param name=\"BALANCE\" value=\"0\">"
        + "<param name=\"CURRENTMARKER\" value=\"0\">"
        + "<param name=\"CURRENTPOSITION\" value=\"0\">"
        + "<param name=\"DISPLAYMODE\" value=\"4\">"
        + "<param name=\"ENABLECONTEXTMENU\" value=\"0\">"
        + "<param name=\"ENABLED\" value=\"1\">"
        + "<param name=\"FULLSCREEN\" value=\"0\">"
        + "<param name=\"INVOKEURLS\" value=\"-1\">"
        + "<param name=\"PLAYCOUNT\" value=\"1\">"
        + "<param name=\"RATE\" value=\"1\">"
        + "<param name=\"SHOWCONTROLS\" value=\"0\">"
        + "<param name=\"SHOWSTATUSBAR\" value=\"0\">"
        + "<param name=\"STRETCHTOFIT\" value=\"1\">"
        + "<param name=\"TRANSPARENTATSTART\" value=\"1\">"
        + "<param name=\"UIMODE\" value=\"FULL\">"
        + "<embed width=0 height=0 type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/download/default.asp' AutoStart='1' ShowControls='0' ShowStatusBar='0' ShowDisplay='1' ShowTracker='0' src='"+play_url+"'></embed>"

        + "</object>"

	document.write(str);
}


// board Ãâ·Â.
function board_show_init(no) {
	if (no == 1) document.getElementById("Layer1").style.visibility = "visible";
	else         document.getElementById("Layer1").style.visibility = "hidden";
}


// Input Date 
function inputDate(formname,opt1,opt2)
{
	today=new Date();
	now_year=today.getYear();
	now_month=today.getMonth()+1;
	now_day=today.getDate();

	month_temp=now_month-1;
	switch(month_temp)
	{
		case(1): day_temp=31; break;
		case(2): day_temp=28; break;
		case(3): day_temp=31; break;
		case(4): day_temp=30; break;
		case(5): day_temp=31; break;
		case(6): day_temp=30; break;
		case(7): day_temp=31; break;
		case(8): day_temp=31; break;
		case(9): day_temp=30; break;
		case(10): day_temp=31; break;
		case(11): day_temp=30; break;
		case(12): day_temp=31; break;
		default: day_temp=31; break;
	}

		the_day=now_day;
		the_month=now_month;
		the_year=now_year;

	if(opt1=='d')
	{
		opt_day=now_day-opt2;
		if(opt_day>0)
		{
			the_day=opt_day;
		}
		else
		{
			opt_month=now_month-1;
			the_day=day_temp+opt_day;
			if(opt_month>0)
			{
				the_month=opt_month;
			}
			else
			{
				the_year=now_year-1;
				the_month=12;
			}
		}
	}
	else if(opt1=='m')
	{
		opt_month=now_month-opt2;
		if(opt_month>0)
		{
			the_month=opt_month;
		}
		else
		{
			the_year=now_year-1;
			the_month=12+opt_month;
		}
	}
	else if(opt1=='y')
	{
		the_year=now_year-opt2;
	}

	if(the_month<10)
	{
		the_month='0'+the_month;
	}
	if(the_day<10)
	{
		the_day='0'+the_day;
	}
	the_date=the_year+'-'+the_month+'-'+the_day;
	formname.date_start.value=the_date;

	if(now_month<10)
	{
		now_month='0'+now_month;
	}
	if(now_day<10)
	{
		now_day='0'+now_day;
	}
	now_date=now_year+'-'+now_month+'-'+now_day;
	formname.date_end.value=now_date;
	
	if(opt1=='w')
	{
		formname.date_start.value='';
		formname.date_end.value='';
	}
}


 
// number_format()
function number_format(num) {
	var num_str = num.toString()
	var result = ''

	for(var i=0; i<num_str.length; i++) {
		var tmp = num_str.length-(i+1)
		if(i%3==0 && i!=0) result = ',' + result
		result = num_str.charAt(tmp) + result
	}

	return result
}
 

// °ø¹é check(space Ã³¸®)
// null => true
function chk_null(toCheck) 
{
    for (var i = 0; i < toCheck.length; i++)
        if (toCheck.substring(i, i+1) != " ") return false;
        
    return true;
}

// °ø¹é check (°ªÀÌ ¾øÀ»°æ¿ì true)
// null => true
function chk_null2(toCheck)
{
    var chkstr = toCheck + "";
        
    if ((chkstr == "") || (chkstr == null)) 
    {
        return true;
    }

    return false;
}

// ¼ýÀÚ check
function chk_num1(toCheck) 
{
   for (j = 0; j < toCheck.length ; j++)
   {
      if ( (toCheck.substring(j,j+1) < "0") || (toCheck.substring(j,j+1) > "9") ) return false;
   }
   return true;
}


// ¼ýÀÚ, ".", "-" ¸¸ Á¸ÀçÇÏ¸é true
function chk_num2(toCheck) 
{
   for (j = 0; j < toCheck.length ; j++) 
   {
      if ( (toCheck.substring(j,j+1) < "0") || (toCheck.substring(j,j+1) > "9") ) 
      {
         if ( (toCheck.substring(j,j+1) == ".") || (toCheck.substring(j,j+1) == "-") ) continue;
         return false;
      }
   }
   
   return true;
}

// ¼ýÀÚ, "-" ¸¸ Á¸ÀçÇÏ¸é true

function chk_num3(toCheck) 
{
   for (j = 0; j < toCheck.length ; j++) 
   {
      if ( (toCheck.substring(j,j+1) < "0") || (toCheck.substring(j,j+1) > "9") ) 
      {
         if (toCheck.substring(j,j+1) == "-") continue;
         return false;
      }
   }
   
   return true;
}

// ÇÑ±Û check
function chk_hangul(toCheck) 
{
    var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890`!@#$%^&*()-=_+~[]\{}|,./<>?";
    
    for (i=0; i< toCheck.length; i++)
    {
        idcheck = toCheck.charAt(i);
        
        for ( j = 0 ;  j < str.length ; j++)
        {
        
            if (idcheck == str.charAt(j)) break;
                
            if (j+1 == str.length)
            {
                return false;
            }
        }
    }
    return true;
}

//¿µ¾î,¼ýÀÚ, _ ¸¸ °¡´É
function chk_hangul2(toCheck) 
{
    var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_";
    
    for (i=0; i< toCheck.length; i++)
    {
        idcheck = toCheck.charAt(i);
        
        for ( j = 0 ;  j < str.length ; j++)
        {
        
            if (idcheck == str.charAt(j)) break;
                
            if (j+1 == str.length)
            {
                return false;
            }
        }
    }
    return true;
}

// ÇÑ±Û, ¿µ¹®¸¸ ÀÔ·Â°¡´É
function chk_hangul3(toCheck) 
{
    var str = "1234567890`!@#$%^&*()-=_+~[]\{}|,./<>?";
    
    for (i=0; i< toCheck.length; i++)
    {
        idcheck = toCheck.charAt(i);
        
        for ( j = 0 ;  j < str.length ; j++)
        {
            if (idcheck == str.charAt(j)){
				return false;
			}                
            if (j+1 == str.length) break;
        }
    }
    return true;
}


// Email check
function chk_mail(toCheck) 
{
    // @Ç¥½Ã È®ÀÎ
    if (toCheck.indexOf('@') == -1 ) 
    { 
        return false; 
    }

    // .Ç¥½Ã È®ÀÎ
    if (toCheck.indexOf('.') == -1 ) 
    { 
        return false; 
    }
    
    // ÇÑ±Û È®ÀÎ
    if ( chk_hangul(toCheck) == false ) 
    { 
        return false; 
    }
    
    return true;
}


// ÁÖ¹Î¹øÈ£ check
function chk_juminno(obj) 
{
	if (obj.length == 14) {
        var calStr1 = "2345670892345", biVal = 0, tmpCal, restCal;

        for (i=0; i <= 12; i++) {
                if (obj.substring(i,i+1) == "-") {
                        tmpCal = 1;
                }
                else {
                        biVal = biVal + (parseFloat(obj.substring(i,i+1)) * parseFloat(calStr1.substring(i,i+1)));
                }
        }

        restCal = 11 - (biVal % 11);

        if (restCal == 11) {
                restCal = 1;
        }

        if (restCal == 10) {
                restCal = 0;
        }
        if (restCal == parseFloat(obj.substring(13,14))) {
                return true;
        }
        else {
                return false;
        }
	}
	else {
		return false;
	}
}

// ¿ìÆí¹øÈ£ Ã£±â
function Winzip() {
	window.open('/popup/zipcode.php', '_zipcode', 'width=417, height=400, scrollbars=1,toolbars=0,statusbar=0');
}
function Winpop() {
	window.open('/popup/pop_04.php', '_pop', 'width=600, height=600, scrollbars=1,toolbars=0,statusbar=0');
}


/* -------------------------- ÇÊ¼ö ÀÔ·Â ÇÊµåÀÇ ÀÔ·Â°ª Ã¼Å© ÇÔ¼ö START ----------------------------------*/
/*
	field ID ¿Í ÇÊµåÀÌ¸§À» Àü´ÞÇÑ´Ù.
	checkbox´Â msg¿¡ ÀüÃ¼ °æ°í¹®±¸¸¦ Àü´ÞÇÑ´Ù.
	radio ¹öÆ°Àº null_chk_field°¡ ¾Æ´Ñ radio_chk_field ¸¦ ÀÌ¿ëÇÏ¿© Ã¼Å©ÇÑ´Ù.

	»ç¿ë¿¹ )
		function chk_f(f) {
			return (
					null_chk_field ("a_id"  , "Admin ID")
				&&  null_chk_field ("a_pass", "Password")
				&&  null_chk_field ("sel", "¼¿·ºÆ®¹Ú½º")
				&&  radio_chk_field (f.radio_fld_name, "¶óµð¿À¹öÆ°.")
				&&  null_chk_field ("chk", "Ã¼Å©¹Ú½º¸¦ Ã¼Å©ÇÏ¼¼¿ä")
			);
		}
*/

// filed  null check (field : filed ID, msg : ¹ÌÀÔ·Â½Ã message)
function null_chk_field(field, msg) {

	// input type¿¡µû¶ó 
	if ($(field))
	{
		switch ($(field).type.toLowerCase()) {
			case 'select-one': // 1°³¸¸ ¼±ÅÃ°¡´ÉÇÑ Select box 
				if($F(field) == '' || $F(field) == null) {
					alert (msg+" : ÇÊ¼öÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
					$(field).activate();
					return false;
				}
				break;


			case 'checkbox': // Checkbox, msg¿¡¼­ °æ°í¹®±¸ ÀüÃ¼¸¦ ¹Þ´Â´Ù.
				if(!$(field).checked) {
					alert (msg);
					$(field).activate();
					return false;
				}
				break;


			default :	// text, textarea ÇÊµå
				if($F(field) == '' || $F(field) == null) {
					alert (msg+" : ÇÊ¼öÀÔ·Â »çÇ×ÀÔ´Ï´Ù.");
					//$(field).activate();
					if (field != 'content') $(field).activate(); // editor¿¡¼­ field¸íÀÌ contentÀÏ°æ¿ì¸¦À§ÇØ content´Â Á¦¿Ü,,
					return false;
				}

				if ($(field).getAttribute("check") && $(field).getAttribute("check").toLowerCase() != "") { // check Ç×¸ñÀÌ ÀÖÀ»°æ¿ì

					switch ($(field).getAttribute("check").toLowerCase()) {

						case "email" :	// ÀÌ¸ÞÀÏÃ¼Å©
							if (!chk_mail($F(field))) {
								alert ("¿Ã¹Ù¸¥ ¸ÞÀÏÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.");
								$(field).activate();
								return false;
							}
							break;

						
						case "number" : // ¼ýÀÚ¸¸ ÀÔ·Â.
							if (!chk_num1($F(field))) {
								alert (msg+" : ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù..");
								$(field).activate();
								return false;
							}
							break;

						case "chk_engnum" : // ¿µ¹®, ¼ýÀÚ, ¾ð´õ¹Ù(_)
							if (!chk_hangul2($F(field))) {
								alert (msg+" : ¿µ¹®, ¼ýÀÚ, ¾ð´õ¹Ù(_)¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù..");
								$(field).activate();
								return false;
							}
							break;

						// case Ãß°¡,,,,,,,,,,,,,,,,,,,,,,,,,,,,
					}
				}
		}
	}

	return true;
}

// radio null check (field : filed name, msg : ¹ÌÀÔ·Â½Ã message)
function radio_chk_field(field, msg) {

	var TF = false;

	for(i=0; i<field.length; i++) {
		
		if (field[i].checked) {
			TF = true;
			break;
		}
	}
	
	if(!TF) alert (msg+" : ¼±ÅÃÇÑ °ªÀÌ ¾ø½À´Ï´Ù.");
	return TF;
}
/* -------------------------- ÇÊ¼ö ÀÔ·Â ÇÊµåÀÇ ÀÔ·Â°ª Ã¼Å© ÇÔ¼ö END ---------------------------------- */





// ½ºÅ©·Ñ¹Ù ÃÖ»ó´ÜÀÇ À§Ä¡.
function getScrollTop() {
	if (document.documentElement.scrollTop) {
		return document.documentElement.scrollTop;
	} else if (window.pageYOffset) {
		return window.pageYOffset;
	} else if (document.body.scrollTop) {
		return document.body.scrollTop;
	} else {
		return 0;
	}
}

// iframe¿¡¼­ ºÎ¸ðÃ¢ÀÇ ½ºÅ©·Ñ¹Ù ÃÖ»ó´ÜÀÇ À§Ä¡.
function getScrollTop_parent() {
	if (parent.document.documentElement.scrollTop) {
		return parent.document.documentElement.scrollTop;
	} else if (parent.window.pageYOffset) {
		return parent.window.pageYOffset;
	} else if (parent.document.body.scrollTop) {
		return parent.document.body.scrollTop;
	} else {
		return 0;
	}
}




// form check
// <input> tag¿¡ ¾Æ·¡»çÇ×À» check
// text : ÇØ´ç column ÀÌ¸§
// notnull : null check
// check
// - number : ¼ýÀÚ check
// - date : ³¯ÀÚ check
// - mail : ¸ÞÀÏ check
// - juminno : ÁÖ¹Î¹øÈ£ check
function chk_form(form) 
{
    var inx = 0; // À§Ä¡

    for ( ; inx < form.length; inx++)
    {
        //alert(inx);
        var column = form.elements[inx];
        
        var text = column.text;

        if ( (column.type == "text") || 
             (column.type == "password") || 
             (column.type == "textarea") ||
             (column.type == "file") )
        {
            // ÇÊ¼öÇ×¸ñ check
            if ( (column.notnull == "") && (chk_null(column.value)) ) 
            {
                alert (text + "Àº(´Â) ÇÊ¼öÇ×¸ñÀÔ´Ï´Ù");
                column.focus();
                return false;
            }
            
            // nullÀÌ ¾Æ´Ï¸é check
            if( !chk_null(column.value) )
            {
                // ÇüÅÂ check
                if ( (column.check == "number") && (!chk_num1(column.value)) )
                {
                    alert (text + "À»(¸¦) ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä");
                    column.focus();
                    return false;
                }
				
                else if ( (column.check == "date") && (!chk_date(column.value)) )
                {
                    alert (text + "À»(¸¦) ³¯ÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä");
                    column.focus();
                    return false;
                }
                else if ( (column.check == "mail") && (!chk_mail(column.value)) )
                {
                    alert ("¿Ã¹Ù¸¥ ¸ÞÀÏÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.");
                    column.focus();
                    return false;
                }
                else if ( (column.check == "juminno") && (!chk_juminno(column.value)) )
                {
                    alert ("¿Ã¹Ù¸¥ ÁÖ¹Î¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
                    column.focus();
                    return false;
                }
                else if ( (column.check == "length") && (!chk_length(column.value,column.hlength)) )
                {
                    alert (column.hlength+"ÀÚ±îÁö ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
                    column.focus();
                    return false;
                }

                else if ( (column.check == "length3") && (!chk_length3(column.value,column.hlength) || !chk_num1(column.value)) )
                {
                    alert (text + "´Â(Àº) " + column.hlength + "±ÛÀÚÀÇ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
                    column.focus();
                    return false;
                }

				else if ( (column.check == "hangul") && (!chk_hangul2(column.value)) )
                {
                    alert (text + " ´Â(Àº) ¿µ¹®,¼ýÀÚ,'_'¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
                    column.focus();
                    return false;
                }
				else if ( (column.check == "hangul2") && (!chk_hangul3(column.value)) )
                {
                    alert (text + " ´Â(Àº) ¿µ¹®,ÇÑ±Û¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
                    column.focus();
                    return false;
                }
				else if ( (column.check2 == "length2") && (!chk_length2(column.value,column.maxlen,column.minlen)) )
                {
                    alert (text + " ´Â(Àº) "+ column.minlen + " ~ " + column.maxlen +"ÀÚ±îÁö ÀÔ·Â°¡´ÉÇÕ´Ï´Ù");
                    column.focus();
                    return false;
                }
				else if ( (column.check == "number3") && (!chk_num3(column.value)) )
                {
                    alert (text + " ´Â(Àº) ¼ýÀÚ,'-'¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
                    column.focus();
                    return false;
                }

            }
        }
    }
  
    return true;
}

// object°¡ nullÀÎÁö check
function chk_null_obj(Obj) 
{
    var check = false;
    var Radio = Obj;

    if (!Radio) return check;

    if (Radio.length) 
    {
        for ( var i=0; i<Radio.length; i++ ) 
        {
            if ( Radio[i].checked == 1 ) 
            {
                check = true;
                break;
            }
        }
    }
    else
    {
        if ( Radio.checked == 1 ) 
        {
            check = true;
        }
    }

    return check
}


// ¸ðµç object¸¦ checkÇÔ
function CheckAll(Obj) 
{
    var Radio = Obj.form.file;

    if (!Radio) return;

    if (Radio.length) 
    {
        for ( var i=0; i<Radio.length; i++ )
            Obj.form.file[i].checked=1;
    }
    else 
    {
        Obj.form.file.checked=1;
    }
}


// ¸ðµç object¸¦ uncheckÇÔ 
function UnCheckAll(Obj) 
{
    var Radio = Obj.form.file;

    if (!Radio) return;

    if (Radio.length) 
    {
        for ( var i=0; i<Radio.length; i++ )
            Obj.form.file[i].checked=0;
    }
    else 
    {
        Obj.form.file.checked=0;
    }
}

// window ¶ç¿ì±â
function open_win(URL, name, width, height) 
{
    msgWindow=window.open(URL,name,'location=0,toolbar=no,width='+width+',height='+height+',directories=no,status=no,scrollbars=Yes,resizable=no,menubar=no,border=0');
    msgWindow.focus()
}

// window ¶ç¿ì±â, no scroll
function open_win1(URL, name, width, height) 
{
    msgWindow=window.open(URL,name,'location=0,toolbar=no,width='+width+',height='+height+',directories=no,status=no,scrollbars=No,resizable=no,menubar=no,border=0');
    msgWindow.focus()
}

// window ¶ç¿ì±â
function open_win_XY(URL, name, width, height) 
{
    msgWindow=window.open(URL,name,'location=0,toolbar=no,width='+width+',height='+height+',directories=no,status=no,scrollbars=Yes,resizable=Yes,menubar=no,border=0,screenX=0,screenY=0');
    msgWindow.focus()
}

// ±âº» ÆË¾÷Ã¢
function view_open(url,name,features) { 
    window.open(url,name,features);
}

// ¹öÆ° ·Ñ¿À¹ö
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];}
}


// ¹è³Ê½ºÅ©·Ñ

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements()
{
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { // ³×Ã÷ÄÉÀÌÇÁ ¿ë ¼³Á¤
                //yButtonFrom = document["divLinkButton"].top;
                //yButtonTo   = top.pageYOffset + top.innerHeight - 55;
                yMenuFrom   = document["divMenu"].top;
                yMenuTo     = top.pageYOffset + 5;   // À§ÂÊ À§Ä¡
        }
       else if ( bExplorer4plus ) {  // IE ¿ë ¼³Á¤
                //yButtonFrom = parseInt (divLinkButton.style.top, 10);
                //yButtonTo   = document.body.scrollTop + document.body.clientHeight - 55;
                yMenuFrom   = parseInt (divMenu.style.top, 10);
                yMenuTo     = document.body.scrollTop + 1; // À§ÂÊ À§Ä¡
        }

        timeoutNextCheck = 500;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }


        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divMenu"].top += yOffset;
                else if ( bExplorer4plus )
                        divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad()
{
        var y;


        // ÆäÀÌÁö ·Îµù½Ã Æ÷Áö¼Ç
        if ( bNetscape4plus ) {
                document["divMenu"].top = top.pageYOffset + 135;
                document["divMenu"].visibility = "visible";
                //document["divLinkButton"].top = top.pageYOffset + top.innerHeight - 55;
                //document["divLinkButton"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                divMenu.style.top = document.body.scrollTop + 135;
                divMenu.style.visibility = "visible";
               //divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
                //divLinkButton.style.visibility = "visible";
        }

        // initializing UI update timer
        CheckUIElements();
        //if ( bExplorer4plus )
        //        setTimeout ( "FlashTitleStepIt(255)", 10 );
        return true;
}


// 20071106 Ãß°¡½ºÅ©¸³Æ®


/* roll over-out image */
function menuOver() {
	this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", ".gif");
}

function initImgEffect(ImgEls,SelImg) {

	MenuImg = document.getElementById(ImgEls).getElementsByTagName("img");
	MenuImgLen = MenuImg.length;

	for (i=0; i<MenuImgLen; i++) {
		MenuImg.item(i).onmouseover = menuOver;
		MenuImg.item(i).onmouseout = menuOut;
		if (i == SelImg) {
			MenuImg.item(i).onmouseover();
			MenuImg.item(i).onmouseover = null;
			MenuImg.item(i).onmouseout = null;
		}
	}
}
/* IE HTML rewrite */
function IE_HtmlRewrite(objParent) {
	if (window.ActiveXObject && objParent) {
		objParent.innerHTML = objParent.innerHTML;
	}
}

/* submenu */
function initSubmenu(depth1, depth2, depth3) {
	selectDepth1 = "menu" + depth1 + "-" + depth2;
	selectDepth2 = "menu" + depth1 + "-" + depth2 + "-" + depth3;

	nav = document.getElementById("sub");
	menuEl = nav.getElementsByTagName("li");


	for(i = 0; i < menuEl.length; i++) {
		if (menuEl.item(i).id == selectDepth1 || menuEl.item(i).id == selectDepth2  ) {
			menuEl.item(i).getElementsByTagName("img").item(0).src = menuEl.item(i).getElementsByTagName("img").item(0).src.replace(".gif", "_on.gif");
		} else {
			menuEl.item(i).getElementsByTagName("img").item(0).onmouseover = menuOver;
			menuEl.item(i).getElementsByTagName("img").item(0).onmouseout = menuOut;
			if (menuEl.item(i).getElementsByTagName("ul").item(0)) {
				menuEl.item(i).getElementsByTagName("ul").item(0).style.display = "none";
			}
		}
	}
}
function applyScriptCss(linkCss) {
	document.write(linkCss);
}

function initMoving(target) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = 600;
	obj.initLeft = 900;
	//obj.bottomLimit = document.documentElement.scrollHeight - 220;
	obj.bottomLimit = document.body.scrollHeight - 220;
	obj.topLimit = 167;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";
	obj.style.left = obj.left + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else if (document.body.scrollTop) {
			return document.body.scrollTop;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + 135;
		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 40)
}
function lecOpen() {
	window.open('/utility/lecture.jsp', 'lecture', 'width=718, height=650, scrollbars=yes');
}
function dicOpen() {
	window.open('/utility/dictionary.jsp', 'dictionary', 'width=718, height=650, scrollbars=yes');
}


document.getElementsBySelector = function(selector) {
	// Attempt to fail gracefully in lesser browsers
	if (!document.getElementsByTagName) {
		return new Array();
	}
	// Split selector in to tokens
	var tokens = selector.split(' ');
	var currentContext = new Array(document);
	for (var i = 0; i < tokens.length; i++) {
		token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
		if (token.indexOf('#') > -1) {
			// Token is an ID selector
			var bits = token.split('#');
			var tagName = bits[0];
			var id = bits[1];
			var element = document.getElementById(id);
			if (tagName && element.nodeName.toLowerCase() != tagName) {
				// tag with that ID not found, return false
				return new Array();
			}
			// Set currentContext to contain just this element
			currentContext = new Array(element);
			continue; // Skip to next token
		}
		if (token.indexOf('.') > -1) {
			// Token contains a class selector
			var bits = token.split('.');
			var tagName = bits[0];
			var className = bits[1];
			if (!tagName) {
				tagName = '*';
			}
			// Get elements matching tag, filter them for class selector
			var found = new Array;
			var foundCount = 0;
			for (var h = 0; h < currentContext.length; h++) {
				var elements;
				if (tagName == '*') {
						elements = getAllChildren(currentContext[h]);
				} else {
						elements = currentContext[h].getElementsByTagName(tagName);
				}
				for (var j = 0; j < elements.length; j++) {
					found[foundCount++] = elements[j];
				}
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			for (var k = 0; k < found.length; k++) {
				if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
					currentContext[currentContextIndex++] = found[k];
				}
			}
			continue; // Skip to next token
		}
		// Code to deal with attribute selectors
		if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
			var tagName = RegExp.$1;
			var attrName = RegExp.$2;
			var attrOperator = RegExp.$3;
			var attrValue = RegExp.$4;
			if (!tagName) {
				tagName = '*';
			}
			// Grab all of the tagName elements within current context
			var found = new Array;
			var foundCount = 0;
			for (var h = 0; h < currentContext.length; h++) {
				var elements;
				if (tagName == '*') {
						elements = getAllChildren(currentContext[h]);
				} else {
						elements = currentContext[h].getElementsByTagName(tagName);
				}
				for (var j = 0; j < elements.length; j++) {
					found[foundCount++] = elements[j];
				}
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			var checkFunction; // This function will be used to filter the elements
			switch (attrOperator) {
				case '=': // Equality
					checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
					break;
				case '~': // Match one of space seperated words
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
					break;
				case '|': // Match start with value followed by optional hyphen
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
					break;
				case '^': // Match starts with value
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
					break;
				case '$': // Match ends with value - fails with "Warning" in Opera 7
					checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
					break;
				case '*': // Match ends with value
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
					break;
				default :
					// Just test for existence of attribute
					checkFunction = function(e) { return e.getAttribute(attrName); };
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			for (var k = 0; k < found.length; k++) {
				if (checkFunction(found[k])) {
					currentContext[currentContextIndex++] = found[k];
				}
			}
			// alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);
			continue; // Skip to next token
		}
		// If we get here, token is JUST an element (not a class or ID selector)
		tagName = token;
		var found = new Array;
		var foundCount = 0;
		for (var h = 0; h < currentContext.length; h++) {
			var elements = currentContext[h].getElementsByTagName(tagName);
			for (var j = 0; j < elements.length; j++) {
				found[foundCount++] = elements[j];
			}
		}
		currentContext = found;
	}
	return currentContext;
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//select_go
function openWindow(http) {
		window.open(http, "")
	}

	function selectLinks(form) {
		var http
			for(i=0;i<form.links.length;i++) {
				if(form.links.options[i].selected == true) {
					http = form.links.options[i].value
				}
			}
		openWindow(http)
	}
	function selectLinks2(form) {
		var http
			for(i=0;i<form.links2.length;i++) {
				if(form.links2.options[i].selected == true) {
					http = form.links2.options[i].value
				}
			}
		openWindow(http)
	}
	function selectLinks3(form) {
		var http
			for(i=0;i<form.links3.length;i++) {
				if(form.links3.options[i].selected == true) {
					http = form.links3.options[i].value
				}
			}
		openWindow(http)
	}
	function selectLinks4(form) {
		var http
			for(i=0;i<form.links4.length;i++) {
				if(form.links4.options[i].selected == true) {
					http = form.links4.options[i].value
				}
			}
		openWindow(http)
	}

