(function($) {
	$.dialog={
		//Да или нет
		orly:function(message, callback) {
			var layout = '<div class="dialog_text">' + message + '</div>';
			$('<div></div>').html(layout).dialog({
				modal: true,
				buttons: {
					'OK': function() {
						callback(true);
						$(this).dialog('close');
					},
					'Отмена': function() {
						callback(false);
						$(this).dialog('close');
					}
				}
			});
		},
		//Инпут
		tellme:function(message, predef, callback) {
			var layout = '';
			for (var i=0; i<message.length; i++) {
				layout += '<div class="dialog_text">' + message[i] + ':<br />';
				layout += '<input id="facebox_input_' + i + '" type="text" rel="' + i + '" value="' + predef[i] + '" /></div>';
			}
			$('<div></div>').html(layout).dialog({
				modal: true,
				buttons: {
					'OK': function() {
						var callbackArray = new Array();
						$('input[id^=facebox_input_]').each(function() {
							callbackArray[$(this).attr('rel')] = $(this).val();
						})
						callback(callbackArray);
						$(this).dialog('close');
					},
					'Отмена': function() {
						$(this).dialog('close');
					}
				}
			});
		},
		//Просто говори что-то
		ritoric:function(message) {
			var layout = '<div class="dialog_text">' + message + '</div>';
			$('<div></div>').html(layout).dialog({
				modal: true,
				buttons: {
					'OK': function() {
						$(this).dialog('close');
					}
				}
			});
		},
		//Показываем анимацию загрузки
		loading:function(stop) {
			/*if (stop) {
				$.)
			}
			else {
				var layout = '<div class="l"><img src="' + base + 'themes/dropped/images/loading.gif" alt="loading" /></div>';
				$.facebox(layout);
			}*/
		}
	}
})(jQuery);