//==================¸ÞÀÎÆäÀÌÁö ÆË¾÷ ¶ç¿ì±â - ½ÃÀÛ
//20070907 ±è±â¸¸
function OpenPopup()
{
	var todayDate = new Date();
	var endDate = new Date();
	endDate.setFullYear(2007,10-1,24);	// (³â,¿ù,ÀÏ monthÀÎÀÚ´Â 0ÀÌ 1¿ùÀÌ¹Ç·Î ÇØ´ç¿ù¿¡ -1ÇØ¾ß ÇÔ)
	if(todayDate <= endDate && location.pathname.toLowerCase() == "/main/default.aspx")
	{
		setCookie("YES24_POPUP","OK",1);
		if ( getCookie( "YES24_POPUP2" ) != "OK" ) {
			window.open('/notice/P071023.aspx','YES24_POPUP2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=404,height=250,top=80,left=20');
		}
	}
}
OpenPopup();
//==================¸ÞÀÎÆäÀÌÁö ÆË¾÷ ¶ç¿ì±â - ³¡

	
/*Áñ°ÜÃ£±â¿¡ Ãß°¡*/
function addFavorite(){
	window.external.AddFavorite("http://www.yes24.com", "YES24 - ´ëÇÑ¹Î±¹ ´ëÇ¥ ÀÎÅÍ³Ý¼­Á¡");
}

/***********************************************************************************
  Á¤ÇØÁø ¼ýÀÚ¸¸Å­ ¹®ÀÚ(¿µ¼ýÀÚ)¸¦ ÀÔ·ÂÇÏ¸é ÀÚµ¿À¸·Î ´ÙÀ½ ÇÊµå·Î Æ÷Ä¿½º ÀÌµ¿
  ÀÔ·Â Ç×¸ñ 
            - thisTab : ÀÛ¾÷ÁßÀÎ ÇÊµå °´Ã¼
            - nextTab: ´ÙÀ½ Æ÷Ä¿½º ´ë»ó
            - thisTabSize: ÀÛ¾÷ÁßÀÎ ÀÔ·ÂÇÊµåÀÇ size °ª
   °ü·Ã ÀÌº¥Æ® : onKeyUp          
***********************************************************************************/
function tabOrder(thisTab,nextTab, thisTabSize) {
  if((event.keyCode == 37) ||  // ¡ç key
     (event.keyCode == 38) ||  // ¡è key
     (event.keyCode == 39) ||  // ¡æ key
     (event.keyCode == 40) ||  // ¡é key
     (event.keyCode == 35) ||  // HOME key
     (event.keyCode == 36) ||  // END key
     (event.keyCode == 13) ||  // Enter key
     (event.keyCode == 229) || // mouse double click
     (window.document.selection.createRange().text.length == thisTabSize)) { 
    return;
  } 
  if (thisTab.value.length == thisTabSize) {
    nextTab.select();
    nextTab.focus();
    return;
  }
}



/**
*ÀÔ·ÂÇÊµå¿¡ ¼ýÀÚ¸¸ ÀÔ·Â¹ÞÀ»¼ö ÀÖµµ·Ï Á¦¾î
*/
function isNumber(){
  
  if ( (event.keyCode == 46) ||  // DEL
       (event.keyCode == 8)  ||  // backspace
       (event.keyCode == 9)  ||  // tab
       (event.keyCode == 37) ||  // ¡ç key
       (event.keyCode == 38) ||  // ¡è key
       (event.keyCode == 39) ||  // ¡æ key
       (event.keyCode == 40) ||  // ¡é key
       (event.keyCode == 35) ||  // HOME key
       (event.keyCode == 36) ||  // END key
       (event.keyCode == 13) ||  // Enter key       
       ((event.keyCode >= 48) && (event.keyCode <= 57 )) || // 0 ~ 9
       ((event.keyCode >= 96) && (event.keyCode <= 105 ))||   // 0 ~ 9 in ¼ýÀÚÆÐµå
		 !isNaN(String.fromCharCode(event.keyCode))
     )
  {

		event.returnValue=true;
 
  }
  else{
		event.returnValue=false;
  }
}

function isNumber2(formName, fieldName, fieldAlt)
{
	var form = eval(formName + "." + fieldName);

	if ( !(/^\d+$/.test(form.value)) )
	{
		alert(fieldAlt + "À» ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä");
		form.value = "1";
		form.focus();
		return false;
	}
	else
	{
		if (parseInt(form.value) <= 0 )
		{
			alert(fieldAlt + "Àº 0 º¸´Ù Ä¿¾ßÇÕ´Ï´Ù.");
			form.value = "1";
			form.focus();
			return false;
		}
		else
		{
			form.value = parseInt(form.value);
		}
	}
}


function isNumeric(s) {
	for (i=0; i<s.length; i++) {
		c = s.substr(i, 1);
		if (c < "0" || c > "9") return false;
	}
	return true;
}

