
var Faq=function()
{
var c=function()
{
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/Faq",{verb:"POST",data:{surname:$("#apssurname").val(),givenname:$("#apsgivenname").val(),email:$("#apsemail").val(),projectId:"",userQuestion:$("#apsquestion").val()+"<br/>SID: "+$("#apssurveynumber").val()+$("#othersurvey").val()+"<br/>",subject:$("#apssubject").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
{
alert(a.Json);
$.modal.close()
}
else
alert(a.ErrorMessage);
apsdaqBtnClickGo=true
},error:function()
{
apsdaqBtnClickGo=true
}})
},
b=function()
{
var a=true,
c=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([\-\w]+\.)+[a-zA-Z]{2,5})|(([0-9]{1,3}\.){3}[0-9]{1,3}))\.?$/,
g=$("#apssurname").val(),
d=$("#apsgivenname").val(),
b=$("#apsemail").val(),
f=$("#apssubject").val(),
e=$("#apsquestion").val();
if(g=="")
{
$("#apssurname").addClass("error");
a=false
}
if(d=="")
{
$("#apsgivenname").addClass("error");
a=false
}
if(b==""||c.test(b)==false)
{
$("#apsemail").addClass("error");
a=false
}
if(f=="")
{
$("#apssubject").addClass("error");
a=false
}
if(e=="")
{
$("#apsquestion").addClass("error");
a=false
}
return a
},
a=function()
{
$("#apssurname").removeClass("error");
$("#apsgivenname").removeClass("error");
$("#apsemail").removeClass("error");
$("#apssubject").removeClass("error");
$("#apsquestion").removeClass("error")
},
d=function()
{
$("#apssubjectoptions").val("000");
$("#apssurname").val("");
$("#apsgivenname").val("");
$("#apsemail").val("");
$("#apssubject").val(" - ");
$("#apsquestion").val("");
$("#AskSurveyNumber").css("display","none")
};
$(function()
{
$("#AskSurveyNumber").css("display","none");
$("#othersurvey").css("display","none");
$("#apssubmit").click(function(d)
{
d.preventDefault();
if(apsdaqBtnClickGo==true)
{
apsdaqBtnClickGo=false;
a();
b()==true&&
c.call()
}
apsdaqBtnClickGo=true
});
$("#apscancel").click(function(a)
{
a.preventDefault();
d()
});
$("#apssubjectoptions").change(function()
{
$(this).val()!="000"&&
$("#apssubjectoptions option:selected").each(function()
{
$("#apssubject").val($(this).text())
});
if($(this).val()==$("#surveyLabelName").val())
$("#AskSurveyNumber").show("slow");
else
{
$("#AskSurveyNumber").hide("slow");
$("#apssurveynumber").val("")
}
});
$("#survey-numer").change(function()
{
if($(this).val()!="000"||$(this).val()!="Other")
{
$("#othersurvey").hide("slow");
$("#othersurvey").val("");
$("#survey-numer option:selected").each(function()
{
$("#apssurveynumber").val($(this).text())
})
}
if($(this).val()=="other")
{
$("#othersurvey").show("slow");
$("#apssurveynumber").val("")
}
});
$(".faq-section li").toggle(function()
{
$(this).find("p").show(function()
{
$(this).prev(".faq-icon").attr("style","background-position: 0 -23px")
})
},function()
{
$(this).find("p").hide(function()
{
$(this).prev(".faq-icon").attr("style","background-position: 0 0")
})
});
$("#submit-a-question").click(function()
{
$("#contact-ss-container").modal({containerId:"modal-container",autoResize:true,closeClass:"modal-close",overlayClose:true,opacity:90});
return false
})
})
}(),
apsdaqBtnClickGo=true


