function getPage(page){
	
	
	
	var xmlhttp=false; //Clear our fetching variable	
	startLoading('');
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object.
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = 'pages/'; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + page, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
	
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('content').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
		if (xmlhttp.readyState==2) {
			stopLoading('');	
					var newLocation = page;   
				
				   var modifiedLocation = "section:" 
										  + newLocation;
										  
										
				   var historyData = "<p>The following location "
									 + "was loaded from our "
									 + "DHTML history: "
									 + modifiedLocation + "</p>";
									 
									
				   dhtmlHistory.add(modifiedLocation, 
									historyData);
		}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
		
		
		
		
		

		
		
		
		
return;
}
function startLoading(type) {


		document.getElementById('loading').style.display = 'block';
		document.getElementById('content').style.display = 'none';
		document.getElementById('content').innerHTML = '';
	
}
function stopLoading(type) {

		document.getElementById('loading').style.display = 'none'; //Change the inner content of your div to the newly retrieved content ****
		document.getElementById('content').style.display = 'block';
	
}
window.onload = initialize;

// initialize ourselves when the page is
// finished loading

/** Our function that initializes when the page
    is finished loading. */
function initialize() {
	
   // initialize the DHTML History framework
   dhtmlHistory.initialize();
   
   // add ourselves as a DHTML History listener
   dhtmlHistory.addListener(handleHistoryChange);
 
   // determine what our initial location is
   // by retrieving it from the browser's
   // location after the hash
   var currentLocation = 
      dhtmlHistory.getCurrentLocation();
	
   // if there is no location then display
   // the default, which is the inbox
   if (currentLocation == "") {
      currentLocation = "section:welcome.php";
   }
   
   // extract the section to display from
   // the initial location 
   
      
   
   
   currentLocation = 
         currentLocation.replace(/section\:/, "");
		 
		
   
   // display this initial location
   displayLocation(currentLocation, null) 
	
	
}

/** Handles history change events. */
function handleHistoryChange(newLocation, 
                             historyData) {
   // if there is no location then display
   // the default, which is the inbox
   if (newLocation == "") {
      newLocation = "section:welcome.php";
   }
   
   // extract the section to display from
   // the location change; newLocation will
   // begin with the word "section:" 
   

   
   newLocation = 
         newLocation.replace(/section\:/, "");
   
   // update the browser to respond to this
   // DHTML history change
   if (newLocation != 'playerstats.php') {
   displayLocation(newLocation, historyData);
   }
	
	
}

/** Displays the given location in the 
    right-hand side content area. */

function displayLocation(newLocation,
                         sectionData) {
		getPage(newLocation);
	
}