jQuery(document).ready(function($) {

// hide all tables (options) on load
$('.deluxefw table').css({'display':'none'});

// open options table when h3 is clicked
$('.deluxefw h3 span.dhead').toggle(
	function() {
		$(this).removeClass('dhead');
		$(this).addClass('minus');
		$(this).parent('h3').next('table').show();
	},
	function() {
		$(this).removeClass('minus');
		$(this).addClass('dhead');
		$(this).parent('h3').next('table').hide();
	}
);

// color picker initialize
$('.colorpickerfield').ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {
		$(el).val(hex);
		$(el).ColorPickerHide();
	},
	onBeforeShow: function () {
		$(this).ColorPickerSetColor(this.value);
	}
})
.bind('keyup', function(){
	$(this).ColorPickerSetColor(this.value);
});

});