﻿(function($){$.fantasyleague.signup={settings:{validUsernameText:'',alreadyExistsText:'',notValidUsernameText:''},init:function(a,b,c,d,f){$.fantasyleague.signup.settings.validUsernameText=c;$.fantasyleague.signup.settings.alreadyExistsText=d;$.fantasyleague.signup.settings.notValidUsernameText=f;$("#"+a).bind("click",function(e){$.fantasyleague.signup.checkUsername(a,$("#"+b).attr("value"))})},onCheckUsernameSuccess:function(a,b){switch(a.d){case 0:$("#checkResponse").text($.fantasyleague.signup.settings.validUsernameText);break;case 1:$("#checkResponse").text($.fantasyleague.signup.settings.alreadyExistsText);break;default:$("#checkResponse").text($.fantasyleague.signup.settings.notValidUsernameText);break}$.fantasyleague.throbber.hideThrobber(b)},checkUsername:function(c,d){$.fantasyleague.throbber.showThrobber(c);$.ajax({type:"POST",url:$.fantasyleague.global.services.userController.url+$.fantasyleague.global.services.userController.methods.IsUsernameValid,data:"{ username: '"+d+"' }",contentType:"application/json; charset=utf-8",dataType:"json",success:function(a,b){$.fantasyleague.signup.onCheckUsernameSuccess(a,c)},error:function(a,b){$.fantasyleague.ajax.onAjaxErrorWithThrobber(a,c)}})}}})(jQuery);
