// JavaScript Document
// Initialize the temporary Panel to display while waiting for external content to load

function loadTerm(id) {
	wait = new YAHOO.widget.Panel("wait",  
										{ width:"240px", 
										  fixedcenter:true, 
										  close:false, 
										  draggable:false, 
										  modal:true,
										  visible:false,
										  effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5} 
										} 
									);

	wait.setHeader("Loading definition, please wait...");
	wait.setBody('<img src="http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/gp/rel_interstitial_loading.gif" />');
	wait.render(document.body);

// Define the callback object for Connection Manager that will set the body of our content area when the content has loaded

var callback_g = {
	success : function(o) {
				// Instantiate the Dialog
				var handleClose = function() {
					this.hide();
				};
				
				simpledialog1 = 
					new YAHOO.widget.SimpleDialog("simpledialog1", 
							 { width: "300px",
							   fixedcenter: true,
							   visible: false,
							   draggable: false,
							   close: true,
							   text: o.responseText,
							   constraintoviewport: true,
							   buttons: [ { text:"Close", handler:handleClose, isDefault:true } ]
							 } );
				simpledialog1.setHeader("Glossary");
				simpledialog1.render(document.body);
				simpledialog1.show();
		wait.hide();
	},
	failure : function(o) {
		alert(o.responseTest);
		wait.hide();
	}
}

// Show the Panel
wait.show();


// Connect to our data source and load the data
var conn = YAHOO.util.Connect.asyncRequest("GET", "/glossary/term.php?id=" + id, callback_g);
return false;

}
