	jQuery.manageCombos = function(json) {
		jQuery.each(json, function(i, jsonCombo){
			var options = '';
			jQuery.each(jsonCombo.lst, function(j, jsonElement){
				options += '<option value="' + jsonElement.id + '"' + (jsonElement.sel == 1 ? ' selected="selected"' : '')  + '>' + jsonElement.val + '</option>';
			});
			jQuery("select#"+jsonCombo.cmb).html(options);
	    });
	};
	
	jQuery.comboChangeEvent = function(formId, hierarchy, changedIdx) {
		var params = jQuery ('form#' + formId).serialize();
		jQuery.ajax({
			url: CONTEXT_PATH + '/chainCombo', 
			type: 'post', 
			dataType: 'json', 
			data: params + "&hierarchy=" + hierarchy + "&changedIdx=" + changedIdx, 
			success: function(json) { jQuery.manageTerritoryCombos(json) }
		});
	};

	jQuery.initCombos = function(myOfferType) {
		jQuery.ajax({
			url: CONTEXT_PATH + '/initCombo', 
			type: 'post', 
			dataType: 'json', 
			data: { offerType: myOfferType },
			success: function(json) { jQuery.manageCombos(json) }
		});
		jQuery('input#searchInput').focus();
		
	};
