﻿// CallWebServiceMethods.js
function GotEmail(result, eventArgs)
{
    var userId=result;
    if(result.indexOf("Email not found") == -1)
    {
       var arr = result.split("|");
       doEmailAction(true,arr[0],arr[1],arr[2]);
    }
    else
    {
        doEmailAction(false);
    }
}

function CheckEmail(text) 
{
    try
    {   
        Calendar.AsyncMethods.GetEmail(text,GotEmail);
    }
    catch(E)
    {
        alert(E.description);
    }
    return false;

}



// This is the callback function invoked if the Web service
// failed.
// It accepts the error object as a parameter.
function FailedCallback(error)
{
    // Display the error.    
    var RsltElem = 
        document.getElementById("ResultId");
    RsltElem.innerHTML = 
    "Service Error: " + error.get_message();
}

if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();