function QueryStringRequest(a)
{
a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var c="[\\?&]"+a+"=([^&#]*)",
d=new RegExp(c),
b=d.exec(window.location.href);
return b==null?"":b[1]
}
$(function()
{
$("#paged-content li:first").show();
$(".pagination li a").click(function(a)
{
a.preventDefault();
$(this).parent().parent().parent().prev("ul").closest("ul").find("li:visible").hide();
$(this).parent().parent().parent().prev("ul").closest("ul").find("li").eq($(this).parent().index()).show()
})
});
$(function()
{
try
{
var a=$("#nav ul li a");
for(i=0;i<a.length;i++)
if(window.location.pathname.toLowerCase().search($(a[i]).attr("id"))!=-1)
{
$(a[i]).addClass("nav-active");
break
}
}
catch(c)
{
}
try
{
var a=$("#nav-dashboard ul li a");
for(i=0;i<a.length;i++)
if(window.location.pathname.toLowerCase().search($(a[i]).attr("id"))!=-1)
{
$(a[i]).addClass("nav-active");
break
}
}
catch(c)
{
}
try
{
var b=$(".dashboard-menu-mid ul li a");
for(i=0;i<b.length;i++)
if(window.location.pathname.toLowerCase().search($(b[i]).attr("id"))!=-1)
{
$(b[i]).addClass("astrongclass");
break
}
}
catch(c)
{
}
$(".reward-box:eq(3)").find("img").addClass("spinner")
});
$(document).ready(function()
{
var b=window.location.pathname,
a="/Secured/Claim-Rewards";
b==a&&
$("#reward-status .points:eq(2)").addClass("points-fix")
})


