var ue = false; var ce = ''; $(document).ready(function () { var input = document.getElementById('txtPreferredArea'); if (input != null && input != undefined) { applyautocomplete(input, "collection"); } if (FindErrorParameter() != null) alert(FindErrorParameter()); //login starts $("#btnLogin").click(function (event) { event.preventDefault(); var email = $('#txtEmail').val().trim(); var pwd = $('#txtPwd').val(); var msg = ''; var focusid = ''; if (email == '' || email == ReturnEmailAddressText()) { msg = ReturnEmailEmpty(); focusid = '#txtEmail'; } else if (!validateEmail(email)) { msg = ReturnEmailInvalid(); focusid = '#txtEmail'; } else if (pwd == '') { msg = ReturnPasswordEmpty(); focusid = '#txtPwd'; } else { var url = "api/oauth/login"; var response = MakeSyncWebCall(url, "{email:'" + email + "',pwd:'" + pwd + "'}", "post"); if (response == "true") { //================ check user type 2 monthly subscription and send to welcome.aspx else droneviewbanksearch ============ //var url = "api/panorama/user/getuserbyasid?sUserId=" + email; //var userResponse = MakeSyncWebCall(url, "{}", "get"); //if (userResponse.meta.code == 200) { // subscriptiontype = userResponse.data.user.subscriptiontype; // if (subscriptiontype == 2 || subscriptiontype == 3 || subscriptiontype == 4 || subscriptiontype == 5) { // window.location.href = "onboard.aspx"; // return; // } //} var returnurl = getParameterByName("ReturnUrl"); //if (response == "first time") // document.location.href = 'setting.aspx?type=droneviewbancksearch'; //else if (returnurl != '') document.location.href = returnurl.replace("&AspxAutoDetectCookieSupport=1", ""); else document.location.href = 'Dashboard.aspx'; } else if (response == "User_Not_Confirmed") { document.location.href = 'registernext.aspx?t=1&q=anc&e=' + email; } else { try { if (response == "User_Not_Found") msg = ReturnUser_Not_Found(); else if (response == "user_not_registered_in_local") msg = Returnuser_not_registered_in_local(); else if (response == "PilotLoginMessage") msg = ReturnPilotLoginMessage(); else if (response == "invalid_grant") msg = ReturnInvalid_grant(); else if (response == "User_Deactivated") msg = ReturnDeactivateUserText(); else msg = response; } catch (ex1) { msg = response; } } } if (msg != '') { alert(msg); if (focusid != '') $(focusid).focus(); } }); $("#btnPilotLogin").click(function (event) { event.preventDefault(); var email = $('#txtEmail').val().trim(); var pwd = $('#txtPwd').val(); var msg = ''; var focusid = ''; if (email == '' || email == ReturnEmailAddressText()) { msg = ReturnEmailEmpty(); focusid = '#txtEmail'; } else if (!validateEmail(email)) { msg = ReturnEmailInvalid(); focusid = '#txtEmail'; } else if (pwd == '') { msg = ReturnPasswordEmpty(); focusid = '#txtPwd'; } else { var url = "api/oauth/pilotlogin"; var response = MakeSyncWebCall(url, "{email:'" + email + "',pwd:'" + pwd + "'}", "post"); if (response == "true") { var returnurl = getParameterByName("ReturnUrl"); if (returnurl != '') document.location.href = returnurl; else document.location.href = 'Pilot/PilotInfo.aspx'; } else if (response == "User_Not_Confirmed") { document.location.href = 'registernext.aspx?t=1&q=anc&e=' + email; } else { try { if (response == "User_Not_Found") msg = ReturnUser_Not_Found(); else if (response == "user_not_registered_in_local") msg = Returnuser_not_registered_in_local(); else if (response == "NotActiveMessage") msg = ReturnNotActiveMessage(); else if (response == "RejectedMessage") msg = ReturnRejectedMessage(); else if (response == "LoginMessage") msg = ReturnLoginMessage(); else if (response == "invalid_grant") msg = ReturnInvalid_grant(); else msg = response; } catch (ex1) { msg = response; } } } if (msg != '') { alert(msg); if (focusid != '') $(focusid).focus(); } }); $("#btnGmailLogin").click(function (event) { event.preventDefault(); OtherLogin("google"); }); $("#btnFacebookLogin").click(function (event) { event.preventDefault(); OtherLogin("facebook"); }); $("#txtEmail").focusin(function (event) { if ($(this).val() == ReturnEmailAddressText()) { $(this).val(''); } }); $("#txtEmail").focusout(function (event) { //if ($(this).val() == '') { // $(this).val(ReturnEmailAddressText()); //} if ($(this).val().trim() != '' && $(this).val().trim() != ReturnEmailAddressText() && !validateEmail($(this).val().trim())) { alert(ReturnEmailInvalid()); } }); $("#btnSignUp").click(function (event) { event.preventDefault(); document.location.href = 'https://www.fastout.com'; }); $("#btnPilotSignUp").click(function (event) { event.preventDefault(); document.location.href = 'pilotregister.aspx'; }); function OtherLogin(type) { var msg = ''; var url = "api/oauth/login/" + type + "?url=" + document.location.href; var response = MakeSyncWebCall(url, "{}", "get"); try { if (response.split("|")[0] == 'true') { document.location.href = response.split("|")[1]; } else { msg = response; } } catch (ex) { msg = ex.message; } if (msg != '') alert(msg); } //login ends //register starts $("#txtRegisterEmail").blur(function (event) { event.preventDefault(); var msg = ''; if ($(this).val().trim() != '' && $(this).val().trim() != ReturnEmailAddressText() && validateEmail($(this).val().trim())) { if (ce == '' || ce != $(this).val().trim() || !ue) { ce = $(this).val().trim(); var url = "api/oauth/checkuser/" + encodeURI($(this).val().trim()); var response = MakeSyncWebCall(url, "", "get"); if (response == "true") { ue = true; msg = ReturnUser_Exists(); } else if (response == "false") { ue = false; } else { ue = null; try { msg = response; } catch (ex1) { msg = response; } } } } if (msg != '') { $($(this).attr('id')).focus(); alert(msg); } }); $("#txtPilotRegisterEmail").blur(function (event) { event.preventDefault(); isLoggedIn = false; $("#btnPilotRegisterLogin").hide(); var msg = ''; if ($(this).val().trim() != '' && $(this).val().trim() != ReturnEmailAddressText() && validateEmail($(this).val().trim())) { if (ce == '' || ce != $(this).val().trim() || !ue) { ce = $(this).val().trim(); var url = "api/oauth/checkuser/" + encodeURI($(this).val().trim()) + "?isPilot=" + true; var response = MakeSyncWebCall(url, "", "get"); if (response == "pilot") { ue = true; msg = ReturnUser_Exists(); $("#txtPassword").show(); $("#btnPilotRegisterLogin").show(); $("#btnPilotRegisterLogin").focus(); } else if (response == "true") { ue = false; isLoggedIn = true; $("#txtPassword").hide(); } else if (response == "false") { ue = false; $("#txtPassword").show(); } else { ue = null; try { msg = response; } catch (ex1) { msg = response; } } } } if (msg != '') { $($(this).attr('id')).focus(); alert(msg); } }); $("#btnCreateAcc").click(function (event) { event.preventDefault(); var email = $('#txtRegisterEmail').val(); var pwd = $('#txtPwd').val(); var cpwd = $('#txtConfPwd').val(); var code = $('#txtConfCode').val(); var msg = ''; var focusid = ''; if (email == '' || email == ReturnEmailAddressText()) { msg = ReturnEmailEmpty(); focusid = '#txtRegisterEmail'; } else if (!validateEmail(email)) { msg = ReturnEmailInvalid(); focusid = '#txtRegisterEmail'; } else if (pwd == '') { msg = ReturnPasswordEmpty(); focusid = '#txtPwd'; } else if (pwd.length < 6 || pwd.length > 15) { msg = ReturnPasswordMinMaxLength(); focusid = '#txtPwd'; } else if (cpwd == '') { msg = ReturnConfirmPasswordEmpty(); focusid = '#txtConfPwd'; } else if (ue == null) { msg = ReturnUser_Exists(); //Your request cannot be processed at this time. Please try later. focusid = '#txtRegisterEmail'; } else if (ue == true) { msg = ReturnUser_Exists(); focusid = '#txtRegisterEmail'; } else if (pwd != cpwd) { msg = ReturnPasswordAndConfirmMismatch(); } else if (!$("#chkTCondition").is(":checked")) { msg = ReturnTermsCondition(); } else { var url = "api/oauth/register?culture=" + GetCulture(); var response = MakeSyncWebCall(url, "{email:'" + email + "',pwd:'" + pwd + "',subscriptionType:'" + $('#hdn_subscriptionType').val() + "',country:'" + $('#hdn_countryid').val() + "'}", "post"); if (response == "User_Exists") { msg = ReturnUser_Exists(); } else if (response == "success") { fbq('track', 'CompleteRegistration'); document.location.href = 'registernext.aspx?t=1&q=success&e=' + email; } else if (response == "requestalreadyregistered") { document.location.href = 'registernext.aspx?t=1&q=ral&e=' + email; } else { try { msg = response; } catch (ex1) { msg = response; } } } if (msg != '') { alert(msg); if (focusid != '') $(focusid).focus(); } }); $("#btnPilotRegister").click(function (event) { event.preventDefault(); var name = $("#txtName").val(); var phone = $("#txtPhone").val(); var email = $('#txtPilotRegisterEmail').val(); var pwd = $("#txtPassword").val(); var company = $("#txtCompanyName").val(); var org = $("#txtOrgNumber").val(); var address = $("#txtAddress1").val(); var zip = $("#txtZip").val(); var city = $("#txtCity").val(); var country = $("#ddCountry").val(); var countryname = $("#ddCountry option:selected").text(); //var preferredarea = $("#txtPreferredArea").val(); var objpreferredAreas = getpreferredareas('collection'); var preferredarea = objpreferredAreas.preferredlocations; var worktime = $("#ddWorkTime option:selected").val(); var msg = ''; var focusid = ''; if (name == '') { $("#divName").addClass('has-error'); $("#txtName").focus(); } else if (phone == '') { $("#divName").removeClass('has-error'); $("#divPhone").addClass('has-error'); $("#txtPhone").focus(); } else if (email == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").addClass('has-error'); $("#txtPilotRegisterEmail").focus(); } else if (!validateEmail(email)) { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); msg = ReturnEmailInvalid(); focusid = '#txtPilotRegisterEmail'; } else if (!isLoggedIn && pwd == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").addClass('has-error'); $("#txtPassword").focus(); } else if (!isLoggedIn && (pwd.length < 6 || pwd.length > 15)) { msg = ReturnPasswordMinMaxLength(); focusid = '#txtPassword'; } else if (company == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").addClass('has-error'); $("#txtCompanyName").focus(); } else if (org == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").addClass('has-error'); $("#txtOrgNumber").focus(); } else if (address == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").addClass('has-error'); $("#txtAddress1").focus(); } else if (zip == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").addClass('has-error'); $("#txtZip").focus(); } else if (city == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").removeClass('has-error'); $("#divCity").addClass('has-error'); $("#txtCity").focus(); } else if (country == '0') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").removeClass('has-error'); $("#divCity").removeClass('has-error'); $("#divCountry").addClass('has-error'); } else if (!$("#chk1").is(":checked") && !$("#chk2").is(":checked") && !$("#chk3").is(":checked") && !$("#chk4").is(":checked") && !$("#chk5").is(":checked")) { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").removeClass('has-error'); $("#divCity").removeClass('has-error'); $("#divCountry").removeClass('has-error'); msg = ReturnTypeOfDrone(); } //else if ($("#chkOther").is(":checked") && $("#txtOther").val() == '') { // $("#divName").removeClass('has-error'); // $("#divPhone").removeClass('has-error'); // $("#divEmail").removeClass('has-error'); // $("#divPassword").removeClass('has-error'); // $("#divCompany").removeClass('has-error'); // $("#divOrg").removeClass('has-error'); // $("#divAddress1").removeClass('has-error'); // $("#divZip").removeClass('has-error'); // $("#divCity").removeClass('has-error'); // $("#divCountry").removeClass('has-error'); // $("#divOther").addClass('has-error'); // $("#txtOther").focus(); // msg = ""; //} else if (preferredarea == '') { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").removeClass('has-error'); $("#divCity").removeClass('has-error'); $("#divCountry").removeClass('has-error'); $("#divOther").removeClass('has-error'); $("#divPreferredarea").addClass('has-error'); msg = ""; } else if (!$("#chkPermits").is(":checked")) { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").removeClass('has-error'); $("#divCity").removeClass('has-error'); $("#divCountry").removeClass('has-error'); $("#divOther").removeClass('has-error'); $("#divPreferredarea").removeClass('has-error'); msg = ReturnPermits(); } //else if (($("#ddCountry option:selected").text().toLowerCase().trim() == "sweden" || $("#ddCountry option:selected").text().toLowerCase().trim() == "finland") && !$("#chkTCondition").is(":checked")) { else if (!$("#chkTCondition").is(":checked")) { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").removeClass('has-error'); $("#divCity").removeClass('has-error'); $("#divCountry").removeClass('has-error'); $("#divOther").removeClass('has-error'); $("#divPreferredarea").removeClass('has-error'); msg = ReturnTermsCondition(); } else if (!isLoggedIn && ue == null) { msg = ReturnUser_Exists(); //Your request cannot be processed at this time. Please try later. focusid = '#txtPilotRegisterEmail'; } else if (!isLoggedIn && ue == true) { msg = ReturnUser_Exists(); focusid = '#txtPilotRegisterEmail'; } else { $("#divName").removeClass('has-error'); $("#divPhone").removeClass('has-error'); $("#divEmail").removeClass('has-error'); $("#divPassword").removeClass('has-error'); $("#divCompany").removeClass('has-error'); $("#divOrg").removeClass('has-error'); $("#divAddress1").removeClass('has-error'); $("#divZip").removeClass('has-error'); $("#divCity").removeClass('has-error'); $("#divCountry").removeClass('has-error'); $("#divOther").removeClass('has-error'); $("#divPreferredarea").removeClass('has-error'); msg = ""; var dronetype = ""; if ($("#chk1").is(":checked")) { dronetype = $("#chk1").val(); } if ($("#chk2").is(":checked")) { if (dronetype == "") dronetype = $("#chk2").val(); else dronetype = dronetype + "," + $("#chk2").val(); } if ($("#chk3").is(":checked")) { if (dronetype == "") dronetype = $("#chk3").val(); else dronetype = dronetype + "," + $("#chk3").val(); } if ($("#chk4").is(":checked")) { if (dronetype == "") dronetype = $("#chk4").val(); else dronetype = dronetype + "," + $("#chk4").val(); } if ($("#chk5").is(":checked")) { if (dronetype == "") dronetype = $("#chk5").val(); else dronetype = dronetype + "," + $("#chk5").val(); } //if ($("#chkOther").is(":checked")) { // if (dronetype == "") // dronetype = "Others:" + $("#txtOther").val(); // else // dronetype = dronetype + ",Others:" + $("#txtOther").val(); //} //var geocoder = new google.maps.Geocoder(); //geocoder.geocode({ 'address': $("#txtPreferredArea").val() }, function (results, status) { //if (status == google.maps.GeocoderStatus.OK) { //var lat = results[0].geometry.location.lat(); //var lng = results[0].geometry.location.lng(); var registerinput = { email: email, pwd: pwd, name: name, phone: phone, companyname: company, orgnumber: org, address1: address, //address2: $("#txtAddress2").val(), zip: zip, city: city, country: country, //dronetype: dronetype, preferredarea: objpreferredAreas.preferredlocations, //worktime: worktime, lstofgeographiccoordinate: objpreferredAreas.lstlatlng //, //preferredarealatitude: lat, //preferredarealongitude:lng }; var culture = "en-US"; if (countryname.trim().toLowerCase() == "sweden") culture = "sv-SE"; var url = "api/oauth/register?culture=" + culture; if (isLoggedIn) { url = "api/oauth/pilotregister?culture=" + culture; } var response = MakeSyncWebCall(url, JSON.stringify(registerinput), "post"); if (response == "User_Exists") { msg = ReturnUser_Exists(); } else if (response == "success") { if (isLoggedIn) { document.location.href = 'registernext.aspx?t=2&q=success&e=' + email; } else { document.location.href = 'registernext.aspx?t=1&q=success&e=' + email; } } else if (response == "requestalreadyregistered") { document.location.href = 'registernext.aspx?t=1&q=ral&e=' + email; } else { try { msg = response; } catch (ex1) { msg = response; } } } //else { // alert(ReturnPreferredAreaWrongAddressText()); //} // if (msg != '') { // alert(msg); // if (focusid != '') // $(focusid).focus(); // } //}); //} }); //$("#ddCountry").change(function (e) { // if ($("#ddCountry option:selected").val() != "0" && ($("#ddCountry option:selected").text().toLowerCase().trim() == "sweden" || $("#ddCountry option:selected").text().toLowerCase().trim() == "finland")) { // $("#divTCondition").show(); // } // else // { // $("#divTCondition").hide(); // } //}); //$("#chkOther").change(function (e) { // if ($(this).is(":checked")) { // $("#divOther").show(); // } // else { // $("#divOther").hide(); // } //}); $('#txtPhone').keyup(function (e) { if (/[^0-9-()+\s]/.test(this.value)) { this.value = this.value.replace(/[^0-9-()+\s]/, ''); } }); $("#txtRegisterEmail").focusin(function (event) { if ($(this).val() == ReturnEmailAddressText()) { $(this).val(''); } }); $("#txtRegisterEmail").focusout(function (event) { //debugger; //if ($(this).val() == '') { // $(this).val('Email Address'); //} if ($(this).val().trim() != '' && $(this).val().trim() != ReturnEmailAddressText() && !validateEmail($(this).val().trim())) { $("#lblConfirmationCodeSent").html(ReturnEmailInvalid()); $("#lblConfirmationCodeSent").show(); } }); $("#txtPilotRegisterEmail").focusin(function (event) { if ($(this).val() == ReturnEmailAddressText()) { $(this).val(''); } }); $("#txtPilotRegisterEmail").focusout(function (event) { //debugger; //if ($(this).val() == '') { // $(this).val('Email Address'); //} if ($(this).val().trim() != '' && $(this).val().trim() != ReturnEmailAddressText() && !validateEmail($(this).val().trim())) { $("#lblConfirmationCodeSent").html(ReturnEmailInvalid()); $("#lblConfirmationCodeSent").show(); } }); $("#btnGoToSignIn").click(function (event) { event.preventDefault(); document.location.href = 'login.aspx'; }); //register ends //recover starts $("#txtRecoveryEmail").blur(function (event) { event.preventDefault(); var msg = ''; if ($(this).val().trim() != '' && $(this).val().trim() != ReturnEmailAddressText() && validateEmail($(this).val().trim())) { if (ce == '' || ce != $(this).val().trim() || !ue) { ce = $(this).val().trim(); var url = "api/oauth/checkuser/" + encodeURI($(this).val().trim()); var response = MakeSyncWebCall(url, "", "get"); if (response == "true") { cs = true; } else { msg = ReturnUser_Not_Found(); } } } if (msg != '') { $($(this).attr('id')).focus(); alert(msg); } }); $("#btnRecoveryChangePwd").click(function (event) { event.preventDefault(); var email = $('#txtRecoveryEmail').val(); var pwd = $('#txtRecoveryPwd').val(); var cpwd = $('#txtConfRecoveryPwd').val(); var code = $('#txtRecoveryConfCode').val(); var msg = ''; if (email == '' || email == ReturnEmailAddressText()) { msg = ReturnEmailEmpty(); } else if (!validateEmail(email)) { msg = ReturnEmailInvalid(); } else if (pwd == '') { msg = ReturnPasswordEmpty(); } else if (cpwd == '') { msg = ReturnConfirmPasswordEmpty(); } else if (code == '' && cs) { msg = ReturnConfirmationCodeIsRequired(); } else if (pwd != cpwd) { msg = ReturnPasswordAndConfirmMismatch(); } else { var url = "api/oauth/recover/" + encodeURI(email.trim()) + "?culture=" + GetCulture(); var response = MakeSyncWebCall(url, "", "get"); if (response == "success") { document.location.href = 'registernext.aspx?t=3&q=success&e=' + email; } else { try { msg = response; } catch (ex1) { msg = response; } } } if (msg != '') alert(msg); }); $("#txtRecoveryEmail").focusin(function (event) { if ($(this).val() == ReturnEmailAddressText()) { $(this).val(''); } }); $("#txtRecoveryEmail").focusout(function (event) { //if ($(this).val() == '') { // $(this).val('Email Address'); //} if ($(this).val().trim() != '' && $(this).val().trim() != ReturnEmailAddressText() && !validateEmail($(this).val().trim())) { $("#lblRecoveryConfirmationCodeSent").html(ReturnEmailInvalid()); $("#lblRecoveryConfirmationCodeSent").show(); } }); $("#aPilotRegisterTerms").click(function () { var country = $("#ddCountry option:selected").text().toLowerCase().trim(); $("#iframePilotRegisterTerms").attr('src', "termsandconditionpopup.aspx?country=" + country); $("#divTerms").modal("show"); }); $("#aRegisterTerms").click(function () { var userType = $("#hdOnBoardType").val(); var terms; if (userType == 4 || userType == 16) { terms = "termsandconditionpopup.aspx?country=other"; } else { terms = "termsofservicespopup.aspx"; } $("#iframeRegisterTerms").attr('src', terms); $("#divTerms").modal("show"); }); $("#aPilotLoginTerms").click(function () { var country = "sweden"; if ($("#txtEmail").val() != "") { var url = "api/oauth/country?email=" + $("#txtEmail").val(); var response = MakeSyncWebCall(url, "", "get"); if (response != "") country = response; } $("#iframePilotLogin").attr('src', "termsandconditionpopup.aspx?country=" + country); $("#divTerms").modal("show"); }); }); function FindErrorParameter() { var results = new RegExp('[\?#]error=([^&#]*)').exec(window.location.href); if (results == null) { return null; } else { return 'Error' + ": " + decodeURIComponent(results[1].replace(/\+/g, " ")) || 0; } } function CheckActivateUser() { var msg = ''; var pwd = $('#txtPwd').val(); var cpwd = $('#txtConfPwd').val(); if (pwd == '') { $("#divActivatePwd").addClass("has-error"); return false; } else if (pwd.length < 6 || pwd.length > 15) { msg = ReturnPasswordMinMaxLength(); $("#divActivatePwd").removeClass("has-error"); } else if (cpwd == '') { $("#divActivatePwd").removeClass("has-error"); $("#divActivateConfPwd").addClass("has-error"); return false; } else if (pwd != cpwd) { msg = ReturnPasswordAndConfirmMismatch(); $("#divActivatePwd").removeClass("has-error"); $("#divActivateConfPwd").removeClass("has-error"); } else if (!$("#chkTCondition").is(":checked")) { $("#divActivatePwd").removeClass("has-error"); $("#divActivateConfPwd").removeClass("has-error"); msg = ReturnTermsCondition(); } if (msg != '') { alert(msg); return false; } return true; }