IDesign.ui.Regis = function() {
	
	return {
		
		settings: {

		},
		
		init: function(err) {
			IDesign.ui.Regis.error(err);
		},

		
		elementError: function(elem, msg, css) {
			if (msg != null) {
				elem.before($('<div class="error_message" style="' + css + '"><div class="error_content" style="display:block;">' + msg + '</div></div>'));
			} else {
				elem.parent().find("div.error_message").remove();
			}
		},
		
		error: function(msg) {
			$("#dialog_error").dialog({
				bgiframe: true,
				modal: true,
				height: 100,
				width: 250,
				resizable: false,
				close: function(){
					$(this).dialog('destroy').find('p.dialog_error_content').text('');
				},
				open: function(){
					$(this).attr('style', 'display:block;').find('p.dialog_error_content').html(msg);
				},
				buttons: {
					Ok: function(){
						$(this).dialog('destroy').find('p.dialog_error_content').text('');
						window.location=BASE_PATH+'index.php/page/home';
					}
				}
			});
		}
		
	}
	
}();