/***************************************************************************
   Input type="Text"¸¦ µ·¿¡ °ü·ÃµÈ ³»¿ëÀ¸·Î »ç¿ë
   µ·¿¡ '100,000'°ú °°ÀÌ ','À» Ãß°¡ ½ÃÄÑÁØ´Ù.
  
   Event Handlers : onBlur  
   °ü·Ã ÇÔ¼ö : removeFormattedMoney(), isNumber(), util.js::reverse()
   »ç¿ë ¹æ¹ý : onBlur="formattedMoney(this)"
***************************************************************************/
function formattedMoney(v) {
  var format = "";
  var a=removeFormat(v.toString(),',');
  a = parseInt10(a);
  var money =a.toString();

  money = reverse(money);
  
  for(var i = money.length-1; i > -1; i--) {
    if((i+1)%3 == 0 && money.length-1 != i) format += ",";
    format += money.charAt(i);
  }
  return format;
}


/**************************************************************************
   StringÀ» ²¨²Ù·Î ¸¸µé¾î ÁØ´Ù.
**************************************************************************/
function reverse(s) {
  var rev = "";
  
  for(var i = s.length-1; i >= 0 ; i--) {
    rev += s.charAt(i);
  }
  
  return rev;
}

/*********************************************************************
    INPUT elementsÀÇ NULL¿©ºÎ Ã¼Å©
**********************************************************************/
function isNull(form_field, msg)
{
  if ( form_field.type == "text" || form_field.type == "textarea" || form_field.type =="password")  {
    if ( (form_field.value == "") || (form_field.value == null) )  {
      alert('[' + msg + ']¸¦(À») ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
      form_field.focus();
      return true;
    }
  }
  else if ( form_field.type == "select-one" ) {
    if ( form_field.selectedIndex == 0 ) {
      alert('[' + msg + ']¸¦(À») ¼±ÅÃÇÏ½Ã±â ¹Ù¶ø´Ï´Ù!');
      return true;
    }
  }
  else if ( form_field[0].type == "radio" )  {
    var cn = 0;
    var r_cn = 0;

    for(var k=0; k<(document.forms.length); k++)  {
      for(var l=0; l<(document.forms[k].length); l++)  {
        if ( document.forms[k].elements[l].name == form_field[0].name )
        r_cn++;
      }
    }

    for(var n=0; n < r_cn; n++)   {
      if ( form_field[n].checked )
      cn++;
    }
    if ( cn == 0 )  {
      alert('[' + msg + ']¸¦(À») ¼±ÅÃÇÏ½Ã±â ¹Ù¶ø´Ï´Ù!');
      return true;
    }
  }
  else
  {}

  return false;
}


/*************post ¹æ½ÄÀ¸·Î SubmitÇØÁÖ´Â method****************/
function submit(form, target, action) {
  eval(form).method = "post";
  eval(form).action = action;
  eval(form).target = target;
  eval(form).submit();
}



/*************************************************************************
  »õ·Î¿î À©µµ¿ì¸¦ ¸¸µé¾î ÁØ´Ù.

  ÆÄ¶ó¸ÞÅÍ : ¸µÅ©Á¤º¸, À©µµ¿ì† ÀÌ, À©µµ¿ì ³ôÀÌ
*************************************************************************/
function centerNewWin(url, winName, width, height) {
  var wi = screen.width - width;
  var hi = screen.height - height;
  
  if( wi < 0 ) wi = 0;   
  if( hi < 0 ) hi = 0;
  
  var info = 'left=' + (wi/2) + ',top=' + (hi/2) + ',width='  + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubars=no,status=yes';
  var newwin = window.open(url, winName, info);
  //newwin.focus();
  return newwin;
}  

function centerNewWin2(url, winName, width, height) {
  var wi = screen.width - width;
  var hi = screen.height - height;
  
  if( wi < 0 ) wi = 0;   
  if( hi < 0 ) hi = 0;
  
  var info = 'left=' + (wi/2) + ',top=' + (hi/2) + ',width='  + width + ',height=' + height + ',resizable=no,scrollbars=yes,menubars=no,status=no';
  var newwin = window.open(url, winName, info);
  //newwin.focus();	ÆË¾÷Â÷´Ü ºê¶ó¿ìÀú¿¡¼­ ¿¡·¯¹ß»ýÇÏ¿© ÁÖ¼®Ã³¸®ÇÔ ¹Ú´ë°Ç
  return newwin;
}

function centerNewWin3(url, winName) {

  var info = 'resizable=yes,scrollbars=yes,menubars=yes,status=yes';
  info = '';
  var newwin = window.open(url, winName, info);
  newwin.focus();
}


function centerNewWinNoScroll(url, winName, width, height) {
  var wi = screen.width - width;
  var hi = screen.height - height;
  
  if( wi < 0 ) wi = 0;   
  if( hi < 0 ) hi = 0;
  
  var info = 'left=' + (wi/2) + ',top=' + (hi/2) + ',width='  + width + ',height=' + height + ',resizable=no,scrollbars=no,menubars=no,status=no';
  var newwin = window.open(url, winName, info);
  newwin.focus();
  return newwin;
}


/*************************************************************************
  »õ·Î¿î À©µµ¿ì¸¦ ¸¸µé¾î ÁØ´Ù.

  ÆÄ¶ó¸ÞÅÍ : ¸µÅ©Á¤º¸, À©µµ¿ìÀÌ¸§, À©µµ¿ì† ÀÌ, À©µµ¿ì ³ôÀÌ
*************************************************************************/ 
function rightNewWin(url,winName, width,height) {
  var wi = screen.width - width;
  var hi = 0;
  
  if( wi < 0 ) wi = 0;   
  if( hi < 0 ) hi = 0;
  
  var info = 'left=' + wi + ',top=' + hi + ',width='  + width + ',height=' + height + ',resizable=yes,scrollbars=auto,menubars=no,status=no';
  var newwin = window.open(url, winName,info);
  newwin.focus();
  return newwin;
} 

/*************************************************************************
  »õ·Î¿î À©µµ¿ì¸¦ ¸¸µé¾î ÁØ´Ù.

  ÆÄ¶ó¸ÞÅÍ : ¸µÅ©Á¤º¸, À©µµ¿ì† ÀÌ, À©µµ¿ì ³ôÀÌ
*************************************************************************/
function leftNewWin(url, winName, width, height) {
  var wi = 0;
  var hi = 0;
  
  var info = 'left=' + wi + ',top=' + hi + ',width='  + width + ',height=' + height + ',resizable=yes,scrollbars=auto,menubars=no,status=no';
  var newwin = window.open(url,winName,info);
  newwin.focus();
  return newwin;
}

function leftNewWin1(url, winName, width, height) {
  var wi = 0;
  var hi = 0;
  
  var info = 'left=' + wi + ',top=' + hi + ',width='  + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubars=yes,status=no';
  var newwin = window.open(url,winName,info);
  newwin.focus();
  return newwin;
}


/*************************************************************************
   Çü½ÄÈ­µÈ ³»¿ëÀÇ ½Éº¼µéÀ» ¾ø¾Ö°í ¿ø·¡ÀÇ ³»¿ë¸¸À» º¸¿©ÁØ´Ù.
   
   ex)
   var str = "31,000";
   var res = removeFormat(str, ",");
   
   result : res -> 31000
*************************************************************************/
function removeFormat(content, sep) {
  var real = "";
  var contents = content.split(sep);
  
  for(var i = 0; i < contents.length; i++) {
    real += contents[i];
  }
  
  return real;
}

function parseInt10(data){
	return parseInt(data, 10);
}


/***************************************************************************
  ÁÖ¹Î¹øÈ£ Ã¼Å©
  ÀÔ·ÂÇ×¸ñ: 
           preNoRes : ÁÖ¹Î¹øÈ£¾Õ 6ÀÚ¸® ÇÊµå
           postNoRes:ÁÖ¹Î¹øÈ£µÚ7ÀÚ¸®ÇÊµå
***************************************************************************/
function checkNoRes(preNoRes, postNoRes){
  if (preNoRes.value.length != 6){
    alert("¿Ã¹Ù¸¥ ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
    preNoRes.focus();
    return false;
  }
  else if (postNoRes.value.length != 7){
    alert("¿Ã¹Ù¸¥ ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
    postNoRes.focus();
    return false;
  }
  else {
    var str_serial1 = preNoRes.value;
    var str_serial2 = postNoRes.value;

    var digit=0
    for (var i=0;i<str_serial1.length;i++){
      var str_dig=str_serial1.substring(i,i+1);
      if (str_dig<'0' || str_dig>'9'){ 
          digit=digit+1 
      }
    }

    if ((str_serial1 == '') || ( digit != 0 )){
      alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
      preNoRes.focus();
      return false;   
    }

    var digit1=0
    for (var i=0;i<str_serial2.length;i++){
      var str_dig1=str_serial2.substring(i,i+1);
      if (str_dig1<'0' || str_dig1>'9'){ 
          digit1=digit1+1 
      }
    }

    if ((str_serial2 == '') || ( digit1 != 0 )){
      alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
      postNoRes.focus();
      return false;   
    }

    if (str_serial1.substring(2,3) > 1){
      alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
      preNoRes.focus();
      return false;   
    }

    if (str_serial1.substring(4,5) > 3){
      alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
      preNoRes.focus();
      return false;   
    } 

    if (str_serial2.substring(0,1) > 6 || str_serial2.substring(0,1) == 0){
      alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
      postNoRes.focus();
      return false;   
    }

    var a1=str_serial1.substring(0,1)
    var a2=str_serial1.substring(1,2)
    var a3=str_serial1.substring(2,3)
    var a4=str_serial1.substring(3,4)
    var a5=str_serial1.substring(4,5)
    var a6=str_serial1.substring(5,6)
    
    var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7

    var b1=str_serial2.substring(0,1)
    var b2=str_serial2.substring(1,2)
    var b3=str_serial2.substring(2,3)
    var b4=str_serial2.substring(3,4)
    var b5=str_serial2.substring(4,5)
    var b6=str_serial2.substring(5,6)
    var b7=str_serial2.substring(6,7)
    
    var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
    
    check_digit = check_digit%11
    check_digit = 11 - check_digit
    check_digit = check_digit%10

    if (check_digit != b7){
      alert('Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇÏ½Ã°í ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
      postNoRes.focus();
      return false;   
    }
  }
  return true;
}


/***************************************************************************
  ³â/¿ù/ÀÏÀ» ÀÔ·ÂÇÏ¸é ³ªÀÌ¸¦ ¸®ÅÏÇØÁØ´Ù.
***************************************************************************/
function returnAge(yy, mm, dd) {

	days = new Date();
	gdate = days.getDate();
	gmonth = days.getMonth();
	gyear = days.getYear();
	age = gyear - yy;
	if((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
		age = age;
	}
	else {
		if(mm <= (gmonth)) {
			age = age;
		}
		else {
			age = age - 1; 
		}
	}
	if(age == 0)
		age = age;
		
	return age;
}


/***************************************************************************
  Modal·Î ¶ç¾îÁö´Â ´ÙÀÌ¾ó·Î±×Ã¢À» »ý¼ºÇÑ´Ù.
***************************************************************************/
window.hasModal = false;
var modal = null;

function doModal(url, windowStyle)
{
    window.hasModal = true;
    
    var returnValue = showModalDialog(url, window, windowStyle);
    
    window.hasModal = false;
    return returnValue;
}

//³¯Â¥ À¯È¿¼ºÃ¼Å©
function CheckDateFields(formName, fields)
{
	var objForm = document.forms[formName];
	
	var yy = objForm[fields[1]].value;
	var mm = objForm[fields[2]].value;
	var dd = objForm[fields[3]].value;
		
	if(!IsValidDate(yy+mm+dd))
	{
		alert(fields[0] + "ÀÇ ³¯ÀÚÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
		objForm[fields[1]].focus();
		return false;
	}

	
	return true;
}
	
function IsValidDate(date)
{
	var year, month, day;

	if(date.length<8) return false;
	if(isNaN(date)) return false;
	if(date.length<8) return false;

	year	= date.substring(0,4);
	month	= date.substring(4,6);
	day		= date.substring(6);

	if(month==0 || month>12) return false;

	if(day==0 || day>GetDaysInMonth(year, month)) return false;

	return true;
}


function GetDaysInMonth(year,month)  {
   var days;
   if (month==1 || month==3 || month==5 || month==7 || month==8 ||
	  month==10 || month==12)  days=31;
   else if (month==4 || month==6 || month==9 || month==11) days=30;
   else if (month==2)  {
	  if (LeapYear (year)==1)  days=29;
	  else days=28;
   }
   return (days);
}

function LeapYear (Year) {
		if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0))
				return (1);
		else
				return (0);
}
    
//´ÙÀ½ INPUT¹Ú½º·Î Æ÷Ä¿½º ÀÌµ¿
function moveFocus(num,fromform,toform){
	var str = fromform.value.length;
	if(str == num)
		 toform.focus();
}


function checkEmail(invalue){
	var retval = true;

	// ¿ä·± ¹®ÀÚ°¡ µé¾îÀÖÀ¸¸é ¾ÈµÇÁÒ~

	if (invalue.indexOf("/") >= 0)   retval = false;
	if (invalue.indexOf(".@") >= 0)  retval = false;
	if (invalue.indexOf("@.") >= 0)  retval = false;
	if (invalue.indexOf("@@") >= 0)  retval = false;
	if (invalue.indexOf(",") >= 0)   retval = false;
	if (invalue.indexOf(" ") >= 0)   retval = false;
	if (invalue.indexOf("http:") >= 0)   retval = false;
	  
	// ¿ä·± ¹®ÀÚ°¡ ¾È µé¾îÀÖÀ¸¸é ¾ÈµÇÁÒ~
	if (invalue.indexOf("@") == -1)   retval = false;
	if (invalue.indexOf(".") == -1)   retval = false;
	    
	// ¿ä·± ¹®ÀÚ°¡ Ã³À½ ³ª¿À¸é ¾ÈµÇÁÒ~

	if (invalue.indexOf("@") == 0)    retval = false;
	if (invalue.indexOf(".") == 0)    retval = false;
	    
	// ¿ä·± ¹®ÀÚ°¡ ¸¶Áö¸·¿¡ ³ª¿À¸é ¾ÈµÇÁÒ~
	if (invalue.charAt(invalue.length-1) == ".")   retval = false;

	return retval;     
 }

//whitemanÀÌ Ãß°¡ÇÔ. 2005-06-28. ÁÖ¹®½Ã ÀÌ¸ÞÀÏÀÌ ºÎÁ¤È®ÇÒ °æ¿ì ½Ç½Ã°£ ¸ÞÀÏ¿¡¼­ ¿¡·¯°¡ ³².  ^^;
function checkEmail2(invalue)
{
	var strPattern = "^[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*@[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+$";
	
	if (invalue.match(strPattern))
	{
		return true;
	}
	else
	{
		return false;
	}
} 

//======================== ms ¼Ò¼Û ¹®Á¦·Î flash º¸¿©ÁÖ±â =================================

///ÇÃ·¡½Ã º¸±â
//path	: ÇÃ·¡½Ã °æ·Î
//wid	: °¡·Î »çÀÌÁî
//hei	: ¼¼·Î »çÀÌÆ®
function ViewFlash( path , width , height )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name=movie value='" + path + "'>" ;
	htmlBody = htmlBody + "<param name='quality' value='high'>" ;
	htmlBody = htmlBody + "<param name='allowScriptAccess' value='always'>";
	
	htmlBody = htmlBody + "<param name='wmode' value='transparent'>" ;
	htmlBody = htmlBody + "<embed src='" + path + "' quality='high' wmode='transparent' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "' allowScriptAccess='always'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;

	document.write(htmlBody)	; 
}

function ViewFlash3( path , width , height )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name='movie' value='" + path + "'>" ;
	htmlBody = htmlBody + "<param name='quality' value='high'>" ;
	htmlBody = htmlBody + "<param name='allowScriptAccess' value='always'>";
	htmlBody = htmlBody + "<embed src='" + path + "' quality='high' wmode='transparent' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "' allowScriptAccess='always'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;
	document.write(htmlBody)	; 
}

///ÇÃ·¡½Ãµ¿È­¿ë º¸±â
//path	: ÇÃ·¡½Ã °æ·Î
//wid	: °¡·Î »çÀÌÁî
//hei	: ¼¼·Î »çÀÌÆ®
function ViewFlashTale( path , width , height )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name=movie value='" + path + "'>" ;
	htmlBody = htmlBody + "<param name='quality' value='high'>" ;
	htmlBody = htmlBody + "<param name='allowScriptAccess' value='always'	>";
	htmlBody = htmlBody + "<param name='wmode' value='transparent'>";
	htmlBody = htmlBody + "<param name='allowFullScreen' value='true' />";
	htmlBody = htmlBody + "<embed src='" + path + "' quality='high' wmode='transparent' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "' allowScriptAccess='always'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;

	document.write(htmlBody)	; 
}

///ÇÃ·¡½Ã º¸±â ¹Ì¸®º¸±â¿ë
//path	: ÇÃ·¡½Ã °æ·Î
//wid	: °¡·Î »çÀÌÁî
//hei	: ¼¼·Î »çÀÌÆ®
function ViewFlashParam( path , width , height, flashvars )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name=movie value='" + path + "'>" ;
	htmlBody = htmlBody + "<param name='quality' value='high'>" ;
	htmlBody = htmlBody + "<param name='allowScriptAccess' value='always'>";
	htmlBody = htmlBody + "<param name='wmode' value='transparent'>" ;
	htmlBody = htmlBody + "<param name='flashvars' value='"+flashvars+"'";	
	htmlBody = htmlBody + "<embed src='" + path + "' quality='high' wmode='transparent' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "' allowScriptAccess='always'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;

	document.write(htmlBody)	; 
}

