
// jQuery Version
$(function () {
	// provide the styled background image
	$('.form .fancySelect dd div').addClass('fancySelectBg');
	// make the select invisible; 
	// create an input element to display the current selection;
	// populate the newly created input element with the current value of the select
	$('.fancySelect select').addClass('fancySelectHidden').before('<input type="text" />').each(function () {
		$(this).prev().val($(this).find(':selected').text());										
	});
	// on change of the select, update the input element
	$('.fancySelect select').bind('change', function () {
		$(this).prev().val($(this).find(':selected').text());
	});	
});

/* dojo Version *not ready* */
/*
dojo.addOnLoad(function () {
	// provide the styled background image
	var sBg = dojo.query('.form .fancySelect dd div');
	sBg.forEach(function (node) {
		dojo.addClass(node, 'fancySelectBg');				   
	});
	// make the select invisible
	var s = dojo.query('.fancySelect select');
	s.forEach(function (node) {
		dojo.addClass(node, 'fancySelectHidden');					   
	});
});
*/
