var historyBlank = domain+"Libs/_js/blank.html?";
//##################################################################################
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 fnMenuMoveEnd(oMenu) { 
    var cnt = oMenu.length-1; 
    var i=0; 

    for (i=oMenu.length-1; i>=0; i--) { 
        if (Menulist_isSelected(oMenu, i)) { 
            if (i==oMenu.length-1) return; 
            var idx = i; 
            
            for (j=idx;j<cnt;j++) { 
                Menulist_downMenu(oMenu, idx); 
                idx = idx + 1; 
            } 
            cnt = cnt - 1; 
        } 
    } 
} 
/* ¸Þ´º ¸Ç À§·Î ÀÌµ¿ */ 
function fnMenuMoveStart(oMenu) { 
    var i=0; 
    var len = oMenu.length; 
    var cnt = 0; 
    for (i=0; i<oMenu.length; i++) { 
    if (Menulist_isSelected(oMenu, i)) { 
        if (i==0) return; 
        var idx = i; 

        for (j=idx;j>cnt;j--) { 
            Menulist_upMenu(oMenu, idx); 
            idx = idx - 1; 
        } 
        cnt = cnt + 1; 
        } 
    } 
} 
/* ¸Þ´º À§·Î ÀÌµ¿ */ 
function fnMenuMoveUp(oMenu) { 
    var i=0; 
    for (i=0; i<oMenu.length; i++) { 
        if (Menulist_isSelected(oMenu, i)) { 
            if (i==0) return; 
            Menulist_upMenu(oMenu, i); 
        } 
    } 
} 
/* ¸Þ´º ¾Æ·¡·Î ÀÌµ¿ */ 
function fnMenuMoveDown(oMenu) { 
    var i=0; 
    for (i=oMenu.length-1; i>=0; i--) { 
        if (Menulist_isSelected(oMenu, i)) { 
            if (i==oMenu.length-1) return; 
            Menulist_downMenu(oMenu, i); 
        } 
    } 
} 

/* °ªÀ» »èÁ¦ */
function fnMenuDelete(oMenu) {  	
	var sel_len=0;
	for(var i =0, j = oMenu.options.length;i<j;i++)
		if(oMenu.options[i].selected==true)
			sel_len++;
	if(oMenu.options.selectedIndex >= 0){
		fnMenuMoveEnd(oMenu);
		for(i=0,j=sel_len;i<j;i++)
			oMenu.options.length--;    
	}
} 

/* °ªÀ» ÀÔ·Â */
function fnMenuInsert(oMenu,val) {  
	if(val){
		oMenu.length=oMenu.length+1;
		oMenu.options[length].text=val;
		oMenu.options[length].value=val;
	}
} 


function Menulist_downMenu(oMenu, index) { 
    if (index < 0) return; 
    if (index == oMenu.length-1) { 
        return; // ´õ ÀÌ»ó ¾Æ·¡·Î ÀÌµ¿ÇÒ ¼ö ¾øÀ»¶§ 
    } 
    Menulist_moveMenu(oMenu, index, 1); 
} 

function Menulist_upMenu(oMenu, index) { 
    if (index < 0) return; 
    if (index == 0) { 
        return; // ´õ ÀÌ»ó À§·Î ÀÌµ¿ÇÒ ¼ö ¾øÀ»¶§ 
    } 
    Menulist_downMenu(oMenu, index-1); 
} 

function Menulist_isSelected(oMenu, idx) { 
    return (oMenu.options[idx].selected==true); 
} 
function Menulist_moveMenu(oMenu, index, distance) { 
    var tmpOption = new Option(oMenu.options[index].text, oMenu.options[index].value, false, 
    oMenu.options[index].selected); 
    for (var i=index; i<index+distance; i++) { 
        oMenu.options[i].text = oMenu.options[i+1].text; 
        oMenu.options[i].value = oMenu.options[i+1].value; 
        oMenu.options[i].selected = oMenu.options[i+1].selected; 
    } 
    oMenu.options[index+distance] = tmpOption; 
}  

