function showDialog(t, reload){
		if(typeof t != 'string') {
			t = $(this).title() || $(this).text() || $(this).href();
		}
		var callback = function(){
				$('form', $('#GB_frame').get())
				.ajaxForm( {	'target': '#GB_frame', 
								'after': function() { 
									var status = $('#status');
									var code = status.attr('class'); // yeah, I use a class name to signal if I'm done. YGAPWT?
									var status_msg = status.html()
									var content = $('#GB_frame').html(); // the whole page in the dialog
									if (code != 'ok') { 
										showDialog(t, content); // call myself again, with the content of the dialog box
									}
									else {
										$.GB_hide();
										alert(status_msg);
									}
								} } );
		}; // end of callback.
		if (!reload) { // we were called for the first time; create a dialog box!
			var url = $(this).href();
		  	var arguments = null;
			$.GB_show('about:blank', {
					height: 80,
					width: 400,
					animation: true,
					overlay_clickable: true,
					caption: t
			  });
			 // We don't want the iframe greybox gives us: 
			$('#GB_frame').remove();
			$("#GB_window").append("<div id='GB_frame'></div>");
		  	$("#GB_frame").load(url, // URL
							   arguments, // Params
							   callback );
		}
		else { // we were called again, because we're not done yet: just reload the HTML
			$("#GB_frame").html(reload);
			callback();
		}
		return false;
	}
	
	$(document).ready(function(){ $("a.dialog").click(showDialog); });

