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 isNumericDot( value )
{	
	if (value == 8 || value == 9 || value == 13 || (value >= 37 && value <= 40) || value == 46 || (value >= 48 && value <= 57) ||  value == 110 || value == 190 || value == 192 || value == 27 || value == 116 || (value >= 96 && value <= 105))
		 return true;
	else return false;
}
// ¼ýÀÚ¸¸ ÀÔ·Â
// onkeydownÀ» »ç¿ëÇÒ °Í 2004/05/08 - ¹ÚÀÏÇü
function num_chekDot() { 
  if (isNumericDot(event.keyCode)==false){
		alert("¼ýÀÚ¿Í '.'¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue=false;
	}
}

//¼ýÀÚÀÎÁö Ã¼Å©
function isNumericBar( value )
{	
	if (value == 8 || value == 9 || value == 13 || value == 189 || value == 109 || (value >= 37 && value <= 40) || value == 46 || value == 27 || value == 116 || (value >= 48 && value <= 57) || (value >= 96 && value <= 105))
		 return true;
	else return false;
}
// ¼ýÀÚ¸¸ ÀÔ·Â
// onkeydownÀ» »ç¿ëÇÒ °Í 2004/05/08 - ¹ÚÀÏÇü
function num_chekBar() { 
  if (isNumericBar(event.keyCode)==false){
		alert("¼ýÀÚ¿Í '-'¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue=false;
	}
}

//¼ýÀÚÀÎÁö Ã¼Å©
function isNumeric( value )
{
	if (value == 8 || value == 9 || value == 13 || (value >= 37 && value <= 40) || value == 46 || value == 27 || value == 116 || (value >= 48 && value <= 57) || (value >= 96 && value <= 105))
		 return true;
	else return false;
}
// ¼ýÀÚ¸¸ ÀÔ·Â
// onkeydownÀ» »ç¿ëÇÒ °Í 2004/05/08 - ¹ÚÀÏÇü
function num_chek() { 
  if (isNumeric(event.keyCode)==false){
		alert("¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
		event.returnValue=false;
	}
}
// ÆÄÀÏ ºÎºÐ¿¡ ÅØ½ºÆ® ÀÔ·Â ¸øÇÏ°Ô ÇÏ±â À§ÇØ¼­
function fileWriteNot(){  
  event.returnValue=false;  
}

// ±â´É: ¹®ÀÚ¿­ÀÇ ¾Õ, µÚ °ø¹éÀ» Á¦°ÅÇÑ´Ù
// ÆÄ¶ó¹ÌÅÍ: ¹®ÀÚ¿­
// ¸®ÅÏ°ª: ¹®ÀÚ¿­
function trim(str)
{
	var s = str.replace(/^ */, "");
	s = s.replace(/ *$/, "");
	return  s;
}

//°³¹ß °ü·Ã °øÅë js

// »õÃ¢ ¶ç¿ì±â
// ÆÄ¶ó¹ÌÅÍ ¼³¸í
// name  : À©µµ¿ì Ã¢ ÀÌ¸§
// url   : »Ñ·ÁÁÙ ÆäÀÌÁö
// width : À©µµ¿ì Ã¢ ³ÐÀÌ
// height: À©µµ¿ì Ã¢ ³ôÀÌ
// toolbar : Åø¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// menubar : ¸Þ´º¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// statusbar : »óÅÂ¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// scrollbar : ½ºÅ©·Ñ¹Ù ³ªÅ¸³¾Áö ¿©ºÎ
// resizable : ¸®»çÀÌÁî ±â´É ¿©ºÎ
// ¿¹Á¦  : open_window('test.asp', 'test', '' ,'' ,'200','100','','','','','')
function open_window(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  /*
  target = window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str);
  target.focus();
  */
  window.open(url, name, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar_str+', menubar=' +menubar_str+', status='+statusbar_str+', scrollbars='+scrollbar_str+', resizable='+resizable_str);
}

// °Ë»ö¾î Æ¯¼ö ¹®ÀÚ Ã¼Å© 
// return : false (°Ë»ö¾ÈµÊ), true (Æ¯¼ö¹®ÀÚ°Ë»ö ¹× ¸Þ¼¼Áö)
function chkSpeChar( oInputCtrl)
{
	var speChar = " `~!#$%^&*+=|\\[]{}:;-,<>/?'\"";
	for(var iCnt = 0; iCnt < speChar.length; iCnt++)
	{
		special = speChar.substr(iCnt, 1);
		if( oInputCtrl.value.indexOf(special) != -1)
		{
			alert("Æ¯¼ö¹®ÀÚ[" + special + "]¸¦ °Ë»ö¾î¿¡ ÀÔ·Â ÇÒ ¼ö ¾ø½À´Ï´Ù.");
			return true;
		}
	}
	return false;
}

//Çà´ç¿ùÀÇ ³¯Â¥ ¼¿·ºÆ® ¹Ú½º
function chkDay(o,valYear, valMonth, valDay, dayValue){
	var tyearName,tMonthName,tDayName, lastDay,i;
	tyearName = eval(o + "." + valYear);
	tMonthName = eval(o + "." + valMonth);
	tDayName = eval(o + "." + valDay);
	//lert(tyearName.selectedIndex)
  //alert(tyearName.selectedIndex);
  //alert(tMonthName.selectedIndex);
	if(tyearName.selectedIndex>0 && tMonthName.selectedIndex>0){
		lastDay = getDayNum(parseInt(tyearName.value,10), parseInt(tMonthName.value,10));
		tDayName.options.length = lastDay+1;
		tDayName.options[0].value = "";
		tDayName.options[0].text  = "ÀÏ";
		
		for(i=0 ; i < lastDay ; i++) {
        //alert(tDayName.options[i].value);
		 if (i+1<10){
			 tDayName.options[i+1].value = "0"+(i+1);		  
			 tDayName.options[i+1].text  = "0"+(i+1);
		 }else{
			 tDayName.options[i+1].value = i+1;		  
			 tDayName.options[i+1].text  = i+1;
		 }
		}
		if (dayValue!=""){
			tDayName.selectedIndex = dayValue;
		}
		tDayName.focus();
	}else{		
		tDayName.options.length = 1;
		tDayName.options[0].value = "";
		tDayName.options[0].text  = "ÀÏ";
	}
}

//ÇØ´ç¿ùÀÇ ¸¶Áö¸·³¯Â¥
function getDayNum(valYear, valMonth){
	var monthDays;
		monthDays = [31,28,31,30,31,30,31,31,30,31,30,31];
		if ((((valYear % 4) == 0) && ((valYear % 100) != 0)) || ((valYear % 400) == 0)){
			monthDays[1] = 29;
		}
		return monthDays[parseInt(valMonth)-1];
}

// ¸ÞÀÏÁÖ¼Ò Ã¼Å©
function chkEmailAddr( sEmail)
{
	var sRegExp = /([\w|\-]+)@([\w|\-]+)\.(\w+)/;
	return sRegExp.test( sEmail)
}

//textarea ¹Ú½ºÀÇ ±ÛÀÚ Á¦¾î ÇÔ¼ö
//pInName : (¿¹ document.frmForm.content)
function showMsgLen(pInName, pLen, pMsgLen){
   if (getStrLen(eval(pInName+".value"))>pLen){
	  alert("¿µ¹® " + pLen + "ÀÚ, ÇÑ±Û " + pLen/2 + " ÀÌ³»·Î ÀÛ¼ºÇØ ÁÖ¼¼¿ä.");
	  eval(pInName+".focus()");
   }
	  pMsgLen.innerHTML = getStrLen(eval(pInName+".value")) + '/' + pLen;
}
function getStrLen(str){
	var len=0, j;
	
	for (i=0, j=str.length;
		i<j;
		i++, len++)
	{
		if ( (str.charCodeAt(i)<0)||(str.charCodeAt(i)>127) )
		{
			len = len+1;
		}
	}
	return len;
}

//´ÙÀ½ ÅÜÀ¸·Î ÀÌµ¿ÇÏ±â (ÁÖ¹Î¹øÈ£³ª ÀüÈ­ ¹øÈ£ µî)
function numTeb(o, pLen, pPre, pNext){
	if (eval("o." + pPre + ".value.length==" + pLen)){
    eval("o." + pNext + ".focus();");
		return;
	}
}

// ¸®½ºÆ®ÀÇ Ã¼Å©¹Ú½º ÀüÃ¼ ¼±ÅÃ ¹× ÇØÁö ÇÔ¼ö ½ÃÀÛ
/*ÀüÃ¼ ¼±ÅÃ ÇØÁ¦*/
function AllChk(o, pAll, pChk){
  var value;
  var tmpChkAll, tmpChk;
  tmpChkAll = eval("o." + pAll);
  tmpChk = eval("o." + pChk);   
  if (tmpChkAll.checked==true){
    value=true;
  }else{
    value=false;
  }
  if ( tmpChk != null ){
    var olen = eval(tmpChk.length);
    if ( olen != null ){
      for ( var i = 0 ; i < tmpChk.length ; i++ ){
        tmpChk[i].checked = value;
       }
    }else{
      tmpChk.checked = value;
    }
  }
}
/*°¢ Ã¼Å© ¹Ú½º¸¦ ¼±ÅÃÇÏ¿© ÀüÃ¼ Ã¼Å©¹Ú½º Á¦¾î*/
function chkBox(o, pAll, pChk){
  var value;
  var tmpChkAll, tmpChk;
  tmpChkAll = eval("o." + pAll);
  tmpChk = eval("o." + pChk);
  value = true;
  if ( tmpChk != null ){
    var olen = eval(tmpChk.length);
    if ( olen != null ){
      for ( var i = 0 ; i < tmpChk.length ; i++ ){
        if (tmpChk[i].checked == false){
          value=false;
          break;
        }
      }
    }else{
      if (tmpChk.checked == false){
          value=false;
      }
    }
  }
  tmpChkAll.checked=value;
}
 // ¸®½ºÆ®ÀÇ Ã¼Å©¹Ú½º ÀüÃ¼ ¼±ÅÃ ¹× ÇØÁö ÇÔ¼ö ³¡


 /*±ÝÁö´Ü¾î ÆË¾÷Ã¢*/
// function curseWordOpen(){
//  var winWord = window.open("admin/inc/curseWord.asp",winWord , "width=420,height=570,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
// }

// ÄíÅ°°ª °¡Á® ¿À±â (ÁÖ·Î ¿ÀÇÂÃ¢¿¡¼­ ÇÏ·ç¸¸ ºÎºÐ Á¦¿¡ ÇÒ¶§ »ç¿ë
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 "";
}

// ÀÌ¹ÌÁö width ¸¸ ÁÙÀÌ±â
function resizeImage(o, pWidth){
	var MAX_WIDTH=pWidth;
	if (o.width > MAX_WIDTH) {
		o.width = MAX_WIDTH;
	}
}
// ÀÌ¹ÌÁö width, height ÁÙÀÌ±â
function resizeImageWH(o, pWidth, pHeight){
	var MAX_WIDTH=pWidth;
  var MAX_HEIGHT=pHeight;
	if (o.width > MAX_WIDTH) {
		o.width = MAX_WIDTH;
	}
  if (o.height > MAX_HEIGHT) {
		o.height = MAX_HEIGHT;
	}
}
// ÀÌ¹ÌÁö ÆË¾÷Ã¢ À©µµ¿ì Å©±â¿¡ µû¶ó¼­ Á¦¾î
function ImageReSizeWindow(o){
  var objBody, height, width
  var version;
  version = navigator.appVersion;
  objBody = document.body
  height = objBody.offsetHeight + (objBody.offsetHeight - objBody.clientHeight)
  width = objBody.offsetWidth + (objBody.offsetWidth - objBody.clientWidth)
  if (o.width > o.height) {
    if(o.width <= width){      
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.width < window.screen.Width && o.width > width){
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.width >= window.screen.Width){
      width = window.screen.Width - 100;
      height = window.screen.Height - 100;
    }
    if(version.indexOf("Windows NT 5.1") > -1){
      height = height  + 20;
    }
    window.resizeTo(width, height); 
	}else{
    if(o.height <= height){      
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.height < window.screen.Height && o.height > height){
      width = o.width + 50;
      height = o.height + 120;
    }else if(o.height >= window.screen.Width){
      width = window.screen.Width - 100;
      height = window.screen.Height - 100;
    }
    if(version.indexOf("Windows NT 5.1") > -1){
      height = height  + 20;
    }
    window.resizeTo(width, height);
  }
}

// ¸ÞÀÎ , ¿ìÃø ¸¶¿ì½º ¿Â¿À¹ö½Ã ÀÌ¹ÌÁö º¯°æ ½ºÅ©¸³Æ® ½ÃÀÛ
function replaceImg(imgName,obj){
  obj.src = imgName; 
}

// ¸ÞÀÎ , ¿ìÃø ¸¶¿ì½º ¿Â¿À¹ö½Ã ÀÌ¹ÌÁö º¯°æ ½ºÅ©¸³Æ® ½ÃÀÛ
function replace2Img(imgName,obj, width, height){ 
//  obj.width = 100;
//  obj.height = 100;
//  obj.src = "images/blank.gif";
  obj.src = imgName;
  if (height==0){
    resizeImage(obj, width);
  }else{
    resizeImageWH(obj, width, height);
  }    
}

function showL(num){
  var temp;
  for(i=3;i<=6;i++){
    temp = "layer_" + i;
    if(i == num){
      document.all[temp].style.display = "";
    } else {
      document.all[temp].style.display = "none";
    }
  }
}

function hideL(){
  var temp;
  for(i=3;i<=6;i++){
    temp = "layer_" + i;
    document.all[temp].style.display = "none";
  }
}
//°Ë»ö
function searchSend(o) {
	if(trim(o.qt.value)=="") {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		o.qt.focus();
		return false;
	}
	return;
}


function PostalPop(frm){	
  var url;
  url = "join/PostalCode.asp@FrmName="+frm;
  window.open(url, "PostalCode", "width=378,height=242,status=no,scrollbars=yes");
}
// ±Ý¾× Ç¥½Ã ½ºÅ©¸³Æ®
function addCommas( strValue ){
  var tmpStr = "" + strValue;
  var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})'); 
  while(objRegExp.test(tmpStr)) { 
    tmpStr = tmpStr.replace(objRegExp, '$1,$2'); 
  } 
 return tmpStr; 
} 

