// 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();
}

function ViewContent(kindid,id) {
	urlpage="view.asp?kindid="+kindid+"&id="+id;
	window.open(urlpage,"openwin","height=600,width=720,resizable=no,scrollbars=yes,mebubar=no");
}

function openwin(url,win_width,win_height,win_scroll,nm) {
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 nm = window.open(url,nm,'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');
nm.focus();
}

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

// yes check
function delete_click(url){
  if(confirm('Å¬¸¯ »óÇ°¸ñ·ÏÀ» ºñ¿ì½Ã°Ú½À´Ï±î?')){location=url;}
}

function GoURL(url){
  location=url;
}


function delete_msg(url,str){
  if(confirm(str)){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.tel1.value.length<1){alert("ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");theform.tel1.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 check_ed(){
  var theform = document.frm_ed;
  if(trim(theform.name.value)==""){alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");theform.name.focus();return false;}
  if(trim(theform.title.value)==""){alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");theform.title.focus();return false;}
  if(trim(theform.comment.value)==""){alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");theform.comment.focus();return false;}
}

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 se_go(form){
  if(form.searchword.value == ""){alert('°Ë»ö ³»¿ëÀ» ³Ö¾î ÁÖ½Ê½Ã¿ä.');form.searchword.focus();return;}
  form.submit();
}

function trim(tmpStr) {
  var atChar;
  if (tmpStr.length > 0) atChar = tmpStr.charAt(0);
  while (isSpace(atChar)) {
    tmpStr = tmpStr.substring(1, tmpStr.length);
    atChar = tmpStr.charAt(0);
  }
  if (tmpStr.length > 0) atChar = tmpStr.charAt(tmpStr.length-1);
  while (isSpace(atChar)) {
    tmpStr = tmpStr.substring(0,( tmpStr.length-1));
    atChar = tmpStr.charAt(tmpStr.length-1);
  }
  return tmpStr;
}

function isSpace(inChar) {
  return (inChar == ' ' || inChar == '\t' || inChar == '\n');
}

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

//¸Þ´º ÇÃ·¡½Ã ¸µÅ© ¸ðÀ½

function Tgo(num)
{
 switch(num)  {

case 1://²É¹Ù±¸´Ï       
   URL="/shop.php?big=1&middle=0&small=0";
   break;
 
case 33://±ÙÁ¶È­È¯		
   URL="/ev_celebration.php" ;
   break;
  
case 5:// µ¿¼­¾ç¶õ
    URL="/event_orchild.php" ;
   break;

case 6://°ü¿±/È­ºÐ
  URL="/shop.php?big=6&middle=0&small=0" ;
   break;

case 2://²É´Ù¹ß,²É»óÀÚ
   URL="/shop.php?big=2&middle=0&small=0" ;
   break;

case 17://°ø±âÁ¤È­½Ä¹°
   URL="/ev_air.php" ;
   break;

case 19://²Éº´
   URL="/shop.php?big=19&middle=0&small=0" ;
   break;
case 9://°úÀÏ¹Ù±¸´Ï
   URL="/shop.php?big=9&middle=0&small=0" ;
   break; 
case 3://²É»óÀÚ
   URL="/shop.php?big=3&middle=0&small=0" ;
   break; 
case 7://ºÐÀç
  URL="/shop.php?big=7&middle=0&small=0" ;
   break;
case 11://100¼ÛÀÌÀå¹Ì
  URL="/shop.php?big=11&middle=0&small=0" ;
   break;
case 22://¿þµùºÎÄÉ
  URL="/shop.php?big=22&middle=0&small=0" ;
   break;
//°¡°Ýº°

case 50000://°¡°Ý 50000 ¿ø ÀÌÇÏ.
  URL="/product_search.php?price_str=50000," ;
   break;
case 70000://°¡°Ý 70000 ¿ø ÀÌÇÏ.
  URL="/product_search.php?price_str=50000,70000" ;
   break;
case 100000://°¡°Ý 100000 ¿ø ÀÌÇÏ.
  URL="/product_search.php?price_str=70000,100000" ;
   break;
case 150000://°¡°Ý 150000 ¿ø ÀÌÇÏ.
  URL="/product_search.php?price_str=100000,150000" ;
   break;
case 200000://°¡°Ý 150000 ¿ø ÀÌ»ó.
  URL="/product_search.php?price_str=150000," ;
   break;


default: 
   alert("¾ø´Â ¸µÅ©ÀÔ´Ï´Ù.");
   URL="/"
   break;
 	}
 location.href=URL;
 }


function onlynumchar(reguserid){   // ÇÑ±Û ¾ÆÀÌµð ¾ÈµÇ°Ô
var i;
var Alpha= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
 compstr = new String(reguserid);

  for (i =0;i<compstr.length;i++) {

    if (Alpha.indexOf(compstr.substring(i,i+1))<0) {
       return false;
    }
  }
   return true;
}

function onlynum(reguserid){   // ÇÑ±Û ¾ÆÀÌµð ¾ÈµÇ°Ô
var i;
var Alpha= '1234567890';
 compstr = new String(reguserid);

  for (i =0;i<compstr.length;i++) {

    if (Alpha.indexOf(compstr.substring(i,i+1))<0) {
       return false;
    }
  }
   return true;
}

function onlynum333(reguserid){   // ÇÑ±Û ¾ÆÀÌµð ¾ÈµÇ°Ô
var i;
var Alpha= '1234567890-';
 //compstr = new String(reguserid.value);
 var compstr = reguserid.value;
  for (i =0;i<compstr.length;i++) {

    if (Alpha.indexOf(compstr.substring(i,i+1))<0) {
		alert("¼ýÀÚ¿Í - ¸¸ »ç¿ë °¡´É ÇÕ´Ï´Ù.");
		reguserid.value="";
       return false;
    }
  }
   return true;
}

//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; 
}

