var Dialog = function(type) {
	this.type = Dialog.DIALOG_POP;

	this.setStyle = function() {

	};

	this.showMessage = function(title, content, button_confirm) {
		if(!button_confirm) button_confirm = 'Okay';
	};

	this.showChoice = function(title, content, button_confirm, button_cancel) {
		if(!button_confirm) button_confirm = 'Okay';
		if(!button_cancel) button_cancel = 'Cancel';
	};

	this.showChoices = function(title, content) {//, button_1, button_2, ...
		var buttons = [];
		var str = '';
		for(var i = 2;i < arguments.length;i++) {
			buttons.push(arguments[i]);
			str += '&button' + (i-1) + '=' + encodeURIComponent(arguments[i]);
		}
		var args = {'title': title};
		parent.Editor.openDialog('/Platform/Popovers/choices.jsp?content=' + encodeURIComponent(content) + str, 400, 250, args);
		Dialog.onButtonPress = this.onconfirm;
	}

	this.onconfirm = function() {};

	this.setContext = function() {
		//for Dialog.DIALOG_CONTEXTUAL only
	};

	this.hide = function() {
		parent.Editor.closeDialog();
	};

	//constructor
	if(type && type == Dialog.DIALOG_CONTEXTUAL) this.type = Dialog.DIALOG_CONTEXTUAL;
};

//static methods
Dialog.onButtonPress = function(val) {
	
};

Dialog.toQueryString = function(source) {
	var queryString = [];
	for (var property in source) queryString.push(encodeURIComponent(property)+'='+encodeURIComponent(source[property]));
	return queryString.join('&');
};

Dialog.DIALOG_POP = 'pop';
Dialog.DIALOG_CONTEXTUAL = 'contextual';