var Qs_colorPicker = qs.createObject(); Qs_colorPicker.prototype = { initialize: function(options) { options.pickerOptions = $.extend(true, {}, options.pickerOptions); this.options = $.extend(true, { id: null, pickerOptions: { alpha: false, showOn: 'both', buttonImage: 'images/colorpicker/ui-colorpicker.png', buttonColorize: true, parts: ['header', 'map', 'bar', 'hex', 'rgb', 'preview', 'swatches', 'footer'] } }, options); $('#' + this.options.id).colorpicker(this.options.pickerOptions); } };