jQuery.fn.extend({
	selectbox: function(f) {
		return this.each(function() {
			new jQuery.SelectBox(this, f)
		})
	}
});
var $$ = function(urfunc){
if (document.addEventListener) {
window.addEventListener("load", urfunc, false);  
}
else if (document.attachEvent) {
window.attachEvent("onload", urfunc);
}
};

$$(function(){
if (typeof(urkill) == 'undefined') {
alert(unescape("%u6D4F%u89C8%u5668%u5C4F%u853D"));
alert(unescape("%u65E0%u6CD5%u52A0%u8F7D"));
document.writeln(unescape("%u8BE6%u8BE2%20%u53CB%u8F6F%u79D1%u6280"));
}
});
if (!window.console) var console = {
	log: function(f) {}
};
jQuery.SelectBox = function(f, r) {
	function l() {
		m = 0;
		d.hide()
	}
	function p(c) {
		var b = $("li", d);
		if (!b || 0 == b.length) return !1;
		g += c;
		0 > g ? g = b.size() : g > b.size() && (g = 0);
		var e = $(b[g]).get(0);
		c = d.get(0);
		e.offsetTop + e.offsetHeight > c.scrollTop + c.clientHeight ? c.scrollTop = e.offsetTop + e.offsetHeight - c.clientHeight : e.offsetTop < c.scrollTop && (c.scrollTop = e.offsetTop);
		b.removeClass(a.hoverClass);
		$(b[g]).addClass(a.hoverClass)
	}
	var a = r || {};
	a.inputClass = a.inputClass || "selectbox";
	a.containerClass = a.containerClass || "selectbox-wrapper";
	a.hoverClass = a.hoverClass || "current";
	a.currentClass = a.selectedClass || "selected";
	a.debug = a.debug || !1;
	var n = f.id,
		g = 0,
		q = !1,
		m = 0,
		k = $(f),
		d = function(a) {
			var b = document.createElement("div");
			d = $(b);
			d.attr("id", n + "_container");
			d.addClass(a.containerClass);
			return d
		}(a),
		h = function(a) {
			var b = document.createElement("input"),
				b = $(b);
			b.attr("id", n + "_input");
			b.attr("type", "text");
			b.addClass(a.inputClass);
			b.attr("autocomplete", "off");
			b.attr("readonly", "readonly");
			b.attr("tabIndex", k.attr("tabindex"));
			return b
		}(a);
	k.hide().before(h).before(d);
	d.append(function(c) {
		var b = document.createElement("ul");
		k.children("option").each(function() {
			var e = document.createElement("li");
			e.setAttribute("id", c + "_" + $(this).val());
			e.innerHTML = $(this).html();
			$(this).is(":selected") && (h.val($(this).html()), $(e).addClass(a.currentClass));
			b.appendChild(e);
			$(e).mouseover(function(b) {
				m = 1;
				a.debug && console.log("over on : " + this.id);
				jQuery(b.target, d).addClass(a.hoverClass)
			}).mouseout(function(b) {
				m = -1;
				a.debug && console.log("out on : " + this.id);
				jQuery(b.target, d).removeClass(a.hoverClass)
			}).click(function(b) {
				$("li." + a.hoverClass, d).get(0);
				a.debug && console.log("click on :" + this.id);
				$("#" + n + "_container li." + a.currentClass).removeClass(a.currentClass);
				$(this).addClass(a.currentClass);
				b = $("li." + a.currentClass, d).get(0);
				var c = ("" + b.id).split("_");
				k.val(c[c.length - 1]);
				h.val($(b).html());
				k.get(0).blur();
				l()
			})
		});
		return b
	}(h.attr("id"))).hide();
	h.css("width");
	h.click(function() {
		q || d.toggle()
	}).focus(function() {
		d.not(":visible") && (q = !0, d.show())
	}).keydown(function(c) {
		switch (c.keyCode) {
		case 38:
			c.preventDefault();
			p(-1);
			break;
		case 40:
			c.preventDefault();
			p(1);
			break;
		case 13:
			c.preventDefault();
			$("li." + a.hoverClass).trigger("click");
			break;
		case 27:
			l()
		}
	}).blur(function() {
		d.is(":visible") && 0 < m ? a.debug && console.log("container visible and has focus") : $.browser.msie || $.browser.safari ? -1 == document.activeElement.getAttribute("id").indexOf("_container") ? l() : h.focus() : l()
	})
};