﻿var helpProxy;

// Initializes global and proxy default variables.
function pageLoad()
{
    // Instantiate the service proxy.
    helpProxy = new HelpWebService();
    

    // Set the default call back functions.
    helpProxy.set_defaultSucceededCallback(SucceededCallback);
    helpProxy.set_defaultFailedCallback(FailedCallback);
}


// Processes the button click and calls
// the service Greetings method.  
function OnClickGethelp(helppagina)
{
    
    var RsltElem = document.getElementById("HelpResults");
    RsltElem.innerHTML = "<div class='popupheader'>Ogenblikje...</div><div class='popupbody'><span class='updating'>&nbsp;</span></div>";
    var gethelp = helpProxy.gethelp(helppagina);
}

// Callback function that
// processes the service return value.
function SucceededCallback(result)
{
    var RsltElem = document.getElementById("HelpResults");
    RsltElem.innerHTML = result;
}

// Callback function invoked when a call to 
// the  service methods fails.
function FailedCallback(error, userContext, methodName) 
{
    if(error !== null) 
    {
        var RsltElem = document.getElementById("HelpResults");

        RsltElem.innerHTML = "Er is een fout opgetreden: " + 
            error.get_message();
    }
}

if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
