// menu tiptool hidden
function openimg(url,win_width,win_height,win_scroll) {
var me_width;
var me_height;

me_width = (window.screen.width/2) - (win_width/2);
me_height = (window.screen.height/2) - (win_height/2);
me_height = me_height - 30;

var win2 = window.open(url,'win2','height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars='+win_scroll+','+',location=no,status=no');
win2.focus();
}

// menu tiptool hidden
function openname(url,name,win_width,win_height,win_scroll) {
var me_width;
var me_height;

me_width = (window.screen.width/2) - (win_width/2);
me_height = (window.screen.height/2) - (win_height/2);
me_height = me_height - 30;

var win2 = window.open(url,name,'height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars='+win_scroll+','+',location=no,status=no');
win2.focus();
}

function fullimg(url,win_scroll) {
  var win3 = window.open(url,'win2','resizable=no,menubar=no,scrollbars='+win_scroll+','+',location=no,status=no,fullscreen=1');
  win3.focus();
}

// yes check
function delete_data(url){
  if(confirm('»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')){location=url;}
}

function delete_msg(url,str){
  if(confirm(str)){location=url;}
}

function confirm_msg(url,str){
  if(confirm(str)){location=url;}
}

function Go2URL(url,str){
  if(confirm(str)){location=url;}
}

function GoURL(url){
  location=url;
}


