PageSourceSearch

https://news.southdakotaonline.us/Scripts/CommonHeader.js?x=0.0631237593773397

js southdakotaonline.us collected 2026-09-24 14:30:25 UTC 71,908 bytes, 1,539 lines download raw bytes

1var postMessageCallbacks = [];
2var callbackDataLogin = null;
3var callbackFunctionLogin = null;
4
5$(document).ready(function () {
6
7    localStorage.removeItem("claimformdetails");
8
9    try {
10
11        /******************** Weather Flip *****************/
12        var flipcount = 1;
13        TotalFlipLi = $('.panel-1 li').length;
14        if (TotalFlipLi > 1) {
15            function FlipFunction() {
16                if (flipcount % 2 != 0) {
17                    $('.panel-1').addClass('flip');
18
19                    var front = $('li.front.current-active', '.panel-1');
20                    var NewFlip = parseInt(front.data('flip')) + 2;
21                    front.removeClass('current-active').removeClass('front');
22                    NewFlip = NewFlip > (TotalFlipLi - 1) ? 1 : NewFlip;
23                    $('li[data-flip="' + NewFlip + '"]', '.panel-1').addClass('current-active').addClass('front');
24                }
25                else {
26                    $('.panel-1').removeClass('flip');
27                    var back = $('li.back.current-active', '.panel-1');
28
29                    var NewFlip = parseInt(back.data('flip')) + 2;
30                    back.removeClass('current-active').removeClass('back');
31                    NewFlip = NewFlip > TotalFlipLi ? 2 : NewFlip;
32                    $('li[data-flip="' + NewFlip + '"]', '.panel-1').addClass('current-active').addClass('back');
33                }
34                flipcount++;
35                flipcount = flipcount > TotalFlipLi ? 1 : flipcount;
36            }
37            var flipInterval = setInterval(FlipFunction, 4000);
38
39            $('.panel').hover(function () {
40                clearInterval(flipInterval);
41            }, function () {
42                flipInterval = setInterval(FlipFunction, 4000);
43            });
44        }
45        /**************************************************/
46    }
47    catch (ex) { }
48    try {
49        $('[data-toggle="popover"]').popover({ trigger: 'hover' });
50    }
51    catch (ex) { }
52    validate = function validate(element) {
53        if (element.is($('#RegUEmail'))) {
54            $('#RegPass,#RegREPass').show();
55        }
56        if (element.is(':visible')) {
57            // alert(element.attr('id'));
58            // alert(element.val());
59            if (element.length > 0 && element.val() == null || element.val() == undefined || element.val().replace(/\s{1,}/g, ' ') == ' ' ||
60                element.val() == '') {
61                $(element.data('errorspan')).text(element.data('displayname') + ' cannot be left blank');
62                return false;
63            }
64            else {
65                if (element.hasClass('login-nonumeric')) {
66                    if (!Ischaronly(element.val())) {
67                        $(element.data('errorspan')).text('Please enter character only');
68                        return false;
69                    }
70                }
71                else if (element.hasClass('login-phonevalidate')) {
72                    if (!IsMobileNumber(element.val())) {
73                        $(element.data('errorspan')).text('Please enter a valid contact number');
74                        return false;
75                    }
76                }
77                else if (element.hasClass('login-emailvalidate')) {
78                    if (!IsEmail(element.val())) {
79                        $(element.data('errorspan')).text('Please enter a valid Email-ID');
80                        return false;
81                    }
82                }
83                else if (element.hasClass('login-PassLength')) {
84                    if (!Checkpasswordlength(element.val())) {
85                        $(element.data('errorspan')).text('Password length must be greater than or equal to 6');
86                        return false;
87                    }
88                }
89                else if (element.hasClass('login-matchwith')) {
90                    var matchwith = $(element.data('matchwith'));
91                    if (element.val() != matchwith.val()) {
92                        $(element.data('errorspan')).text(matchwith.data('matcherror'));
93                        return false;
94                    }
95                }
96
97            }
98        }
99        $(element.data('errorspan')).text('');
100        return true;
101    };
102    window.setTimeout(function () {
103        $('#wrapper').removeClass('active');
104    }, 3000); //<-- Delay in milliseconds
105
106    $("#login-USA").validate({
107        rules: {
108            UsaUserEmail: {
109                required: true,
110                maxlength: 50,
111                CommonRejexValidation:  /^([\w-]+(?:\.[\w-]+)*)@((?
111:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i,///^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/,
112            },
113            UsaUserPassword: {
114                required: true,
115                minlength: 6,
116            },
117        },
118        messages: {
119            UsaUserEmail: {
120                required: "E-Mail ID cannot be empty",
121                maxlength: "E-Mail ID less than 50 characters",
122                CommonRejexValidation: "The input is not a valid email address"
123            },
124            UsaUserPassword: {
125                required: "Password cannot be empty",
126                minlength: "",
127            },
128        },
129        errorElement: "em",
130        errorPlacement: function (error, element) {
131            // Add the `help-block` class to the error element
132            error.addClass("help-block");
133            error.insertAfter(element);
134            // Add `has-feedback` class to the parent div.form-group
135            // in order to add icons to inputs
136            element.parents(".form-group").addClass("has-feedback");
137
138            // Add the i element, if doesn't exists, and apply the icon classes to it.
139            if (!element.next("i")[0]) {
140                $("<i class='fa fa-close form-control-feedback'></i>").insertAfter(element);
141            }
142        },
143        success: function (label, element) {
144            // Add the i element, if doesn't exists, and apply the icon classes to it.
145            if (!$(element).next("i")[0]) {
146                $("<i class='fa fa-check form-control-feedback'></i>").insertAfter($(element));
147            }
148        },
149        highlight: function (element, errorClass, validClass) {
150            $(element).parents(".form-group").addClass("has-error").removeClass("has-success");
151            $(element).next("i").addClass("fa fa-close").removeClass("fa-check");
152        },
153        unhighlight: function (element, errorClass, validClass) {
154            $(element).parents(".form-group").addClass("has-success").removeClass("has-error");
155            $(element).next("i").addClass("fa fa-check").removeClass("fa-close");
156        }
157    });
158    $.validator.addMethod("CommonRejexValidation", function (value, element, regexpr) {
159        return regexpr.test(value);
160    }, "");
161    $("#Register-USA").validate({
162        rules: {
163            RegUName: {
164                required: true,
165                minlength: 2,
166                maxlength: 30,
167                CommonRejexValidation: /^(?![0-9]*$)[a-zA-Z0-9]+(?: [a-zA-Z0-9]+)*$/
168            },
169
170            RegUNumber: {
171                //required: false,
172                minlength: 10,
173                maxlength: 15,
174                CommonRejexValidation: /(^$)|(^[0-9]+$)/// /^[0-9]+$/
175            },
176            RegUEmail: {
177                required: true,
178                // email: true,
179                maxlength: 50,
180                CommonRejexValidation:  /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i,///^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/,
181            },
182            RegUREmail: {
183                required: true,
184                //   email: true,
185                CommonRejexValidation:  /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i,///^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/,
186                maxlength: 50,
187                equalTo: "#RegUEmail"
188            },
189
190            RegPass: {
191                required: true,
192                minlength: 6,
193                maxlength: 30
194            },
195            RegREPass: {
196                required: true,
197                minlength: 6,
198                maxlength: 30,
199                equalTo: "#RegPass"
200            },
201
202
203        },
204        messages: {
205            RegUName: {
206                required: "Full Name cannot be empty",
207                minlength: "Full Name must be more than 2 and less than 30 characters",
208                maxlength: "Full Name must be more than 2 and less than 30 characters",
209                CommonRejexValidation: "Please enter valid Name"
210            },
211            RegUNumber: {
212                //required: "Mobile No. cannot be empty",
213                minlength: "Mobile No. must be 10 - 15 digit long",
214                maxlength: "Mobile No. must be 10 - 15 digit long",
215                CommonRejexValidation: "Please enter valid mobile no"
216            },
217            RegUEmail: {
218                required: "E-Mail ID cannot be empty",
219                maxlength: "E-Mail ID less than 50 characters",
220                CommonRejexValidation: "The input is not a valid email address"
221            },
222            RegUREmail: {
223                required: "Confirm E-Mail ID cannot be empty",
224                maxlength: "E-Mail ID less than 50 characters",
225                equalTo: "Please enter the same E-Mail ID as above"
226            },
227
228            RegPass: {
229                required: "Password cannot be empty",
230                minlength: "Your password must be at least 6 characters long",
231                maxlength: "Your password must be maximum 30 characters long",
232            },
233            RegREPass: {
234                required: "Confirm Password cannot be empty",
235                minlength: "Your password must be at least 6 characters long",
236                maxlength: "Your password must be maximum 30 characters long",
237                equalTo: "Please enter the same password as above"
238            },
239
240        },
241        errorElement: "em",
242        errorPlacement: function (error, element) {
243            // Add the `help-block` class to the error element
244            error.addClass("help-block");
245            error.insertAfter(element);
246            // Add `has-feedback` class to the parent div.form-group
247            // in order to add icons to inputs
248            element.parents(".form-group").addClass("has-feedback");
249
250            // Add the i element, if doesn't exists, and apply the icon classes to it.
251            if (!element.next("i")[0]) {
252                $("<i class='fa fa-close form-control-feedback'></i>").insertAfter(element);
253            }
254        },
255        success: function (label, element) {
256            // Add the i element, if doesn't exists, and apply the icon classes to it.
257            if (!$(element).next("i")[0]) {
258                $("<i class='fa fa-check form-control-feedback'></i>").insertAfter($(element));
259            }
260        },
261        highlight: function (element, errorClass, validClass) {
262            $(element).parents(".form-group").addClass("has-error").removeClass("has-success");
263            $(element).next("i").addClass("fa fa-close").removeClass("fa-check");
264        },
265        unhighlight: function (element, errorClass, validClass) {
266            $(element).parents(".form-group").addClass("has-success").removeClass("has-error");
267            $(element).next("i").addClass("fa fa-check").removeClass("fa-close");
268        },
269    });
270    $('input:text,input:password', '#User-FacebookLogin-Responce').on('blur', function (e) {
271        element = $(this);
272        validate(element);
273    });
274    $(".RegisterNow").click(function () {
275        $('#login-USA').hide();
276        $('#Register-USA').show();
277        $('h4.login-pop-header').html("Register")
278    });
279    $(".LoginNow").click(function () {
280        $('#login-USA').show();
281        $('#Register-USA').hide();
282        $('h4.login-pop-header').html("Login")
283    });
284    IsMobileNumber = function IsMobileNumber(nmbr) {
285        var response = (!(nmbr.length < 10 || nmbr.search(/[^0-9\-()+,]/g) != -1));
286        if (response) {
287            if (/0{10,}/g.test(nmbr) || /1{10,}/g.test(nmbr) || /2{10,}/g.test(nmbr) || /3{10,}/g.test(nmbr) || /4{10,}/g.test(nmbr) || /5{10,}/g.test(nmbr) ||
288                /6{10,}/g.test(nmbr) || /7{10,}/g.test(nmbr) || /8{10,}/g.test(nmbr) || /9{10,}/g.test(nmbr))
289                response = false;
290        }
291        return response;
292    };
293    $(document).on('click', '.skipemailpassword', function () {//click on skip or X button for close pop up window.(user login with facebook and we does not get an email id)
294        // $('#divLoading,#dialogpassword,#dialogemailpassword').hide();
295        $('#divLoading,#dialogemailpassword').hide();
296    });
297    $(document).on('click', '.skipsetpassword', function () { //click on skip or X button to send self generated password to user.(user login with facebook and we got an email id)
298        $('#divLoading').show();
299        // $('#dialogpassword').hide();
300        var user = $('#setpassword').attr('data-pass');
301        if (user > 0) {
302            $.post("/ga/www/SendPassToUser", { uid: user }, function (data) {
303                //console.info(data);
304                //alert(data);
305                $('#divLoading').hide();
306                ClosePopups();
307            });
308        }
309    });
310    //// login request from other service
311    var qrval = GetQueryString("utype");
312    if (qrval == "signin") {
313        var uri = window.location.toString();
314        if (uri.indexOf("?") > 0) {
315            var clean_uri = uri.substring(0, uri.indexOf("?"));
316            window.history.replaceState({}, document.title, clean_uri);
317        }
318        OpenLoginPopUp();
319        //$('#signinuser').trigger('click');
320    }
321
322});
323$(document).on('click', '[data-id=listingclickupdate]', function () {
324    var cid = $(this).attr('data-cid');
325    $.ajax({
326        url: '/globalajax/updatelistingclick',
327        data: { companyid: cid },
328        success: function (response) {
329            if (!response.Status) {
330                console.info(response.ExceptionMessage);
331            }
332        }
333    })
334});
335$(document).on('keyup', '[data-acceptenter]', function (event) {
336    //   console.info($($(this).data('acceptenter')));
337    if (event.which ? event.which == 13 : event.keyCode == 13) {
338        try {
339            $($(this).data('acceptenter')).trigger('click');
340        }
341        catch (ex) {
342            console.info('EXCEPTION DESCRIPTIOn : ' + ex);
343        }
344    }
345});
346function IsEmail(email) {
347    var reg = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
348    return reg.test(email);
349};
350function ValidationCheckModified(context) {
351    // alert(context);
352    var res = true;
353    $('input:text,input:password', context).each(function (i, v) {
354        // alert(this.id);
355        res = validate($(this));
356        if (!res)
357            return false;
358    });
359    return res;
360};
361function CheckUserEmailExits(email, id, msg) {
362    $.getJSON("/IsExistUserEmail", { email: email },
363            function (data) {
364                if (data.exist) {
365                    $('#' + msg).show();
366                    $('#' + id).focus();
367                    return false;
368                }
369            });
370};
371var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
372var eventer = window[eventMethod];
373var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
374var LoginUserCookie = 0;
375var IsUserLoggedIn = false;
376// Listen to message from child window
377//eventer(messageEvent, function (event) {
378//    var key = event.message ? "message" : "data";
379//    var data = event[key];
380//    // console.info(event.origin  +" - " + data);
381//    if (event.origin == 'https://www.usaonline.us') {
382//        var parts = data.split('#$&');
383//        //console.info(parts);
384//        if (parts[0] == 'usausermodel') {
385//            var usermodel = $.parseJSON(parts[1])
386//            console.info(usermodel);
387//            $('#UsaLoginUserID').val(usermodel.UserID);
388//            $('#LoginUserName').val(usermodel.UserName);
389//            $('#LoginFacebookImageURL').val(usermodel.FacebookImageURL);
390//            try {
391//                $('#LoginUserEmailID').val(usermodel.UserEmail);
392//                $('#LoginUserMobileNumber').val(usermodel.UserMobile);
393//                $('#LoginUserCityID').val(usermodel.UserCityID);
394//            }
395//            catch (ex) { }
396//            //if ($('#UsaLoginUserID').val() === undefined) { setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 2000); }
397//            IsUserLoggedIn = parseInt($('#UsaLoginUserID').val()) > 0;
398//            //  console.info('login ' + IsUserLoggedIn);
399//            if (IsUserLoggedIn) {
400//                $("#UsaUserImage").show();
401//                $("#signinuser").hide();
402//                $('#sign-in-loader').hide();
403//                LoginUserCookie = parseInt($('#UsaLoginUserID').val());
404//                var d = $('#LoginFacebookImageURL').val();
405//                $(".userimage").attr("src", (d && d.length > 0) ? (d.replace(/\&amp\;/g, '&')) : "https://img.usaonline.us/com/defaultUser.png").attr('onerror', 'this.src="https://img.usaonline.us/com/defaultUser.png";');
406//                $('#liusername').html($('#LoginUserName').val());
407//            }
408//            else {
409//                if ($('#UsaLoginUserID').val() === undefined) { setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 2000); }
410//                $("#UsaUserImage").hide();
411//                $("#signinuser").show();
412//                $('#sign-in-loader').hide();
413//            }
414
415//            setTimeout(function () {
416//                if (postMessageCallbacks.length > 0) {
417//                    for (i = 0; i < postMessageCallbacks.length; i++) {
418//                        if (typeof postMessageCallbacks[i] === 'function') {
419//                            try {
420//                                postMessageCallbacks[i]();
421//                            }
422//                            catch (ex) { console.info('postMessageCallback Exception : ' + ex); }
423//                        }
424//                    }
425//                }
426//            }, 1200);
427//        }
428//        else if (parts[0] == 'USAWalletManagerModel') {
429//            var walletManagerModel = $.parseJSON(parts[1]);
430//            // console.log(walletManagerModel);
431//            $('#usaCountcart').html('');
432//            $('#usaCountcart').html('<div class="c-cart"><a href="https://www.usaonline.us/my-cart" target="_blank"><i class="fa fa-shopping-cart"></i>My Cart <span>' + walletManagerModel.TotalCartCount + '</span></a></div>');
433//        }
434//        if (parts[0] === "usaclosed") { //close pop up and refress
435//            //debugger
436//            if (parts[1]) {
437//                ClosePopups(parts[1]);
438//            }
439//            else {
440//                ClosePopups();
441//            }
442//        }
443//        else if (parts[0] === "usamobile") { //when user login with facebook but we did not get email id
444//            if (parts[1]) {
445//                var fbdetail = parts[1].split('^&*(');
446//                $('#FBid').val(fbdetail[0]);
447//                $('#FBFirst_name').val(fbdetail[1]);
448//                $('#FBLast_name').val(fbdetail[2]);
449//                $('#FBuser_Image').val(fbdetail[3]);
450//                $('.EmailAndPassword').text("You have logged in using your Facebook phone number id but we need your email id for all transactional emails that we'll be sending you. Providing your email id and a password will enable you to create a direct login id for all your future use")
451//                $("#UserEmailData,#UserReEmail,#UserSetPass,#UserSetREPass").attr("data-acceptenter", "#UserEmailPasswordBtn");
452//                $(".setpass").html("Skip");
453//                $(".SetPass-page-close,.setpass").removeClass("skipsetpassword").addClass("skipemailpassword");
454//            }
455//            $('#Logindialog').modal('hide');
456//            $('#UserEmailPasswordBtn').show();
457//            $('#SetPasswordBtn').hide();
458//            $('#dialogpassword').modal('show');
459//        }
460//        else if (parts[0] === "usaemail") { //when user login with facebook get email id
461//            $('#setpassword').attr('data-pass', parts[1]);
462//            $('.EmailAndPassword').text("Will you like to set your password for USA Online Networks?")
463//            $("#UserSetPass,#UserSetREPass").attr("data-acceptenter", "#SetPasswordBtn");
464//            $(".setpass").html("Skip and continue using Facebook Id & Password");
465//            $(".SetPass-page-close,.setpass").removeClass("skipemailpassword").addClass("skipsetpassword");
466//            $('#User-Email,#UserEmailPasswordBtn').hide();
467//            $('#SetPasswordBtn').show();
468//            $('#Logindialog').modal('hide');
469//            $('#dialogpassword').modal('show');
470//        }
471//    }
472//}, false);
473function isNumber(n) { return /^-?[\d.]+(?:e-?\d+)?$/.test(n); }
474function OpenLoginPopUp(stateid, cityid) {
475    
476    $("#login-USA-error,#Register-USA-error,#login-page-overlay-error").text('');
477    if (!IsUserLoggedIn) {
478        ResetLoading();
479        $('#Logindialog').modal('show');
480        /*Commented due to change in login modal dialogue*/
481        //if (window.location.href.toLowerCase().indexOf("emailerid") > -1) {
482        //    $('#login-USA').hide();
483        //    $('#Register-USA').show();
484        //}
485        //else {
486        //    $('#login-USA').show();
487        //    $('#Register-USA').hide();
488        //}
489        /*Comments end here*/
490        $('h4.login-pop-header').html("Login")
491        // console.info(' if clause excuted');
492        //deepak singh //23 feb 2016 //create hidden for state and city so than on locgin button click same can be used
493        if (stateid != undefined) {
494            $('<input>').attr({ type: 'hidden', id: 'hf_stateid_for_commonlogin' }).val(stateid).appendTo('body');
495        }
496        if (cityid != undefined) {
497            $('<input>').attr({ type: 'hidden', id: 'hf_cityid_for_commonlogin' }).val(cityid).appendTo('body');
498        }
499    }
500    else {
501        //we get user id just refress the page
502        //$('#Logindialog').hide();
503        $('#login-USA').hide();
504        $('#Register-USA').hide();
505        // console.info(' else clause excuted');
506        // alert('ok');
507        setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 2000);
508    }
509};
510function openRegisterpopup() {
511    if (!IsUserLoggedIn) {
512        $('#Logindialog').modal('show');
513        // $('#login-USA').hide();
514        $('#Register-USA').show();
515        //$('h4.login-pop-header').html("Register")
516    }
517    else { //we get user id just refress the page
518        $('#login-USA').hide();
519        $('#Register-USA').hide();
520        if ($('#seturl').attr('data-gourl')) {
521            setTimeout(function () { window.location.href = $('#seturl').attr('data-gourl'); }, 50);
522        }
523        else {
524            setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 50);
525        }
526    }
527};
528var signOutRedirectUrl = window.location.href.split('#')[0];
529$(function () {
530    $('#signinuser').click(function () {
531        //  $('#login-USA').bootstrapValidator('destroy');
532        $('#seturl').attr('data-gourl', '');
533        OpenLoginPopUp();
534    });
535    $('#RegBtn').click(function () {
536        openRegisterpopup();
537    });
538    $('#signout').click(function () {
539        window.location.href = "https://www.usaonline.us/logout?u=" + signOutRedirectUrl;
540    });
541    IsUserLoggedIn = $("#UsaLoginUserID").val() != "" ? true : false;
542    /*************footer.cshtml js************************/
543    $("#EnqForm").submit(function (event) {
544        event.preventDefault();
545        var host = document.domain;
546        $(".btn-quote").prop("disabled", true);
547        var name = $('#enqname').val();
548        var email = $('#enqemail').val();
549        var msg = $('#enqmsg').val();
550        var code = $('#footercaptchaCode').val();
551        $('.btn-quote').text('Please wait...');
552        $.ajax({
553            type: "POST",
554            url: protocol + host + "/globalajax/userenquiry",
555            data: param = "{name:'" + name + "',email:'" + email + "',message:'" + msg + "',code:'" + code + "'}",
556            contentType: "application/json; charset=utf-8",
557            dataType: "json",
558            success: function (data) {
559                if (data == 1) {
560                    CustomAlertModal("Success", 'success', 'Query posted successfully',
561                        function () {
562                            setTimeout(function () {
563                                setEnqiryFormBtn(false);
564                            }, 2000);
565                        })
566                }
567                else if (data == 2) {
568                    CustomAlertModal("Alert", 'danger', 'Please enter valid captcha code.', function () { setEnqiryFormBtn(true); })
569                }
570                else
571                    CustomAlertModal("Alert", 'danger', 'Please enter valid Email-Id.', function () { setEnqiryFormBtn(false); })
572            },
573            error: function (req, status, error) {
574                alert('OOPS! something went wrong')
575            }
576        })
577    });
578
579    var getCvalue = getclaimstickyCookie('_prmbnrusa'); //common footer claim sticky cookie usa
580    if (getCvalue.length > 0) {
581        $(".permotion-banner").hide();
582    }
583    else {
584        $(".permotion-banner").animate({ 'height': '250px', 'bottom': '2px' }, 1000);
585    }
586    $(".permotion-close").click(function () {
587        //// Create cookie if use cick on close button
588        ////if (sessionStorage.getItem("_prmbnrusa") === null || sessionStorage.getItem("_prmbnrusa") === undefined) {
589        var getCvalue = getclaimstickyCookie('_cfcskusa');
590        if (getCvalue === undefined || getCvalue.length == 0) {
591            createclaimstickyCookie('_prmbnrusa', 'PBK3Mc#PMMfK', 1);
592        }
593
594        $(".permotion-banner").hide();
595    });
596    var getCvalue = getclaimstickyCookie('_cfcskusa'); //common footer claim sticky cookie usa
597    if (getCvalue.length > 0) {
598        $(".claim-stickfooter-bar").hide();
599        $(".closewrap").hide();
600    }
601    else {
602        $(".claim-stickfooter-bar").fadeIn("slow");
603        $(".closewrap").fadeIn("slow");
604    }
605    $("#closeClaimbtn").click(function () {
606        $(".claim-stickfooter-bar").fadeOut("slow");
607        $(".closewrap").fadeOut("slow");
608        var getCvalue = getclaimstickyCookie('_cfcskusa');
609        if (getCvalue === undefined || getCvalue.length == 0) {
610            createclaimstickyCookie('_cfcskusa', 'LckMc#!MfK', 1);
611        }
612    });
613    $("img.lazy").lazy();
614    $(".bglazy.lazy").lazy();
615    /****************End*********************************/
616});
617/*************footer.cshtml js************************/
618var createclaimstickyCookie = function (name, value, days) {
619    var _hostname = location.hostname.split('.');
620    var _domain = '.' + _hostname[1] + '.' + _hostname[2];
621    var expires;
622    if (days) {
623        var date = new Date();
624        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
625        expires = "; expires=" + date.toGMTString();
626    }
627    else {
628        expires = "";
629    }
630    document.cookie = name + "=" + value + expires + ";domain=" + _domain + "; " + "path=/;";
631}
632function getclaimstickyCookie(c_name) {
633    if (document.cookie.length > 0) {
634        c_start = document.cookie.indexOf(c_name + "=");
635        if (c_start != -1) {
636            c_start = c_start + c_name.length + 1;
637            c_end = document.cookie.indexOf(";", c_start);
638            if (c_end == -1) {
639                c_end = document.cookie.length;
640            }
641            return unescape(document.cookie.substring(c_start, c_end));
642        }
643    }
644    return "";
645}
646function setEnqiryFormBtn(issetCatpchaOnly) {
647    if (!issetCatpchaOnly) {
648        $('#enqname').val('');
649        $('#enqmsg').val('');
650        $('#enqemail').val('');
651    }
652    $(".btn-quote").prop("disabled", false);
653    $('.btn-quote').text('SEND NOW');
654    $('#footercaptchaCode').val('');
655    document.getElementById('CaptchaFooterImage').src = '/Scripts/Captcha.aspx?id=' 
655+ Math.random();
656}
657$(window).scroll(function () {
658    if ($(this).scrollTop() > 100) {
659        $('.scrollup').fadeIn();
660    } else {
661        $('.scrollup').fadeOut();
662    }
663});
664$('.scrollup').click(function () {
665    $("html, body").animate({ scrollTop: 0 }, 600);
666    return false;
667});
668/****************End*********************************/
669function prepareFrame(userid, name, image, callback) {//make dynamic iframe for create userid and user name cookie
670    ifrm = document.createElement("IFRAME");
671    image = image.replace(/\&/g, "--amp--").replace(/\?/g, "--qstn--")
672    ifrm.setAttribute("src", ("https://www.usaonline.us/MakeCookiebyIframe?img=" + image + "&uid=" + userid + "&name=" + name));
673    ifrm.setAttribute('id', 'NewIframe');
674    ifrm.style.width = 640 + "px";
675    ifrm.style.height = 480 + "px";
676    document.body.appendChild(ifrm);
677    $('#NewIframe').on('load', function () { callback(); });
678};
679function mycustomcallback(userid) {
680    if ($('#seturl').attr('data-gourl')) {
681        var redirecturl = $('#seturl').attr('data-gourl');
682        if (redirecturl.indexOf("/buy-credits/BuyNow") > 0) {
683            var arr = redirecturl.split(':$:');
684            BuyNow(arr[1], arr[2], userid, hf_stateid, hf_cityid);
685        }
686        else if (redirecturl.indexOf("/buy-credits/AddtoCart") > 0) {
687            var arr = redirecturl.split(':$:');
688            AddtoCart(arr[1], arr[2], '', userid, (arr.length > 4 ? arr[4] : 0));
689            if (arr[5] != "" && arr[5] == "T")//tribute guest user first time login case
690            {
691                TributecallbackService(userid, 'N');
692                window.location.href = "https://www.usaonline.us/my-cart";
693            }
694            else {
695                window.location.href = window.location.href.split('#')[0];
696            }
697        }
698        else if (redirecturl == "tributeGuestUserLogin") { //tribute guest user first time login case
699            TributecallbackService(userid, 'Y');
700        }
701        else {
702            // console.info("else" + redirecturl);
703            window.location.href = $('#seturl').attr('data-gourl');
704        }
705    }
706    else {
707        if (localStorage.getItem("claimformdetails")) {
708            SaveClaimDataAfterLoginRegister(localStorage.getItem("claimformdetails"), false, "");
709        }
710        else if (localStorage.getItem("claimpagepkginfo")) {
711            SavePackageDetailForClaim(localStorage.getItem("claimpagepkginfo"), userid, false);
712        }
713        else {
714            window.location.href = window.location.href.split('#')[0];
715        }
716    }
717
718}
719function ProcessCallBackData(token) {
720    if (callbackDataLogin) {
721
722        if (callbackDataLogin.Action) {
723
724            var callbackVariableValue = '';
725            try {
726                callbackVariableValue = eval(callbackDataLogin.Action);
727            }
728            catch (ex) { }
729
730            if (typeof callbackVariableValue == 'function') {
731                callbackVariableValue(token);
732            }
733            else {
734
735                if (callbackDataLogin.Action.toLowerCase() == 'addtocart') {
736                    CommonAddtoCart(callbackDataLogin.Packageid, callbackDataLogin.clientid, token, callbackDataLogin.successcallback)
737                }
738                else if (callbackDataLogin.Action.toLowerCase() == 'buynow') {
739                    CommonBuyNow(callbackDataLogin.Packageid, callbackDataLogin.clientid, token)
740                }
741                else if (callbackDataLogin.Action.toLowerCase() == 'addtocartcommoncart') {
742                    var externalPackageId = callbackDataLogin.ExternalPackageID ? callbackDataLogin.ExternalPackageID : 0;
743                    AddtoCart_BuyCredits(callbackDataLogin.Packageid, callbackDataLogin.credits, callbackDataLogin.obj, callbackDataLogin.clientid, callbackDataLogin.ListingID, token, externalPackageId);
744                }
745                else if (callbackDataLogin.Action.toLowerCase() == 'buynowcommoncart') {
746                    BuyNow_BuyCredits(callbackDataLogin.Packageid, callbackDataLogin.credits, '', token);
747                }
748            }
749        }
750    }
751};
752function CheckUSALogin(url, stateid, cityid, callbackDataAfterLogin, callbackFunctionAfterLogin) {
753    callbackDataLogin = callbackDataAfterLogin ? callbackDataAfterLogin : null;
754    callbackFunctionLogin = callbackFunctionAfterLogin ? callbackFunctionAfterLogin : null;
755
756    $('body').removeClass('has-active-menu');
757    $('#c-menu--slide-left').removeClass('is-active');
758    $('#o-wrapper').removeClass('has-active-menu');
759    $('#c-mask').removeClass('is-active');
760    if (IsUserLoggedIn) {
761
762        ProcessCallBackData();
763
764        if (url.indexOf("PUrl=getonline") > 10) {
765            var QueryPara = window.location.href.split("?").slice(1).join("?");
766            if (QueryPara.length > 1) { QueryPara = '?' + QueryPara; }
767            window.location.href = url ? url : '/';
768            return false;
769        }
770        else {
771            //window.location.href = url ? url : '/';
772            //return false;
773
774            if (callbackFunctionAfterLogin) {
775                callbackFunctionAfterLogin();
776                window.location.href = url ? url : '/';
777            }
778            else
779                window.location.href = url ? url : '/';
780            return false;
781        }
782    }
783    else {
784        $('#seturl').attr('data-gourl', url ? url : '');
785        OpenLoginPopUp(stateid, cityid);
786        // $('#signinuser').trigger('click');
787    }
788};
789function ClosePopups(data) {
790    // alert(data);
791    if (data) {
792        var userfbdetail = data.split('$');
793        if (!isNumber(userfbdetail[0])) {
794            //alert('if : ' + userfbdetail[0]);
795            $("#UserEmailData").val(userfbdetail[0]);
796            $("#UserReEmail").val(userfbdetail[0]);
797            $('#setpassword').attr('data-pass', userfbdetail[1]);
798            $("#FBlogin_valid").val(userfbdetail[2]);
799            $('.EmailAndPassword').text("You have logged in using your Facebook phone number id but we need your email id for all transactional emails that we'll be sending you. Providing your email id and a password will enable you to create a direct login id for all your future use")
800            $('#UserEmailPasswordBtn').show();
801            $('#SetPasswordBtn').hide();
802            $(".setpass").html("Skip");
803            $(".SetPass-page-close,.setpass").removeClass("skipsetpassword").addClass("skipemailpassword");
804            $('#Logindialog').modal('hide');
805            $('#login-USA,#Register-USA').hide();
806            $("#UserEmailData,#UserReEmail,#UserSetPass,#UserSetREPass").attr("data-acceptenter", "#UserEmailPasswordBtn");
807            $('#dialogpassword').modal('show');
808            // $('#dialogpassword').show();
809        }
810        else {
811            //alert('else : ' + userfbdetail[0]);
812            //$('#setpassword').attr('data-pass', userfbdetail);
813            $('#dialogpassword,#Logindialog').modal('hide');
814            $('#login-USA').hide();
815            $('#login-USA,#Register-USA').hide();
816            if ($('#seturl').attr('data-gourl')) {
817                var redirecturl = $('#seturl').attr('data-gourl');
818                if (redirecturl.indexOf("/buy-credits/BuyNow") > 0) {
819                    var arr = redirecturl.split(':$:');
820                    //alert('HI BUY NOW');
821                    BuyNow(arr[1], arr[2], userfbdetail[0]);
822                }
823                else if (redirecturl.indexOf("/buy-credits/AddtoCart") > 0) {
824                    var arr = redirecturl.split(':$:');
825                    AddtoCart(arr[1], arr[2], '', userfbdetail[0], (arr.length > 4 ? arr[4] : 0));
826                    setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 2000);
827                }
828                else {
829                    console.info("else" + redirecturl);
830                    setTimeout(function () { window.location.href = $('#seturl').attr('data-gourl'); }, 2000);
831                }
832            }
833            else {
834
835                //**************Save data and send to package page if login from claim business page *********
836                if (localStorage.getItem("claimformdetails")) {
837                    SaveClaimDataAfterLoginRegister(localStorage.getItem("claimformdetails"), true, $('#RegUEmail').val());
838                }
839                else if (localStorage.getItem("claimpagepkginfo")) {
840                    SavePackageDetailForClaim(localStorage.getItem("claimpagepkginfo"), userfbdetail[0], true);
841                }
842                    //*************************END****************************************
843                else {
844                    setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 2000);
845                }
846            }
847        }
848    }
849    else {
850        // alert('outer else : ' + data);
851        $('#dialogpassword,#Logindialog').modal('hide');
852        $('#login-USA').hide();
853        $('#login-USA,#Register-USA').hide();
854
855        if ($('#seturl').attr('data-gourl')) {
856            var redirecturl = $('#seturl').attr('data-gourl');
857            if (redirecturl.indexOf("/buy-credits/BuyNow") > 0) {
858                //alert('HI NOW');
859                var arr = redirecturl.split(':$:');
860                BuyNow(arr[1], arr[2], $('#setpassword').attr('data-pass'));
861            }
862            else if (redirecturl.indexOf("/buy-credits/AddtoCart") > 0) {
863                var arr = redirecturl.split(':$:');
864                AddtoCart(arr[1], arr[2], '', $('#setpassword').attr('data-pass'), (arr.length > 4 ? arr[4] : 0));
865                setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 2000);
866            }
867            else {
868                //console.info("else" + redirecturl);
869                setTimeout(function () { window.location.href = $('#seturl').attr('data-gourl'); }, 2000);
870            }
871        }
872        else {
873
874            //**************Save data and send to package page if login from claim business page *********
875            if (localStorage.getItem("claimformdetails")) {
876                SaveClaimDataAfterLoginRegister(localStorage.getItem("claimformdetails"), true, $('#RegUEmail').val());
877            }
878            else if (localStorage.getItem("claimpagepkginfo")) {
879                SavePackageDetailForClaim(localStorage.getItem("claimpagepkginfo"), data.split('$')[0], true);
880            }
881                //*************************END****************************************
882            else {
883                setTimeout(function () { window.location.href = window.location.href.split('#')[0]; }, 2000);
884            }
885        }
886    }
887};
888var Processing = false;
889var hf_stateid, hf_cityid = 0;
890$(document).on('click', '#LoginBtn', function (e) {
891    //alert('hi');
892    if (!$("#login-USA").valid()) { // Not Valid
893        return false;
894    } else {
895        if (!Processing) {
896            var hf_stateid = $('#hf_stateid_for_commonlogin').val();
897            var hf_cityid = $('#hf_cityid_for_commonlogin').val();
898            Processing = true;
899            $('#divLoading').show();
900            $.ajax({
901                url: '/ga/www/LoginUserPopUp',
902                type: "POST",
903                data: { "email": $('#UsaUserEmail').val(), "Pass": $('#UsaUserPassword').val() },
904                dataType: "json",
905                beforeSend: function () {
906                    jQuery('#LoginBtn').attr('disabled', 'disabled');
907                },
908                success: function (data) {
909                    // alert(data);
910                    //console.log(data);
911                    if (data == "Email Error") {//user email not in my data base
912                        $('#login-USA-error').text('Email-ID is not registered');
913                        $('#UsaUserEmail').closest('.form-group').addClass("has-error").removeClass("has-success");
914                        $('#UsaUserEmail').closest('.form-group').find('i').addClass("fa fa-close").removeClass("fa-check");
915                        // $('#UsaUserEmail').closest('.form-group').find('em').text("Email-ID is not registered");
916                        $('#UsaUserEmail').focus();
917                        $('#divLoading').hide();
918                    }
919                    else if (data == "Password is incorrect") {//user password is in currect
920                        $('#login-USA-error').text('Password is incorrect');
921                        $('#UsaUserPassword').closest('.form-group').addClass("has-error").removeClass("has-success");
922                        $('#UsaUserPassword').closest('.form-group').find('i').addClass("fa fa-close").removeClass("fa-check");
923                        // $('#UsaUserPassword').closest('.form-group').find('em').text("Password is incorrect");
924                        $('#UsaUserPassword').focus()
925                        $('#divLoading').hide();
926                    }
927                    else if (data == "Block") {//user lock by admin
928                        $('#divLoading').hide();
929                        $('#dialogpassword').modal('hide');
930                        $("#CustomAlertModal").attr("data-keyboard", "false");
931                        $("#CustomAlertModal").attr("data-backdrop", "static");
932                        CustomAlertModal('Alert', 'info', 'Your Account has been locked. Please Contact Admin.', function () { window.location.href = window.location.href.split('#')[0]; });
933                    }
934                    else if (data == "Email Not Varify") {//varify email
935                        $('#divLoading').hide();
936                        $('#dialogpassword').modal('hide');
937                        $("#CustomAlertModal").attr("data-keyboard", "false");
938                        $("#CustomAlertModal").attr("data-backdrop", "static");
939                        CustomAlertModal('Alert', 'info', 'You have not yet verified your Email-ID. To complete this process please click on the Verify link in the verification email we sent you earlier. Please check your mail or spam/bulk folder. Or click the button below to receive verification email again.<br> <a class="resend-varification" data-attr="resendverificationlink" data-emailid="' + $('#UsaUserEmail').val() + '" href="javascript:void(0)" title="Click to Resend verification Email">Resend  verification Email</a>', function () { window.location.href = window.location.href.split('#')[0]; });
940                    }
941                    else {
942                        //debugger;
943                        var parts = data.split('$');
944                        console.info(parts);
945                        var userid = parts[0];
946                        var name = parts[1];
947                        var image = parts[2];
948                        prepareFrame(userid, name, image, function () { mycustomcallback(userid); });
949                    }
950                    Processing = false;
951                },
952                error: function (req, status, error) { CustomAlertModal('Alert', 'danger', "We've encountered an error. Please try again later."); $('#divLoading').hide(); }
953            }).always(function () {
954                jQuery('#LoginBtn').removeAttr('disabled');
955            });
956        }
957        else
958            Processing = false;
959    }
960});
961
962$(document).on('click', '#RegisterBtn', function () {
963    
964    if (!$("#Register-USA").valid()) { // Not Valid
965        return false;
966    }
967    else {
968        
969        if (!Processing) {
970            Processing = true;
971            $('#divLoading').show();
972            var emailerid = null;
973            var cityid = 0;
974            if (window.location.href.toLowerCase().indexOf("emailerid") > -1) {
975                emailerid = GetQueryString('emailerid');
976                cityid = parseInt(GetQueryString('cityid')) ? GetQueryString('cityid') : 0;
977            }
978            $.ajax({
979                url: '/ga/www/RegisterUserPopUp',
980                data: { UName: $("#RegUName").val(), UNumber: $("#RegUNumber").val(), UEmail: $("#RegUEmail").val(), Pass: $("#RegPass").val(), EmailerId: emailerid, CityId: cityid },
981                type: 'post',
982                beforeSend: function () {
983                    jQuery('#RegisterBtn').attr('disabled', 'disabled');
984                },
985                success: function (data) {
986                    // alert(data);
987                    console.log(data);
988                    if (data == "Already Register Email") {
989                        $('#divLoading').hide();
990                        $('#RegUEmail').closest('.form-group').addClass("has-error").removeClass("has-success");
991                        $('#RegUEmail').closest('.form-group').find('i').addClass("fa fa-close").removeClass("fa-check");
992                        // $('#RegUEmail').closest('.form-group').find('em').text("Email-ID is already registered with UsaOnline Network");
993                        $('#RegUEmail').focus()
994
995                        $('#Register-USA-error').text('Email-ID is already registered with UsaOnline Network');
996                    }
997                    else if (data == "Enter valid credentials") {
998                        $('#divLoading').hide();
999                        $('#Register-USA-error').text('Enter valid credentials');
1000                    }
1001                    else {
1002                        $('#Logindialog').modal('hide');
1003                        $('#divLoading').hide();
1004                        $("#CustomAlertModal").attr("data-keyboard", "false");
1005                        $("#CustomAlertModal").attr("data-backdrop", "static");
1006                        //CustomAlertModal("Alert", "info", "A verification E-Mail has been sent to your Email-ID : <b> " + $('#RegUEmail').val() + "</b>. Kindly check your E-Mail and click on the Confirm link in the email to activate your account. Please check your spam/bulk mail folder also in case the mail has been diverted there.<br><br>Please continue to complete your business profile.", function () {
1007                        CustomAlertModalWithCustomBtn("Alert", "info", "A verification E-Mail has been sent to your Email-ID : <b> " + $('#RegUEmail').val() + "</b>. Kindly check your E-Mail and click on the Confirm link in the email to activate your account. Please check your spam/bulk mail folder also in case the mail has been diverted there.<br><br/> Please continue to complete your business profile.", 'Continue', function () {
1008                            //**************Save data and send to cart page if login from claim business page *********
1009                            if (localStorage.getItem("claimformdetails")) {
1010                                SaveClaimDataAfterLoginRegister(localStorage.getItem("claimformdetails"), true, $('#RegUEmail').val());
1011                            }
1012                            else if (localStorage.getItem("claimpagepkginfo")) {
1013                                SavePackageDetailForClaim(localStorage.getItem("claimpagepkginfo"), data.split('$')[0], true);
1014                            }
1015                                //*************************END****************************************
1016                            else {
1017                                window.location.href = window.location.href.split('#')[0];
1018                            }
1019                        });
1020                    }
1021                    Processing = false;
1022                },
1023                error: function (req, status, error) { CustomAlertModal('Alert', 'danger', "We've encountered an error. Please try again later." + req + '\n ' + status + '\n ' + error);
1023 $('#divLoading').hide(); }
1024            }).always(function () {
1025                jQuery('#RegisterBtn').removeAttr('disabled');
1026            });
1027
1028
1029            //$.post("/ga/www/RegisterUserPopUp", { UName: $("#RegUName").val(), UNumber: $("#RegUNumber").val(), UEmail: $("#RegUEmail").val(), Pass: $("#RegPass").val(), EmailerId: emailerid, CityId: cityid }, function (data) {
1030            //    if (data == "Already Register Email") {
1031            //        $('#divLoading').hide();
1032            //        $('#RegUEmail').closest('.form-group').addClass("has-error").removeClass("has-success");
1033            //        $('#RegUEmail').closest('.form-group').find('i').addClass("fa fa-close").removeClass("fa-check");
1034            //        // $('#RegUEmail').closest('.form-group').find('em').text("Email-ID is already registered with UsaOnline Network");
1035            //        $('#RegUEmail').focus()
1036
1037            //        $('#Register-USA-error').text('Email-ID is already registered with UsaOnline Network');
1038            //    }
1039            //    else {
1040            //        $('#Logindialog').modal('hide');
1041            //        $('#divLoading').hide();
1042            //        $("#CustomAlertModal").attr("data-keyboard", "false");
1043            //        $("#CustomAlertModal").attr("data-backdrop", "static");
1044            //        CustomAlertModal("Alert", "info", "A verification E-Mail has been sent to your Email-ID : <b> " + $('#RegUEmail').val() + "</b>. Kindly check your E-Mail and click on the Confirm link in the email to activate your account. Please check your spam/bulk mail folder also in case the mail has been diverted there.", function () { window.location.href = window.location.href.split('#')[0]; });
1045            //    }
1046            //    Processing = false;
1047            //}).fail(function (jqXHR, status, error) {
1048            //    CustomAlertModal('Alert', 'danger', "We've encountered an error. Please try again later.");
1049            //   // alert("We've encountered an error. Please try again later");
1050            //    console.info('EXCEPTION DESCRIPTION : ' + error);
1051            //    Processing = false;
1052            //});
1053        }
1054        else {
1055            Processing = false;
1056        }
1057    }
1058});
1059function SetPasswordClick(errorspan) {// save password in useronline.us database from facebook login(with email)
1060    if (errorspan) {
1061        $(errorspan).text('');
1062    }
1063    if (!Processing) {
1064        Processing = true;
1065        if (ValidationCheckModified('#User-FacebookLogin-Responce')) {
1066            $('#divLoading').show();
1067            $.post("/ga/www/SetPassByUser", { SetPass: $("#UserSetPass").val(), uid: $('#setpassword').attr('data-pass') }, function (data) {
1068                // $('#divLoading').hide();
1069                ClosePopups();
1070            }).fail(function (jqXHR, status, error) {
1071                CustomAlertModal('Alert', 'danger', "We've encountered an error. Please try again later.");
1072                //  alert("We've encountered an error. Please try again later");
1073                console.info('EXCEPTION DESCRIPTION : ' + error);
1074                Processing = false;
1075                Processing = false;
1076            });;
1077        }
1078        else
1079            Processing = false;
1080    }
1081
1082};
1083function SetEmailPasswordClick(errorspan) {// save email and password in useronline.us database from facebook login(without email)
1084    if (errorspan) {
1085        $(errorspan).text('');
1086    }
1087    if (!Processing) {
1088        Processing = true;
1089        if (ValidationCheckModified('#User-FacebookLogin-Responce')) {
1090            $('#divLoading').show();
1091            $.post("/ga/www/usersavewithfacebook", { userid: $('#setpassword').attr('data-pass'), uemail: $('#UserEmailData').val(), pass: $('#UserSetPass').val(), Fname: $("#FBFirst_name").val(), Lname: $("#FBLast_name").val(), Fid: $("#FBid").val(), fb_image: $("#FBuser_Image").val() }, function (data) {
1092                // alert(data);
1093                Processing = false;
1094                if (data == "exits") {
1095                    $('#divLoading').hide();
1096                    $(errorspan).text('This Email id is already in use');
1097                }
1098                else {
1099                    var d = data.split('$');
1100                    $('#divLoading').hide();
1101                    $('#dialogpassword').modal('hide');
1102                    $("#CustomAlertModal").attr("data-keyboard", "false");
1103                    $("#CustomAlertModal").attr("data-backdrop", "static");
1104                    //CustomAlertModal("Alert", "info", "A verification E-Mail has been sent to your Email-ID : <b> " + $('#UserEmailData').val() + "</b>. Kindly check your E-Mail and click on the Confirm link in the email to activate your account. Please check your spam/bulk mail folder also in case the mail has been diverted there.<br><br>Please continue to complete your business profile.", function () { window.location.href = window.location.href.split('#')[0]; });
1105                    CustomAlertModalWithCustomBtn("Alert", "info", "A verification E-Mail has been sent to your Email-ID : <b> " + $('#UserEmailData').val() + "</b>. Kindly check your E-Mail and click on the Confirm link in the email to activate your account. Please check your spam/bulk mail folder also in case the mail has been diverted there.<br><br/> Please continue to complete your business profile.", 'Continue', function () { window.location.href = window.location.href.split('#')[0]; });
1106                }
1107            }).fail(function (jqXHR, status, error) {
1108                CustomAlertModal('Alert', 'danger', "We've encountered an error. Please try again later.");
1109                console.info('EXCEPTION DESCRIPTION : ' + error);
1110                Processing = false;
1111            });
1112        }
1113        else
1114            Processing = false;
1115    }
1116
1117};
1118function Checkpasswordlength(element) {
1119    return (element.length >= 6);
1120}
1121function Ischaronly(value) {
1122    var reg = /^[a-zA-Z _-]*$/;
1123    return reg.test(value);
1124};
1125function readCookie(name) {
1126    //  debugger
1127    var nameEQ = name + "=";
1128    var ca = document.cookie.split(';');
1129    for (var i = 0; i < ca.length; i++) {
1130        var c = ca[i];
1131        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
1132        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
1133    }
1134    return null;
1135};
1136function ResetLoading() {
1137    Processing = false;
1138    $('#Login-Popup-Loading-Span').text('Loading, Please Wait...');
1139    $('#divLoading').hide();
1140};
1141function GetQueryString(key) {
1142    key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars
1143    var match = location.search.match(new RegExp("[?&]" + key + "=([^&]+)(&|$)"));
1144    return match && decodeURIComponent(match[1].replace(/\+/g, " "));
1145};
1146
1147$(document).on('keypress', '[data-attr="usnumbervalidation"]', function (event) {
1148
1149    var controlKeys = [8, 9, 13, 35, 36, 37, 39];
1150    var isControlKey = controlKeys.join(",").match(new RegExp(event.which));
1151    if (!event.which || // Control keys in most browsers. e.g. Firefox tab is 0
1152        (event.which >= 48 && event.which <= 57) || // Always 0 through 9
1153        isControlKey) {
1154        return;
1155    }
1156    else {
1157        event.preventDefault();
1158    }
1159});
1160//$(document).ready(function () {
1161//    $('[data-attr="usnumbervalidation"]').mask('(000) 000-0000');
1162//});
1163function SavePackageDetailForClaim(parameters, userid, registercase) {
1164    var jsonPrm = JSON.parse(parameters);
1165    var param = {
1166        'userid': userid,
1167        'companyid': 0,
1168        'profilePackage': jsonPrm.packageId,
1169        'websiteurlTaken': '',
1170        'ownwebsiteurl': '',
1171        'citydomainUrl': '',
1172        'webpagecount': jsonPrm.webpageCount,
1173        'websiteid': '',
1174        'claimedBusinessId': jsonPrm.claimedCompid,
1175        'paymentCase': jsonPrm.paymentcase,
1176        'isComboPackage': jsonPrm.isComboPackage,
1177        'isSeobuddy': jsonPrm.isSeoBuddy,
1178        'isSmb': jsonPrm.isSMB
1179    };
1180    $.ajax({
1181        type: "POST",
1182        url: '/register-business/SubmitClaimPackageDetails',
1183        data: param,
1184        success: function (data) {
1185            if (!data.Status) {
1186                CustomAlertModal('Alert', 'danger', 'Oops! There seems to be some error. Please try again', function () {
1187                    return false;
1188                });
1189                return false;
1190            }
1191            else {
1192                localStorage.removeItem("claimpagepkginfo");
1193                if (!registercase) {
1194                    var customData = data.CustomParam.split(';');
1195                    var hrefclaimsrcUrl = '';
1196                    var redirectedUrl = '';
1197                    if (jsonPrm.isSeoBuddy) {
1198                        hrefclaimsrcUrl = 'https://www.usaonline.us/claim-your-seo-buddy';
1199                    }
1200                    else
1201                        hrefclaimsrcUrl = 'https://www.usaonline.us/claim-your-business' + (jsonPrm.isappview == true ? '?isappview=1' : '');
1202                    if (jsonPrm.claimedCompid > 0) {
1203                        redirectedUrl = hrefclaimsrcUrl + "?lid=" + customData[2] + "&cid=" + jsonPrm.claimedCompid + "&cname=" + jsonPrm.claimedCompanyName;
1204                    }
1205                    else if (jsonPrm.packageId > 0 && jsonPrm.paymentcase == 3) {
1206                        redirectedUrl = "https://www.usaonline.us/my-cart" + (jsonPrm.isappview == true ? '?isappview=1' : '');
1207                    }
1208                    else if (jsonPrm.isSMB) {
1209                        redirectedUrl = "https://www.usaonline.us/local/myadmin/smb?n=" + customData[1] + "&combo=" + jsonPrm.isComboPackage + "&lid=" + customData[2] + (claimedCompany != 0 ? "&cid=" + claimedCompany : "");
1210                    }
1211                    else if (jsonPrm.paymentcase == 1 || jsonPrm.paymentcase == 2) {
1212                        redirectedUrl = "https://www.usaonline.us/local/myadmin/editlisting?n=" + customData[1] + "&combo=" + jsonPrm.isComboPackage + "&lid=" + customData[2] + (claimedCompany != 0 ? "&cid=" + claimedCompany : "") + (jsonPrm.isappview ? '?isappview=1' : '');
1213
1214                    }
1215                    location.href = redirectedUrl;
1216                }
1217                else {
1218                    location.reload();
1219                }
1220            }
1221        },
1222        error: function (req, status, error) {
1223            CustomAlertModal('Alert', 'danger', "Oops! There seems to be some error. Please try again.");
1224            $('.submitpackagebtn').show();
1225            $('#bsubmitclaimpackageprogress').hide();
1226        }
1227    })
1228}
1229
1230function SaveClaimDataAfterLoginRegister(parameters, IsNewUser, registerEmailId) {
1231    var claimParm = parameters = parameters.slice(0, -1);
1232    claimParm = claimParm + ',"IsNewUser":"' + IsNewUser + '","registermailid":"' + registerEmailId + '"}';
1233    $.ajax({
1234        type: "POST",
1235        url: 'https://www.usaonline.us/register-business/SubmitClaimDetails',
1236        data: claimParm,
1237        dataType: "json",
1238        contentType: "application/json; charset=utf-8",
1239        success: function (data) {
1240
1241            localStorage.removeItem("claimformdetails");
1242            window.location.href = "https://www.usaonline.us/register-business?step=pkg&cid=" + data;
1243            //window.location.href = "https://www.usaonline.us/register-business?step=pkg";
1244        },
1245        error: function (req, status, error) {
1246            localStorage.removeItem("claimformdetails");
1247            CustomAlertModal('Alert', 'danger', "Oops! There seems to be some error. Please try again." + error);
1248            $('#btnsubmitlocal').show();
1249            $('#btnsubmitlocalprogress').hide();
1250        }
1251    })
1252}
1253
1254function getusercity(statename, cityname, sid) {
1255
1256    $.ajax({
1257        type: "POST",
1258        url: '/globalajax/detectmycitydomain',
1259        data: {
1260            statename: statename,
1261            cityname: cityname,
1262            sid: sid
1263        },
1264        success: function (data) {
1265            if (data.domain.Domain != null) {
1266                $('#IDpopularin').text(data.domain.CityName);
1267                setcategorylinks(data.domain.Domain);
1268                if ($("#IDRecentListingshomepage").length > 0) {
1269                    $('.usercitylocation').text(data.domain.CityName);
1270                    Getrecentlisting(data.domain.CityId);
1271                }
1272                if ($("#usercitylocationlocalcategory").length > 0) {
1273                    $('#usercitylocationlocalcategory').text(data.domain.CityName);
1274                }
1275                //data.domain.CityId 
1276                //data.domain.Domainurl
1277                //data.domain.StateName
1278                //data.domain.CityName 
1279                //data.domain.StateAbb 
1280                //data.domain.CityUrl
1281
1282                /// for Search Js Page Set Auto detected value
1283                SetAuoDetectedValues(data.domain.CityName, data.domain.StateAbb, data.domain.StateName, data.domain.Domainurl, data.domain.CityId);
1284            }
1285        },
1286        error: function (jqXHR, status, error) {
1287            //ResetLoading();
1288            console.info("Oops! There seems to be some error. Please try again.");
1289        }
1290    });
1291
1292}
1293
1294function Getrecentlisting(cid) {
1295
1296    $.ajax({
1297        type: "POST",
1298        url: '/globalajax/getrecentlisting',
1299        data: {
1300            cityid: cid
1301        },
1302        success: function (data) {
1303            $('#IDRecentListingshomepage').html('');
1304            $('#IDRecentListingshomepage').append(data);
1305        },
1306        error: function (jqXHR, status, error) {
1307            //ResetLoading();
1308            console.info("Oops! There seems to be some error. Please try again.");
1309        }
1310    });
1311
1312}
1313
1314function isHTML(str) {
1315    // return /^<.*?>$/.test(str);
1316    return str.match(/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/) || (str.indexOf('<') > -1 && str.indexOf('>') > -1);
1317}
1318$(document).on('click', '[data-attr="resendverificationlink"]', function (e) {
1319    var emailId = $(this).data('emailid')
1320    $('#divLoading').show();
1321    $.ajax({
1322        url: 'https://www.usaonline.us/ga/www/ResendVarificationLink',
1323        type: "POST",
1324        data: { "emailId": emailId },
1325        dataType: "json",
1326        success: function (data) {
1327            window.location.reload();
1328        },
1329        error: function (req, status, error) { $('#divLoading').hide(); }
1330    }).always(function () {
1331        $('#divLoading').hide();
1332    });
1333});
1334$(document).on('click', '.member', function (e) {
1335    $(".loginRegisterBox > div").toggleClass("active");
1336});
1337$(document).ready(function () {
1338  
1339    $(window).bind('scroll', function () {
1340        var navHeight = $(window).height() - 135;
1341        //if (($(window).scrollTop()) > navHeight) {
1342        //    $('.naveFix').addClass('fixedArea');
1343        //}
1344        //else {
1345        //    $('.naveFix').removeClass('fixedArea');
1346        //}
1347    });
1348    $(".dropdown").hover(
1349            function () {
1350                $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true, true).show();
1351                $(this).toggleClass('open');
1352            },
1353            function () {
1354                $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true, true).hide();
1355                $(this).toggleClass('open');
1356            }
1357        );
1358    //$.fn.ratingStars = function () {
1359    //    return $(this).each(function () {
1360    //        var wid = Math.max(0, (Math.min(5, parseFloat($(this).html())))) * 20
1361    //        $(this).html($('<span />').width(wid));
1362    //    });
1363    //}
1364    //$('.stars span').ratingStars();
1365});
1366
1367/****************_searchlocation.cshtml js************************/
1368$(function () {
1369    var url = location.protocol + "//" + document.domain + '/searchlocation';
1370    if ($('#blankdomain').length > 0) {
1371        document.getElementById('blankdomain').value = "";
1372    }
1373    if (document.domain == "localhost") {
1374        url = 'https://localhost:2993/searchlocation';
1375    }
1376    $('.showSearchLocationfooter').click(function () {
1377        $('#changelocationfooter_popup').show();
1378    });
1379    $('#closeSearchLocationFooter').click(function () {
1380        $('#changelocationfooter_popup').hide();
1381        $("#searchlocationfooter_input").val('');
1382    });
1383
1384    function searchlocationfooter_domain(val) {
1385        var arr = val.split(':');
1386        if (arr.length == 2) {
1387            val = arr[1].replace(" ", "");
1388        }
1389        if (arr.length == 3) {
1390            val = arr[1].replace(" ", "") + arr[2].replace(" ", "");
1391        }
1392        if (arr.length == 4) {
1393            val = arr[1].replace(" ", "") + arr[2].replace(" ", "") + arr[3].replace(" ", "");
1394        }
1395        if (arr.length == 5) {
1396            val = arr[1].replace(" ", "") + arr[2].replace(" ", "") + arr[3].replace(" ", "") + arr[4].replace(" ", "");
1397        }
1398        var HttProtocall = new MynewProtocol(val);
1399        return HttProtocall.getprotocol() + val;
1400    }
1401    function highlightText(text, jqnode) {
1402        var searchText = $.trim(text).toLowerCase(), currentNode = jqno
1402de.get(0).firstChild, matchIndex, newTextNode, newSpanNode;
1403        while ((matchIndex = currentNode.data.toLowerCase().indexOf(searchText)) >= 0) {
1404            newTextNode = currentNode.splitText(matchIndex);
1405            currentNode = newTextNode.splitText(searchText.length);
1406            newSpanNode = document.createElement("span");
1407            newSpanNode.className = "highlight";
1408            currentNode.parentNode.insertBefore(newSpanNode, currentNode);
1409            newSpanNode.appendChild(newTextNode);
1410        }
1411    }
1412
1413    if ($("#changelocationfooter_popup").length > 0) {
1414        jQuery("#searchlocationfooter_input").keypress(function (event) {
1415            var charCode = (event.which) ? event.which : event.keyCode;
1416            if (charCode == 8)
1417                return true;
1418            if (charCode == 127)
1419                return true;
1420            if (charCode == 32)
1421                return true;
1422            if ((charCode > 47) && (charCode < 58))
1423                return true;
1424            if ((charCode >= 65) && (charCode <= 90))
1425                return true;
1426            if ((charCode >= 97) && (charCode <= 122))
1427                return true;
1428            else
1429                return false;
1430        });
1431        jQuery("#searchlocationfooter_input").autocomplete({
1432            source: function (request, response) {
1433                jQuery('#searchlocationfooter_spiner').show();
1434                var i = 0;
1435                document.getElementById('blankdomain').value = "";
1436                jQuery.ajax({
1437                    url: url,
1438                    data: { term: request.term.trim() },
1439                    dataType: "json", success: function (data) {
1440                        $('#searchlocationfooter_spiner').hide();
1441                        response(jQuery.map(data, function (item) {
1442                            $('#hdfirstcatid').val(data[0].CatId);
1443                            //if (i == 0) {
1444                            //    var val = item.domain.replace(" ", "");
1445                            //    if (val != "City:" && val != "State:") {
1446                            //        document.getElementById('blankdomain').value = searchlocationfooter_domain(val);
1447                            //        i = 1;
1448                            //    }
1449                            //}
1450                            return { value: item.domain, lable: item.domain, catid: item.CatId };
1451                        }))
1452                    }, error: function () { $('#searchlocationfooter_spiner').hide(); }
1453                });
1454            },
1455            focus: function (event, ui) {
1456                event.preventDefault();
1457                var val = ui.item.label;
1458                if (val != "City:" && val != "State:") {
1459
1460                    $(this).val(val);
1461                }
1462                else { $(this).val(''); }
1463            },
1464            autoFocus: false,
1465            select: function (event, ui) {
1466                var val = ui.item.label;
1467                val = val.replace(" ", "");
1468                if (val != "City:" && val != "State:") {
1469                    window.location.href = searchlocationfooter_domain(val);
1470                }
1471                else {
1472                    event.preventDefault();
1473                    jQuery('#searchlocationfooter_input').val('');
1474                }
1475            }
1476        }).data("ui-autocomplete")._renderItem = function (ul, item) {
1477            var host = item.label;
1478            var atag = "<a></a>";
1479            var jqa;
1480            if (host == "City:" || host == "State:") {
1481                atag = "<a class='licolor'></a>";
1482                jqa = jQuery(atag).text(host);
1483            }
1484            else {
1485                jqa = $(atag).text(host);
1486                highlightText(this.term, jqa);
1487            }
1488            return jQuery("<li></li>").append(jqa).appendTo(ul);
1489        };
1490    }
1491    // to be commented to check results of user registration
1492    //if ($("#UsaLoginUserID").val() == "" || $("#UsaLoginUserID").val() == "0") {
1493    //    if (ReadCookie("usaloginclose") != "1" && location.host != "accounts.usaonline.us") {
1494    //        setTimeout(function () {
1495    //            $("#Logindialog").modal('show');
1496    //        }, 10000);
1497    //    }
1498    //}
1499    //$('#Logindialog').on('hide.bs.modal', function (e) {
1500    //    CreateCookie("usaloginclose","1")
1501    //});
1502});
1503jQuery("#searchlocationfooter_input").keypress(function (event) {
1504    if (event.keyCode == '13' && document.getElementById("searchlocationfooter_input").value != "" && document.getElementById('blankdomain').value != "") {
1505        window.location.href = document.getElementById('blankdomain').value;
1506    }
1507
1508});
1509/********************end*******************************************/
1510//$(window).unload(function () {
1511//    DeleteCookie("usaloginclose");
1512//});
1513//window.onbeforeunload = function () {
1514//    debugger;
1515//    DeleteCookie("usaloginclose");
1516//};
1517function CreateCookie(cname, cvalue, exdays) {//use this create cookie method just to create cookie till browser is open, on closing browser cookies will remove
1518    var d = new Date();
1519    //d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
1520    //var expires = "expires=" + d.toGMTString();
1521    document.cookie = cname + "=" + cvalue + "; path=/;";//+ expires;
1522}
1523function ReadCookie(cname) {
1524    var name = cname + "=";
1525    var ca = document.cookie.split(';');
1526    for (var i = 0; i < ca.length; i++) {
1527        var c = ca[i];
1528        while (c.charAt(0) == ' ') {
1529            c = c.substring(1);
1530        }
1531        if (c.indexOf(name) == 0) {
1532            return c.substring(name.length, c.length);
1533        }
1534    }
1535    return "";
1536}
1537function DeleteCookie(cname) {
1538    document.cookie = cname + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
1539}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.