$.ui.dialog.defaults.bgiframe = true;
function popUpWindow(url, widthWin, heightWin, title, parentReload, userLoggedIn){
	reloadPage = false;
	newPageReload = false;
	$("#messageBox").dialog( 'destroy' ).html('<img style="vertical-align: middle" src="http://sjb.cr-direct.com/system/ext/jquery/progbar.gif" alt="Please, wait ..." /> Please, wait ...');
	$("#messageBox").dialog({
		width: widthWin,
		height: heightWin,
		modal: true,
		title: title,
		close: function(event, ui) {
			if((parentReload == true) && !userLoggedIn || newPageReload == true) {
				if(reloadPage == true)
					parent.document.location.reload();
			}
		}
	}).dialog( 'open' );
	$.get(url, function(data){
		$("#messageBox").html(data);
	});
	return false;
}
function SaveAd(noteId, url){
	$.get(url, function(data){
		$("#"+noteId).html(data);
	});
}
