CreateTopicAjax = Class.create();
CreateTopicAjax.prototype = {

	id: 'createTopic',
	page: projectUrl +'/member/forum/createTopic',

	execute: function(object) {

		this.hide();

	},

	handleMessage: function(object) {
	}

}

Object.extend(CreateTopicAjax.prototype, CommonAjax);

ChangeTopicAjax = Class.create();
ChangeTopicAjax.prototype = {

	id: null,
	page: projectUrl +'/member/forum/actionTopic',

	construct: function(params) {
		this.id = params['id'];
	},

	execute: function(object) {

		this.hide();

		if(object.type == 'delete') {
			document.location.href = projectUrl +'/member/forum/forum?id='+ object.eForum.id +'&message='+ object.message;
		} else if(object.type == 'move') {
			document.location.href = projectUrl +'/member/forum/topic?id='+ object.eTopic.id +'&message='+ object.message;
		} else {
			this.reload('message='+ object.message);
		}

	},

	handleMessage: function(object) {
	}

}

Object.extend(ChangeTopicAjax.prototype, CommonAjax);

ChangeMessageAjax = Class.create();
ChangeMessageAjax.prototype = {

	id: null,
	page: projectUrl +'/member/forum/actionMessage',

	construct: function(params) {
		this.id = params['id'];
	},

	execute: function(object) {

		this.hide();
		this.reload('message='+ object.message);

	},

	handleMessage: function(object) {
	}

}

Object.extend(ChangeMessageAjax.prototype, CommonAjax);

CreateMessageAjax = Class.create();
CreateMessageAjax.prototype = {

	id: 'createMessage',
	page: projectUrl +'/member/forum/createMessage',

	execute: function(object) {

		this.hide();
		this.reload('message='+ object.message);

	},

	handleMessage: function(object) {
	}

}

Object.extend(CreateMessageAjax.prototype, CommonAjax);

LockTopicAjax = Class.create();
LockTopicAjax.prototype = {

	id: 'lock',
	page: projectUrl +'/member/forum/lockTopic',

	execute: function(object) {

		this.hide();
		this.reload('message='+ object.message);

	},

	handleMessage: function(object) {
	}

}

Object.extend(LockTopicAjax.prototype, CommonAjax);



/* Mark abuse form */
var AbuseAjax = Class.create();
AbuseAjax.prototype = {

	id: 'abuse',
	page: projectUrl +'/member/forum/abuse',

	execute: function(object) {
		this.content();
		showBox('abuseBox');
	}

}

Object.extend(AbuseAjax.prototype, CommonAjax);

/* Mark a message as abusing */
var DoAbuseAjax = Class.create();
DoAbuseAjax.prototype = {

	id: 'doAbuse',
	page: projectUrl +'/member/forum/doAbuse',

	execute: function(object) {

		hideBox('abuseBox');

	}

}

Object.extend(DoAbuseAjax.prototype, CommonAjax);

DoPositionForumAjax = Class.create();
DoPositionForumAjax.prototype = {

	id: null,
	page: projectUrl +'/admin/forum/doPosition',

	execute: function(object) {
		this.content();
	}

}
Object.extend(DoPositionForumAjax.prototype, CommonAjax);

IdeaTopicAjax = Class.create();
IdeaTopicAjax.prototype = {

	id: 'ideaTopic',
	page: projectUrl +'/member/forum/ideaTopic',

	execute: function(object) {
		this.content();
		showBox('ideaTopicBox');
	}

}

Object.extend(IdeaTopicAjax.prototype, CommonAjax);

DoIdeaTopicAjax = Class.create();
DoIdeaTopicAjax.prototype = {

	id: 'doIdeaTopic',
	page: projectUrl +'/member/forum/doIdeaTopic',

	execute: function(object) {
		this.content();
	}

}
Object.extend(DoIdeaTopicAjax.prototype, CommonAjax);

VoteIdeaTopicAjax = Class.create();
VoteIdeaTopicAjax.prototype = {

	id: 'voteIdeaTopic',
	page: projectUrl +'/member/forum/voteIdeaTopic',

	execute: function(object) {
		this.content();
		showBox('voteIdeaTopicBox');
	}

}
Object.extend(VoteIdeaTopicAjax.prototype, CommonAjax);


DoVoteIdeaTopicAjax = Class.create();
DoVoteIdeaTopicAjax.prototype = {

	id: 'doVoteIdeaTopic',
	page: projectUrl +'/member/forum/doVoteIdeaTopic',

	execute: function(object) {
		this.content();
	}

}
Object.extend(DoVoteIdeaTopicAjax.prototype, CommonAjax);



/* Display idea type selection tabs */
var ideaToApproveParams = 'idea=toapprove&page=0';
var IdeaToApproveAjax = Class.create();
IdeaToApproveAjax.prototype = {

	id: 'forum-feedback',
	page: projectUrl +'/member/forum/ideaTopicFeedback',

	execute: function(object) {

		ideaToApproveParams = this.params;

		$(this.id).innerHTML = object.content;
		hideCurrentAction();
		currentAction = null;

	}

}
Object.extend(IdeaToApproveAjax.prototype, CommonAjax);

var ideaToVoteParams = 'idea=tovote&page=0';
var IdeaToVoteAjax = Class.create();
IdeaToVoteAjax.prototype = {

	id: 'forum-feedback',
	page: projectUrl +'/member/forum/ideaTopicFeedback',

	execute: function(object) {

		ideaToVoteParams = this.params;

		$(this.id).innerHTML = object.content;
		hideCurrentAction();
		currentAction = null;

	}
}
Object.extend(IdeaToVoteAjax.prototype, CommonAjax);

var IdeaDoneParam = 'idea=done&page=0';
var IdeaDoneAjax = Class.create();
IdeaDoneAjax.prototype = {

	id: 'forum-feedback',
	page: projectUrl +'/member/forum/ideaTopicFeedback',

	execute: function(object) {

		ideaDoneParams = this.params;

		$(this.id).innerHTML = object.content;
		hideCurrentAction();
		currentAction = null;

	}
}
Object.extend(IdeaDoneAjax.prototype, CommonAjax);