var Login=function()
{
var a=function()
{
document.cookie="FB_CheckUser=true; path=/";
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/Login",{verb:"POST",data:{user:$("#apsusername").val(),password:$("#apspassword").val(),redirectUrl:QueryStringRequest("redirecturl"),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
if(a.ErrorMessage!=null)
{
i(a.JavaScript,a.ErrorMessage);
return false
}
else
eval(a.JavaScript);
else
alert(a.ErrorMessage);
apsloBtnClickGo=true
},error:function()
{
apsloBtnClickGo=true
}})
},
i=function(b,c)
{
var a=0;
$.modal("<div id='login-unconfirmed-modal'><p>"+c+"</p></div>",{onClose:function()
{
if(a!=1)
{
$.modal.close();
eval(b)
}
},containerId:"login-unconfirmed-modal-container",autoResize:false,closeClass:"modal-close",overlayClose:true,opacity:90});
$("#login-confirm-email").click(function()
{
a=1;
$.modal.close();
h(b)
})
},
h=function(a)
{
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/RegistrationEmail",{verb:"POST",data:{user:$("#apsusername").val(),password:$("#apspassword").val(),redirectUrl:QueryStringRequest("redirecturl"),guid:currentItem},success:function(c)
{
var b=JSON.parse(c.d);
if(b.Success==true)
{
alert(b.Json);
$.modal.close();
eval(a)
}
else
{
alert(b.ErrorMessage);
$.modal.close();
eval(a)
}
},error:function()
{
}})
},
b=function()
{
var a=true,
d=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([\-\w]+\.)+[a-zA-Z]{2,5})|(([0-9]{1,3}\.){3}[0-9]{1,3}))\.?$/,
c=$("#apsusername").val(),
b=$("#apspassword").val();
if(c=="")
{
$("#apsusername").addClass("error");
a=false
}
if(b=="")
{
$("#apspassword").addClass("error");
a=false
}
return a
},
c=function()
{
$.ajaxDotNet("/app_services/aps/secured/SecuredServices.asmx/LogOut",{verb:"POST",data:{guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
alert(a.ErrorMessage);
apsliBtnClickGo=true
},error:function()
{
apsliBtnClickGo=true;
window.location="/"
}})
},
g=function()
{
$.ajaxDotNet("/app_services/aps/public/PublicServices.asmx/FbRegistration",{verb:"POST",data:{firstName:$("#fbfirstname").val(),lastName:$("#fblastname").val(),userEmail:$("#fbUserEmail").val(),url:document.location.href,redirectUrl:$("#fbRedirect").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
alert("Post wasn't successfull")
},error:function()
{
alert("Error!")
}})
},
e=function()
{
$.ajaxDotNet("/app_services/aps/public/PublicServices.asmx/FbSyncAccount",{verb:"POST",data:{userEmail:$("#apsusername").val(),userPassword:$("#apspassword").val(),FbUserId:$("#fbUserId").val(),FbUserToken:$("#fbUserToken").val(),FbUserEmail:$("#fbUserEmail").val(),redirectUrl:$("#fbRedirect").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
{
alert(a.ErrorMessage);
eval(a.JavaScript)
}
},error:function()
{
alert("Error")
}})
},
d=function()
{
$.ajaxDotNet("/app_services/aps/public/PublicServices.asmx/knownMemberSyncFb",{verb:"POST",data:{appId:appId,appSecret:appSecret,redirectUrl:redirectURL,guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
{
alert(a.ErrorMessage);
eval(a.JavaScript)
}
},error:function()
{
alert(returnedobj.ErrorMessage)
}})
},
f=function()
{
$.ajaxDotNet("/app_services/aps/public/PublicServices.asmx/FbDisconnect",{verb:"POST",data:{userId:userId,appId:appId,appSecret:appSecret,redirectUrl:redirectURL,guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
alert(a.ErrorMessage)
},error:function()
{
alert("Error")
}})
};
$(function()
{
$("#apsusername").keypress(function(c)
{
var d=c.keyCode?c.keyCode:c.which;
if(d==13)
if(apsloBtnClickGo==true)
{
apsloBtnClickGo=false;
b()==true&&
a.call()
}
});
$("#apspassword").keypress(function(c)
{
var d=c.keyCode?c.keyCode:c.which;
if(d==13)
if(apsloBtnClickGo==true)
{
apsloBtnClickGo=false;
b()==true&&
a.call()
}
});
$("#apslogin").click(function(c)
{
c.preventDefault();
if(apsloBtnClickGo==true)
{
apsloBtnClickGo=false;
if(b()==true)
a.call();
else
apsloBtnClickGo=true
}
});
$("#fblogin").click(function(b)
{
b.preventDefault();
FB.login(function(b)
{
if(b.authResponse)
{
document.cookie="FB_Status=true; path=/";
a.call();
top.location.href=redirectURL
}
},{scope:permissions})
});
$("#fbRegister").click(function(a)
{
a.preventDefault();
g.call()
});
$("#fbSyncAccount").click(function(a)
{
a.preventDefault();
e.call()
});
$("#knownMemberSyncFb").click(function(a)
{
a.preventDefault();
FB.login(function(a)
{
if(a.authResponse)
{
document.cookie="FB_Status=true; path=/";
d.call()
}
else
alert("There was a problem syncing accounts")
},{scope:permissions})
});
$("#fbDisconnectApp").click(function(a)
{
a.preventDefault();
f.call()
});
$("#fblogout").click(function(a)
{
a.preventDefault();
if(apsliBtnClickGo==true)
{
apsliBtnClickGo=false;
document.cookie="FB_Status=false; path=/";
document.cookie="FB_CheckUser=false; path=/";
c.call()
}
});
$(".inbody-aps-logout").click(function(a)
{
a.preventDefault();
if(apsliBtnClickGo==true)
{
apsliBtnClickGo=false;
c.call()
}
});
$("#forgotpasswordtextforbutton").click(function(a)
{
a.preventDefault();
window.location=$("#forgotpasswordtextforbutton").attr("href")+"?emailaddress="+$("#apsusername").val()
});
$("#apslogout").click(function(a)
{
a.preventDefault();
if(apsliBtnClickGo==true)
{
apsliBtnClickGo=false;
c.call()
}
});
$("#apsusername").focusin(function()
{
if(apsuserHolder=="")
apsuserHolder=$("#apsusername").val();
$("#apsusername").val()==apsuserHolder&&
$("#apsusername").val("")
});
$("#apsusername").focusout(function()
{
var a=$("#apsusername").val();
a==""&&
$("#apsusername").val(apsuserHolder)
});
$("#apsusernamerequest").focusin(function()
{
if(apsuserrequestHolder=="")
apsuserrequestHolder=$("#apsusernamerequest").val();
$("#apsusernamerequest").val()==apsuserrequestHolder&&
$("#apsusernamerequest").val("")
});
$("#apsusernamerequest").focusout(function()
{
var a=$("#apsusernamerequest").val();
a==""&&
$("#apsusernamerequest").val(apsuserrequestHolder)
});
$("#apspassword").focusin(function()
{
if(apspassHolder=="")
apspassHolder=$("#apspassword").val();
$("#apspassword").val()==apspassHolder&&
$("#apspassword").val("")
});
$("#apspassword").focusout(function()
{
var a=$("#apspassword").val();
a==""&&
$("#apspassword").val(apspassHolder)
})
})
}(),
apsuserHolder="",
apsuserrequestHolder="",
apspassHolder="",
apsloBtnClickGo=true,
apsliBtnClickGo=true,
ChangeLogin=function()
{
var b=function()
{
$.ajaxDotNet("/app_services/aps/secured/securedservices.asmx/ChangeLogin",{verb:"POST",data:{newemail:$("#apsnewemailaddress").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
$("#changeLogin").html(a.Json);
else
{
$("#customMessages").html(a.ErrorMessage);
$("#customMessages").removeClass("hideme");
$("#customMessages").addClass("error");
return
}
apsemailBtnClickGo=true
},error:function()
{
apsemailBtnClickGo=true
}})
},
a=function()
{
var a=true,
b=true,
e=$("#apsnewemailaddress").val(),
c=$("#apsconfirmemailaddress").val();
if(e!=c)
{
$("#customMessages").text($("#emailDontMatchMessage").html());
$("#customMessages").removeClass("hideme");
$("#customMessages").addClass("error");
b=false
}
else
{
$("#customMessages").removeClass("error");
$("#customMessages").addClass("hideme")
}
$.validator.addMethod("email",function(b,a)
{
return this.optional(a)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([\-\w]+\.)+[a-zA-Z]{2,5})|(([0-9]{1,3}\.){3}[0-9]{1,3}))\.?$/.test(b)
},"test");
var d=$("#form1").validate({rules:{newemailaddress:"required email",confirmemailaddress:"required email"},messages:{newemailaddress:" * "+$("#emailValidationError").html(),confirmemailaddress:" * "+$("#emailValidationError").html()}});
if(d.form())
if(b)
a=true;
else
a=false;
else
a=false;
return a
};
$(function()
{
$("#apssavenewemailbutton").click(function(c)
{
c.preventDefault();
if(apsemailBtnClickGo==true)
{
apsemailBtnClickGo=false;
a()==true&&
b();
apsemailBtnClickGo=true
}
})
})
}(),
apsemailBtnClickGo=true


