jQuery(document).ready(function($) {
	$('select').each(function(){
		var options = ""; var current = "";
		$(this).children("option").each(function () {
			options += '<li rel="'+$(this).val()+'">'+$(this).text()+'</li>';
			if ($(this).parent().val() == $(this).val()) current = $(this).text()+' ';
		}); 
		$(this).after('<div id="replace-'+$(this).attr('id')+'" class="replace-select"><div class="current-select">'+current+'</div><div class="options-select"><p class="top">&#160;</p><ul id="ul-'+$(this).attr('id')+'">'+options+'</ul><p class="bottom">&#160;</p></div></div>');
	});
	$(".replace-select").mouseover(function(){$(this).children(".options-select").show();}); 
	$(".replace-select").mouseout(function(){$(this).children(".options-select").hide();});
	$(".replace-select li").click(function(){
		$(this).parent().parent().hide();
		$(this).parent().parent().parent().children('.current-select').html($(this).html());
		$(this).parent().parent().parent().parent().children('select').val($(this).attr('rel'));
	});
}); 
