$(document).ready(function () {
  // include 페이지 적용
  $.datepicker.setDefaults( $.datepicker.regional[ "ko" ] );
  
  $('#topMenu li').bind('mouseenter', function() { // 메뉴바의 각 메뉴들에 마우스를 올리거나 키보드로 이동하면,
    $(this).addClass('on').siblings().removeClass(); // 해당 메뉴에 클래스 on을 추가하고, 다른 메뉴의 클래스를 제거합니다.
  });
});


/*
 * -start- IE 6.0 이미지 배경 색
 */
function setPng24(obj) {  
  obj.width=obj.height=1;  
  obj.className=obj.className.replace(/\bpng24\b/i,'');  
  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');";
  obj.src='';
  return '';
}
/*
 * -end- IE 6.0 이미지 배경 색
 */


function checkEvent(obj){
  alert(obj.checked);
}


function fncSubAction(action){
   document.main.action = action;
   document.main.submit();
}


// message_box
var message_box = function() {
  var button = '<input type="button" onclick="message_box.close_message();" value="Okay!" />';
  return {
    show_message: function(title, body) {
     if($('#message_box').html() === null) {
      var message = '<div id="message_box"><h1>' + title + '</h1>' + body + '<br/>' + button + '</div>';
      $(document.body).append( message );
      $(document.body).append( '<div id="darkbg">zzzzzzzzzzzzzzzzz</div>' );
      $('#darkbg').show();
      $('#darkbg').css('height', $('html, body').height());
   
      $('#message_box').css('top', $('html, body').scrollTop() + 150);
      $('#message_box').show('slow');
     } else {
      var message = '<h1>' + title + '</h1>' + body + '<br/>' + button;
      $('#darkbg').show();
      $('#darkbg').css('height', $('html, body').height());
   
      $('#message_box').css('top', $('html, body').scrollTop() + 150);
      $('#message_box').show('slow');
      $('#message_box').html( message );
     }
    },
    close_message: function() {
     $('#message_box').hide('fast');
     $('#darkbg').hide();
    }
   }
  }();
// --message_box
  

function autoMove(o,m,s){
  var from = document.main;
  
  if (o.value.length == s){
    m.focus();
  }
}

//숫자만 입력받게 함 /*완료 
function onlyNums(){
  if ((event.keyCode < 48) || (event.keyCode > 57)) event.returnValue = false;
  return true;
}

function key_check(code){  
  if(code == 8){
   event.keyCode = 0;
   return false;
  }  
}
