jQuery.fn.customSelect = function(_options){
	var _options = jQuery.extend({
		selectStructure: '<div class="selectArea"><div class="left-image"><div class="left"></div><div class="center"></div><a href="#" class="selectButton">&nbsp;</a><div class="disabled"></div></div></div><br />&nbsp;',
		selectText: '.center',
		selectBtn: '.selectButton',
		selectDisabled: '.disabled',
		optStructure: '<div class="selectOptions"><ul></ul></div>',
		optList: 'ul'
	}, _options);
	return this.each(function(){
		var select = jQuery(this);
		if(!select.hasClass('outtaHere')){
			if(select.is(':visible')){
				var replaced = jQuery(_options.selectStructure);
				var selectText = replaced.find(_options.selectText);
				var selectBtn = replaced.find(_options.selectBtn);
				var selectDisabled = replaced.find(_options.selectDisabled).hide();
				var optHolder = jQuery(_options.optStructure);
				var optList = optHolder.find(_options.optList);
				if(select.attr('disabled')) selectDisabled.show();
				select.find('option').each(function(){
					var selOpt = $(this);
					var _opt = jQuery('<li><a href="#">' + selOpt.html() + '</a></li>');
					if(selOpt.attr('selected')){
						selectText.html(selOpt.html());
						_opt.addClass('selected');
					}
					_opt.children('a').click(function(){
						optList.find('li').removeClass('selected');
						select.find('option').removeAttr('selected');
						$(this).parent().addClass('selected');
						selOpt.attr('selected', 'selected');
						selectText.html(selOpt.html());
						select.change();
						optHolder.hide();
						return false;
					});
					optList.append(_opt);
				});
				replaced.width(select.outerWidth());
				replaced.insertBefore(select);
				optHolder.css({
					width: select.outerWidth() - 2,
					display: 'none',
					position: 'absolute'
				});
				jQuery(document.body).append(optHolder);
				
				var optTimer;
				replaced.hover(function(){
					if(optTimer) clearTimeout(optTimer);
				}, function(){
					optTimer = setTimeout(function(){
						optHolder.hide();
					}, 200);
				});
				optHolder.hover(function(){
					if(optTimer) clearTimeout(optTimer);
				}, function(){
					optTimer = setTimeout(function(){
						optHolder.hide();
					}, 200);
				});
				selectBtn.click(function(){
					if(optHolder.is(':visible')){
						optHolder.hide();
					}
					else{
						optHolder.css({
							top: replaced.offset().top + replaced.outerHeight(),
							left: replaced.offset().left,
							display: 'block'
						});
					}
					return false;
				});
				select.addClass('outtaHere');
			}
		}
	});
}