var smkp = (function() {
	var methods = {};
	var __config = {};
	
	methods.openProductDlg = function(opts) {
		var options = $.extend({
			"id" : "prod-dialog",
			"width" : 650,
			"height" : 500,
			"params" : {}
		}, opts);
		
		var params = $.extend({
			"action" : "getProductDialog",
			"object" : 0,
			"dlgid" : options.id
		}, options.params);
		
		$("#" + options.id).dialog({
			"width" : options.width,
			"height" : options.height,
			"modal" : true,
			"draggable" : false,
			"overlay" : {
				"opacity" : 0.8,
				"background-color" : "#000000"
			},
			"position" : ["center", "center"],
			"open" : function() {
				$(this).html('<div class="ajax-loader"></div>');
				var this_dlg = $(this);
				jQuery.ajax({
					"type" : "GET",
					"async" : true,
					"cache" : false,
					"timeout" : 10 * 1000,
					"url" : __config.prodDlgURL,
					"data" : params,
					"dataType" : "html",
					"success" : function(data) {
						$(this_dlg).html(data);
					}
				});
			},
			"close" : function() {
				$(this).html("");
				$(this).dialog("destroy");
			}
		});
	};
	
	methods.init = function(opts) {
		__config = $.extend({}, opts);
	}
	
	return methods;
})();