function check_login_form(){
  var theme = document.frm_login;

  if(theme.id.value.length < 1 || theme.id.value == '¾ÆÀÌµð'){
    alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
    theme.id.focus();
    return false;
  }

  if(theme.pw.value.length < 1 || theme.pw.value == 'ÆÐ½º¿öµå'){
    alert('ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
    theme.id.focus();
    return false;
  }

  return true;
}

function mf(theme,nm){
  if(nm){
    theme.style.backgroundColor='#984710';
    theme.style.color='#ffffff';
  }
  else{
    theme.style.backgroundColor='#ffffff';
    theme.style.color='#333333';
  }
}

function check_guest_form(){ 
  var theform = document.frm_guest;

  if(theform.id.value.length<1){alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");theform.id.focus();return false;} 
  if(theform.pw.value.length<1){alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");theform.pw.focus();return false;} 
  return true; 
}

function check_ordernm_form(){ 
  var theform = document.frm_ordernm;

  if(theform.name.value.length<1){alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");theform.name.focus();return false;} 
  if(theform.order_nm.value.length<1){alert("ÁÖ¹®¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");theform.order_nm.focus();return false;} 
  return true; 
}

function check_rule_form(){ 
  var theform = document.form_rule; 

  if(!theform.rule_agree.checked){alert("¾à°ü¿¡ µ¿ÀÇÇØ¾ß È¸¿ø¿¡ °¡ÀÔÇÒ ¼ö ÀÖ½À´Ï´Ù.");theform.rule_agree.focus();return false;} 
  return true; 
} 

function ffnOpen(url,width,height){
  var sFeatures="dialogHeight: " +height+ "px; dialogWidth: " +width+ "px; center: yes; help: no; resizable: no; status: no; scrollbars: no; location: no; menubar: no; display: no";
  window.showModelessDialog(url,"mydinoc", sFeatures);
}

function find_id_form(){ 
  var theform = document.frm_login;

  if(theform.id.value.length<1){alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");theform.id.focus();return false;} 
  if(theform.pw.value.length<1){alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");theform.pw.focus();return false;} 
  return true; 
}

function onstyle(nm,cur,id){
  if(nm != cur){
    id.style.backgroundColor='#0047B1';
    id.style.color='#ffffff';
  }
}

function ovstyle(nm,cur,id){
  if(nm != cur){
    id.style.backgroundColor='#ffffff';
    id.style.color='#000000';
  }
}

function menu_dn(nm){
  m01.style.display = 'none';
  m02.style.display = 'none';
  m03.style.display = 'none';
  m04.style.display = 'none';
  m05.style.display = 'none';
  m06.style.display = 'none';
  m07.style.display = 'none';

  switch(nm){
    case 1: m01.style.display = 'block'; break;
    case 2: m02.style.display = 'block'; break;
    case 3: m03.style.display = 'block'; break;
    case 4: m04.style.display = 'block'; break;
    case 5: m05.style.display = 'block'; break;
    case 6: m06.style.display = 'block'; break;
    case 7: m07.style.display = 'block'; break;
  }
}

function pre_view(win_width,win_height,str){
  var msg_str;
  var me_width;
  var me_height;

  me_width = (window.screen.width/2) - (win_width/2);
  me_height = (window.screen.height/2) - (win_height/2);
  me_height = me_height - 30;

  popup = window.open("","",'height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars=no,'+',location=no,status=no');

  popup.document.open()

  msg_str = '<html><title>¹Ì¸®º¸±â</title><body style=cursor:hand; topmargin=0 leftmargin=0 onclick=window.close();>';
  msg_str = msg_str+'<div style=position:absolute;align:bottom;width:'+win_width+';height:'+win_height+';><layer>';
  msg_str = msg_str+'<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr>';
  msg_str = msg_str+'<td align=right valign=bottom style=padding-bottom:12px;padding-right:12px;font-size:8pt;font-family:µ¸¿ò;>Å¬¸¯½Ã Ã¢´Ý±â</td>';
  msg_str = msg_str+'</tr></table>';
  msg_str = msg_str+'</layer></div>';
  msg_str = msg_str+'<img border=0 src='+str+'>';
  msg_str = msg_str+'</body></html>';

  popup.document.write(msg_str)
  popup.document.close()
}

function ppv(win_width,win_height,str){
  var msg_str;
  var me_width;
  var me_height;

  me_width = (window.screen.width/2) - (win_width/2);
  me_height = (window.screen.height/2) - (win_height/2);
  me_height = me_height - 30;

  popup = window.open("","",'height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars=no,'+',location=no,status=no');

  popup.document.open()

  msg_str = '<html><title>¹Ì¸®º¸±â</title><body style=cursor:hand; topmargin=0 leftmargin=0 onclick=window.close();>';
  msg_str = msg_str+'<img border=0 src='+str+'>';
  msg_str = msg_str+'</body></html>';

  popup.document.write(msg_str)
  popup.document.close()
}

function popup_html(win_width,win_height,str,title){
  var msg_str;
  var me_width;
  var me_height;

  me_width = (window.screen.width/2) - (win_width/2);
  me_height = (window.screen.height/2) - (win_height/2);
  me_height = me_height - 30;

  popup = window.open("","",'height='+win_height+',width='+win_width+',left='+me_width+',top='+me_height+',screenX='+me_width+',screenY='+me_height+',resizable=no,menubar=no,scrollbars=no,'+',location=no,status=no');

  popup.document.open()

  msg_str = '<html><title>'+title+'</title>';
  msg_str = msg_str+'<style>td,body,td,th{font-family:±¼¸²;font-size:12px;}</style>';
  msg_str = msg_str+'<body topmargin=0 leftmargin=0>';
  msg_str = msg_str+str;
  msg_str = msg_str+'</body></html>';

  popup.document.write(msg_str)
  popup.document.close()
}

function chk_selectall(){
  var theform = document.frm_select;
  var i=0;
  
  if(theform.chk_select.value == 0){
    for(i=0; i<theform.elements.length; i++) {
      var element = theform.elements[i];
      if(element.name.indexOf('chk') == 0) element.checked = 1;
    }
    theform.chk_select.value = 1;
  }
  else{
    for(i=0; i<theform.elements.length; i++) {
      var element = theform.elements[i];
      if(element.name.indexOf('chk') == 0) element.checked = 0;
    }
    theform.chk_select.value = 0;
  }
}

function mfocus(id,num){
  if(num == 1) id.className = 'fst';
  else if(num == 2) id.className = 'fdn';
  else id.className = 'fup';
}

function sfocus(id,num){
  if(num == 1){
    id.style.backgroundColor = '#c0c0c0';
    id.style.color = '#000000';
  }
  else{
    id.style.backgroundColor = '#000080';
    id.style.color = '#ffffff';
  }
}

function mget(id,num){
  if(num == 1){
    id.style.backgroundColor = '#D6D7F1';
    id.style.color = '#984710';
  }
  else{
    id.style.backgroundColor = '#ffffff';
    id.style.color = '#6B696B';
    window.status=''
  }
}

function imgfocus(id,num){
//Alpha(Opacity=100 ,FinishOpacity=0 ,Style=3)
//invert
  if(num == 1){
    id.style.filter = 'Xray'; 
  }
  else{
    id.style.filter = 'alpha(opacity=100)'; 
  }
}

function menu_popup(x,y,width,height,str){
  var popup = window.createPopup(); 
  popup.document.body.innerHTML = str;
  popup.show(x, y, width, height, document.body);
//ex) popup.show(0,0,100,100, document.body);
}
