﻿function OpenRegistrationForm()
{
    new Lightbox.base('CreateAccount'); 
}

function DisplayProfile(userid)
{
	if (parent != self){ // if we're inside an island
		parent.DisplayProfile(userid); return;} // call this function in the parent
		
    GetProfileInfo(userid);
    new Lightbox.base('Profile'); 
}

function SetJSVarsForValidation(val){
    if (val == "1") //USA
    {
        Page_Validators =  USPageValidators;
    }
    else
    {
        Page_Validators =  NonUSPageValidators;
    }
}

function DisplayOptIn(val)
{
    if (val == "1") //USA
    {
        $("OptinFields").show();
    }
    else
    {
        $("OptinFields").empty();
        $("OptinFields").hide();
    }
    SetJSVarsForValidation();
}

function DisplayForgotUorP()
{
    new Lightbox.base('ForgotUsernameOrPassword');
}

function CallRegisterUserSpotLight()
{
    //prepare the ajax request
    var url = "/RunEasy/AjaxRequests/RegisterUserSpotlight.aspx";
    var params = "";

    //send the request 
    var ajax = new Ajax.Request(url, { asynchronous:true} );
}

function CheckAgreement(btnCreate, cbIAgree)
{
    $(btnCreate).disabled = !cbIAgree.checked;
}