
var dialogWindow = function(id, title, content, options) {
	var contener = $j('<div>');//new Element('div');
	contener = $j(contener);
	
	var config = {
		bgiframe: false,
		draggable: false,
		modal: true,
		position: 'center',
		minWidth: 400,
		overlay: {
				backgroundColor: '#000',
				opacity: 0.5
			},
		close: function(event, ui) { contener.remove(); }

	}
	
	$j.extend(config, options);
	
	contener.attr('id', id);
	contener.attr('title', title);
	contener.html(content);
	contener.hide();
	$j('body').append(contener);
	setTimeout(function() {$j('#' + id).dialog(config);}, 100);
	//$j('#' + id).dialog(config);	
};


var windowInfo = function(id, title, content) {
	dialogWindow(id, title, content, { 
			buttons: { 
					"Ok": function() { $j(this).dialog("close"); } 
			}
	});
}


var windowAjaxContent = function(url, title, options) {
	title = title ? title : '';
	$j.ajax({
		url: url,
		cache: false,
		success: function(html){
			dialogWindow(randomString(), title, html, options);
		}
	});

}

