

$(document).ready(function(){
		

	$('.dlgPmt').unbind();
	$('.dlgPmt').each(function() {
		var link = $(this);
		var mwidth = link.attr('width') ? link.attr('width') : 500;
		var mheight = link.attr('height') ? link.attr('height') : 700;
		var $dialog2 = $('<div></div>')
			.load(link.attr('href'))
			//.dialog({autoOpen: false, title: link.attr('title'), modal: true, overlay: { background: "url(img/modal.png) repeat"},	width: mwidth,	height: mheight
			.dialog({autoOpen: false, title: link.attr('title'), resizable: false, modal: true, buttons: { "   Close    ": function() { $(this).dialog("close"); } }, overlay: { background: "url(img/modal.png) repeat"},	width: mwidth,	height: mheight
			});

		link.click(function() {
			$dialog2.dialog('open');

		$(".ui-dialog-buttonpane").attr('id', 'mbpanel');
		$("#mbpanel").hide();

		dialogPayment = $dialog2;
		
		return false;
		});

		
	});

	$('.dlgAjax').unbind();
	$('.dlgAjax').each(function() {
		var link = $(this);
		var mwidth = link.attr('width') ? link.attr('width') : 500;
		var mheight = link.attr('height') ? link.attr('height') : 700;
		var $dialog = $('<div></div>')
			.load(link.attr('href'))
			.dialog({autoOpen: false, title: link.attr('title'), modal: true, overlay: { background: "url(img/modal.png) repeat"},	width: mwidth,	height: mheight, buttons: { "  Close  ": function() { $(this).dialog("close"); } }
			});

		link.click(function() {
			$dialog.dialog('open');

			return false;
		});
	});


	$('.dlgStatic').unbind();
	$('.dlgStatic').each(function() {
		var link = $(this);
		var $dialog = $('<div>' + link.attr('href') + '</div>')
			.dialog({autoOpen: false, title: link.attr('title'), modal: true, overlay: { background: "url(img/modal.png) repeat"}, width: 500,	buttons: { "  Close  ": function() { $(this).dialog("close"); } }
			});

		link.click(function() {	
			$dialog.dialog('open');

			return false;
		});
	});



});		



