﻿function openRadWindow(uName)
{   
    var oWnd = radopen("EmailVerifyPrompt.aspx?u="+uName, "RadWindow1" );
    oWnd.center();
    oWnd.add_close(onWindowClose);
}

function onWindowClose(sender, eventArgs)
{
    
}

function checkEmailVerified()
{
    var userName = $get("ctl00_ContentPlaceHolder1_LoginCustomer_UserName").value;
    PageMethods.IsEmailVerified(userName, onSuccess, onFailure);
}

// Called when the asynchronous call to the PageMethod is completed 
function onSuccess(result, context, methodName)
{
    var uName = $get("ctl00_ContentPlaceHolder1_LoginCustomer_UserName").value;
     if(!result)
     {
        openRadWindow(uName);
     }
}

// Called when the asynchronous call to the PageMethod fails
function onFailure(error, context, methodName)
{
}