//¼ýÀÚ ¾Æ´Ñ°ªÀ» ¼ýÀÚ·Î ¹Ù²Ù´Â ½ºÅ©¸³Æ®
function onlyDigit(el) {
		el.value = el.value.replace(/\D/g,'');
}

//»õÃ¢À» ¶ç¿ì´Â ÇÔ¼ö
function win_open(val,x,y,left,top){//»õ Ã¢À» ¶ç¿ì´Â ÇÔ¼ö
		//»õÃ¢ÀÇ Å©±â
		cw=x;
		ch=y;

		//½ºÅ©¸°ÀÇ Å©±â
		sw=screen.availWidth;
		sh=screen.availHeight;

		//¿­ Ã¢ÀÇ Æ÷Áö¼Ç
		if(!left)
			px=(sw-cw)/2;
		else
			px=Number(left)+20;
		if(!top)
			py=(sh-ch)/2;
		else
			py=Number(top)+20; 

		//Ã¢À» ¿©´ÂºÎºÐ
		window.open(val,'','left='+px+',top='+py+',width='+cw+',height='+ch+',toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no');
}

//## ÀÌ¹ÌÁö Ã¼Å© :: ie Àü¿ë ##
var checkImages = function(el, image) {
	if(document.all) {
		var imgs = el.getElementsByTagName("IMG");
		for(var i=0; i<imgs.length; i++) {
			imgs[i].onerror = function() {
				var obj = event.srcElement;
				obj.src = image ? image : domain+"images/no_thumb_goods.gif";
			}
		}
	}
}

//## flash object Ã³¸® ##
var flashDraw = function(i,s,w,h,t) {
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width="+w+" height="+h+" id="+i+"><param name=wmode value="+t+" /><param name=allowScriptAccess value=sameDomain /><param name=movie value="+s+" /><param name=quality value=high /><param name=menu value=false /><param name=loop value=false /><embed src="+s+" name="+i+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" width="+w+" height="+h+" allowScriptAccess=sameDomain loop=false menu=false></object>");
}

//## media player object Ã³¸® ##
var mediaDraw = function(i,s,w,h) {
	document.write("<object id='"+i+"' width='"+w+"' height='"+h+"' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'><param NAME='AudioStream' VALUE='-1'><param NAME='AutoSize' VALUE='0'><param NAME='AutoStart' VALUE='-1'><param NAME='AnimationAtStart' VALUE='-1'><param NAME='AllowScan' VALUE='-1'><param NAME='AllowChangeDisplaySize' VALUE='-1'><param NAME='AutoRewind' VALUE='0'><param NAME='Balance' VALUE='0'><param NAME='BaseURL' VALUE=''><param NAME='BufferingTime' VALUE='100'><param NAME='CaptioningID' VALUE=''><param NAME='ClickToPlay' VALUE='0'><param NAME='CursorType' VALUE='0'><param NAME='CurrentPosition' VALUE='-1'><param NAME='CurrentMarker' VALUE='0'><param NAME='DefaultFrame' VALUE='Slide'><param NAME='DisplayBackColor' VALUE='0'><param NAME='DisplayForeColor' VALUE='16777215'><param NAME='DisplayMode' VALUE='0'><param NAME='DisplaySize' VALUE='4'><param NAME='Enabled' VALUE='-1'><param NAME='EnableContextMenu' VALUE='0'><param NAME='EnablePositionControls' VALUE='-1'><param NAME='EnableFullScreenControls' VALUE='0'><param NAME='EnableTracker' VALUE='-1'><param NAME='Filename' VALUE='"+s+"'><param NAME='InvokeURLs' VALUE='-1'><param NAME='Language' VALUE='-1'><param NAME='Mute' VALUE='0'><param NAME='PlayCount' VALUE='1'><param NAME='PreviewMode' VALUE='0'><param NAME='Rate' VALUE='1'><param NAME='SAMILang' VALUE=''><param NAME='SAMIStyle' VALUE=''><param NAME='SAMIFileName' VALUE=''><param NAME='SelectionStart' VALUE='-1'><param NAME='SelectionEnd' VALUE='-1'><param NAME='SendOpenStateChangeEvents' VALUE='-1'><param NAME='SendWarningEvents' VALUE='-1'><param NAME='SendErrorEvents' VALUE='-1'><param NAME='SendKeyboardEvents' VALUE='0'><param NAME='SendMouseClickEvents' VALUE='0'><param NAME='SendMouseMoveEvents' VALUE='0'><param NAME='SendPlayStateChangeEvents' VALUE='-1'><param NAME='ShowCaptioning' VALUE='0'><param NAME='ShowControls' VALUE='1'><param NAME='ShowAudioControls' VALUE='1'><param NAME='ShowDisplay' VALUE='0'><param NAME='ShowGotoBar' VALUE='0'><param NAME='ShowPositionControls' VALUE='0'><param NAME='ShowStatusBar' VALUE='0'><param NAME='ShowTracker' VALUE='1'><param NAME='TransparentAtStart' VALUE='-1'><param NAME='VideoBorderWidth' VALUE='2'><param NAME='VideoBorderColor' VALUE='0'><param NAME='VideoBorder3D' VALUE='0'><param NAME='Volume' VALUE='-600'><param NAME='WindowlessVideo' VALUE=''></object>");
}