function GNBFlashView( path , width , height , param )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name=movie value='" + path + "?"+param+"'>" ;
	htmlBody = htmlBody + "<param name='quality' value='high'>" ;
	htmlBody = htmlBody + "<param name='allowScriptAccess' value='always'>";
	htmlBody = htmlBody + "<param name='wmode' value='transparent'>" ;
	htmlBody = htmlBody + "<embed src='" + path + "?"+param+ "' quality='high' wmode='transparent' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "' allowScriptAccess='always'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;

	document.write(htmlBody)	; 
}

//======================== ms ¼Ò¼Û ¹®Á¦·Î µ¿¿µ»ó º¸¿©ÁÖ±â =================================
///µ¿¿µ»óº¸±â
//path	: µ¿¿µ»ó °æ·Î
//wid	: °¡·Î ±æÀÌ
//hei	: ¼¼·Î ±æÀÌ
//autoStart		: ÀÚµ¿½ÃÀÛ À¯¹« 0:ÀÚµ¿½ÃÀÛ¾ÈÇÔ 1:ÀÚµ¿½ÃÀÛÇÔ
function  ViewMovie01( path , width , height , autoStart )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<OBJECT id=WMPlay1 codeBase="+strProtocol+"://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 type=application/x-oleobject width='" + width + "' height='" + height + "' standby='Loading Microsoft Windows Media Player components...' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95'>" ;
	htmlBody = htmlBody + "<PARAM NAME='FileName' VALUE='" + path + "'>" ;
	htmlBody = htmlBody + "<param name='AllowScan' value='-1'>" ;
	htmlBody = htmlBody + "<param name='AllowChangeDisplaySize' value='-1'>" ;
	htmlBody = htmlBody + "<param name='AnimationAtStart' value='1'>" ;
	htmlBody = htmlBody + "<param name='AudioStream' value='-1'>" ;
	htmlBody = htmlBody + "<param name='AutoStart' value='" + autoStart + "'>" ;
	htmlBody = htmlBody + "<param Name='AutoSize' Value='0'>" ;
	htmlBody = htmlBody + "<param name='AutoResize' value='-1'>" ;
	htmlBody = htmlBody + "<param name='AutoRewind' value='0'>" ;
	htmlBody = htmlBody + "<param name='Balance' value='0'>" ;
	htmlBody = htmlBody + "<param name='BaseURL'>" ;
	htmlBody = htmlBody + "<param name='BufferingTime' value='5'>" ;
	htmlBody = htmlBody + "<param name='CaptioningID'>" ;
	htmlBody = htmlBody + "<param name='ClickToPlay' value='-1'>" ;
	htmlBody = htmlBody + "<param name='CursorType' value='0'>" ;
	htmlBody = htmlBody + "<param name='CurrentPosition' value='-1'>" ;
	htmlBody = htmlBody + "<param name='CurrentMarker' value='0'>" ;
	htmlBody = htmlBody + "<param name='DefaultFrame'>" ;
	htmlBody = htmlBody + "<param name='DisplayBackColor' value='0'>" ;
	htmlBody = htmlBody + "<param name='DisplayForeColor' value='16777215'>" ;
	htmlBody = htmlBody + "<param name='DisplayMode' value='0'>" ;
	htmlBody = htmlBody + "<param name='DisplaySize' value='4'>" ;
	htmlBody = htmlBody + "<param name='Enabled' value='-1'>" ;
	htmlBody = htmlBody + "<param name='EnableContextMenu' value='0'>" ;
	htmlBody = htmlBody + "<param name='EnablePositionControls' value='-1'>" ;
	htmlBody = htmlBody + "<param name='EnableFullScreenControls' value='-1'>" ;
	htmlBody = htmlBody + "<param name='EnableTracker' value='-1'>" ;
	htmlBody = htmlBody + "<param name='InvokeURLs' value='-1'>" ;
	htmlBody = htmlBody + "<param name='Language' value='-1'>" ;
	htmlBody = htmlBody + "<param name='PlayCount' value='1'>" ;
	htmlBody = htmlBody + "<param name='PreviewMode' value='0'>" ;
	htmlBody = htmlBody + "<param name='Rate' value='1'>" ;
	htmlBody = htmlBody + "<param name='ShowStatusBar' value='true'>" ;
	htmlBody = htmlBody + "<embed name='WMPlay1' width='"+width+"' height='"+height+"' type='application/x-mplayer2' pluginspage='"+strProtocol+"://www.microsoft.com/windows/mediaplayer/download/' src='"+path+"' showcontrols='1' showstatusbar='0' autostart='"+autoStart+"'></embed> ";
	htmlBody = htmlBody + "'</OBJECT>" ;
	document.write(htmlBody)	; 
}

