function init()
{
    // Nothing happens here this time
}

function makeARequest( requestType )
{
    // create a new request object
    var req = new XMLHttpRequest();

    // declare a callback, look ma closures again!
    function callBack()
	{
	    console.log( req.readyState );

	    // if the request is complete
	    if( req.readyState == 4 )
		{
		    // make sure the request was made successfully
		    if( req.status == 200 )
			{
			    // sucess call the handler
			    myHandler( req.responseText );
			}
		    else
			{
			    alert( req.statusText );
			}
		}
	}

    // set the callback function
    req.onreadystatechange = callBack;
    
    // make an asynchronous call
    req.open( "GET", "http://www.freeformed.org/ajax/ajax.php?type=" + requestType, true);
    req.send( "" );
}

function myHandler( responseText )
{
    // we going to dynamically update a portion of the page
    
    // get a reference to the dynamic div
    var dynamic = document.getElementById( "dynamic" );
    
    // set the innerHTML property to the reponseText
    dynamic.innerHTML = responseText;
}