//## ÆäÀÌÁö ½ºÅ©·Ñ¹Ù À§Ä¡ ##
function getPageScroll() {
	var yScroll;
	if(self.pageYOffset) yScroll = self.pageYOffset;
	else if(document.documentElement && document.documentElement.scrollTop) yScroll = document.documentElement.scrollTop; // Explorer 6 Strict
	else if(document.body) yScroll = document.body.scrollTop; // all other Explorers
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

//## ÆäÀÌÁö »çÀÌÁî ##
function getPageSize(){
	var xScroll, yScroll;
	if(window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	}
	else if(document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	}
	else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if(self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	}
	else if(document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}
	else if(document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
	pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

//## ºí¶óÀÎµå ##
var sb_selects;
var screenBlind = function(mode) {
	if(mode == "on") {
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		var sendingImage = document.createElement("img");
		sendingImage.src = domain+"images/sending.gif";
		sendingImage.setAttribute('id','sendingImage');
		sendingImage.style.position = "absolute";
		sendingImage.width = "195";
		sendingImage.height = "18";
		sendingImage.style.zIndex = "150";
		sendingImage.style.top = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - sendingImage.height) / 2) + 'px';
		sendingImage.style.left = ((arrayPageSize[0] - sendingImage.width) / 2) + 'px';
		sendingImage.style.display = "block";
		$('screenBlind').appendChild(sendingImage);
		$('screenBlind').style.height = (arrayPageSize[1] + 'px');
		$('screenBlind').style.display = "block";
		sb_selects = document.getElementsByTagName("select");
		for(var i=0; i<sb_selects.length; i++) sb_selects[i].style.visibility = "hidden";
	}
	else if(mode=='off') {
		$('screenBlind').update('');
		$('screenBlind').style.display = "none";
		for(var i=0; i<sb_selects.length; i++) sb_selects[i].style.visibility = "visible";
	}
}

//## Ä«Å×°í¸® Ã³¸® ##
var changeCategory = function(from, to, val, extra1, extra2) {
	if(from.value==='') {
		to.options.length = 1;
		to.value = '';
	}
	else {
		var url = domain+"Libs/changeCategory.html?cVal="+ from.value +"&tObj="+ to.name;
		var myRequest = new Ajax.Request(url, {
			method: 'get',
			onSuccess: function(transport) {
				if(!transport.responseText.match(null)) {
					var optionsData = transport.responseXML.getElementsByTagName('options')[0];
					var option = optionsData.getElementsByTagName("option");
					to.options.length = 1;
					to.value = '';
					var optgroups = to.getElementsByTagName("optgroup");
					for(var i=parseInt(optgroups.length); i>0; i--) to.removeChild(optgroups[i-1]);
					for(var i=0; i<option.length; i++) {
						if(option[i].getAttribute("optgroup")!=null) {
							var newOptgroup = document.createElement("optgroup");
							newOptgroup.style.color = "#565656";
							newOptgroup.style.backgroundColor = "#EEEEEE";
							newOptgroup.setAttribute("label", option[i].getAttribute("label"));
							to.appendChild(newOptgroup);
						}
						else {
							var newOption = document.createElement("option");
							newOption.setAttribute("value", option[i].getAttribute("value"));
							if(val == option[i].getAttribute("value")) newOption.setAttribute("selected", "selected");
							newOption.innerHTML = option[i].firstChild.nodeValue;
							to.appendChild(newOption);
						}
					}
				}
				myRequest = null;
			}
		});
	}
	for(var i=1; i<=2; i++) {
		var extra = eval('extra'+i);
		if(extra==null) break;
		extra.options.length = 1;
		extra.value = '';
	}
}


//##################################################################################
//## ÆË¾÷
//##################################################################################
var POPUP = function() {
	this.mode = "divpop";		// ÆË¾÷¸ðµå{ divpop | winpop }
	this.items = new Object;
	this.popups = new Array;	// ÆË¾÷µ¥ÀÌÅÍ
	this.template = '';				// ÅÛÇÃ¸´
	this.cookies = '';				// ÄíÅ°Á¤º¸
	this.baseTop = 0;
	this.baseLeft = 0;
	this.selTop = 0;
	this.selLeft = 0;
	this.tmpHeight = 0;
}
// ÆË¾÷ °¡Á®¿À±â
POPUP.prototype.getPopup = function() {
	var classObj = this;
	var myRequest = new Ajax.Request(domain+"rankup_module/rankup_pop/get_popup.html", {
		method: 'get',
		onSuccess: function(transport) {
			//alert(transport.responseText);
			if(!transport.responseText.match(null)) {
				var popupData = transport.responseXML.getElementsByTagName('popupData')[0];
				classObj.items = popupData.getElementsByTagName('item');
				classObj.formalize();
			}
			myRequest = null;
		}
	});
}
// ÆË¾÷ µî·Ï
POPUP.prototype.formalize = function() {
	for(var i=0; i<this.items.length; i++) {
		var item = this.items[i];
		var pNo = item.getAttribute("no");
		if(this.cookies.indexOf("popup_id"+pNo+"=checked")!=-1) continue;
		var pop = {
			no: item.getAttribute("no"),
			title: item.getElementsByTagName("title")[0].firstChild.nodeValue,
			top: item.getElementsByTagName("top")[0].firstChild.nodeValue,
			left: item.getElementsByTagName("left")[0].firstChild.nodeValue,
			width: item.getElementsByTagName("width")[0].firstChild.nodeValue,
			height: item.getElementsByTagName("height")[0].firstChild.nodeValue,
			content: item.getElementsByTagName("content")[0].firstChild.nodeValue
		};
		this.popups.push(pop);
	}
	this.view();
}
// ÆË¾÷ ³ëÃâ
POPUP.prototype.view = function() {
	if(!document.all) this.mode = "divpop"; // ÆÄÆø¿¡¼­´Â divpop À¸·Î °íÁ¤
	for(var i=0; i<this.popups.length; i++) {
		var pop = this.popups[i];
		switch(this.mode) {
			case "divpop":
				// ÅÛÇÃ¸´ º¹»ç
				var divpop = document.createElement("DIV");
				divpop.setAttribute("id", "divpop_id"+pop.no);
				divpop.style.position = "absolute";
				divpop.style.top = this.selTop+"px";
				divpop.style.left = this.selLeft+"px";
				divpop.style.zIndex = 200;
				divpop.style.display = "block";
				divpop.innerHTML = this.template.innerHTML.replace(/{:no:}/g, pop.no).replace(/{:popup_title:}/g, pop.title);
				document.body.appendChild(divpop);

				// ÆË¾÷ ÄÁÅÙÃ÷ ÀÔ·Â
				try {
					var iframe = divpop.getElementsByTagName("iframe")[0];
					iframe.contentWindow.document.write(pop.content);
					document.getElementById("popup_content"+pop.no).innerHTML = iframe.contentWindow.document.body.innerHTML;

					if(pop.width) document.getElementById("popup_content"+pop.no).style.width = pop.width;
					if(pop.height) document.getElementById("popup_content"+pop.no).style.height = pop.height;

					// ºí¶óÀÎµå ¼³Á¤ - 2008.05.28 Ãß°¡
					var iframe_x = divpop.getElementsByTagName("iframe")[0];
					var content_x = divpop.getElementsByTagName("table")[0];
					iframe_x.style.width = content_x.offsetWidth;
					iframe_x.style.height = content_x.offsetHeight;

					this.selLeft += content_x.offsetWidth-1;

					// °¡·Î »çÀÌÁî¸¦ ¿À¹öÇÒ°æ¿ì, ¼¼·Î»çÀÌÁî°¡ Å«°ªÀ¸·Î °»½Å
					if(this.selLeft>document.body.offsetWidth) {
						divpop.style.top = this.selTop + this.tmpHeight-1;
						divpop.style.left = this.baseLeft;
						this.selLeft = this.baseLeft + content_x.offsetWidth-1;
						this.selTop += this.tmpHeight-1;
						this.tmpHeight = content_x.offsetHeight; // °»½Å
					}
					if(content_x.offsetHeight>this.tmpHeight) this.tmpHeight = content_x.offsetHeight;

				}
				catch(e) {
					alert(e.message);
				}
				break;

			case "winpop":
				// ¹Ì±¸Çö
				break;
		}
	}
}
// ÄíÅ°±Á±â
POPUP.prototype.setCookie = function(no, expiredays) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate()+expiredays);
	document.cookie = "popup_id"+no+"=checked; path=/; expires="+todayDate.toGMTString()+";";
}
// ÆË¾÷Ã¢´Ý±â
POPUP.prototype.closeWin = function(no, check) {
	if(this.mode=="divpop") {
		var divPop = $("divpop_id"+no);
		if(divPop.getElementsByTagName("input")[0].checked) this.setCookie(no,1);
		divPop.style.visibility = "hidden";
	} else if(check) this.setCookie(no,1);
}
// ÆË¾÷ ¼³Á¤
POPUP.prototype.initialize = function(template) {
	this.template = $(template);			// ÅÛÇÃ¸´
	this.cookies = document.cookie;		// ÄíÅ°·Îµå
	this.getPopup();
}