//======================== ms ¼Ò¼Û ¹®Á¦·Î µ¿¿µ»ó º¸¿©ÁÖ±â =================================
///À½¿øµè±â
//path	: À½¿ø °æ·Î
//wid	: °¡·Î ±æÀÌ
//hei	: ¼¼·Î ±æÀÌ(80°íÁ¤ÇÏÀÚ)
//autoStart		: ÀÚµ¿½ÃÀÛ À¯¹« 0:ÀÚµ¿½ÃÀÛ¾ÈÇÔ 1:ÀÚµ¿½ÃÀÛÇÔ
function  ViewMusic01( path , width , autoStart )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<OBJECT id=WMPlay1 codeBase="+strProtocol+"://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 type=application/x-oleobject width='" + width + "' standby='Loading Microsoft Windows Media Player components...' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95'>" ;
	htmlBody = htmlBody + "<PARAM NAME='FileName' VALUE='" + path + "'>" ;
	htmlBody = htmlBody + "<param name='AutoStart' value='" + autoStart + "'>" ;
	htmlBody = htmlBody + "<param name='ShowControls' value='1'>" ;
	htmlBody = htmlBody + "<param name='ShowStatusBar' value='0'>" ;
	htmlBody = htmlBody + "<embed name='WMPlay1' width='"+width+"' type='application/x-mplayer2' pluginspage='"+strProtocol+"://www.microsoft.com/windows/mediaplayer/download/' src='"+path+"' showcontrols='1' showstatusbar='0' autostart='"+autoStart+"'></embed> ";
	htmlBody = htmlBody + "'</OBJECT>" ;
	document.write(htmlBody)	; 
}