// ÁÖ¹® ÇÁ¸°Æ® ÇÏ±â
function OrderPrint(OrderID, Name){
  url = "shoppingCart/Account_OrdPrint.asp@OrderID="+OrderID+"&Name="+Name;
  window.open(url, "PrintPage", "width=625, height=616, scrollbars=yes");
}
// ÁÖ¹® ÇÁ¸°Æ® ÇÏ±â
function productImgPopup(pCode){
  url = "product/productPopup.asp@productCode=" + pCode;
  window.open(url, "productImgPopup", "width=485, height=630, scrollbars=yes");
}

// image roll
function menuOver() {
	this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", ".gif");
}

function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}


// ÆË¾÷
function open_popup(url, wid, hei, scroll, winName)
{
	var url = url;
	var posi = "width="+ wid +",height="+hei+",toolbar=no,location=no,status=no,menubar=no,top=10,left=50,scrollbars=" + scroll +",resizable=no" ;
	if (winName == "")
	{
		winName = popup;
	}
	window.open(url,winName,posi);
}

//¸ñ·Ï»óÀÚ ¸µÅ©
function selectGo(dropdownName){
	var page = document.all[dropdownName].value;
	if(page !="") window.open(page);
}

//¸µÅ© ÁÖº¯ Á¡¼± ¾ø¾Ö±â
var myAnchors=document.all.tags("A"); 
function allblur() {
	for (i=0;i<myAnchors.length;i++) { 
		myAnchors[i].onfocus=new Function("blur()");
	} 
}

