//
// Loads a file using GET and sets its contents as the innerHTML of content
//
function load(pageName, content) {

    var page_request = false; 

    //If Mozilla, Safari etc
    if (window.XMLHttpRequest) {
        page_request = new XMLHttpRequest();
    }

    //If IE
    else if (window.ActiveXObject) { 
        try {
            page_request = new ActiveXObject("Msxml2.XMLHTTP");
        } 
        catch (e) {
            try {
                page_request = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
            }
        }
    }

    //I guess its not going to happen so
    else {
        return false;
    }

    //If we get this far, GET the page
    page_request.open('GET', pageName, true);

    //Register the call back function for when the request is ready
    page_request.onreadystatechange = function() {
         
        //Check if the GET request is complete
        if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) { 
            //If so set the content's innerHTML to the content fetched
            document.getElementById(content).innerHTML = page_request.responseText;
        }
    }

    //Nullify the request
    page_request.send(null); 
};

