// Form Styling

	// DROP DOWN STYLING
	
	$('select.select').each(function(){
		var title = $(this).attr('title');
		if( $('option:selected', this).val() != ''  ) title = $('option:selected',this).text();
		$(this)
			.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
			.after('<span class="select">' + title + '</span>')
			.change(function(){
				val = $('option:selected',this).text();
				$(this).next().text(val);
				})
	});
		
	$('select').each(function () {
		if($(this).hasClass('error')) {
			$(this).siblings('span.select').addClass('error-select');
		} 								   
	});
	
	//Checkbox Styling
	$('input:checkbox').wrap('<span class="checkbox"></span>');
	$('input:checkbox:checked').parent('span.checkbox').addClass('checkbox-select');

	$('span.checkbox').click(function () {
		if($(this).hasClass('checkbox-select')) {
			$(this).removeClass('checkbox-select');
			$(this).children('input').removeAttr("checked");	
		} else {
			$(this).addClass('checkbox-select');
			$(this).children('input').attr("checked", true);
		}		
	});
	
	//wrap radio buttons with span
	$('input:radio').wrap('<span class="radio"></span>');
	$('input:radio:checked').parent('span.radio').addClass('selected');
	$('input:radio:checked').parent('span.radio').addClass('radio-select');

	//when span clicked change class on selected radio
	$('span.radio').live('click', function(event){
		//remove background on previous selected radio button
		var radioName = $(this).children('input:radio').attr('name');

		$("input[name='"+radioName+"']").parent('span').removeClass('selected');			
		
		//add selected background to selected radio button
		$(this).addClass('selected');
	});