var PasswordHint=function()
{
var c=function()
{
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/RequestPassword",{verb:"POST",data:{user:$("#apsusernamerequest").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
alert(a.Json);
else
alert(a.ErrorMessage);
apspwhBtnClickGo=true
},error:function()
{
apspwhBtnClickGo=true
}})
},
d=function()
{
$.ajaxDotNet("/app_services/aps/secured/securedservices.asmx/ChangePassword",{verb:"POST",data:{password:$("#apscurrentpassword").val(),newpassword:$("#apsnewpassword").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
alert(a.Json);
else
alert(a.ErrorMessage);
apspwsBtnClickGo=true
},error:function()
{
apspwsBtnClickGo=true
}})
},
a=function()
{
var a=true,
c=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([\-\w]+\.)+[a-zA-Z]{2,5})|(([0-9]{1,3}\.){3}[0-9]{1,3}))\.?$/,
b=$("#apsusernamerequest").val();
if(b==""||c.test(b)==false)
{
$("#apsusernamerequest").addClass("error");
a=false
}
return a
},
b=function()
{
var a=true,
c=/^[\w\s\?!@#%&*\(\)\/\|+:]{5,20}$/,
e=$("#apscurrentpassword").val(),
b=$("#apsnewpassword").val(),
d=$("#apsconfirmnewpassword").val();
if(c.test(b)==false)
{
$("#apsnewpassword").addClass("error");
alert($("#passwordValidationError").html());
a=false
}
else
if(b!=d)
{
$("#apsnewpassword").addClass("error");
$("#apsconfirmnewpassword").addClass("error");
alert($("#passwordsDontMatchMessage").html());
a=false
}
return a
};
$(function()
{
$("#apspasswordhint").click(function(d)
{
d.preventDefault();
if(apspwhBtnClickGo==true)
{
apspwhBtnClickGo=false;
var b=a();
b==true&&
c();
b==false&&
alert($("#passwordhint-validation-message").html());
apspwhBtnClickGo=true
}
});
$("#apssavenewpwbutton").click(function(a)
{
a.preventDefault();
if(apspwsBtnClickGo==true)
{
apspwsBtnClickGo=false;
b()==true&&
d();
apspwhBtnClickGo=true
}
})
})
}(),
apspwhBtnClickGo=true,
apspwsBtnClickGo=true


