function showDialog(id, title) {
	var width = ($('#'+id).css('min-width') != null ? $('#'+id).css('min-width') : '600px'); 
	var height = ($('#'+id).css('min-height') != null ? $('#'+id).css('min-height') : '350px'); 
	$('#'+id).css('width', width).css('height', height);
	if(title && title.length > 0 ){
		$('#'+id).find("#dialog-titlebar").html(title);
	}
	var dialog = new DialogBox(id, callbackDialog);
	$('<div id="ui-overlay-for-dialog" class="ui-overlay"><div class="ui-widget-overlay"></div></div>').hide().appendTo('body').show(0,
		function(){
			dialog.showDialog();
		});
	
	function callbackDialog(btnName) {
		$("#ui-overlay-for-dialog").remove();
	}
}

function initDialogLinks(){
	$('.dialog-box').css('visibility','visible');
	
	$(".dialog-box").dialog({ 
		autoOpen:	false
	});
	
	$(".dialog-html-show-link").click(function(){
			$(".ui-dialog-titlebar").show();
			event.preventDefault();
			var href = $( this ).attr('href');
			var title = $( this ).attr('title');
			showDialog(href, title);
	});
}

$(document).ready(function(){
	initDialogLinks();
});