
//-------------------------------
 // ÁÖ¹Î¹øÈ£ À¯È¿¼º Ã¼Å©(¿¬»ê¿¡ ÀÇÇÑ.)
 //------------------------------- 
 function validateCalJumin(j1,j2){
  jumin = j1+j2;
  
  result = false;
  jumin_hap = 0;
  calNum = "234567892345";  

  if( jumin.charAt(6) == 1 || jumin.charAt(6) == 2 ){ 
   for (i=0;i<12;i++) jumin_hap = jumin_hap + jumin.charAt(i)*(calNum.charAt(i));
   
   fixValue = (11-(jumin_hap % 11))%10;   
         
   if (jumin.charAt(12) == fixValue) result=true;
  }
  return result;
 }      
 
 //-------------------------------
 // isEmail
 //-------------------------------
 function isEmail(s) {
  if (s.indexOf(" ") != -1)
   return false;
  else if (s.indexOf("@") == -1)
   return false;
  else if (s.indexOf("@") == 0)
   return false;
  else if (s.indexOf("@") == (s.length-1))
   return false;
   
  arrayString = s.split("@");
 
  if (arrayString[1].indexOf(".") == -1)
   return false;
  else if (arrayString[1].indexOf(".") == 0)
   return false;
  else if (arrayString[1].charAt(arrayString[1].length-1) == ".") {
   return false;
  }
  return true;
 } 
 
 //-------------------------------
 // Left Trim
 //-------------------------------
 function LTrim(s) {
  while (1) {
   if ( s.substring(0, 1) != " " ) {
    break;
   }
   s = s.substring(1, s.length);
  }
  return s;
 }
 
 //-------------------------------
 // Right Trim
 //-------------------------------
 function RTrim(s) {
  while (1) {
   if ( s.substring(s.length - 1, s.length) != " " ) {
    break;
   }
   s = s.substring(0, s.length - 1);
  }
  return s;
 }
 
 //-------------------------------
 // Trim
 //-------------------------------
 function Trim(s) {
  tmpstr = LTrim(s);
  return RTrim(tmpstr);
 }
  
 //-------------------------------
 // ¼ýÀÚ, ¿µ¹®ÀÚ(_,-Á¦¿Ü) ¸¸ °¡´É.
 //------------------------------- 
 function isWord(sWord) {
  valid = true;
  exStr = /[^A-Za-z0-9]/; // regular expression excluding non-word characters
  
  if (sWord.match(exStr)) valid = false;
  return valid;
 } 
 
 //-------------------------------
 // ¼ýÀÚ
 //------------------------------- 
 function isInteger(sWord) {

  if (sWord.length > 0) {
   for (i=0; i<sWord.length; i++) {
    if (sWord.charAt(i) < '0' || sWord.charAt(i) > '9') { return false; }
   }
   return true;
  } else { return false; }
 }  

 //----------------------------------------------
 // ÇÃ·¡½¬ °ü·Ã
 //----------------------------------------------
 function changeEmbed(arg1, arg2, arg3)
 {
   document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
   document.write("        codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+arg2+"' height='"+arg3+"'>");
   document.write("<param name='movie' value='"+arg1+"'>");
   document.write("<param name='quality' value='high'>");
   document.write("<embed src='"+arg1+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+arg2+"' height='"+arg3+"'></embed>");
   document.write("</object>");
 }


//-----------------------------------------------
//ÁÖ¼Ò°Ë»öÃ¢
//-----------------------------------------------
function zipinput()
{
	var gourl;
	gourl="/admin/common/zipcode.asp";
	
	window.open(gourl,"zipcode","width=350,height=350,scrollbars=YES");
}

//-----------------------------------------------
//¾ÆÀÌµð/ÆÐ½º¿öµå Ã£±â
//-----------------------------------------------
function search_idpw()
{
	window.open("/member/search_idpw.asp","searchidpw","width=417,height=410,scrollbars=no");
}

//-----------------------------------------------
//°áÁ¦ ÆË¾÷
//-----------------------------------------------
function nowby(idx,bymode)
{
	var gourl;
	
	gourl="/order/paypop.asp?id="+idx+"&bymode="+bymode;
	window.open(gourl,"paypop","width=500,height=700,scrollbars=NO");
}

//-----------------------------------------------
//°áÁ¦ ÆË¾÷ - Å×½ºÆ®
//-----------------------------------------------
function nowby2(idx,bymode)
{
	var gourl;
	
	gourl="/order/paypop2.asp?id="+idx+"&bymode="+bymode;
	window.open(gourl,"paypop","width=500,height=670,scrollbars=NO");
}

//----------------------------------------------
//µµ¼­ ´Ù¿î·Îµå 
//----------------------------------------------
function down_file(idx,item_id,tidx)
{
	window.open("","file_down","width=495,height=305,scrollbars=NO");
	
	document.ttdown.id.value=idx;
	document.ttdown.item_id.value=item_id;
	document.ttdown.item_kind.value=tidx;
	document.ttdown.target="file_down";
	document.ttdown.action="/ebook/ebook_down.asp";
	document.ttdown.submit();
}


//----------------------------------------------
//µµ¼­ ¹Ù·Îº¸±â - À¥¹æ½Ä º¸±â
//----------------------------------------------
function DayView(idx,item_id,tidx)
{
	window.open("","file_view","width=190,height=150,scrollbars=NO, top=0 left=0");
	
	document.ttdown.id.value=idx;
	document.ttdown.item_id.value=item_id;
	document.ttdown.item_kind.value=tidx;
	document.ttdown.target="file_view";
	document.ttdown.action="/ebook/ebook_view.asp";
	document.ttdown.submit();
}

//----------------------------------------------
//µµ¼­ ¹Ù·Îº¸±â - ¹«·áº¸±â
//----------------------------------------------
function nomoney_View(idx,item_id,tidx)
{
	window.open("","file_view","width=190,height=150,scrollbars=NO, top=0 left=0");
	
	document.ttdown.id.value=idx;
	document.ttdown.item_id.value=item_id;
	document.ttdown.item_kind.value=tidx;
	document.ttdown.target="file_view";
	document.ttdown.action="/ebook/nomoney.asp";
	document.ttdown.submit();
}

//----------------------------------------------
//µµ¼­ ¹Ù·Îº¸±â - ¹Ì¸®º¸±â
//----------------------------------------------
function preView(idx)
{
	window.open("","file_view","width=190,height=150,scrollbars=NO, top=0 left=0");
	
	document.ttdown.id.value=idx;
	document.ttdown.target="file_view";
	document.ttdown.action="/ebook/preview.asp";
	document.ttdown.submit();
}

//----------------------------------------------
//ÄíÆù»ç¿ëµî·Ï ÆË¾÷ ¶ç¿ì±â
//----------------------------------------------
function gift_pop()
{
	window.open("/event/gift_num.asp","comgift","width=417,height=250");	
}