var Refer=function()
{
var b=function()
{
$.ajaxDotNet("/app_services/aps/secured/securedservices.asmx/ReferService",{verb:"POST",data:{mEmail:$("#refer-myemail").val(),rEmail:$("#refer-youremail").val(),mName:$("#refer-myname").val(),rName:$("#refer-yourname").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
alert(a.Json);
else
alert(a.ErrorMessage);
apsrefBtnClickGo=true
},error:function()
{
apsrefBtnClickGo=true
}})
},
a=function()
{
var a=true,
b=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/,
c=$("#refer-myemail").val(),
d=$("#refer-youremail").val(),
e=$("#refer-myname").val(),
f=$("#refer-yourname").val();
if(b.test(c)==false)
{
$("#refer-myemail").addClass("error");
a=false
}
if(b.test(d)==false)
{
$("#refer-youremail").addClass("error");
a=false
}
if(e=="")
{
$("#refer-myname").addClass("error");
a=false
}
if(f=="")
{
$("#refer-yourname").addClass("error");
a=false
}
return a
};
$(function()
{
$("#refer-send-email").click(function(c)
{
c.preventDefault();
if(apsrefBtnClickGo==true)
{
apsrefBtnClickGo=false;
a()==true&&
b()
}
})
})
}(),
apsrefBtnClickGo=true


var Register=function()
{
var a=function()
{
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/Registration",{verb:"POST",data:{surname:$("#apssurname").val(),givenname:$("#apsgivenname").val(),email:$("#apsemail").val(),gendercode:$("input:radio:checked").val()?$("input:radio:checked").val():"",url:document.location.href,redirectUrl:QueryStringRequest("redirecturl"),guid:currentItem},success:function(c)
{
var a=JSON.parse(c.d);
if(a.Success==true)
eval(a.JavaScript);
else
{
$.validator.addMethod("email",function(b,a)
{
return this.optional(a)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([\-\w]+\.)+[a-zA-Z]{2,5})|(([0-9]{1,3}\.){3}[0-9]{1,3}))\.?$/.test(b)
},a.ErrorMessage[3]);
$.validator.addMethod("givenname",function(b,a)
{
return this.optional(a)||/^[a-zA-Z0-9-\s\.']{1,40}$/.test(b)
},a.ErrorMessage[1]);
$.validator.addMethod("surname",function(b,a)
{
return this.optional(a)||/^[a-zA-Z0-9-\s\.']{1,40}$/.test(b)
},a.ErrorMessage[2]);
var b=$("#form1").validate({rules:{apsgender:"required",givenname:"required",surname:"required",email:"required email"},messages:{apsgender:" * "+a.ErrorMessage[0],givenname:" * "+a.ErrorMessage[1],surname:" * "+a.ErrorMessage[2],email:" * "+a.ErrorMessage[3]},errorPlacement:function(b,a)
{
if(a.is(":radio"))
{
a="#gender_ms";
b.insertAfter(a)
}
else
b.insertAfter(a)
},highlight:function(a,b)
{
if($(a).attr("type")=="radio")
$(a.form).find("input[type=radio]").each(function()
{
$(a.form).find("input[for="+this.name+"]").addClass(b);
$(this).addClass(b)
});
else
{
$(a.form).find("input[name="+a.name+"]").addClass(b);
$(a).addClass(b)
}
},unhighlight:function(a,b)
{
if($(a).attr("type")=="radio")
$(a.form).find("input[type=radio]").each(function()
{
$(a.form).find("input[for="+this.name+"]").removeClass(b);
$(this).removeClass(b)
});
else
{
$(a.form).find("input[name="+a.name+"]").removeClass(b);
$(a).removeClass(b)
}
}});
b.form()
}
apsregBtnClickGo=true
},error:function()
{
apsregBtnClickGo=true
}})
},
b=function()
{
var b=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([\-\w]+\.)+[a-zA-Z]{2,5})|(([0-9]{1,3}\.){3}[0-9]{1,3}))\.?$/,
c=true,
f=$("#apssurname").val(),
e=$("#apsgivenname").val(),
a=$("#apsemail").val(),
d=$("input:radio:checked").val();
(a==""||b.test(a)==false)&&
$("#apsemail").addClass("error");
e==""&&
$("#apsgivenname").addClass("error");
f==""&&
$("#apssurname").addClass("error");
d==""&&
$("#apsgender").addClass("error");
return c
};
$(function()
{
$("#apsregister").click(function(b)
{
b.preventDefault();
if(apsregBtnClickGo==true)
{
apsregBtnClickGo=false;
a()
}
})
})
}(),
apsregBtnClickGo=true


