<PUBLIC:COMPONENT lightWeight="true">
<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="realy()" />
<PUBLIC:ATTACH EVENT="onchange" FOR="element" ONEVENT="change()" />
<script type="text/javascript">
var elm = element,
	doc = elm.document,
	border = doc.createElement("select-border-ie"),
	wrap = doc.createElement("select-wrap-ie"),
	bgColor = elm.currentStyle.backgroundColor.replace("transparent", "#fff"),
	text, arrow;

function change(){
	if(text){
		text.innerHTML = elm.options[elm.selectedIndex].innerHTML + "&nbsp;";
	}
}

function realy(){
	if(elm.multiple || elm.size > 1){
		return;
	}

	with(elm.runtimeStyle){
		verticalAlign = "top";
		height = "auto";
		margin = -2;
	}

	with(border.runtimeStyle){
		paddingBottom = elm.currentStyle.paddingBottom;
		paddingRight = elm.currentStyle.paddingRight;
		paddingLeft = elm.currentStyle.paddingLeft;
		paddingTop = elm.currentStyle.paddingTop;
		maxWidth = elm.currentStyle.maxWidth;
		minWidth = elm.currentStyle.minWidth;
		width = elm.currentStyle.width;
		border = "1px solid #ccc";
		verticalAlign = "middle";
		background = bgColor;
		textAlign = "center";
		display = "inline";
		zoom = 1;
	}

	with(wrap.runtimeStyle){
		position = "relative";
		overflow = "hidden";
		display = "inline";
		zoom = 1;
	}

	border.onfocusin = function() {
		border.runtimeStyle.borderColor = "#79c0f2";
	}

	border.onfocusout = function() {
		border.runtimeStyle.borderColor = "#ccc";
	}

	if(!("XMLHttpRequest" in window)){
		text = doc.createElement("select-text-ie");
		arrow = doc.createElement("select-arrow-ie");

		with(arrow.runtimeStyle){
			borderLeft = borderRight = "4px solid " + bgColor;
			top =  elm.offsetHeight / 2 - 3;
			borderTop = "4px solid #000";
			position = "absolute";
			overflow = "hidden";
			height = width = 0;
			right = 3;
		}

		with(text.runtimeStyle){
			lineHeight = elm.offsetHeight - 4 + "px";
			fontSize = elm.currentStyle.fontSize;
			color = elm.currentStyle.color;
			fontFamily = "Arial, SimSun";
			verticalAlign = "baseline";
			position = "absolute";
			zoom = 1;
			left = 3;
			top = 0;
		}

		function visible(val){
			with(elm.runtimeStyle){
				position = val ? "relative" : "static";
				left = val;
			}
		}

		function show(){
			visible("");
		}
	
		function hide(){
			visible(-9999);
		}

		border.onmouseenter = show;
		border.onmouseleave = hide;

		wrap.appendChild(arrow);
		wrap.appendChild(text);
		change();
		hide();
	}

	border.appendChild(wrap);
	elm.parentNode.insertBefore(border, elm);
	wrap.appendChild(elm);
}

</script>
</PUBLIC:COMPONENT>
