/* ÆË¾÷Ã¢¶ç¿ì±â */
function winOpen(file,wid,hei){

	if(file==""){ alert('ÆäÀÌÁö ÁØºñÁß'); return false;}

	window.open(file, 'add', 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizeable=no, scrollbars=yes, width='+wid+', height='+hei+',top=200,left=400');
}
function winOpen2(file,wid,hei){

	if(file==""){ alert('ÆäÀÌÁö ÁØºñÁß'); return false;}

	window.open(file, 'add', 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizeable=no, scrollbars=no, width='+wid+', height='+hei+',top=200,left=400');
}

/* ·Ñ¿À¹öÅÇ¸Þ´º
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

*/

/* µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î */

/*¸Ç À§·Î°¡°¡±â*/
function topMove(){
	 document.documentElement.scrollTop = 0 +"px";
}

 var yHeight;
 var yScroll;
 var yLimit=0;
 var elem;
 var yTop=0;
 var FooterH=80;
function positionMessage(){

 elem=document.getElementById("quick"); // ¸Þ´º ¿¤¸®¸ÕÆ®

 // ÃÊ±â top À§Ä¡
 // yHeight = parseInt(document.body.scrollHeight); // ÀüÃ¼ »çÀÌÁî
	yHeight=document.documentElement.scrollHeight;

  elem.pos=function(y){elem.style.top=y+"px";  }
	elem.y=yTop;
	elem.pos(elem.y);
  elem.limit = yHeight-elem.scrollHeight-FooterH;  //  y limit À§Ä¡

  setTimeout("moveElement()", 20);
}

var totView =0;
function moveElement(){

	start = parseInt (elem.style.top);
	yScroll = document.documentElement.scrollTop; //½ºÅ©·Ñ y À§Ä¡°ª
	yTemp = yTop; // ÀÏÁ¤ À§Ä¡°ªÀÌ»ó ³»·Á°¡¸é ¸Þ´º ¹Ù·Î ÀÌµ¿
	end = document.documentElement.scrollTop+yTop;
	elem.y +=   Math.floor((end - elem.y ) / 10 );
	if(elem.y>elem.limit){elem.y=elem.limit;}
	elem.pos(elem.y);

	 setTimeout("moveElement()", 10);
}

function addLoadEvent(func){

  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }

}

function quickMenu(str) {
	 this.top	= 0;														// default top À§Ä¡;
	 this.left = 907;														// default left À§Ä¡;

	 this.ele		= document.getElementById(str);		//¾×¼Ç element

	 this.footlimit = 300;											//ÇÏ´Ü¿¡¼­ 300±îÁö limit.
	 this.timer = null;

	 this.yHeight = parseInt(document.documentElement.scrollHeight); //¹®¼­³ôÀÌ
	 this.ele.limit = this.yHeight- this.footlimit; //
	 // element  position, left, top value setup
	 this.ele.style.position	=	"absolute";
	 this.ele.style.top				= this.top+"px";
	 this.ele.style.left			=	this.left+"px";
	 this.moveY	= this.top;

	}
	quickMenu.prototype.pos = function(){this.ele.style.top=this.moveY+"px";}
	quickMenu.prototype.move = function(){

		this.end = document.documentElement.scrollTop+this.top; /*½ºÅ©·ê¹Ù+À§Ä¡°ª*/
		this.moveY +=   Math.floor((this.end - this.moveY ) / 10 );

		if(this.moveY>this.ele.limit){this.moveY = this.ele.limit;}
		this.pos();// À§Ä¡°ª ÀÔ·Â
		this.timer = setTimeout(this.name+".move()",10);
	}
	quickMenu.prototype.cheagePostion = function(){
		this.ele.style.top =this.top+"px";
		this.ele.style.left=this.left+"px";

	}
	quickMenu.prototype.start = function(){

		this.start = parseInt (this.ele.style.top);
		this.timer = setTimeout(this.name+".move()",10);
	}

/* Åõ¸ípngÆÄÀÏ ½ºÅ©¸³Æ® */

function setPng24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter =
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src+"',sizingMethod='image');"
    obj.src='';
    return '';
}


// ±¸¸Å ¿¹¾à È®ÀÎ
function goReserve() {
  location.href="/store/good.php";
}

function chkNum(event, form) {
  // ÀÔ·ÂÅ°°ª Ã¼Å©
  // , Âï±â
  form.value = numberFormat(3, ',', form.value);
}

//Æ¯Á¤ ¹®ÀÚ¸¦ Á¦°ÅÇØ ÁÖ´Â ÇÔ¼ö
function strClear(str, chr) {
  var returnStr = "";
  for( i=0 ; i<str.length ; i++ ) {
    if( str.charAt(i) != chr )
      returnStr = returnStr + str.charAt(i);
    }
  returnStr = returnStr.split(" ").join("");
  return returnStr;
}

// Æ¯Á¤ ÀÚ¸®¼ö ¸¶´Ù Æ¯Á¤¹®ÀÚ Âï±â(ÀÚ¸®¼ö, Æ¯Á¤¹®ÀÚ, Ã¼Å©¹®ÀÚ)
function numberFormat(pos, chr, str) {
  str = str + "";
  str = strClear(str, chr);
  var strLen = str.length;
  strLen--;
  var strTmp = "";
  for( var i=0 ; i <= strLen ; i++ ) {
    if( i && (i%pos)==0 )
      strTmp = chr + strTmp;
    lo = strLen - i;
    strTmp = str.charAt(lo) + strTmp;
  }
  return strTmp;
}

