var http = null; //make global

//main links functions (from ucp_links_ajax.php)

function showHelp(help_section){
    http = getHTTPObject(); // We create the HTTP Object 
    http.onreadystatechange = function() {
        handleHelpHttpResponse(help_section); 
    };
    var url = "help.php?help_section="+help_section;
    http.open("GET", url, true);
    http.send(null);
}
function showFaqSection(help_section){
    
    help_section+="_help";
    var msg_loading_shell = document.getElementById("msg_loading_shell");
    msg_loading_shell.innerHTML = "<div style='padding:5px; background-color:orange;'><img src='new-images/icons/loading.gif'/>Loading "+help_section+". . .</div>";


    //alert(help_section);
    
    //alert(help_section);
    
    http = getHTTPObject(); // We create the HTTP Object 
    http.onreadystatechange = function() {
        handleFaqSectionHttpResponse(help_section); 
    };
    var url = "help.php?help_section="+help_section;
    http.open("GET", url, true);
    http.send(null);
}
function handleHelpHttpResponse(help_section){
    if(http.readyState == 4) {
        var help_section_shell = document.getElementById("master_help_shell");
        help_section_shell.innerHTML = http.responseText;
    }
}
function handleFaqSectionHttpResponse(help_section){
    if(http.readyState == 4) {
        var faq_section_shell = document.getElementById("faq_section_shell");
        faq_section_shell.innerHTML = http.responseText;
        
        var msg_loading_shell = document.getElementById("msg_loading_shell");
        msg_loading_shell.innerHTML = "";
    }
}
function hideHelp(help_section){
    var help_section_shell = document.getElementById("master_help_shell");
    help_section_shell.innerHTML = "";
}
function hideFaq(){
    var faq_section_shell = document.getElementById("faq_section_shell");
    if(faq_section_shell)
        faq_section_shell.innerHTML = "Click the links above to get started";
}