var RegisterDOI=function()
{
var b=function()
{
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/RegistrationDOI",{verb:"POST",data:{maritalStatusSelect:$("#maritalStatusSelect").val(),education:$("#education").val(),employment:$("#employment").val(),dateofbirth1month:$("#dateofbirth1month").val(),dateofbirth1days:$("#dateofbirth1days").val(),dateofbirth1year:$("#dateofbirth1year").val(),gender1:$("#gender1").val(),dateofbirth2month:$("#dateofbirth2month").val(),dateofbirth2days:$("#dateofbirth2days").val(),dateofbirth2year:$("#dateofbirth2year").val(),gender2:$("#gender2").val(),dateofbirth3month:$("#dateofbirth3month").val(),dateofbirth3days:$("#dateofbirth3days").val(),dateofbirth3year:$("#dateofbirth3year").val(),gender3:$("#gender3").val(),dateofbirth4month:$("#dateofbirth4month").val(),dateofbirth4days:$("#dateofbirth4days").val(),dateofbirth4year:$("#dateofbirth4year").val(),gender4:$("#gender4").val(),dateofbirth5month:$("#dateofbirth5month").val(),dateofbirth5days:$("#dateofbirth5days").val(),dateofbirth5year:$("#dateofbirth5year").val(),gender5:$("#gender5").val(),url:document.location.href,redirectUrl:"/Secured/Action/Welcome",guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
alert(a.ErrorMessage);
apsregBtnClickGo=true
},error:function()
{
apsregBtnClickGo=true
}})
};
function a()
{
var a=$("#form1").valid();
if(a==true)
validForm=true
}
$(function()
{
$("#doiregister").click(function(c)
{
$("#form1").validate();
a();
c.preventDefault();
if(apsregBtnClickGo==true&&validForm==true)
{
apsregBtnClickGo=false;
b()
}
})
})
}(),
validForm=false,
apsregBtnClickGo=true


var TerminateReward=function()
{
var a=function(a)
{
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/DonateToCharity",{verb:"POST",data:{charityID:a,termRewardID:$("#apstermrewardid").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
alert(a.Json);
donateClickGo=true
},error:function(a)
{
alert(a.statusText);
donateClickGo=true
}})
},
b=function()
{
$.ajaxDotNet("/app_services/aps/public/publicservices.asmx/PlayInstantWin",{verb:"POST",data:{termRewardID:$("#apstermrewardid").val(),guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
alert(a.Json);
playClickGo=true
},error:function(a)
{
alert(a.statusText);
playClickGo=true
}})
};
$(function()
{
$(".donate").click(function(b)
{
b.preventDefault();
if(donateClickGo==true)
{
donateClickGo=false;
a($(this).attr("name"))
}
});
$("#play").click(function(a)
{
a.preventDefault();
if(playClickGo==true)
{
playClickGo=false;
b()
}
})
})
}(),
donateClickGo=true,
playClickGo=true