//¹®ÀÚ¿­ÀÌ ¼ýÀÚ·Î¸¸ ±¸¼ºÀÌ µÇ¾ú´ÂÁö Ã¼Å©ÇÑ´Ù.
//¼ýÀÚ¸¸ ÀÖÀ» °æ¿ì true, ¾Æ´Ñ °æ¿ì false¸¦ ¸®ÅÏÇÑ´Ù.
function checkNumberOnly(strTemp){
	var blReturn = false;
	var objRe = new RegExp("[^0-9]","gi");

	if (objRe.test(strTemp))
	{
		blReturn = false;
	}
	else
	{
		blReturn = true;
	}

	return blReturn;
}

/*
»ç¾÷ÀÚ µî·Ï¹øÈ£ Ã¼Å©
*/
function check_busino(vencod) 
{ 
	var sum = 0; 
	var getlist = new Array(10); 
	var chkvalue =new Array("1","3","7","1","3","7","1","3","5");  

	try
	{
		for(var i=0; i<10; i++) 
		{ 
			getlist[i] = vencod.substring(i, i+1); 
		}         

		for(var i=0; i<9; i++) 
		{ 
			sum += getlist[i]*chkvalue[i]; 
		}  

		sum		= sum + parseInt((getlist[8]*5)/10); 
		sidliy	= sum % 10; 
		sidchk	= 0;        

		if(sidliy != 0)
		{ 
			sidchk = 10 - sidliy; 
		} 
		else 
		{
			sidchk = 0; 
		}         

		if(sidchk != getlist[9]) 
		{ 
			return false; 
		} 

		return true; 
	}
	catch(e)
	{
		return false;
	}
} 

