function objwrite(src,w,h){
  var str = "<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="+w+" height="+h+">";

  str+= "<param name='movie' value='"+src+"'>";
  str+= "<param name='quality' value='high'>";
  //str+= "<param name='wmode' value='transparent'>";
  str+= "<embed src='"+src+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'>";
  str+= "</embed>";
  str+= "</object>";

  if(src) document.write(str);
}

// menu tiptool hidden
function is_openwin(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 iswin = window.open(url,'iswin','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=yes');
  iswin.focus();
}

function fullimg(url,win_scroll) {
  var win3 = window.open(url,'win3','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 isdel(base,nm,start){
  var url = base + "?action=delete&nm="+nm;
  if(start > 0) url+= "&start="+start;

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

function ifdo(theme){ 
  if(!theme.title) return; 

  if(confirm("Àû¿ëÇÏ½Ã°Ú½À´Ï±î?")) location = theme.title; 
}

function ifdel(theme){ 
  if(!theme.title) return; 

  if(confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) location = theme.title; 
}

//PHP_SELF?action=delete&nm=$row[nm]&start=$start

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_field(theme,msg){
  if(!theme.value){
    alert(msg);
    theme.focus();
    return false;
  }
}

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 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(original_ww,original_hh,src){
  var ww = original_ww + 2;
  var hh = original_hh + 2;
  var m_ww = (window.screen.width/2) - (ww/2);
  var m_hh = (window.screen.height/2) - (hh/2);

  popup = window.open("","",'height='+hh+',width='+ww+',left='+m_ww+',top='+m_hh+',screenX='+m_ww+',screenY='+m_hh+',resizable=no,menubar=no,scrollbars=no,'+',location=no,status=yes');
  popup.document.open();

  var str = "<html><title>È®´ëº¸±â</title>";
  str+= "<body topmargin=0 leftmargin=0 onclick=window.close(); style='cursor:pointer;'>";
  str+= "<img alt='Ã¢´Ý±â' border=0 src="+src+">";
  str+= "</body></html>";

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

function pre_page(original_ww,original_hh,src){
  var ww = original_ww + 2;
  var hh = original_hh + 2;
  var m_ww = (window.screen.width/2) - (ww/2);
  var m_hh = (window.screen.height/2) - (hh/2);

  popup = window.open("","",'height='+hh+',width='+ww+',left='+m_ww+',top='+m_hh+',screenX='+m_ww+',screenY='+m_hh+',resizable=no,menubar=no,scrollbars=no,'+',location=no,status=yes');
  popup.document.open();

  var str = "";
  str+= "<html><title>°øÁö»çÇ×</title><style>td,body,th{font-size:12px;}</style>";
  str+= "<body topmargin=0 leftmargin=0 onclick=window.close();>";
  str+= src.value;
  str+= "</body></html>";

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

//object top location
function getRealOffsetTop(o){ 
  return o ? o.offsetTop + getRealOffsetTop(o.offsetParent) : 0; 
}

//object left location
function getRealOffsetLeft(o){ 
  return o ? o.offsetLeft + getRealOffsetLeft(o.offsetParent) : 0; 
}

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 trim (strSource) {
 var re = /^\s+|\s+$/g; 
 return strSource.replace(re, '');
}

function js_viewobj(objhtml) { 
  document.write(objhtml); 
} 

function number_format(num){
  num = num.replace(",","");

  num = num.toString(); 
  var arr = num.split(".");
  var num = new Array;

 for(i=0;i<=arr[0].length-1;i++){
    num[i]=arr[0].substr(arr[0].length-1-i,1);
    if(i%3==0 && i!=0) num[i]+=",";
  }

  num = num.reverse().join("");

  if(!arr[1]) return num;
  else return num+"."+arr[1]; 
}

//layer select open
function isopen_category(theme,div){
  var theid = document.getElementById(div);

  theid.style.top = getRealOffsetTop(theme) + 17;
  theid.style.left = getRealOffsetLeft(theme);

  if(theid.style.display == "none") theid.style.display = "inline";
  else theid.style.display = "none";
}

//layer select return
function select_return(theme,div){
  var theform = document.frm_ed;

  theform.num.value = theme.options[theme.selectedIndex].value;
  theform.label.value = theme.options[theme.selectedIndex].text;
  document.getElementById(div).style.display = "none";
}

function ifopen(theme){
  if(confirm("»õÃ¢À¸·Î ¶ç¿ï±î¿ä?"))window.open(theme.src);
  else window.location.href = theme.src;
}

//over
function cnj(id,after)
{
  eval(id+'.filters.blendTrans.stop();');
  eval(id+'.filters.blendTrans.Apply();');
  eval(id+'.src="'+after+'";');
  eval(id+'.filters.blendTrans.Play();');
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}