PLUM.Actions.SetFeaturedPhoto = {
		
	start : function (o) {
		var threadId = createRandomId();
		var actionObj = new PLUM.Actions.actionObj(o, threadId);
		
		PLUM.Popups.createPopup('plum.actions.setfeaturedphoto.confirm', threadId);
	},
	
	ok : function (o) {		
		
		var oPi=findParentByClassName(o,'g_element_');
		var threadId=getCustomAttr(oPi,'popupid');
		var actionObj=PLUM.Actions.getAction(threadId);
		var itemId = actionObj.elementId;
	
		/* 
		 * set popup into processing phase before ajax call
		 */
		PLUM.Popups.doProcess(threadId);
		
		$.ajax({ 
            url: PLUM.servletPrefix + '/group/setDefaultImage.x',
            data : {
				itemId : itemId, 
				outputFormat : 'json'
			},
            type : "POST",
            timeout : 10000,
            dataType : "json", 
            success : function(data) {
    			PLUM.Actions.AutoNavigate(null, true);
    		},
            error: function(error) {
    			PLUM.Actions.SetFeaturedPhoto.error();
    		}
		});
		
		/*
		 * cleanup the actionObj
		 */
		PLUM.Actions.cleanUp(actionObj);
	},
	
	error:PLUM.Actions.Template.error,
	cancel:PLUM.Actions.Template.cancel	
};