// 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 Go2URL(url,str){
  if(confirm(str)){location=url;}
}

function GoURL(url){
  location=url;
}


function check_login_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 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>';
  msg_str = msg_str+'<meta HTTP-EQUIV=imagetoolbar CONTENT=no>';
  msg_str = msg_str+"<body style=cursor:hand; leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 onContextmenu='return false' onContextmenu='return event.crtlKey' onSelectstart='return false' onclick=window.close();>";
  //msg_str = msg_str+'<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()
}

// selectbox all checked
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 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];}
}



function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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 bfocus(id,num){
  if(num == 1){
    id.style.filter = 'alpha(opacity=70)'; 
  }
  else{
    id.style.filter = 'alpha(opacity=100)'; 
  }
}

function list_dn(theme,str){
  if(str == 1){
    theme.style.backgroundColor='#D4D0C8';
  }
  else{
    theme.style.backgroundColor='#ffffff';
  }
}
