/* ÆË¾÷Ã¢¶ç¿ì±â */
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, scrolling=no, width='+wid+', height='+hei+',top=200,left=400');


}

function winOpen2(file,wid,hei){
	if(file==""){ alert('ÆäÀÌÁö ÁØºñÁß'); return false;}
	window.open(file, 'ecatalog', 'status=no, toolbar=no, location=no, menubar=no, directories=no, resizeable=no, scrolling=no, width='+wid+', height='+hei);
}
/* ·Ñ¿À¹öÅÇ¸Þ´º */
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 positionMessage(){
	//dvSidebar menu id
	var elem=document.getElementById("top");
	// ÃÊ±â top À§Ä¡
	elem.style.top=document.documentElement.scrollTop + 325 + "px";
	setTimeout("moveElement()", 10);
}

function moveElement(){
	var elem = document.getElementById("top");
	start = parseInt (elem.style.top);
	end = document.documentElement.scrollTop + 325; // limit Á¤ÇÏ±â

	//start ¿Í end °°À¸¸é ¸ØÃá´Ù.
	if ( start != end ) {
		scale =   Math.ceil( Math.abs( end - start ) / 10 );

		//½ºÅ©·ÑÀÌ »ó´ÜÀ¸·Î ÀÌµ¿ÀÌ½Ã ¸¶ÀÌ³Ê½º°ª...
		if ( end < start )	{
			scale = -scale; // alert("end = "+end+" start = "+start);
		}
			elem.style.top = parseInt (elem.style.top)+ scale + "px";
	}
	setTimeout("moveElement()", 10);
}
/*¸Ç À§·Î°¡°¡±â*/
function topMove(){
	 document.documentElement.scrollTop = 0 +"px";
}

function addLoadEvent(func){
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }

}

/* Åõ¸í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 '';
}