allblur();

function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 

//mook people thumnail image
function trendThumb(status,name)
{
	imgName=eval("thumb"+name);
	imgName.className="mp_trend_thumb_"+status;
}
function trendThumb01(status,name)
{
	imgName=eval("thumb"+name);
	imgName.className="mp_trend_thumb01_"+status;
}
// ÇÑ±Û Ã¼Å©
function IsKorean(formname){
		var intErr
		var strValue=formname
		var retCode=0
		
		for(var i=0;i<strValue.length;i++){
			var retCode=strValue.charCodeAt(i)
            var retChar=strValue.substr(i,1).toUpperCase()
            retCode=parseInt(retCode)
            
			if((retChar<'0' || retChar>'9')&&(retChar<'A' || retChar>'Z')&&((retCode>255) || (retCode<0))) return false;
        }
        return true;
}

// ÀÌ¹ÌÁö ÆË¾÷Ã¢ À©µµ¿ì Å©±â¿¡ µû¶ó¼­ Á¦¾î
function ImageReSizeWindow(o,width, height){
  var objBody, height, width
  var version;
  version = navigator.appVersion;
  objBody = document.body
    if(o.width <= width){      
      width = width;
    }else if(o.width < window.screen.Width && o.width > width){
      width = o.width + 70;
    }else if(o.width >= window.screen.Width){
      width = window.screen.Width - 100;
    }
    if(o.height <= height){  
      alert("a")
      height = height + 20;
    }else if(o.height < window.screen.Height && o.height > height){
      height = o.height + 50;
    }else if(o.height >= window.screen.Width){
      height = window.screen.Height - 100;
    }
    if(version.indexOf("Windows NT 5.1") > -1){
      height = height  + 20;
    }
    window.resizeTo(width, height);
}