var Unsubscribe=function()
{
var a=function()
{
$.ajaxDotNet("/app_services/aps/secured/securedservices.asmx/Unsubscribe",{verb:"POST",data:{guid:currentItem},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
eval(a.JavaScript);
else
alert(a.ErrorMessage);
apsUnBtnClickGo=true
},error:function()
{
apsUnBtnClickGo=true
}})
};
$(function()
{
$("#apsunsubscribe").click(function(c)
{
c.preventDefault();
if(apsUnBtnClickGo==true)
{
apsUnBtnClickGo=false;
var b=confirm($("#unsubscribe-sure-message").html());
b==true&&
a()
}
})
})
}(),
apsUnBtnClickGo=true


var RewardClaimPhoneValidation=function()
{
var a=function()
{
$.ajaxDotNet("/app_services/aps/secured/securedservices.asmx/RewardClaimPhoneValidation",{verb:"POST",data:{contactmethod:$("input:radio:checked").val()?$("input:radio:checked").val():"",phonenumber:$("#phonenumber").val(),guid:currentItem,entityId:$("#entityId").val(),checkGuid:$("#checkGuid").val()},success:function(b)
{
var a=JSON.parse(b.d);
if(a.Success==true)
{
$("#phoneValidate").addClass("hideme");
$("#pinSent").removeClass("hideme");
a.Json&&
$("#checkGuid").val(a.Json)
}
else
{
alert(a.ErrorMessage);
if(a.JavaScript)
{
eval(a.JavaScript);
return false
}
}
apsloBtnClickGo=true
},error:function()
{
apsloBtnClickGo=true
}})
},
c=function()
{
$.ajaxDotNet("/app_services/aps/secured/securedservices.asmx/RewardClaimPinValidation",{verb:"POST",data:{pinnumber:$("#pinnumber").val(),guid:currentItem,entityId:$("#entityId").val(),checkGuid:$("#checkGuid").val()},success:function(c)
{
var a=JSON.parse(c.d);
if(a.Success==true)
eval(a.JavaScript);
else
if(a.Json)
{
var b=a.Json;
if(b[0]=="NoMatch")
{
$("#checkGuid").val(b[1]);
alert(a.ErrorMessage)
}
else
{
alert(a.ErrorMessage);
if(a.JavaScript)
eval(a.JavaScript);
return false
}
}
else
{
alert(a.ErrorMessage);
if(a.JavaScript)
eval(a.JavaScript);
return false
}
apsloBtnClickGo=true
},error:function()
{
apsloBtnClickGo=true
}})
},
d=function()
{
var a=eval($("#regexValidation").html());
if(typeof a!="undefined")
{
var b=$("#form1").validate({rules:{contactmethod:"required",phonenumber:"required phone"},messages:{contactmethod:$("#requiredFieldError").html(),phonenumber:$("#invalidFormatError").html()}});
$.validator.addMethod("phone",function(c,b)
{
return this.optional(b)||a.test(c)
},"test")
}
else
var b=$("#form1").validate({rules:{contactmethod:"required",phonenumber:"required"},messages:{contactmethod:$("#requiredFieldError").html(),phonenumber:$("#requiredFieldError").html()}});
if(!b.form())
{
apsloBtnClickGo=true;
return false
}
return true
},
b=function()
{
var a=$("#form1").validate({rules:{pinnumber:"required"},messages:{pinnumber:$("#requiredFieldError").html()}});
if(!a.form())
{
apsloBtnClickGo=true;
return false
}
return true
};
$(function()
{
$("#rewardclaimvalidate").click(function(b)
{
b.preventDefault();
if(apsloBtnClickGo==true)
{
apsloBtnClickGo=false;
d()==true&&
a()
}
})
});
$(function()
{
$("#pinvalidate").click(function(a)
{
a.preventDefault();
if(apsloBtnClickGo==true)
{
apsloBtnClickGo=false;
b()==true&&
c()
}
})
})
}(),
apsloBtnClickGo=true