//##################################################################################
//## ÄÞº¸¹Ú½º Å¬·¡½º Á¤ÀÇ
//##################################################################################
var COMBOBOX = function() {
	this.items = new Array(); // ¿ÀºêÁ§Æ®
	this.drawMode = "multi";  // µå·Î¿ì ¹æ½Ä : single  or  multi
	this.width = 0;
	this.pulldown_flag = new Array(); // Ç®´Ù¿î Ã¼Å©
	this.left = "<img src='"+domain+"images/top01_search01.gif'>";
	this.body = "url('"+domain+"images/top01_search02.gif') repeat-x";
	this.right = "<img src='"+domain+"images/top01_search_icon.gif'>";
	this.styles = { // ½ºÅ²¿¡ Àû¿ëÇÒ ½ºÅ¸ÀÏ
		"base": "border:#dedede 0px solid;font-size:9pt;cursor:pointer;padding:0px;",
		"option": "border:#dedede 1px solid;font-size:9pt;display:none;background-color:white;padding:2px;", // ¿É¼Ç¹è°æ
		"item": "border:0;font-size:9pt;font-family:dotum;color:black;line-height:120%;background-color:white;padding:2 0 0 5px;" // ¾ÆÀÌÅÛ
	};
	this.base_color = { // ±âº»»ö»ó : this.styles['item'] ¼³Á¤°ª°ú µ¿ÀÏÇÏ°Ô ¼³Á¤
		"background": "white",
		"color": "black"
	};
	this.hover_color = { // È£¹ö»ö»ó
		"background": "#336699",
		"color": "white"
	};
}
// ÄÞº¸¹Ú½º ¼±ÅÃ
COMBOBOX.prototype.select_item = function(obj) {
	var item = $(obj.parentNode.id.replace(/_option$/g,''));
	item.value = obj.value;
	$(item.name+'_text').update(obj.innerHTML);
	this.pulldown(item.name);
}
// ÄÞº¸¹Ú½º ¾ÆÀÌÅÛ È£¹ö
COMBOBOX.prototype.item_hover = function(obj, mode) {
	var color = (mode=="hover") ? this.hover_color : this.base_color;
	var name = obj.parentNode.id.replace(/_option$/g,'');
	var item = $(name);
	if(this.pulldown_flag[parseInt(item.getAttribute('no'))]==true) { // ¼±ÅÃ°ª ÃÊ±âÈ­
		var option = obj.parentNode.getElementsByTagName('div');
		for(var i=0; i<option.length; i++) {
			if(option[i].value==item.value) {
				this.pulldown_flag[parseInt(item.getAttribute('no'))] = false;
				this.item_hover(option[i], 'base');
				break;
			}
		}
	}
	for(var idx in color) obj.style.setAttribute(idx, color[idx]);
}
// ÄÞº¸¹Ú½º Ç®´Ù¿î
COMBOBOX.prototype.pulldown = function(obj) {
	var item = $(obj+'_option');
	item.style.display = (item.style.display=="block") ? "none" : "block";
	if(item.style.display=="block") {
		var option = item.getElementsByTagName('div');
		for(var i=0; i<option.length; i++) {
			if(option[i].value==$(obj).value) {
				this.pulldown_flag[$(obj).getAttribute('no')] = true;
				for(var idx in this.hover_color) option[i].style.setAttribute(idx, this.hover_color[idx]);
				break;
			}
		}
	}
}
// ÄÞº¸¹Ú½º ½ºÅ²
COMBOBOX.prototype.skin = function(obj, no) {
	var skins = { // ½ºÅ²
		"base": "<input type=\"hidden\" name=\"{:name:}\" value=\"{:value:}\" no=\"{:no:}\"><div style='"+this.styles['base']+"' id=\"{:name:}\" onClick=\"combobox.pulldown('{:name:}')\"><table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td>"+this.left+"</td><td style=\"background:"+this.body+";font-size:9pt;width:{:width:}px;padding:3 3 2 1px;overflow:hidden\" id='{:name:}_text'>{:text:}</td><td align='right'>"+this.right+"</td></tr></table></div>",
		"option": "<div style='position:absolute;"+this.styles['option']+"' id=\"{:name:}_option\">{:item:}</div>",
		"item": "<div style='cursor:pointer;width:100%;"+this.styles['item']+"' value=\"{:value:}\" onMouseOver=\"combobox.item_hover(this, 'hover')\" onMouseOut=\"combobox.item_hover(this, 'base')\" onClick=\"combobox.select_item(this)\">{:text:}</div>"
	};
	var option = obj.options;
	var skinHTML = skins['base'].replace(/{:name:}/g, obj.name).replace(/{:no:}/g, no);
	skinHTML = skinHTML.replace(/{:value:}/g, obj.value).replace(/{:text:}/g, obj.options[obj.selectedIndex].text); // ÇöÀç ¼±ÅÃµÈ °ª;
	for(var i=0, item='', max_width=0; i<option.length; i++) {
		if(max_width < option[i].text.bytes()) max_width = option[i].text.bytes();
		item += skins['item'].replace(/{:value:}/g, option[i].value).replace(/{:text:}/g, option[i].text);
	}
	return skinHTML.replace(/{:width:}/g, Math.ceil(parseInt(max_width)*6)) + skins['option'].replace(/{:name:}/g, obj.name).replace(/{:item:}/g, item);
}
// ÄÞº¸¹Ú½º »ý¼º
COMBOBOX.prototype.draw = function(obj) {
	if(obj) this.items[0] = obj;
	for(var i=0; i<this.items.length; i++) {
		if(this.items[i].outerHTML) this.items[i].outerHTML = this.skin(this.items[i], i);
		else {
			// ÆÄÆø - ¹Ì±¸Çö
			var xs = new XMLSerializer;
			xs.serializeToString(this.items[i]).innerHTML = this.skin(this.items[i], i);
		}
	}
}
// ÄÞº¸¹Ú½º ÃÊ±âÈ­
COMBOBOX.prototype.initialize = function() {
	var items = document.getElementsByTagName('select');
	for(var i=0; i<items.length; i++) {
		if(items[i].type=="combobox") {
			this.pulldown_flag[this.items.length] = false;
			if(this.drawMode=="multi") this.items.push(items[i]);
			else this.draw(items[i]); // µå·Î¿ì
		}
	}
	if(this.items.length) this.draw();
}