//HTMLÅÂ±× Á¦°ÅÄÚµå
function hrmlTagRemove(strHtml){
	var objRegExp = new RegExp("<html(.*|)<body([^>]*)>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("</body(.*)</html>(.*)","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("<[/]*(div|layer|body|html|head|meta|form|input|select|textarea|base|font|br|p|b|img|embed|object|span|table|tbody|tr|td|embed|u|a|strong|li|em|col|bgsound|script|center|h1|hr|o:p)[^>]*>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("<(style|script|title|link)(.*)</(style|script|title)>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("<[/]*(scrit|style|title|xmp)>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("&nbsp;","gi");
	strHtml = strHtml.replace(objRegExp,"");

	return strHtml;
}


//ÄíÆù´Ù¿î·Îµå
function downloadCoupon(coupNo, goodsNo)
{
	if(document.all["LoginYnH"].value=="N")
	{
		alert("·Î±×ÀÎÀ» ÇÏÁö ¾Ê¾Ò½À´Ï´Ù. \n·Î±×ÀÎ ÈÄ ÄíÆùÀ» ´Ù¿î¹ÞÀ¸½Ê½Ã¿À");
		location.href = "https://www.yes24.com/Templates/FTLogIn.aspx?ReturnURL="+document.location.href.replace(/&/g, "`").replace("?", "&&ReturnParams=");
		//document.location = 
	}
	else
	{
		
		window.open("/eventworld/popup_CouponDownA1.aspx?CoupNo="+coupNo+"&GoodsNo="+goodsNo, "", "toolbars=no, scrollbars=no, width=500, height=577");
		/*
		var req = new ActiveXObject("Microsoft.XMLHTTP");
		var uri = "/Goods/FTCoupDownload.aspx?CoupNo=" + coupNo + "&MemNo=" + document.all["HdMemNo"].value + "&GoodsNo=" + goodsNo;

		req.open("GET", uri, false);
		req.send();
		var message = req.responseText;

		alert(message);
		*/
	}
}



function popEventPage(url, winName, width, height, mleft, mtop)
{
	var wi = screen.width - width;
	var hi = screen.height - height;
	
	if( wi < 0 ) wi = 0;   
	if( hi < 0 ) hi = 0;
	
	var info = 'left=' + ((wi/2)-mleft) + ',top=' + ((hi/2)-mtop) + ',width='  + width + ',height=' + height + ',resizable=no,scrollbars=no,menubars=no,status=no';
	var newwin = window.open(url, winName, info);
	newwin.focus();
	return newwin;
}


function GetCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return null;
}

function GetCardCode(v) {
	var cardcode = "";
	switch (v)
	{

		case "01":  //BCÄ«µå
			cardcode="CCBC";
			break;
		case "02":  //±¹¹ÎÄ«µå
			cardcode="CCKM";
			break;
		case "03":  //LGÄ«µå
			cardcode="CCLG";
			break;
		case "04":  //»ï¼ºÄ«µå
			cardcode="CCSS";
			break;
		case "05":  //¿ÜÈ¯Ä«µå
			cardcode="CCKE";
			break;
		case "06":  //½ÅÇÑÄ«µå
			cardcode="CCSH";
			break;
		case "07":  //¼öÇùÄ«µå
			cardcode="CCSU";
			break;
		case "08":  //±¤ÁÖÀºÇà
			cardcode="CCKJ";
			break;
		case "09":  //Á¶ÈïÄ«µå(°­¿øÀºÇà). ½ÅÇÑÀºÇàÀ¸·Î Ã³¸®ÇÔ..
			cardcode="CCSH";
			break;
		case "10":  //ÇÏ³ªÀºÇà
			cardcode="CCHN";
			break;
		case "11":  //±¹³»¾Æ¸ß½º. ·Ôµ¥ ¾Æ¸ß½º·Î º»´Ù..
			cardcode="CCLO";
			break;
		case "13":  //(±¸)ÇÑ¹Ì,½Å¼¼°èÇÑ¹Ì
			cardcode="CCCT";
			break;
		case "16":  //Á¦ÁÖÀºÇà
			cardcode="CCCJ";
			break;
		case "17":  //ÀüºÏÀºÇà
			cardcode="CCJB";
			break;
		case "18":  //Çö´ëÄ«µå
			cardcode="CCDI";
			break;
		case "19":  //½ÃÆ¼ÀºÇà
			cardcode="CCCT";
			break;
		case "24":  //·Ôµ¥Ä«µå   º¸ÈÆÀº ÀÌ °ªÀ¸·Î »ç¿ëÇÏ³×.. CCAM
			cardcode="CCLO";
			break;
		case "26":  //»ê¾÷ÀºÇàÄ«µå
			cardcode="CCKD";
			break;
		default:
			cardcode="";
	}		
	return cardcode;
}

function getPgCode(v)
{
	var Pgcode = "";  //01:KCP, 03:INICIS, 04:BOHOUN
	switch (v)
	{
		case "01":  // BCÄ«µå
			Pgcode="03";
			break;
		case "02":  // ±¹¹ÎÄ«µå
			Pgcode="03";
			break;
		case "03":  // LGÄ«µå
			Pgcode="03";
			break;
		case "04":  // »ï¼ºÄ«µå
			Pgcode="03";
			break;
		case "05":  // ¿ÜÈ¯Ä«µå
			Pgcode="03";
			break;
		case "06":  // ½ÅÇÑÄ«µå
			Pgcode="03";
			break;
		case "07":  // ¼öÇùÄ«µå
			Pgcode="03";
			break;
		case "08":  // ±¤ÁÖÀºÇà
			Pgcode="03";
			break;
		case "09":  // °­¿øÀºÇà
			Pgcode="03";
			break;
		case "10":  // ÇÏ³ªÀºÇà
			Pgcode="03";
			break;
		case "11":  // ±¹³»¾Æ¸ß½º
			Pgcode="01";
			break;
		case "12":  // ÇØ¿Ü¾Æ¸ß½º
			Pgcode="03";
			break;
		case "13":  // ÇÑ¹ÌÀºÇà
			Pgcode="03";
			break;
		case "14":  // ÃàÇùÄ«µå
			Pgcode="03";
			break;
		case "15":  // ÆòÈ­ÀºÇà
			Pgcode="03";
			break;
		case "16":  // Á¦ÁÖÀºÇà
			Pgcode="03";
			break;
		case "17":  // ÀüºÏÀºÇà
			Pgcode="03";
			break;
		case "18":  // Çö´ëÄ«µå
			Pgcode="03";
			break;
		case "19":  // ½ÃÆ¼ÀºÇà
			Pgcode="03";
			break;
		case "20":  // µ¿³²ÀºÇà
			Pgcode="03";
			break;
		case "21":  // ÇØ¿ÜºñÀÚ
			Pgcode="03";
			break;
		case "22":  // ÇØ¿Ü¸¶½ºÅ¸Ä«µå
			Pgcode="03";
			break;
		case "23":  // ÇØ¿ÜJCBÄ«µå
			Pgcode="03";
			break;
		case "24":  // ·Ôµ¥Ä«µå
			Pgcode="01";
			break;
		case "25":  // ±âÅ¸
			Pgcode="03";
			break;
		case "26":  // »ê¾÷ÀºÇàÄ«µå
			Pgcode="03";
			break;
		case "27":  // ±¹¹ÎÄ«µå-Ã¼¸®
			Pgcode="03";
			break;
		default:
			Pgcode="03";
	}		
	return Pgcode;
	
}

function getCookie( name ) {
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ) {
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}

function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function redirectToHttps()
{
	var url = document.location.href;
	if(url.search("http://") != -1)
	{
		url = url.replace("http://", "https://");
		location.href = url;
	}
}

function redirectToHttps(formId)
{
	var url = document.location.href;
	if(url.search("http://") != -1)
	{
		url = url.replace("http://", "https://");
		var form = document.getElementById(formId);
		if(form != null)
			submit(form,"", url);
		else
			location.href = url;
	}
}

//ÄíÅ°ÀúÀåÇÏ±â
function setCookie(name, value, expiredays)
{
	try
	{
		var todayDate = new Date();
		todayDate.setDate(todayDate.getDate() + expiredays);
		if(typeof expiredays != "undefined" && expiredays)
		    document.cookie = name + "=" + escape(value) + "; path=/;expires=" + todayDate.toGMTString() + ";";
		else
		    document.cookie = name + "=" + escape(value) + "; path=/;";
	}
	catch(e){}
}

//ÄíÅ°°¡Á®¿À±â
/*
function getCookie(name)
{
	try
	{
		var Found = false;
		var start, end;
		var i = 0 ;

		while(i <= document.cookie.length)
		{
			start = i;
			end = start + name.length;
			if(document.cookie.substring(start, end) == name)
			{
				Found = true;
				break;
			}
			i++;
		}

		if(Found == true)
		{
			start = end + 1;
			end = document.cookie.indexOf(";", start);
			if(end < start)
			{
				end = document.cookie.length;
			}
			return document.cookie.substring(start, end) ;
		}
		return "" ;
	}
	catch(e){}
}
*/


/*
OZ ºÐ±â
*/
var isOzBrowser = false;
var RegOz = new RegExp("(((WV{1})([0-9]{2})(.){1}([0-9]{2})(.){1}([0-9]{2}))|(POLAR;){1}|((POLARIS ){1}([0-9]{2})(.)([0-9]{2}))){1}..((lgtelecom;){1})", "gi");
var currentDocumentUrl = document.URL;

//if (currentDocumentUrl.indexOf("m.yes24.com") > -1 && RegOz.test(navigator.appVersion)) {
if (RegOz.test(navigator.appVersion)) {

    setCookie("OZM", "True");    
}

if (getCookie("OZM") == "True") {
    isOzBrowser = true;

    document.writeln("<style>.OZHIDE{display:none !important;}.OZSHOW{display:block !important;}</style>");


    var relativeUrlSplitPosition = 0;
    if (currentDocumentUrl.indexOf("yes24.com") > 0) {
        relativeUrlSplitPosition = currentDocumentUrl.indexOf("yes24.com") + 9;
    }
    else {
        relativeUrlSplitPosition = 21; // for test ramses
    }
    var relativePath = currentDocumentUrl.substr(relativeUrlSplitPosition, currentDocumentUrl.length - relativeUrlSplitPosition);

    //OZ can't see splash page
    if (relativePath == "/" || relativePath.toLowerCase() == "/main/default.aspx") {
        location.href = "/Main/Book.aspx?CategoryNumber=001";
    }

    function rearraneSearchItemsByOzFunction(target) {
        for (var i = target.options.length - 1; i > -1; i--) {
            if (target.options[i].value != "±¹³»µµ¼­" &&
                target.options[i].value != "¿Ü±¹µµ¼­") {
                target.removeChild(target.options[i]);
            }
        }
    }
}