//##################################################################################
//## ÇÃ·ÎÆÃ Å¬·¡½º Á¤ÀÇ
//##################################################################################
var FLOATING = function(el, pattern, x, y, pro, cycle) {
	this.floatingObj = document.getElementById(el); // °³Ã¼
	this.marginX = x ? x : 0;					// xÃà ¿©¹é
	this.marginY = y ? y : 0;					// yÃà ¿©¹é
	this.pro = pro ? pro : 10;					// °³Ã¼ÀÌµ¿¼Óµµ
	this.cycle = cycle ? cycle : 10;			// Àç±ÍÈ£Ãâ°£°Ý
	this.pattern = pattern ? pattern : 'y';	// ¿òÁ÷ÀÓ { x | y | xy }
	this.floatingObj.style.position = "absolute";
	this.initialize();
}
// ÇÃ·ÎÆÃ µ¿ÀÛ
FLOATING.prototype.initialize = function () {
	var classObj = this;
	var floatingObjLeft = this.floatingObj.style.left ? parseInt(this.floatingObj.style.left,10) : this.floatingObj.offsetLeft;
	var floatingObjTop = this.floatingObj.style.top ? parseInt(this.floatingObj.style.top,10) : this.floatingObj.offsetTop;
	var docLeft = document.body.scrollLeft + this.marginX;
	var docTop = document.body.scrollTop>this.marginY ? document.body.scrollTop : this.marginY;

	var moveX = Math.ceil(Math.abs(floatingObjLeft - docLeft) / this.pro);
	var moveY = Math.ceil(Math.abs(floatingObjTop - docTop) / this.pro);

	if(this.pattern.indexOf('x')!=-1) this.floatingObj.style.left = floatingObjLeft < docLeft ? floatingObjLeft + moveX + "px" : floatingObjLeft - moveX + "px";
	if(this.pattern.indexOf('y')!=-1) this.floatingObj.style.top = floatingObjTop < docTop ? floatingObjTop + moveY + "px" : floatingObjTop - moveY + "px";
	
	setTimeout(function(){classObj.initialize()}, classObj.cycle); // Àç±ÍÈ£Ãâ
}
