/* Minification failed. Returning unminified contents.
(805,25-26): run-time error JS1195: Expected expression: )
(805,28-29): run-time error JS1195: Expected expression: >
(813,1-2): run-time error JS1002: Syntax error: }
(815,24-25): run-time error JS1004: Expected ';': {
 */
//$(document).ready(function () {
//    showimages_catphoto(CatId);
//});

document.addEventListener("DOMContentLoaded", function (event) {
    setTimeout(function () {
        showimages_catphoto(CatId);
    }, 500);

})

function showimages_catphoto(cat_id) {

    $.ajax({
        url: "/review/CorporateResponse.ashx",
        type: "POST",
        contentType: "application/x-www-form-urlencoded",
        dataType: "text",
        data: { type: 'catphoto', catid: cat_id, corp: false },
        responseType: "text/html",
        success: function (data) {

            if (data != '') {
                var arrimagedata = data.split('^');
                $('#divphotos_catphoto').html(arrimagedata[0]);
                $('#divphotos_catphoto').lightGallery();
            }
            else {
                $('#divphotos_catphoto').hide();
            }
        },
        error: function (data, status, jqXHR) { }
    });
}


function initialize() {

    if ($('#ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_imgproduct').attr('src').indexOf('map.jpg') > -1) {
        if (lt2 == '0' || lt2 == '') {
            $('#ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_imgproduct').attr('src', $('#ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_imgproduct').attr('data-src'));
        }
        else {

            var myLatlng2 = new google.maps.LatLng(lt2, lng2);
            var mapProp2 = {
                center: myLatlng2,
                zoom: 17,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                scaleControl: true,
                zoomControl: true,
                zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE }
            };
            var map2 = new google.maps.Map(document.getElementById("dealmap"), mapProp2);

            map2.setTilt(45);
            var marker2 = new google.maps.Marker({
                position: myLatlng2,
                map: map2,
                draggable: false
            });
            marker2.setMap(map2);
            var infowindow1 = new google.maps.InfoWindow({
                content: '<p>Marker Location:' + marker2.getPosition() + '</p>'
            });

            google.maps.event.addListener(marker2, 'click', function () {
                infowindow.open(map2, marker2);
            });

            $('#divdealmap').show();
            $('#ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_imgproduct').hide();
            $('.product-images').removeClass('product-images');
        }
    }


}

function UrlEncode(str) {
    str = str.replace(/\+/g, "%2b")
    str = escape(str)
    return str
}
function redirectvarients(objdrop) {

    var url_hit = objdrop.options[objdrop.selectedIndex].value
    window.location.href = url_hit

}

function analyseYearChanged() {
    var ddlYrs = $('#analyse_dropdown option:selected').val();
    var lblval = $('#analyse_dropdown option:selected').text();

    $('#analyse_dropdown').val('-1');
    displayLastRatings(ddlYrs, lblval, mergedprods);

}

function displayLastRatings(ddlYrs, lblval, mergedprods) {
    $('#dvAnalyseRating').empty();
    var txt = lblval

    openModal('.analyse-rating');
    var html = $('#wait_icon').html();
    $('#dvAnalyseRating').append(html);

    if (ddlYrs >= 0) {
        var clsAjax = new CreateRequest()
        clsAjax.ajaxObject.onreadystatechange = function () {
            if (clsAjax.ajaxObject.readyState == 4) {
                document.getElementById('dvAnalyseRating').innerHTML = clsAjax.ajaxObject.responseText;
                $(element).append('<span class="icon-close"></span>');
            }
        }
        clsAjax.ajaxObject.open("GET", "/review/reviewratings_ajax.aspx?pid=" + pid + "&year=" + lblval + "&range=" + ddlYrs + "&rndIe=" + ReturnRndIe() + "&mergedprods=" + mergedprods + "&ismerge_new=" + ismerge_new + "&check_corp=" + check_corp, true)
        clsAjax.ajaxObject.send(null)
    }
}




function clsRR() {
    document.getElementById("link_hide2").style.display = "none";
}

function showspecsdiv(dvhide) {
    dvhide.style.display = "none";
    var elems = document.getElementsByClassName("spec");
    for (i = 0; i < elems.length; i++) {
        elems[i].style.display = 'block';

    }

}
function hidespecsdiv(dvhide) {
    document.getElementById('dvshowspecs').style.display = "block";

    var elems = document.getElementsByClassName("specsdiv");
    for (i = 0; i < elems.length; i++) {
        elems[i].style.display = 'none';

    }
    window.scrollTo(0, 400);

}
function assignimg(path) {
    if (path.indexOf('/' + CatId) > -1) {
        path = imgPathForLayer;
    }
    var dtObj = new Date();
    var timee = dtObj.getTime();
    path = path + '?p=' + timee;
    $('img#ph1').attr('src', path)
              .load(function () {
                  document.getElementById("ph1").height = getImgSize(path);
                  document.getElementById("ph1").style.maxWidth = "800px";
                  document.getElementById("ph1").style.maxHeight = "460px";
                  document.getElementById("photolarge").style.display = "";
                  document.getElementById("photolarge").style.visibility = "visible";
                  document.getElementById("photolarge").focus();
                  showcentre('photolarge');
              });

}
function changebtnreviewlink(revcatid) {
    cidOfuserreview = revcatid;
}
function submit_corporate() {
    alert('Write review feature is not available for Brand Pulse!');
    return false;
}


function submit_review_verified() {
    alert(vdrmsg);
    return false;
}
function writereview_disabled() {
    alert(drmsg);
    return false;
}
function writereview_discont() {
    alert("Write Review is currently disabled for the Discontinued products.");
    return false;
}
function writereview_closed() {
    alert("Write Review is currently disabled for the Closed products.");
    return false;
}

function editreview_disabled() {
    alert('Editing is disabled for FAKE review, kindly contact support@mouthshut.com for any further query!');
    return false;
}

function validateEmail(str) {
    var filter = /^[a-zA-Z0-9.][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/i
    if (filter.test(str))
        return true
    else
        return false
}

function verified_pepperfry(txtemail) {
    var email_ver = "";
    var catid_ver = 0;
    catid_ver = CatId;

    var pepperfry_redirect = mshostver;
    if (txtemail.value == "")
    { alert("Please enter email address"); return false; }
    else
    {
        if (!validateEmail(txtemail.value)) { alert("Invalid email address");; return false; }
    }
    email_ver = txtemail.value;
    var clsAjax = new CreateRequest()
    clsAjax.ajaxObject.onreadystatechange = function () {
        if (clsAjax.ajaxObject.readyState == 4) {
            if (clsAjax.ajaxObject.responseText == "redirect") {

                pepperfry_redirect = mshostver;
                window.location.href = mshostver + red_ver_url + "/" + email_ver;
            }
            else if (clsAjax.ajaxObject.responseText == "login") {

                pepperfry_redirect = mshostver;
                $('#modal-bckpep').hide();
               
                var pepperfry_redirect = mshostver + red_ver_url + "/" + email_ver;
                if (strSession == 0)
                    ajaxLogin(pepperfry_redirect);
                else
                    window.location.href = mshostver + red_ver_url + "/" + email_ver;
                return false;
            }
            else {

                pepperfry_redirect = mshostver;
                $('#modal-bckpep').hide();
                
                var pepperfry_redirect = mshostver + red_ver_url + '#writerev';
                if (strSession == 0)
                    ajaxLogin(pepperfry_redirect);
                else
                    window.location.href = mshostver + red_ver_url;

                return false;
            }
        }
    }
    clsAjax.ajaxObject.open("GET", "/review/new_verified.aspx?email_ver=" + email_ver + "&catid_ver=" + catid_ver + "", true)
    clsAjax.ajaxObject.send(null)

}

function redirect_pepperfry(url) {
    window.location.href = url
}

function AdditionalhighlightsDetails() {
    $("#dvpopLayer").empty();
    $("#pptitle").html("Additional details");
    $("#popuplayer1").width(625);
    $("#dvpopLayer").html(document.getElementById("dvhighlights").innerHTML);
    showcentre('popuplayer1');
}
function showexpresssuccess() {
    $("#dvpopLayer").empty();
    $("#dvRating").attr('class', 'confirmationbox');
    $("#dvRating").html('<span>Thank you for rating this Product</span>');
    $("#pptitle").html("&nbsp;");
    $("#popuplayer1").width(347);
    $("#popuplayer5").hide();
    showcentre('popuplayer1');
    closepptimeout('popuplayer1', 3000);
    var f = document.getElementById('ifrmReview');
    f.src = f.src;
}


function redirecttowrite() {

    if (window.onload) {
        var querystring = "cid=" + cidOfuserreview;

        if ($("#expressrev").html() == '') {
            document.getElementById('writereviewpanel2').innerHTML = "<iframe allowtransparency scrolling='no' frameborder='0' id='ifrmReview'  style='width: 650px; border:0;' src='/review/expressreview.aspx?" + querystring + "'></iframe>"
            var ref = $("#writereviewpanel2").html();
            $("#popuplayer1").hide();
            $("#expressrev").empty();
            $("#expressrev").append(ref);
        }

        $("#popuplayer5").show();
        $("#writereviewpanel2").empty();
        showcentrepop('popuplayer5');

    }

}

function editrestdetails(str) {
    $("#pptitle").html("Edit this listing");
    $("#dvpopLayer").empty();
    $("#popuplayer1").width(400);
    $("#dvpopLayer").append($("#restodetails").html());
    showcentre('popuplayer1');
}


function WriteReview() {
    if (cidOfuserreview1 != cidOfuserreview) { cidOfuserreview = cidOfuserreview1; }
    if (orderid == '')
        window.location.href = '/review/writereview_readall.aspx?cid=' + cidOfuserreview;
    else
        window.location.href = '/review/writereview_readall.aspx?cid=' + cidOfuserreview + '&oid=' + orderid + '&verrevid=' + ver_rev_id;
}

function setHeight(height) {
    document.getElementById('ifrmReview').style.height = height + 30 + "px";
}
function scrollOnTop(val) {
    if (val == 2) {
        var eTop = $('#writereviewpanel2').offset().top; window.scroll(eTop, eTop);
    }
    else {
        var eTop = $('#writereviewpanel').offset().top; window.scroll(eTop, eTop);
    }
}


function setHeight2(height) {
    document.getElementById('ifrmReview2').style.height = height + 30 + "px";
}



function callcustom(catid, maincat, subcat) {

    var dvSpecification = document.getElementById('specification');
    var spec_table = document.getElementById('idspec');
    if (dvSpecification.style.display == 'none' && dvSpecification.innerHTML != "")
        dvSpecification.style.display = '';

    else if ((type == 0 || type == 2) && (dvSpecification.style.display == 'block' || dvSpecification.style.display == '')) {
        dvSpecification.style.display = 'none';
        window.scrollTo(0, 0);
    }

    var parameter = "";
    if (isbot == '0') {
        parameter = "PType=spec" + "&id=" + catid + "&CatName=" + CatName + "&maincat=" + maincat + "&subcat=" + subcat;
        if (dvSpecification.innerHTML == "") {

            var xmlhttp = new CreateRequest()
            xmlhttp.ajaxObject.onreadystatechange = function ajaxResponse() {
                if (xmlhttp.ajaxObject.readyState == 4) {
                    if (xmlhttp.ajaxObject.responseText.indexOf("confirmationbox") > -1) {
                        dvSpecification.style.display = 'none';
                        var lispecs = document.getElementById('ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_tabs1_tdSpec');
                        if (lispecs != null) {
                            lispecs.removeAttribute("class");
                        }
                    }
                    else {
                        if (xmlhttp.ajaxObject.responseText == '') {
                            lispecs.removeAttribute("class"); dvSpecification.style.display = 'none';
                        }
                        else {
                            var arr = xmlhttp.ajaxObject.responseText.split('|');
                            dvSpecification.innerHTML = arr[0];
                            spec_table.innerHTML = arr[1];

                            var lispecs = document.getElementById('ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_tabs1_tdSpec');
                            if (lispecs != null) {
                                lispecs.setAttribute("class", "on");
                            }
                            dvSpecification.style.display = 'block';
                            dvSpecification.style.marginTop = '10px';
                        }
                    }
                }
            }
            xmlhttp.ajaxObject.open("GET", '/Comparison/compareproducts.php?' + parameter, true);
            xmlhttp.ajaxObject.send(null)
        }

    }


}
function customSpecification(catid, maincat, subcat) {
    var dvSpecification = document.getElementById('specification');
    var spec_table = $('.spec');
    var spec_title = $('.spec_title');
    if ($('#specification').css('display') == 'none' && dvSpecification.innerHTML != "") {
        dvSpecification.style.display = 'block';
    }
    else if ((type == 0 || type == 2) && (dvSpecification.style.display == 'block' || dvSpecification.style.display == '')) {
        dvSpecification.style.display = 'none';
        window.scrollTo(0, 0);
    }
    else if ((dvSpecification.innerHTML != "") && (dvSpecification.style.display == 'block')) {
        dvSpecification.style.display = 'none';
    }
    var parameter = "";
    if (isbot == '0') {
        parameter = "PType=spec" + "&id=" + catid + "&CatName=" + CatName + "&maincat=" + maincat + "&subcat=" + subcat;
        if (dvSpecification.innerHTML == "") {

            var xmlhttp = new CreateRequest()
            xmlhttp.ajaxObject.onreadystatechange = function ajaxResponse() {
                if (xmlhttp.ajaxObject.readyState == 4) {
                    dvSpecification.style.display = 'block';
                    var eTop = $('#specificationa').offset().top - 120;
                    window.scrollTo(eTop, eTop);
                    dvSpecification.style.marginTop = '10px';
                    var arr = xmlhttp.ajaxObject.responseText.split('|');
                    dvSpecification.innerHTML = arr[0];
                    spec_table.innerHTML = arr[1];

                }
            }
            xmlhttp.ajaxObject.open("GET", '/Comparison/compareproducts.php?' + parameter, true);
            xmlhttp.ajaxObject.send(null)
        }

    }

}

function Specification(type, parent) {
    var dvSpecification = document.getElementById('specification');
    var iscars = ""
    if (parent == "101") {
        if (CatId == merge_parent)
            iscars = "&ov=1&mpar=1";
        else
            iscars = "&ov=1";


    }
    if (CatId == merge_parent)
        iscars = "&ov=1&mpar=1";

    if ($('#specification').css('display') == 'none') {

        dvSpecification.style.display = 'block';
        dvSpecification.style.marginTop = '10px';
        var eTop = $('#specificationa').offset().top - 120;
        window.scrollTo(eTop, eTop);

    }
    else if ((type == 0 || type == 2) && (dvSpecification.style.display == 'block' || dvSpecification.style.display == '')) {

        dvSpecification.style.display = 'none';
        window.scrollTo(0, 0);
    }

    var parameter = "";
    if (isbot == '0') {
        if (type == 1) {
            $("#specification").html('');
            parameter = "PType=spec" + "&id=" + parent + "&CatName=" + CatName;
        }
        else if (type == 2) {
            parameter = "PType=info" + "&id=" + CatId + "&CatName=" + CatName.replace("&", "**");
        }
        else {
            parameter = "PType=spec" + iscars + "&id=" + parent + "|1|" + CatId + "&CatName=" + CatName;

        }
        if (dvSpecification.innerHTML == '') {

            var xmlhttp = new CreateRequest()
            xmlhttp.ajaxObject.onreadystatechange = function ajaxResponse() {
                if (xmlhttp.ajaxObject.readyState == 4) {
                    dvSpecification.innerHTML = xmlhttp.ajaxObject.responseText
                }
            }
            xmlhttp.ajaxObject.open("GET", '/Comparison/compareproducts.php?' + parameter, true);
            xmlhttp.ajaxObject.send(null)
        }
    }
    else {
        if (type == 1) {
            $("#specification").html('');
        }
    }

}



function headover(n) {
    try {
        for (i = 1; i <= 2 ; i++) {
            if (i == n) {
                show('link_hide' + i);
            } else {
                hide('link_hide' + i);
            }
        }
    } catch (e) { }
}

function headout(e, no) {
    try {
        var p = drop_div(e);
        if (p.id != 'link_hide' + no) {
            hide('link_hide' + no);
        }
    } catch (e) { }
}
function show(divnm) {
    try { d_g_id(divnm).style.display = "block"; } catch (e) { }
}

function hide(divnm) {
    try { d_g_id(divnm).style.display = "none"; } catch (e) { }
}
function d_g_id(elem) {
    try {
        return document.getElementById(elem);
    } catch (e) { }
}

function toggle(divnm) {
    if (d_g_id(divnm).style.display == "none" || d_g_id(divnm).style.display == "" || d_g_id(divnm).style.display == null || d_g_id(divnm).style.display == undefined) {
        show(divnm);
    } else {
        hide(divnm);
    }
}
function drop_div(e) {
    if (!e) var e = window.event;
    var relTarg = e.relatedTarget || e.toElement;
    return relTarg;
}
function showDiscreation(rid, postedby) {
    if (strSession > 0) {
        if(postedby == user_id){
            if (strUsrName == $('[id$=linkrevname]').text()) {
            if ($('[id$=hidDiscretionExist]').val() != "0") {
                document.getElementById('dvthankModal').innerHTML = "<span>We have already taken your feedback. Be patient while our Support Team processes your request.</span>"
                $('#dvthankModal').show();
                $('#dvfakeModal').hide();
                $('.upload-file-selected').html('');
                openModal('.fakeModal');

            }
            else {
                document.getElementById('hidReviewId').value = rid;
                document.getElementById('btnSubmitDisc').style.display = '';

                $('#dvthankModal').hide();
                $('#dvfakeModal').show();
                $('#txtDAreaComm').val("");
                $('.upload-file-selected').html('');
                openModal('.fakeModal');
            }
        
        }
        else if ($('[id$=linkrevname]').text() == 'Anonymous' && strUsrName == postedby) {
            if ($('[id$=hidDiscretionExist]').val() != "0") {
                document.getElementById('dvthankModal').innerHTML = "<span>We have already taken your feedback. Be patient while our Support Team processes your request.</span>"
                $('#dvthankModal').show();
                $('#dvfakeModal').hide();
                $('.upload-file-selected').html('');
                openModal('.fakeModal');
            }
            else {
                document.getElementById('hidReviewId').value = rid;
                document.getElementById('btnSubmitDisc').style.display = '';

                $('#dvthankModal').hide();
                $('#dvfakeModal').show();
                $('#txtDAreaComm').val("");
                $('.upload-file-selected').html('');
                openModal('.fakeModal');
            }
        }
        }
    }
    else {
        ajaxLogin('');
    }
}

function setFocus() {
    document.getElementById('txtDAreaComm').focus();
}
function validateQuoteForm() {
    var loaderdiv = $("#loader").html();
    $("#lnkviewmore").hide();
    $('#getQuote').append(loaderdiv);
    $('.ajaxloader').show();



    if (nameGetRoadPrice.value == "" || emailGetRoadPrice.value == "" || teleGetRoadPrice.value == "") {
        document.getElementById(dvqerror).style.display = "block";
        document.getElementById(dvqerror).innerText = "Fields marked with * are mandatory. ";
        $("#getQuote .ajaxloader").remove();
        return false;
    }
    else if (validateEmail(emailGetRoadPrice.value) == false) {
        document.getElementById(dvqerror).style.display = "block";
        document.getElementById(dvqerror).innerText = "Invalid Email ID. ";
        $("#getQuote .ajaxloader").remove();
        return false;
    }
    else if (teleGetRoadPrice.value.length < 10) {
        document.getElementById(dvqerror).style.display = "block";
        document.getElementById(dvqerror).innerText = "Invalid Mobile Number ";
        $("#getQuote .ajaxloader").remove();
        return false;
    }
    else {


        $.ajax({
            type: 'POST',
            url: '/web/WebService3.asmx/SaveOnRoadPrice',
            data: "{Name:'" + $("#txtName").val() + "',ProdName:'" + $("#txtModel").val() + "',Email:'" + $("#txtMail").val() + "',MobileNo:'" + $("#txtMob").val() + "',City:'" + $("#txtCity").val() + "',PinCode:'" + $("[id$=txtPinCode]").val() + "',CatId:'" + CatId + "',CatName:'" + CatName + "',Parent2:'" + parent2 + "',Level1:'" + Level1 + "',userId:'" + userId + "',Productlaunch:'" + $("#hdnproductlaunch").val() + "'}",
            dataType: 'json',
            contentType: 'application/json; charset=utf-8',
            processData: false,
            success: function (result) {
                var res = (result.d).split('|')
                if (res[0].toLowerCase().trim() == "error") {
                    openModal('#getQuote');
                    $("#dvQuoteError").css('display', 'block');
                    $("#dvQuoteError").html(res[1]);
                }
                else {
                    openThankYouModal()
                }
            },
            error: function (err) {
                $("#dvQuoteError").html(err);
            }
        });
    }
}

function openPriceModal() {
    $("#getQuote .ajaxloader").remove();
    openModal('#getQuote');
}

function validateQuoteForm12() {
    $("#getQuote1").css('display', 'block');
    $("#dvQuoteError1").css('display', 'block');
    $("#dvQuoteError1").html("Fields marked with * are mandatory. ");
    return false;
}
function validateQuoteForm1() {
    if ($("#txtName").val() == "" || $("#txtMail").val() == "") {
        $("#getQuote1").css('display', 'block');
        $("#dvQuoteError1").css('display', 'block');
        $("#dvQuoteError1").html("Fields marked with * are mandatory. ");
        return false;
    }
    else if (validateEmail($("#txtMail").val()) == false) {
        $("#dvQuoteError1").css('display', 'block');
        $("#dvQuoteError1").html("Invalid Email ID. ");
        $("#getQuote1").css('display', 'block');
        return false;
    }
    else if ($("#txtMob").val().length < 10) {
        $("#dvQuoteError1").css('display', 'block');
        $("#dvQuoteError1").html("Invalid Mobile Number ");
        $("#getQuote1").css('display', 'block');
        return false;
    }
    else {


        $.ajax({
            type: 'POST',
            url: '/web/WebService3.asmx/SaveOnRoadPrice',
            data: "{Name:'" + $("#txtName").val() + "',ProdName:'" + $("#txtModel").val() + "',Email:'" + $("#txtMail").val() + "',MobileNo:'" + $("#txtMob").val() + "',City:'" + $("#txtCity").val() + "',PinCode:'" + $("[id$=txtPinCode]").val() + "',CatId:'" + CatId + "',CatName:'" + CatName + "',Parent2:'" + parent2 + "',Level1:'" + Level1 + "',userId:'" + userId + "',Productlaunch:'" + $("#hdnproductlaunch").val() + "'}",
            dataType: 'json',
            contentType: 'application/json; charset=utf-8',
            processData: false,
            success: function (result) {
                var res = (result.d).split('|')
                if (res[0].toLowerCase().trim() == "error") {
                    $("#dvQuoteError1").css('display', 'block');
                    $("#dvQuoteError1").html(res[1]);
                }
                else {
                    openThankYouModal()
                    $("#dvQuoteError1").css('display', 'none');
                }
            },
            error: function (err) {
                $("#dvQuoteError1").html(err);
            }
        });
    }
}
function openLeadModal1(catId, AdditionalField) {

    $.ajax({
        type: 'POST',
        url: '/web/WebService3.asmx/GetTextDrop',
        data: "{CatId:'" + catId + "',AdditionalField:'" + AdditionalField + "'}",
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        processData: false,
        success: function (result) {
            $("#dvLead1").html(result.d);
        },
        error: function (err) {

        }
    });
}

function validateLeadForm() {
    var data = {
        Name: $("#txtName1").val(),
        ProdName: $("#prodName").val(),
        Email: $("#txtMail1").val(),
        MobileNo: $("#txtMob1").val(),
        City: $("#txtCity1").val(),
        PinCode: $("[id$=txtPinCode1]").val(),
        Values: []
    };
    $("#dvLead .form-control").each(function (key, val) {
        data.Values.push($(val).val());
    });
    $.ajax({
        type: 'POST',
        url: '/web/WebService3.asmx/SaveLeadGeneration',
        data: "{Name:'" + data.Name + "',ProdName:'" + data.ProdName + "',Email:'" + data.Email + "',MobileNo:'" + data.MobileNo + "',City:'" + data.City + "',PinCode:'" + data.PinCode + "',values:" + JSON.stringify(data.Values) + ",CatId:'" + CatId + "',CatName:'" + CatName + "',Parent2:'" + parent2 + "',Level1:'" + Level1 + "',mshost:'" + mshost + "',Ip:'" + Ip + "',userId:'" + userId + "'}",
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        processData: false,
        success: function (result) {
            var res = (result.d).split('|')
            if (res[0].toLowerCase().trim() == "error") {
                openModal('#getLead');
                $("#dvLeadError").css('display', 'block');
                $("#dvLeadError").html(res[1]);
            }
            else {
                openLeadThankYouModal()
            }
        },
        error: function (err) {
            $("#dvLeadError").html(err);
        }
    });
}


function validateLeadForm1() {
    var data = {
        Name: $("#txtName1").val(),
        ProdName: $("#prodName").val(),
        Email: $("#txtMail1").val(),
        MobileNo: $("#txtMob1").val(),
        City: $("#txtCity1").val(),
        PinCode: $("[id$=txtPinCode1]").val(),
        Values: []
    };
    $("#dvLead1 .field-outline").each(function (key, val) {
        data.Values.push($(val).val());
    });
    $.ajax({
        type: 'POST',
        url: '/web/WebService3.asmx/SaveLeadGeneration',
        data: "{Name:'" + data.Name + "',ProdName:'" + data.ProdName + "',Email:'" + data.Email + "',MobileNo:'" + data.MobileNo + "',City:'" + data.City + "',PinCode:'" + data.PinCode + "',values:" + JSON.stringify(data.Values) + ",CatId:'" + CatId + "',CatName:'" + CatName + "',Parent2:'" + parent2 + "',Level1:'" + Level1 + "',mshost:'" + mshost + "',Ip:'" + Ip + "',userId:'" + userId + "'}",
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        processData: false,
        success: function (result) {
         
            var res = (result.d).split('|')
            if (res[0].toLowerCase().trim() == "error") {
                $('#getLead').css('display', 'block');
                $("#dvLeadError1").css('display', 'block');
                $("#dvLeadError1").html(res[1]);
            }
            else {
                openLeadThankYouModal()
                $('#getLead').css('display', 'block');
                $("#dvLeadError1").css('display', 'none');
                resetLeadsForm();
            }
        },
        error: function (err) {
            $("#dvLeadError1").html(err);
        }
    });
}

const resetLeadsForm = () => {
    $("#txtName1").val('');
    $("#txtMail1").val('');
    $("#txtMob1").val('');
    $("#txtCity1").val('');
    $("[id$=txtPinCode1]").val('');
    $('[id^="ddlVal"] option[value="0"]').prop('selected', true);
    $('[id^="txtVal"]').val('');
}

function setddlStyle() {
    const ddlSelect = document.querySelectorAll('[id ^="ddlVal"]');
    for (const element of ddlSelect) {
        if (element.value != "0") {
            element.style.color = "#242c42";
            element.style.fontWeight = "400";
        } else {
            element.style.color = "gray";
        }
    }
}


function openThankYouModal() {
    $('.black-layer').css('visibility', 'hidden');
    openModal('#dvThankQuote');
}

function openLeadThankYouModal() {
    $('.black-layer').css('visibility', 'hidden');
    openModal('#dvLeadThankQuote');
}


function validateEmail(str) {
    var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    var emailid = str.split("@");
    var array = emailid[0].split(".");
    var length = array.length;

    if (filter.test(str) && length > 2 && (emailid[1] == "gmail.com" || emailid[1] == "yahoo.com"))
        return false
    else if (filter.test(str))
        return true
}

function isNumberKey(evt) {
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; }
    return true;
}

function isNumberKey1(evt) {
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; }
    if (document.getElementById('txtMob1').value.length>=10) {
        return false;
    }
    return true;
}
function validate() {

    var comm = document.getElementById("txtDAreaComm").value.trim();
    var gfval;
    var err = "";
    var emailerr = "";
    if (document.getElementById('roundedOne').checked != true && document.getElementById('roundedTwo').checked != true) {
        err = err + "Please select any one option " + '\n';
    }
    else {
        if (document.getElementById('roundedOne').checked == true) {
            gfval = 0;
        }
        else {
            gfval = 1;
        }
    }
    if (emai == "") {
        err = err + "Email cannot be blank " + '\n';
    }
    else {
        if (validateEmail(emai) == false) {
            emailerr = emailerr + "Invalid E-mail ID" + '\n';
        }
    }
    if (comm == "") {
        err = err + "Your Comments cannot be blank " + '\n';
    }
    if (err == "" && emailerr == "") {
        SendEmail(name, msid, emai, comm, document.getElementById('hidReviewId').value, gfval);
    }
    else if (emailerr != "") {
    }
    else {
        alert(err);
    }
}
function SendEmail(name, msid, emai, comm, rid, gfval) {

    var formData = new FormData();
    var files = $("#fileJustifyPhoto").get(0).files;
    if (files.length != 0) {

        formData.append(files[0].name, files[0]);
        formData.append('name', name);
        formData.append('msid', msid);
        formData.append('email', emai);
        formData.append('comment', comm);
        formData.append('rid', rid);
        formData.append('gfval', gfval);

        var extension = $("#fileJustifyPhoto").val().split('.').pop().toLowerCase();
        if ($.inArray(extension, ['gif', 'png', 'jpg', 'jpeg']) == -1) {
            alert('Invalid file extension. Only files with png, jpg, jpeg and gif extensions are allowed.')
            return;
        }

        $.ajax({
            url: "/review/DescritionAjax.aspx",
            type: "POST",
            contentType: false,
            processData: false,
            data: formData,
            success: function (result) {
                document.getElementById('btnSubmitDisc').style.display = 'none';
                $('#dvfakeModal').hide();
                $('#dvthankModal').show();
                document.getElementById('dvthankModal').innerHTML = "<span>Thank you for writing to us. Our Support Team shall look into this and get back to you soon.</span>"
                setTimeout(function () {
                    $('.black-layer').css('visibility', 'hidden');
                    $('body').css('overflow-y', 'auto');
                    $('#optionpopup').hide().removeClass('modal');

                    let currentUrl = window.location.href;
                    if (currentUrl.length > 5) {
                        let last = currentUrl.substr(currentUrl.length - 5, 5);
                        if (last == "-fake") {
                            window.location = currentUrl.substr(0, currentUrl.length - 5);
                        }
                        else {
                            window.location.reload();
                        }

                    }

                }, 2500);
            },
            error: function (err) {
                alert('Something error occurred');
            }
        });
    }
    else {
        alert('At least one proof is mandatory. Please upload a purchase proof');
    }
}

function changeJustifyPhoto() {
    if ($('#fileJustifyPhoto').val()) {
        let array = $('#fileJustifyPhoto').val().split('\\');
        $('.upload-file-selected').text(array[array.length - 1]);
    }
};
var divMoreReviews, linkMoreProdRev, linkMoreMemRev, linkEditorsPick, MoreMemRevUrl, MoreProdRevUrl, OverallRatUrl, TrustRatUrl, tabMoreProdRev, tabMoreMemRev, tabEditorsPick, divComments, divCorpComments, spancomcount, diverror, txtComment, btnSubmit, btnEdit, hidCommentId, loadhead, divTotcnt, hidviewmore, corp_btnEdit, corp_btnSubmit, Height1, Height2, width1, width2, selEdit, urlredirect, indesof, urlredirectTo, canPostComntOnReview, canPostComntOnResponse, Rate_Comment = !1, FocusOnComments = !1, Add_Comment = !1, FocusOnAddComments = !1, editabletr = "", firstvisit = 1, googlebot = "<%=isBot%>"; function JavaScrVars() { divMoreReviews = document.getElementById("divMoreReviews"), tabMoreMemRev = document.getElementById("tabMoreMemRev"), tabEditorsPick = document.getElementById("tabEditorsPick"), linkMoreMemRev = document.getElementById("linkMoreMemRev"), linkEditorsPick = document.getElementById("linkEditorsPick"), spancomcount = document.getElementById("spancomcount"), diverror = document.getElementById("diverror"), MoreMemRevUrl = "MoreMemberReviews=" + revAuthor + "&CatId=" + CatId + "&Random=", OverallRatUrl = "OverallGraph=" + Rid + "&u=" + revAuthor + "&Random=", TrustRatUrl = "TrustGraph=" + revAuthor + "&Rid=" + Rid + "&Random=", divTotcnt = document.getElementById("divTotcnt") } function SuspectMem(e) { ChkLogin(e, ""), "success" == e && BindReason() } function Ajax(e, t) { var n = new CreateRequest; n.ajaxObject.onreadystatechange = function () { 4 == n.ajaxObject.readyState && e(n.ajaxObject.responseText) }, n.ajaxObject.open("GET", "/review/reviewajax.php?" + t, !1), n.ajaxObject.send(null) } function AjaxByHash(e, t) { $.ajax({ async: !0, type: "GET", url: mshost + "/review/reviewajax.php?" + t, contentType: "application/json; charset=utf-8", dataType: "text", success: function (t) { e(t) } }) } function Ajaxres(e, t) { $.ajax({ async: !0, type: "GET", url: mshost + "/review/reviewratingrestaurant.aspx?" + t, contentType: "application/json; charset=utf-8", dataType: "text", success: function (t) { e(t) } }) } function AjaxPost(e, t) { var n = new CreateRequest; n.ajaxObject.onreadystatechange = function () { 4 == n.ajaxObject.readyState && (e(n.ajaxObject.responseText), t.includes("AddCorpComment=1") && ($("#ltCommentCount").text(parseInt($("#ltCommentCount").text()) + 1), $("#corp_errComment").text("Comment added successfully.").css("color", "#3c763d").show())) }, n.ajaxObject.open("POST", "/review/reviewajax.php", !0), n.ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), n.ajaxObject.setRequestHeader("Content-length", t.length), n.ajaxObject.setRequestHeader("Connection", "close"), n.ajaxObject.send(t) } function AjaxPostRev(e, t, n, a) { var o = new CreateRequest; o.ajaxObject.onreadystatechange = function () { 4 == o.ajaxObject.readyState && e(o.ajaxObject.responseText, n, a) }, o.ajaxObject.open("POST", "/product/restaurant_ajax.aspx", !0), o.ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), o.ajaxObject.setRequestHeader("Content-length", t.length), o.ajaxObject.setRequestHeader("Connection", "close"), o.ajaxObject.send(t) } function ChkLogin(e, t, n) { "login" == e && (indesof = (urlredirect = LoginUrl + escape(t) + (void 0 == n ? "" : n)).indexOf("/review/"), ajaxLogin(urlredirectTo = urlredirect.substr(indesof))) } function ChkLogin_Rate(e, t, n, a) { "login" == e && (indesof = (urlredirect = "/signup/login/login_now.php?add=" + escape("/review/" + CatName + "-review-" + n) + escape(t) + (void 0 == a ? "" : a)).indexOf("/review/"), ajaxLogin(urlredirectTo = urlredirect.substr(indesof))) } function ChkAlert(e, t, n) { "login" == e && (indesof = (urlredirect = LoginUrl + escape(t) + (void 0 == n ? "" : n)).indexOf("/review/"), ajaxalert(urlredirectTo = urlredirect.substr(indesof))) } function Trust(e) { ChkLogin(e, "-trust-1"), "reload" == e ? window.location.reload() : "success" == e && (linkTrust.style.display = "none", alreadyTrust.style.display = "block", linkDistrust.innerHTML = "Distrust this member", linkDistrust.setAttribute("href", "javascript:Ajax(Distrust,'Distrust=" + revAuthor + "&loadhead=" + loadhead + "')"), linkDistrust.className = "smallfont", TrustCount(1)) } function Distrust(e) { ChkLogin(e, "-trust-0"), "reload" == e ? window.location.reload() : "success" == e && (linkDistrust.innerHTML = "Distrusted by you", linkDistrust.removeAttribute("href"), linkDistrust.className = "smallfontred", "Trusted by you" == linkTrust.innerHTML && TrustCount(-1), linkTrust.innerHTML = "Trust this member", linkTrust.setAttribute("href", "javascript:Ajax(Trust,'Trust=" + revAuthor + "&loadhead=" + loadhead + "')"), linkTrust.className = "smallfont") } function TrustCount(e) { var t = []; (t = lblTrustBy.innerHTML.split(" "))[0] = 1 * t[0], t[0] = t[0] + e, 1 == t[0] ? t[1] = "member" : t[1] = "members", lblTrustBy.innerHTML = t.join(" ") } function AlertMember(e) { ChkLogin(e, "-alert-1"), "reload" == e ? window.location.reload() : "success" == e && (linkAlertMember.style.display = "none", alreadyAlertMember.style.display = "block") } function AjaxsetAlert(e) { var t = new CreateRequest; t.ajaxObject.onreadystatechange = function () { t.ajaxObject.readyState }, t.ajaxObject.open("GET", "/review/reviewajax.php?" + e, !0), t.ajaxObject.send(null) } function EAlert(e) { "" != $("#alertE").html() && ("E" == e ? document.getElementById("emailalerttxt").disabled = !1 : "edit" == e.substring(0, 4) ? (document.getElementById("emailalerttxt").disabled = !0, document.getElementById("emailalerttxt").value = e.replace("edit|", "")) : (document.getElementById("emailalerttxt").disabled = !0, document.getElementById("emailalerttxt").value = e), 1 == chkEPA1 && (document.getElementById("alertreviewE").checked = !0), 1 == chkERC1 && (document.getElementById("alertcommentE").checked = !0)) } function setAlert(e, t) { var n = document.getElementById("lblSucess"); if ("E" == e) { var a = document.getElementById("emailalerttxt").value, o = document.getElementById("alertreviewE").checked, r = document.getElementById("alertcommentE").checked; epattern = /^[a-zA-Z0-9.@_]+$/, "" != a && !0 == epattern.test(a) ? !0 == o && !0 == r ? (AjaxsetAlert(t + "&Email=" + a + "&EAlert=Eboth"), n.className = "success", n.innerText = "Changes has been updated successfully", chkEPA1 = 1, chkERC1 = 1) : !0 == o ? (AjaxsetAlert(t + "&Email=" + a + "&EAlert=EReview"), n.className = "success", n.innerText = "Changes has been updated successfully", chkEPA1 = 1, chkERC1 = 0) : !0 == r ? (AjaxsetAlert(t + "&Email=" + a + "&EAlert=ECmt"), n.className = "success", n.innerText = "Changes has been updated successfully", chkEPA1 = 0, chkERC1 = 1) : !1 == o && !1 == r && (AjaxsetAlert(t + "&Email=" + a + "&EAlert=Ed"), n.className = "success", n.innerText = "Unsubscribed sucessfully", chkEPA1 = 0, chkERC1 = 0) : (n.className = "warning", n.innerText = "*Please enter valid Email address") } } function OverallRating(e) { ShowGraph(e) } function MoreProductReviews(e) { "no records" == e ? divMoreReviews.innerHTML = "<span class='font'>No records found.</span>" : divMoreReviews.innerHTML = e, tabMoreMemRev.className = "tabs_grey", tabEditorsPick.className = "tabs_grey", linkMoreMemRev.setAttribute("href", "javascript:Ajax(MoreMemberReviews,'" + MoreMemRevUrl + Math.random() + "')"), linkEditorsPick.setAttribute("href", "javascript:Ajax(EditorsPick,'EditorsPick=1&Random=" + Math.random() + "')") } function MoreMemberReviews(e) { "no records" == e ? divMoreReviews.innerHTML = "<span class='font'>No records found.</span>" : divMoreReviews.innerHTML = e, tabMoreMemRev.className = "tabs_blue", tabEditorsPick.className = "tabs_grey", linkMoreMemRev.removeAttribute("href"), linkEditorsPick.setAttribute("href", "javascript:Ajax(EditorsPick,'EditorsPick=1&Random=" + Math.random() + "')") } function EditorsPick(e) { "no records" == e ? divMoreReviews.innerHTML = "<span class='font'>No records found.</span>" : divMoreReviews.innerHTML = e, tabMoreMemRev.className = "tabs_grey", tabEditorsPick.className = "tabs_blue", linkEditorsPick.removeAttribute("href"), linkMoreMemRev.setAttribute("href", "javascript:Ajax(MoreMemberReviews,'" + MoreMemRevUrl + Math.random() + "')") } function NextPhoto() { var e = document.getElementById("RevImg"), t = e.src; e.src = e.getAttribute("nextimg"), e.setAttribute("nextimg", t), imgno = "1" == imgno ? "2" : 1 } function next() { 1 == imgno ? (imgno = 2, ph1.height = Height2, ph1.style.maxWidth = "800px", ph1.style.minWidth = "300px", ph1.src = arrImg_user[1], document.getElementById("photolarge1").style.display = "", document.getElementById("photolarge1").style.visibility = "visible", document.getElementById("photolarge1").focus(), showcentre("photolarge1"), document.getElementById("nxt1").setAttribute("class", "btn-next-disabled"), document.getElementById("nxt1").removeAttribute("onclick"), document.getElementById("pre1").setAttribute("class", "btn-prev"), document.getElementById("pre1").setAttribute("onclick", "next()"), document.getElementById("pre1").innerHTML = "<a  href='javascript:void(0);'></a>") : (imgno = 1, ph1.height = Height1, ph1.style.maxWidth = "800px", ph1.style.minWidth = "300px", ph1.src = arrImg_user[0], document.getElementById("photolarge1").style.display = "", document.getElementById("photolarge1").style.visibility = "visible", document.getElementById("photolarge1").focus(), showcentre("photolarge1"), document.getElementById("pre1").setAttribute("class", "btn-prev-disabled"), document.getElementById("pre1").removeAttribute("onclick"), document.getElementById("nxt1").setAttribute("class", "btn-next"), document.getElementById("nxt1").setAttribute("onclick", "next()"), document.getElementById("nxt1").innerHTML = "<a  href='javascript:void(0);'></a>") } function cls() { document.getElementById("photolarge1").style.display = "none", imgno = 1 == tempno ? 1 : 2 } function closethis1() { document.getElementById("photolarge1").style.display = "none", imgno = 1 == tempno ? 1 : 2 } function clicktozoom() { newImgSize(), 1 == imgno ? (tempno = 1, document.getElementById("pre1").setAttribute("class", "btn-prev-disabled"), document.getElementById("pre1").removeAttribute("onclick"), document.getElementById("nxt1").setAttribute("class", "btn-next"), document.getElementById("nxt1").setAttribute("onclick", "next()"), document.getElementById("nxt1").innerHTML = "<a  href='javascript:void(0);'></a>", ph1.height = Height1, ph1.style.maxWidth = "800px", ph1.style.minWidth = "300px", ph1.src = arrImg_user[0]) : 2 == imgno & 1 == imgcount ? (tempno = 1, document.getElementById("nxt1").setAttribute("class", "btn-next-disabled"), document.getElementById("nxt1").removeAttribute("onclick"), document.getElementById("pre1").setAttribute("class", "btn-prev"), document.getElementById("pre1").setAttribute("onclick", "next()"), document.getElementById("pre1").innerHTML = "<a  href='javascript:void(0);'></a>", ph1.height = Height1, ph1.style.maxWidth = "800px", ph1.style.minWidth = "300px", ph1.src = arrImg_user[0]) : (tempno = 2, document.getElementById("nxt1").setAttribute("class", "btn-next-disabled"), document.getElementById("nxt1").removeAttribute("onclick"), document.getElementById("pre1").setAttribute("class", "btn-prev"), document.getElementById("pre1").setAttribute("onclick", "next()"), document.getElementById("pre1").innerHTML = "<a  href='javascript:void(0);'></a>", ph1.height = Height2, ph1.style.maxWidth = "800px", ph1.style.minWidth = "300px", ph1.src = arrImg_user[1]), 1 == imgcount && (document.getElementById("nxt1").setAttribute("class", "btn-next-disabled"), document.getElementById("nxt1").removeAttribute("onclick"), document.getElementById("pre1").setAttribute("class", "btn-prev-disabled"), document.getElementById("pre1").removeAttribute("onclick")), document.getElementById("photolarge1").style.display = "block", document.getElementById("photolarge1").style.visibility = "visible", document.getElementById("photolarge1").focus(), showcentre("photolarge1"), firstvisit += 1 } function newImgSize() { 1 == imgcount ? (Height1 = getImgSize(arrImg_user[0]), document.getElementById("nxt1").setAttribute("class", "btn-next-disabled"), document.getElementById("nxt1").removeAttribute("onclick")) : 2 == imgcount && (Height1 = getImgSize(arrImg_user[0]), Height2 = getImgSize(arrImg_user[1])) } function getImgSize(e) { var t = 500, n = 0, a = new Image; return a.src = e, n = (t = a.height) >= 500 ? 500 : t } function FocusComments() { ShowHideError(0, ""), txtComment.value = "", document.getElementById("CommentHeading").innerHTML = "<h2>Post a comment on this Review of " + CatName + "</h2>", btnSubmit.style.display = "block", btnEdit.style.display = "none", hidCommentId.value = "", btnSubmit.focus() } function ShowComments(e) { if ("no records" != e) { if (e = e.replace("&lt;br/&gt;", "\r\n"), $("#divComments").find("#hidCmmtCnt").remove(), $("#divComments").html(e), revCmtTotCnt.value = document.getElementById("hidCmmtCnt").value, submitclick && parseInt(revCmtTotCnt.value) > 3) $("#linkpostcomment").html("View " + (parseInt(revCmtTotCnt.value) - 3) + " more comment").show(), submitclick = !1, revHidskip.value = 13; else if (revHidskip.value - 10 < parseInt(revCmtTotCnt.value)) { linkpostcomment.style.display = "inline-block"; var t = parseInt(revCmtTotCnt.value) - (revHidskip.value - 10); t > 1 ? $("#linkpostcomment").html("View " + t + " more comments") : 1 == t ? $("#linkpostcomment").html("View " + t + " more comment") : linkpostcomment.style.display = "none" } else linkpostcomment.style.display = "none"; "1" == showall && (revHidskip.value = revCmtTotCnt.value + 10), !0 == FocusOnComments && (window.location.hash = "#comments"), divComments.style.display = "block" } else divComments.style.display = "none", linkpostcomment.style.display = "none" } function ShowCorpComments(e) { ChkLogin(e, "", "#corp_divComments"), "login" != e && ("no records" != e ? (e = e.replace("&lt;br/&gt;", "\r\n"), divCorpComments.innerHTML = e, "edit" == (buttonclicked = FindCorpButtonClicked()) ? ($("html,body").animate({ scrollTop: $("#" + editabletr).offset().top - 180 }, "slow"), $("#corp_errComment").text("Comment updated successfully.").css("color", "#3c763d").show()) : $("#corp_errComment").html(""), corp_txtComment.value = "", corp_btnSubmit.style.display = "block", corp_btnEdit.style.display = "none", DisableCorpButton(!1)) : divCorpComments.style.display = "none") } function ShowMoreComments(e) { if (hidskipval = revHidskip.value, "no records" != e) { var t = parseInt(hidskipval); if (revCmtTotCnt.value > t) { var n = parseInt(revCmtTotCnt.value) - parseInt(hidskipval); n > 1 ? $("#linkpostcomment").html("View " + n + " more comments") : $("#linkpostcomment").html("View " + n + " more comment") } else linkpostcomment.style.display = "none"; t = parseInt(hidskipval) + 10, revHidskip.value = t, (divComments = document.getElementById("divComments")).innerHTML = e, revCmtTotCnt.value = document.getElementById("hidCmmtCnt").value, !0 == FocusOnComments && (window.location.hash = "#comments"), !0 == FocusOnAddComments && "" != document.getElementById("hidAddCommentId").value && ViewmoreFocus(), divComments.style.display = "block" } } function ShowMoreComments_My(e) { if (hidskipval = revHidskip.value, revCmtTotCnt.value = document.getElementById("hidCmmtCnt").value, "no records" != e) { if (1 == hidskipval) revCmtTotCnt.value = document.getElementById("hidCmmtCnt").value, revCmtTotCnt.value > 20 ? !0 == Add_Comment ? (document.getElementById("divCmtInc").style.display = "none", document.getElementById("spanCommCnt").innerHTML = "Showing 1 - " + parseInt($("#tblcomments").find("tr td:nth-child(2)").length) + " of " + parseInt(revCmtTotCnt.value) + " Comments") : document.getElementById("spanCommCnt").innerHTML = "Showing 1 - " + +parseInt($("#tblcomments").find("tr td:nth-child(2)").length) + " of " + parseInt(revCmtTotCnt.value) + " Comments" : (document.getElementById("divCmtInc").style.display = "none", document.getElementById("spanCommCnt").innerHTML = "Showing 1 - " + parseInt($("#tblcomments").find("tr td:nth-child(2)").length) + " of " + parseInt(revCmtTotCnt.value) + " Comments"); else { var t = parseInt(hidskipval); revCmtTotCnt.value > t || (divTotcnt.style.display = "none", document.getElementById("divCmtInc").style.display = "none"), document.getElementById("spanCommCnt").innerHTML = "Showing 1 - " + parseInt($("#tblcomments").find("tr td:nth-child(2)").length) + " of " + parseInt(revCmtTotCnt.value) + " Comments", revCmtTotCnt.value = document.getElementById("hidCmmtCnt").value } divComments.style.display = "block" } } function EditComment(e, t, n, a) { var o = $("#" + t).html(); editabletr = a, selEdit = n, o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = o.replace("...", "").replace("READ MORE", "").replace("Read More", "")).replace(/<(?!br\s*\/?)[^>]+>/g, "")).replace("(<(/)*p>)", "<br/>")).replace("(\n)", "<br/>")).replace("((s)*<(/)*br(/)*>(s)*){2,}", "<br/><br/>")).replace("(<(/)*br(/)*>)", "\n")).replace(/<br>/g, "\n")).replace(/<BR>/g, "\n")).replace(/&nbsp;/g, " ")).replace(/&amp;/g, "&")).replace(/&lt;/g, "<")).replace(/&gt;/g, ">")).replace(/<a target.*?>/g, "")).replace(/<\/a>/g, "")).replace(/<(|\n)*?>/g, ""), txtComment.value = o, hidCommentId.value = e, btnSubmit.style.display = "none", btnEdit.style.display = "block", $("#errComment").hide(), $("html,body").animate({ scrollTop: $("#txtComment").offset().top - 180 }, "slow"), document.getElementById("txtComment").focus() } function EditCorpComment(e, t, n, a) { var o = document.getElementById(t).innerHTML; editabletr = a, selEdit = n, o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = (o = o.replace("...", "").replace("READ MORE", "").replace("Read More", "")).replace(/<(?!br\s*\/?)[^>]+>/g, "")).replace("(<(/)*p>)", "<br/>")).replace("(\n)", "<br/>")).replace("((s)*<(/)*br(/)*>(s)*){2,}", "<br/><br/>")).replace("(<(/)*br(/)*>)", "\n")).replace(/<br>/g, "\n")).replace(/<BR>/g, "\n")).replace(/&nbsp;/g, " ")).replace(/&amp;/g, "&")).replace(/&lt;/g, "<")).replace(/&gt;/g, ">")).replace(/<a target.*?>/g, "")).replace(/<\/a>/g, "")).replace(/<(|\n)*?>/g, ""), corp_txtComment.value = o, hidCorpCommentId.value = e, corp_btnSubmit.style.display = "none", corp_btnEdit.style.display = "block", $("html,body").animate({ scrollTop: $("#corp_txtComment").offset().top - 180 }, "slow"), document.getElementById("corp_txtComment").focus() } function UpdateComment() { !0 == ValidateComment(txtComment.value, Rid) && (DisableButton(!0), AjaxPost(AddOnlyComment, "Rid=" + Rid + "&EditCommentId=" + hidCommentId.value + "&Comment=" + UrlEncode(txtComment.value) + "&tr=" + UrlEncode(editabletr) + "&count=" + revHidskip.value)) } function AddComment() { !0 == ValidateComment(txtComment.value, Rid) && (DisableButton(!0), !1 == Rate_Comment ? AjaxPost(AddOnlyComment, "Rid=" + Rid + "&AddComment=" + UrlEncode(txtComment.value) + "&loadhead=" + loadhead) : AjaxPost(RateNU_Comment, "Rid=" + Rid + "&RateComment=" + UrlEncode(txtComment.value) + "&catname=" + CatName + "&loadhead=" + loadhead)) } function corp_AddComment(e) { !0 == ValidateCorpComment(corp_txtComment.value) && (0 != e ? (DisableCorpButton(!0), AjaxPost(ShowCorpComments, "AddCorpComment=1&PostId=" + PostId + "&Rid=" + Rid + "&Comment=" + UrlEncode(corp_txtComment.value) + "&loadhead=" + loadhead)) : (ajaxLogin("/review/ReviewAjax.php?AddCorpComment=1&PostId=" + PostId + "&Rid=" + Rid + "&Comment=" + UrlEncode(corp_txtComment.value) + "&redirectToRR=1&revKey=" + strRid1 + "&cat_name=" + CatName + "&loadhead=1&what=1"), createCookie("fbLoginRedirection1", "/review/ReviewAjax.php?AddCorpComment=1&PostId=" + PostId + "&Rid=" + Rid + "&Comment=" + UrlEncode(corp_txtComment.value) + "&redirectToRR=1&revKey=" + strRid1 + "&cat_name=" + CatName + "&loadhead=1&what=1", 30))) } function corp_UpdateComment() { !0 == ValidateCorpComment(corp_txtComment.value) && (DisableCorpButton(!0), AjaxPost(ShowCorpComments, "UpdateCorpComment=1&CommentId=" + hidCorpCommentId.value + "&PostId=" + PostId + "&Comment=" + UrlEncode(corp_txtComment.value))) } function AddOnlyComment(e) { if (ChkLogin(e, "", ""), "login" != e) { if ("bad word(s)" == e.substring(0, 11).toLowerCase()) $("#errComment").html("<span class='icon-tool-tip'></span> &nbsp; " + e + ".").css("color", "red").show(); else { var t; "edit" == (t = FindButtonClicked()) ? (hidCommentId.value, ShowComments(e), $("#errComment").text("Comment updated successfully.").css("color", "#3c763d").show(), revCmtTotCnt.value = document.getElementById("hidCmmtCnt").value, $("html,body").animate({ scrollTop: $("#" + editabletr).offset().top - 180 }, "slow")) : (Add_Comment = !0, $("#errComment").text("Comment posted successfully.").css("color", "#3c763d").show(), ShowComments(e)), txtComment.value = "", btnSubmit.style.display = "block", btnEdit.style.display = "none", hidCommentId.value = "" } } DisableButton(!1) } function ShowMyComment(e) { e = e.replace("&lt;br/&gt;", "\r\n"), "" == editabletr && (editabletr = "tr1"), $("#" + editabletr).length > 0 ? ($("#" + editabletr).html(e), $(".uwpDiv").unwrap()) : $("#divComments").append(e); var t = $("#" + editabletr).offset().top - 135; window.scrollTo(t, t) } function RateNU_Comment(e) { if (ChkLogin(e, "", ""), "login" != e) { if ("bad word(s)" == e.substring(0, 11).toLowerCase()) $("#errComment").html("<span class='icon-tool-tip'></span> &nbsp; " + e + ".").css("color", "red").show(); else { var t, n, a; t = e.indexOf('<p><span id="ratingText"'), n = e.substring(0, t), a = e.substring(t), Add_Comment = !0, revCmtTotCnt.value = parseInt(revCmtTotCnt.value) + 1, NU(a), $("html,body").animate({ scrollTop: $("#pnlGraph").offset().top - 180 }, "slow"), divComments.innerHTML = n, divComments.style.display = "block", DisableButton(!1), $("#errComment").html(""), txtComment.value = "", hidCommentId.value = "", Rate_Comment = !1 } } DisableButton(!1) } function textCommentCounter() { txtComment && (txtComment.value.length > 2e3 ? ($("#errComment").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters").css("color", "red").show(), $("#btnSubmit").prop("disabled", !0), $("#btnEdit").prop("disabled", !0)) : ($("#errComment").html("").hide(), $("#btnSubmit").prop("disabled", !1), $("#btnEdit").prop("disabled", !1)), txtComment.value.length > 100 && $("#txtComment").css("height", "152px")) } function CountWordsrr(e) { var t = (e = e.replace(/&nbsp;/gi, "")).trim(), n = t.replace(/^[^A-Za-z0-9]+/gi, ""), a = rExp = "", o = n.replace(a, " "), r = o.split(" "), i = 0; if (r.length - 1 <= 5e3) { var s, r = o.split("\n"), l = 0; if (r.length >= 1) for (l = 0; l < r.length; l++) { s = r[l].split(" "); for (var d = 0; d < s.length; d++)"" != s[d].trim() && (i += 1) } else for (var d = 0; d < r.length; d++)"" != r[d].trim() && (i += 1) } else for (var d = 0; d < r.length; d++)"" != r[d].trim() && (i += 1); return t.length < 2 && (i = 0), i } function textResComCounter() { corp_txtComment && (corp_txtComment.value.length > 2e3 ? ($("#corp_errComment").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters").css("color", "red").show(), $("#corp_btnSubmit").prop("disabled", !0), $("#corp_btnEdit").prop("disabled", !0)) : ($("#corp_errComment").html("").hide(), $("#corp_btnSubmit").prop("disabled", !1), $("#corp_btnEdit").prop("disabled", !1)), (corp_txtComment.value.length > 25 || CountWordsrr(corp_txtComment.value) > 25) && $("#corp_txtComment").css("height", "152px")) } function ValidateComment(e, t) { if ("" == e.trim()) return $("#errComment").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").css("color", "red").show(), !1; if ("False" == canPostComntOnReview) return $("#errComment").html("<span class='icon-tool-tip'></span> &nbsp; Access Not Granted.").css("color", "red").show(), !1; if (3 > CountWords(e)) { if (txtComment.value.length <= 2e3) return $("#errComment").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters.").css("color", "red").show(), !1; if (txtComment.value.length > 2e3) return $("#errComment").html("").hide(), !0 } else if (!0 == Rate_Comment) return checkRatingCountRR(Rid) ? !!checkCommentCountRR(t) || (window.parent.$("#commentpopimg").attr("src", "../Images/comment_popup_desktop.png"), window.parent.$("#commentpopimg").attr("width", "400px"), window.parent.$(".imgPastePrevent1,#commentpopimg").css("display", "block"), window.parent.$(".black-layer").css("visibility", "visible"), window.parent.$(".black-layer").css("display", "block"), !1) : (window.parent.$("#ratepopimg").attr("src", "../Images/rate_popup_web.png"), $(".imgPastePrevent2,#ratepopimg").css("display", "block"), window.parent.$(".black-layer").css("visibility", "visible"), window.parent.$(".black-layer").css("display", "block"), !1); else if (!checkCommentCountRR(t)) return window.parent.$("#commentpopimg").attr("src", "../Images/comment_popup_desktop.png"), window.parent.$("#commentpopimg").attr("width", "400px"), window.parent.$(".imgPastePrevent1,#commentpopimg").css("display", "block"), window.parent.$(".black-layer").css("visibility", "visible"), window.parent.$(".black-layer").css("display", "block"), !1; else return !0 } function ValidateCorpComment(e) { return "block" == $("[id$=_customer]").css("display") ? ($("#corp_errComment").html('<span class="icon-tool-tip"></span> &nbsp;Please click "YES" or "NO" to justify your comments!'), $("#corp_errComment").css("display", "block"), $(".corp-box").siblings(".comment").slideDown(), !1) : "" == e.trim() ? ($("#corp_errComment").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").css("color", "red").show(), !1) : "False" == canPostComntOnResponse ? ($("#corp_errComment").html("<span class='icon-tool-tip'></span> &nbsp; Access Not Granted.").css("color", "red").show(), !1) : !(3 > CountWords(e)) || (txtComment.value.length < 2e3 ? ($("#corp_errComment").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters.").css("color", "red").show(), !1) : txtComment.value.length >= 2e3 ? ($("#corp_errComment").html("").hide(), !0) : void 0) } function ShowHideError(e, t) { 1 == e ? (diverror.style.display = "block", diverror.innerHTML = "<span>" + t + "</span>", "add" == FindButtonClicked() ? btnSubmit.focus() : btnEdit.focus()) : (diverror.style.display = "none", diverror.innerHTML = "") } function FindCorpButtonClicked() { var e; return "none" == corp_btnEdit.style.display ? "add" : "edit" } function FindButtonClicked() { var e; return "none" == btnEdit.style.display ? "add" : "edit" } function CountWords(e) { var t = (e = e.replace(/&nbsp;/gi, "")).trim(), n = t.replace(/^[^A-Za-z0-9]+/gi, ""), a = rExp = "", o = n.replace(a, " "), r = o.split(" "), i = 0; if (r.length - 1 <= 5e3) { var s, r = o.split("\n"), l = 0; if (r.length >= 1) for (l = 0; l < r.length; l++) { s = r[l].split(" "); for (var d = 0; d < s.length; d++)"" != s[d].trim() && (i += 1) } else for (var d = 0; d < r.length; d++)"" != r[d].trim() && (i += 1) } else for (var d = 0; d < r.length; d++)"" != r[d].trim() && (i += 1); return t.length < 2 && (i = 0), i } function textCounter() { txtComment.value.length > 2e3 ? (txtComment.value = txtComment.value.substring(0, 2e3), ShowHideError(1, "Minimum 3 words and Maximum 2000 characters")) : (diverror.style.display = "none", diverror.innerHTML = ""), txtComment.value.length > 65 && $(".comment-box").css("height", "152px") } function ShowGraph(e) { "Corporate Cannot Rate Reviews." == e ? $("#ratingText").text(e).css("color", "red") : document.getElementById("divRatingR").innerHTML = e } function Rating(e) { if (loadhead = document.getElementById("hidpgload").value, "btnAjxVU" == e) { if (!checkRatingCountRR(Rid)) return window.parent.$("#ratepopimg").attr("src", "../Images/rate_popup_web.png"), window.parent.$("#ratepopimg").attr("width", "400px"), $(".imgPastePrevent2,#ratepopimg").css("display", "block"), window.parent.$(".black-layer").css("visibility", "visible"), window.parent.$(".black-layer").css("display", "block"), !1; Ajaxres(VU, "rid=" + Rid + "&rating=4&catname=&loadhead=" + loadhead) } else if ("btnAjxU" == e) { if (!checkRatingCountRR(Rid)) return window.parent.$("#ratepopimg").attr("src", "../Images/rate_popup_web.png"), window.parent.$("#ratepopimg").attr("width", "400px"), $(".imgPastePrevent2,#ratepopimg").css("display", "block"), window.parent.$(".black-layer").css("visibility", "visible"), window.parent.$(".black-layer").css("display", "block"), !1; Ajaxres(U, "rid=" + Rid + "&rating=2&catname=&loadhead=" + loadhead) } else if ("btnAjxNU" == e) { if (!checkRatingCountRR(Rid)) return window.parent.$("#ratepopimg").attr("src", "../Images/rate_popup_web.png"), window.parent.$("#ratepopimg").attr("width", "400px"), $(".imgPastePrevent2,#ratepopimg").css("display", "block"), window.parent.$(".black-layer").css("visibility", "visible"), window.parent.$(".black-layer").css("display", "block"), !1; Ajaxres(NU, "rid=" + Rid + "&rating=-4&catname=&loadhead=" + loadhead) } } function checkCommentCountRR(e) { var t, n = !1; return t = CatId, $.ajax({ url: "/review/CorporateResponse.ashx", contentType: "application/json; charset=utf-8", dataType: "text", async: !1, data: { type: "commentcount", corp: !1, cat_id: t, login_id: loginid, reviewid: e, corp_name: corporateName, corp_product: iscorp }, responseType: "text/html", success: function (e) { "success" == e && (n = !0) } }), n } function checkRatingCountRR(e) { var t, n = !1; return t = CatId, $.ajax({ url: "/review/CorporateResponse.ashx", contentType: "application/json; charset=utf-8", dataType: "text", async: !1, data: { type: "ratecount", corp: !1, cat_id: t, login_id: loginid, reviewid: e, corp_name: corporateName, corp_product: iscorp }, responseType: "text/html", success: function (e) { "success" == e && (n = !0) } }), n } function writeExpressRev() { AjaxPostRev(expressfunc, "cid=" + cidOfuserreview, "", "") } function expressfunc(e, t, n) { ChkLogin_Ratereview(e, "-ratereview"), "login" != e && redirecttowrite() } function ChkLogin_Ratereview(e, t) { "login" == e && ajaxLogin(urlredirect = window.location.href) } function RatingAll(e, t, n) { MM_showHideLayers("rating", "", "hide"), "very useful" == e.value.toLowerCase() ? AjaxPostRev(VU_All, "rid=" + t + "&rating=4&catname=" + CatName + "&loadhead=" + loadhead, n, t) : "useful" == e.value.toLowerCase() ? AjaxPostRev(U_All, "rid=" + t + "&rating=2&catname=" + CatName + "&loadhead=" + loadhead, n, t) : "not useful" == e.value.toLowerCase() && AjaxPostRev(NU_All, "rid=" + t + "&rating=-4&catname=" + CatName + "&loadhead=" + loadhead, n, t) } function VU_All(e, t, n) { ChkLogin_Rate(e, "", n), "login" != e && (window.location.href = escape("/review/" + CatName + "-review-" + n)) } function U_All(e, t, n) { ChkLogin_Rate(e, "", n), "login" != e && (window.location.href = escape("/review/" + CatName + "-review-" + n)) } function NU_All(e, t, n) { ChkLogin_Rate(e, "", n), "login" != e && (window.location.href = escape("/review/" + CatName + "-review-" + n)) } function RatingMsg_All(e, t, n) { document.getElementById("dvpopLayer").innerHTML = "", document.getElementById("popuplayer1").style.display = "block", document.getElementById("dvRating").setAttribute("style", "display:block;width:125;"), document.getElementById("dvRating").className = "confirmationbox", document.getElementById("pptitle").innerHTML = "Review Rating", "Corporate" == e ? document.getElementById("dvRating").innerHTML = "Corporate users cannot rate a review" : (document.getElementById("dvRating").innerHTML = "<span>You found this review <span class='review-rating-breakup'>" + e + "</span>. Thank you for your rating</span>", showcentre("popuplayer1"), "Not Useful" == e && (chkradioNU.checked = !0)), closepptimeout("popuplayer1", 2e3), AjaxPost_All(update_lblrating_all, "lblrating=1&rid=" + n, t) } function AjaxPost_All(e, t, n) { var a = new CreateRequest; a.ajaxObject.onreadystatechange = function () { 4 == a.ajaxObject.readyState && e(a.ajaxObject.responseText, n) }, a.ajaxObject.open("POST", "/product/restaurant_ajax.aspx", !0), a.ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), a.ajaxObject.setRequestHeader("Content-length", t.length), a.ajaxObject.setRequestHeader("Connection", "close"), a.ajaxObject.send(t) } function update_lblrating_all(e, t) { var n = e.split("|"); document.getElementById(t).innerHTML = n[0], document.getElementById(t).setAttribute("class", n[1]) } function VU(e) { ChkLogin(e, ""), "login" != e && ("You cannot rate your own review" == e ? $("#ratingText").text(e).css("color", "red") : "Corporate Cannot Rate Reviews." == e ? $("#ratingText").text(e).css("color", "red") : ($("#divRatingR").html(e), $("#errComment").html("").hide(), Rate_Comment = !1, $("#snackbarLike").show().text("You found this review Very Useful").delay(2e3).fadeOut())) } function U(e) { ChkLogin(e, ""), "login" != e && ("You cannot rate your own review" == e ? $("#ratingText").text(e).css("color", "red") : "Corporate Cannot Rate Reviews." == e ? $("#ratingText").text(e).css("color", "red") : ($("#divRatingR").html(e), $("#errComment").html("").hide(), Rate_Comment = !1, $("#snackbarLike").show().text("You found this review Useful").delay(2e3).fadeOut())) } function NU(e) { ChkLogin(e, ""), "login" != e && ("You cannot rate your own review" == e ? $("#ratingText").text(e).css("color", "red") : "write comment" == e ? ($("#errComment").html("<span class='icon-tool-tip'></span> &nbsp; Please fill in a comment to justify your rating for this review.").css("color", "red").show(), $("html,body").animate({ scrollTop: $("#errComment").offset().top - 180 }, "slow"), document.getElementById("errComment").focus(), Rate_Comment = !0, FocusOnComments = !0) : "Corporate Cannot Rate Reviews." == e ? $("#ratingText").text(e).css("color", "red") : ($("#ratingText").text('You found this review <span class="review-rating-breakup">Not Useful</span>').css("color", "#3c763d"), $("#divRatingR").html(e), $("#errComment").html("").hide(), $("#snackbarLike").show().text("You found this review Not Useful").delay(2e3).fadeOut())) } function RatingCount() { "none" == ratingbox.style.display && (lblTotRated.innerHTML = 1 * lblTotRated.innerHTML + 1, lblTotRated.innerHTML > 1 ? lblRatedMem.innerHTML = "members" : lblRatedMem.innerHTML = "member") } function RatingMsg(e) { document.getElementById("dvpopLayer").innerHTML = "", document.getElementById("popuplayer1").style.display = "block", document.getElementById("dvRating").setAttribute("style", "display:block;width:325;"), document.getElementById("dvRating").className = "confirmationbox", document.getElementById("pptitle").innerHTML = "Review Rating", "Corporate" == e ? document.getElementById("dvRating").innerHTML = "Corporate users cannot rate a review" : (document.getElementById("dvRating").innerHTML = "<span>You found this review <span class='review-rating-breakup'>" + e + "</span>. Thank you for your rating</span>", showcentre("popuplayer1"), "Not Useful" == e && (chkradioNU.checked = !0)), closepptimeout("popuplayer1", 2e3), ratingbox && (ratingbox.style.display = "none") } function DisableButton(e) { !0 == e ? (btnSubmit.disabled = !0, btnEdit.disabled = !0) : (btnSubmit.disabled = !1, btnEdit.disabled = !1) } function DisableCorpButton(e) { !0 == e ? (corp_btnSubmit.disabled = !0, corp_btnEdit.disabled = !0) : (corp_btnSubmit.disabled = !1, corp_btnEdit.disabled = !1) } function UrlEncode(e) { return e = encodeURIComponent(e = e.replace(/\+/g, "%2b")) } function Bookmark(e) { ChkLogin(e, "-bookmark-1"), "reload" == e ? window.location.reload() : "success" == e && (linkBookmark.style.display = "none", alreadyBookmark.style.display = "block") } function AjaxDelImg(e, t) { if (!confirm("Do you really want to delete this photo?")) return !1; var n = document.getElementById("RevImg"), a = n.src; n.src = n.getAttribute("nextimg"), n.setAttribute("nextimg", a); var o = new CreateRequest; o.ajaxObject.onreadystatechange = function () { 4 == o.ajaxObject.readyState && e(imgno) }, o.ajaxObject.open("GET", "/review/delete_review_Photo.aspx?cidimg=" + t + "&imgno=" + imgno + "&rndIe=" + ReturnRndIe(), !0), o.ajaxObject.send(null) } function deleteimg(e) { if ("2" == imgcount) document.getElementById("spannextlink").style.display = "none", imgcount = "1", 1 == imgno ? (imgno = 1, arrImg_user[0] = arrImg_user[1]) : (imgno = 1, arrImg_user[1] = arrImg_user[0]); else { var t = document.getElementById("divimage"); t.style.height = "0", t.style.width = "0", t.style.display = "none", imgcount = "0" } } function ShowNUComments(e) { revCmtTotCnt.value = e, document.getElementById("divCmtInc").style.display = "none", document.getElementById("spanCommCnt").innerHTML = "Showing 1 - " + parseInt($("#tblcomments").find("tr td:nth-child(2)").length) + " of " + parseInt(revCmtTotCnt.value) + " Comments", document.getElementById("divCommentCount").innerHTML = "<strong>Comments on this review (" + parseInt(revCmtTotCnt.value) + ")</strong>" } function AjaxPost_new(e, t, n) { var a = new CreateRequest; a.ajaxObject.onreadystatechange = function () { 4 == a.ajaxObject.readyState && e(a.ajaxObject.responseText, n) }, a.ajaxObject.open("POST", "/review/reviewajax.php", !0), a.ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), a.ajaxObject.setRequestHeader("Content-length", t.length), a.ajaxObject.setRequestHeader("Connection", "close"), a.ajaxObject.send(t) } function ShowratingMsg(e, t) { "corporate" == e ? RatingMsg("Corporate") : 5 == t ? RatingMsg("Very Useful") : 4 == t ? RatingMsg("Useful") : 2 == t && RatingMsg("Somewhat Useful") } function searchHitRar(e) { "" == document.getElementById("txtrrTabSearch").value || "Search Product, Reviews and Ratings" == document.getElementById("txtrrTabSearch").value || $(".sb_dropdown").hide(); var t = ""; if (13 == (t = "Microsoft Internet Explorer" == navigator.appName ? window.event.keyCode : navigator.userAgent.toLowerCase().indexOf("chrome") > -1 ? window.event.which : e.keyCode ? e.keyCode : e.charCode) || 26 == t) return !1 } $(document).ready(function () { try { btnSubmit = document.getElementById("btnSubmit"), divComments = document.getElementById("divComments"), divCorpComments = document.getElementById("corp_divComments"), linkpostcomment = document.getElementById("linkpostcomment"), btnEdit = document.getElementById("btnEdit"), txtComment = document.getElementById("txtComment"), corp_txtComment = document.getElementById("corp_txtComment"), loadhead = document.getElementById("hidpgload").value, hidCommentId = document.getElementById("hidCommentId"), corp_btnSubmit = document.getElementById("corp_btnSubmit"), corp_btnEdit = document.getElementById("corp_btnEdit") } catch (e) { } }), $(function () { function e(e) { var n; t("currLatLong", currLatLong = (geo_loc = (n = e, html5Lat = n.coords.latitude, html5Lon = n.coords.longitude, html5Lat.toFixed(8) + ", " + html5Lon.toFixed(8))).split(",")) } function t(e, t) { var n = new Date; n.setTime(n.getTime() + 31536e6); var a = "expires=" + n.toUTCString(); document.cookie = e + "=" + t + "; " + a + "; path=/" } function n(e) { for (var t = e + "=", n = decodeURIComponent(document.cookie).split(";"), a = 0; a < n.length; a++) { for (var o = n[a]; " " == o.charAt(0);)o = o.substring(1); if (0 == o.indexOf(t)) return o.substring(t.length, o.length) } return "" } $(document).ready(function () { currLatLong = 0; var e = n("currLatLong"); "" == e || "0" == e ? function e() { currLatLong = 0; try { $.get("https://ipapi.co/json", function (e) { if (null != e && "" != e) try { html5Lat = e.latitude, html5Lon = e.longitude, currLatLong = (currLatLong = html5Lat.toFixed(8) + ", " + html5Lon.toFixed(8)).split(","), t("currLatLong", currLatLong) } catch (n) { t("currLatLong", currLatLong) } }, "json") } catch (n) { currLatLong = 0 } }() : currLatLong = e }), $("#txtrrTabSearch").autocomplete({ source: function (e, t) { var n, a, o, r, i, s, l = 0, d = e.term; d = stripHTML(d), e.term = d, "" == d.replace(/[^\w\s]/gi, "") && (l = 1), srctype = srctype1, txtId = "txtrrTabSearch", "Search Product, Reviews and Ratings" == d && (d = ""); var c = "{contextKey:'" + (n = srchcat) + "|0||',count:10,prefixText:'" + d + "',type:'" + srctype1 + "'}"; if (d.trim().length >= 2 && 0 == l) { if (prevparameters == c && (dupreq = !0), prevparameters = c, !0 == dupreq && void 0 != prevmsgd) { var a = prevmsgd; msgdlength = a.length, t($.map(a, function (e) { if (null != e) { var t, n = e.split("|"); return 0 == n[1] ? { label: '<b style="padding-left: 7px;">' + n[0].replace("repme", stripHTML($("#txtrrTabSearch").val())) + "</b>  ", value: n[1], catid: n[1], parent2: n[6] } : 111111 == n[1] ? { label: '<span ><span style="color: #6d6d6d;">' + n[0] + "</span>", value: 111111, catid: n[1], parent2: n[6], url: n[9] } : (t = '<span ><span style="color: #6d6d6d;">' + n[0] + "</span>" + n[10] + n[3], n[2] > 0 && (t = t + ' <span  style="font-size:11px;color:#44a512;">(' + n[2] + " Variants)</span>"), t += "</span>", t += '<div class="clear"></div>', { label: t = t + ' <span style="font-size:11px;color:#44a512;">' + n[5] + "</span>", value: n[0] + "-" + n[1], catid: n[1], parent2: n[6], level1: n[7], ptype: n[8], valueUrl: n[9], isCorp: n[10] }) } })), dupreq = !1 } else xhr1 && 4 != xhr1.readyState && xhr1.abort(), xhr1 = $.ajax({ type: "GET", url: "/web/search.asmx/GetAutoCompleteProductSearch", data: { contextKey: "'" + n + "|0||'", strProductSrh: "'" + d.replace("'", "\\'") + "'", currLatLong: "'" + currLatLong + "'", isPreWrite: "0" }, contentType: "application/json; charset=utf-8", dataType: "json", success: function (e) { if ($("#txtrrTabSearch").val() == d) { var n, a; prevmsg = e, msgdlength = (n = e.d ? e.d : e).length, prevmsgd = n, t($.map(n, function (e) { if (null != e) { var t = e.split("|"); return 0 == t[1] ? (1 == n.length && insertSearch(document.getElementById("txtrrTabSearch").value, "No Action", btoa(window.location.href), ""), { label: '<b style="padding-left: 7px;">' + t[0].replace("repme", stripHTML($("#txtrrTabSearch").val())) + "</b>  ", value: t[1], catid: t[1], parent2: t[6] }) : 111111 == t[1] ? { label: '<span ><span style="color: #6d6d6d;">' + t[0] + "</span>", value: 111111, catid: t[1], parent2: t[6], url: t[9] } : (a = '<span><span style="color: #6d6d6d;">' + t[0] + "</span>" + t[10] + t[3], t[2] > 0 && (a = a + ' <span  style="font-size:11px;color:#44a512;">(' + t[2] + " Variants)</span>"), a += "</span>", a += '<div class="clear"></div>', { label: a = a + ' <span style="font-size:11px;color:#44a512;">' + t[5] + "</span>", value: t[0] + "-" + t[1], catid: t[1], parent2: t[6], level1: t[7], ptype: t[8], valueUrl: t[9], isCorp: t[10] }) } })), srctype = srctype1 } }, error: function (e) { } }) } else prevparameters == c && (dupreq = !0), prevparameters = c, !0 == dupreq && void 0 != prevmsgd ? (msgdlength = (a = prevmsgd).length, t($.map(a, function (e) { if (null != e) return 0 == (r = e.split("|"))[1] ? ("" != r[2] && "" == r[3] ? (i = r[2].split("~"))[1] ? (o = '<span ><span class="search-span-headAnchor" style="color: #6d6d6d;"><b>' + i[0] + "</b></span></span>", s = i[1]) : (o = '<span ><span class="search-span-head" style="color: #6d6d6d;"><b>' + i[0] + "</b></span></span>", s = "") : o = '<span ><span style="color: #6d6d6d;">' + r[2] + "</span></span>", { label: o, value: "Redirecting", catid: r[1], parent2: r[6], innValueUrl: s, valueUrl: r[3] }) : (o = '<span ><span style="color: #6d6d6d;">' + r[0] + "</span>" + r[12], r[4] > 0 && (o = o + ' <span  style="font-size:11px;color:#44a512;padding-top: 3px;">(' + r[4] + " Variants)</span>"), o += "</span>", o += '<div class="clear"></div>', { label: o = o + ' <span style="font-size:11px;color:#44a512;padding-top: 3px;">' + r[7] + "</span>", value: r[0] + "-" + r[1], catid: r[1], parent2: r[6], level1: r[8], ptype: r[9], valueUrl: r[11], isCorp: r[12] }) })), $(".search-span-head").parent().parent().css({ background: "rgba(204,204,204,0.3)", cursor: "default" }), $(".search-span-headAnchor").parent().parent().css({ background: "rgba(204,204,204,0.3)" }), dupreq = !1) : (xhr1 && 4 != xhr1.readyState && xhr1.abort(), xhr1 = $.ajax({ type: "GET", url: "/web/search.asmx/GetAutoCompleteProductSearchFixed", contentType: "application/json; charset=utf-8", dataType: "json", success: function (e) { var n, a, o, r, i; prevmsg = e, msgdlength = (n = e.d ? e.d : e).length, prevmsgd = n, t($.map(n, function (e) { if (null != e) return 0 == (o = e.split("|"))[1] ? ("" != o[2] && "" == o[3] ? (r = o[2].split("~"))[1] ? (a = '<span ><span class="search-span-headAnchor" style="color: #6d6d6d;"><b>' + r[0] + "</b></span></span>", i = r[1]) : (a = '<span ><span class="search-span-head" style="color: #6d6d6d;"><b>' + r[0] + "</b></span></span>", i = "") : a = '<span ><span style="color: #6d6d6d;">' + o[2] + "</span></span>", { label: a, value: "Redirecting", catid: o[1], innValueUrl: i, parent2: o[6], valueUrl: o[3] }) : (a = '<span ><span style="color: #6d6d6d;">' + o[0] + "</span>" + o[12], o[4] > 0 && (a = a + ' <span  style="font-size:11px;color:#44a512;padding-top: 3px;">(' + o[4] + " Variants)</span>"), a += "</span>", a += '<div class="clear"></div>', { label: a = a + ' <span style="font-size:11px;color:#44a512;padding-top: 3px;">' + o[7] + "</span>", value: o[0] + "-" + o[1], catid: o[1], parent2: o[6], level1: o[8], ptype: o[9], valueUrl: o[11], isCorp: o[12] }) })), srctype = srctype1, $(".search-span-head").parent().parent().css({ background: "rgba(204,204,204,0.3)", cursor: "default" }), $(".search-span-headAnchor").parent().parent().css({ background: "rgba(204,204,204,0.3)" }) }, error: function (e) { } })) }, minLength: 0, selectFirst: !0, select: function (e, a) { if ("0" != a.item.parent2 && void 0 != a.item.parent2) { let o = n("srchparent2"); t("srchparent2", o = "" == o || "0" == o ? a.item.parent2 : o + "," + a.item.parent2) } if ("0" != a.item.catid && "11111111" != a.item.catid && "111111" != a.item.catid && "Redirecting" != a.item.catid && void 0 != a.item.catid) { let r = n("srchcatid"); t("srchcatid", r = "" == r || "0" == r ? a.item.catid : r + "," + a.item.catid) } var i = ""; if ($("#ui_element").find(".sb_dropdown").hide(), 0 == a.item.value) { var s = document.getElementById("CategorySP"), l = ""; null != s && (l = "&amp;p=" + s.options[s.selectedIndex].value), i = mshost + "search/prodsrch.aspx?data=" + encodeURIComponent(this.value.toLowerCase()).replace(/%20/g, "+") + decodeURIComponent("%26type=%26p=") + srchcat, msgdlength > 1 ? window.location.href = i : window.location = i, insertSearch(document.getElementById("txtrrTabSearch").value, "Clicked on see more", btoa(window.location.href), btoa(i)) } else if (111111 == a.item.value) window.location.href = a.item.url; else if ("Redirecting" == a.item.value) { var d = a.item.valueUrl, c = a.item.innValueUrl; d ? window.location.href = d : c ? window.location.href = c : a.item.value = "" } else { a.item.value; var d = a.item.valueUrl; a.item.level1, a.item.parent2, a.item.ptype, i = d, "11111111" == a.item.catid ? insertSearch(document.getElementById("txtrrTabSearch").value, "Clicked on Category link", btoa(window.location.href), btoa(i)) : insertSearch(document.getElementById("txtrrTabSearch").value, "Clicked on product link", btoa(window.location.href), btoa(i)), window.location.href = i, document.getElementById("txtrrTabSearch").value = "" } } }), $("#txtrrTabSearch").click(function () { $(this).autocomplete("search") }) });;
var divMoreReviews,
    linkMoreProdRev,
    linkMoreMemRev,
    linkEditorsPick,
    MoreMemRevUrl,
    MoreProdRevUrl,
    OverallRatUrl,
    TrustRatUrl,
    tabMoreProdRev,
    tabMoreMemRev,
    tabEditorsPick,
    divComments,
    divCorpComments,
    spancomcount,
    diverror,
    txtComment,
    btnSubmit,
    btnEdit,
    hidCommentId,
    loadhead,
    divTotcnt,
    hidviewmore,
    corp_btnEdit,
    corp_btnSubmit,
    Height1,
    Height2,
    width1,
    width2,
    selEdit,
    urlredirect,
    indesof,
    urlredirectTo,
    editabletr,
    canPostComntonResponse1,
    Rate_Comment = !1,
    FocusOnComments = !1,
    Add_Comment = !1,
    FocusOnAddComments = !1,
    firstvisit = 1;
try {
    canPostComntonResponse1 = canPostComntOnResponse;
} catch (e) { }
function textCommentCounterrr(e, t, n, a, r) {
    3 > CountWordsrr($("#" + a).val())
        ? ($("#" + a).val().length > 50 &&
            ($(".comment-box").css("height", "152px"),
                "corp" == r
                    ? ($("#" + e)
                        .html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters")
                        .css("color", "red")
                        .show(),
                        $("#" + a).css("height", "152px"))
                    : $("#" + e)
                        .html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters")
                        .css("color", "red")
                        .show()),
            $("#" + t).prop("disabled", !0),
            $("#" + n).prop("disabled", !0))
        : ($("#" + a).val().length > 2e3
            ? ("corp" == r
                ? ($("#" + e)
                    .html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters")
                    .css("color", "red")
                    .show(),
                    $("#" + a).css("height", "152px"))
                : $("#" + e)
                    .html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters")
                    .css("color", "red")
                    .show(),
                $("#" + t).prop("disabled", !0),
                $("#" + n).prop("disabled", !0))
            : ($("#" + e)
                .html("")
                .hide(),
                $("#" + t).prop("disabled", !1),
                $("#" + n).prop("disabled", !1)),
            $("#" + a).val().length > 100 && $("#" + a).css("height", "152px"));
}
function ChkLoginComment(e, t, n) {
    "login" == e &&
        ("undefined" == typeof pgurl ? (pgurl = uri) : pgurl.includes("sort") ? pgurl : (pgurl = mainurl),
            (indesof = (urlredirect = encodeURI(pgurl) + encodeURI(t) + (void 0 == n ? "" : n)).indexOf("/review/")),
            ajaxLogin((urlredirectTo = urlredirect.substr(urlredirect))));
}
function Ajaxrr(e, t, n, a, r, s, o) {
    var l = new CreateRequest();
    (l.ajaxObject.onreadystatechange = function () {
        4 == l.ajaxObject.readyState && e(l.ajaxObject.responseText, n, a, r, s, o);
    }),
        l.ajaxObject.open("GET", "/review/reviewajax.php?" + t, !0),
        l.ajaxObject.send(null);
}
function AjaxByHashrr(e, t, n, a, r, s, o, l) {
    var c = new CreateRequest();
    (c.ajaxObject.onreadystatechange = function () {
        4 == c.ajaxObject.readyState &&
            ("no records" == c.ajaxObject.responseText &&
                ($("#" + n)
                    .parent()
                    .find("h5")
                    .hide(),
                    $("#" + n)
                        .parent()
                        .find(".text-center")
                        .hide()),
                e(c.ajaxObject.responseText, n, a, r, s, o, l));
    }),
        c.ajaxObject.open("GET", "/review/reviewajax.php?" + t, !1),
        c.ajaxObject.send(null);
}
function AjaxByHashCorprr(e, t, n, a, r, s, o) {
    var l = new CreateRequest();
    (l.ajaxObject.onreadystatechange = function () {
        4 == l.ajaxObject.readyState && e(l.ajaxObject.responseText, n, a, r, s, o);
    }),
        l.ajaxObject.open("GET", "/review/reviewajax.php?" + t, !1),
        l.ajaxObject.send(null);
}
function AjaxresAllrr(e, t, n, a, r, s, o, l, c, d, p, m, h, u, g) {
    var v = new CreateRequest();
    (v.ajaxObject.onreadystatechange = function () {
        4 == v.ajaxObject.readyState && e(v.ajaxObject.responseText, n, a, r, s, o, l, c, d, p, m, h, u, g);
    }),
        v.ajaxObject.open("GET", "/review/reviewratingrestaurant.aspx?" + t, !0),
        v.ajaxObject.send(null);
}
function AjaxPostrr(e, t, n, a, r, s, o, l, c, d, p, m, h) {
    var u = new CreateRequest();
    (u.ajaxObject.onreadystatechange = function () {
        4 == u.ajaxObject.readyState && (t.includes("AddCorpComment=1") && $("#ltCommentCount").text(parseInt($("#ltCommentCount").text()) + 1), e(u.ajaxObject.responseText, n, a, r, s, o, l, c, d, p, m));
    }),
        u.ajaxObject.open("POST", "/review/reviewajax.php", !0),
        u.ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded"),
        u.ajaxObject.setRequestHeader("Content-length", t.length),
        u.ajaxObject.setRequestHeader("Connection", "close"),
        u.ajaxObject.send(t);
}
function ChkLoginrr(e, t, n) {
    "login" == e &&
        ("undefined" == typeof pgurl ? (pgurl = uri) : pgurl.includes("sort") ? pgurl : (pgurl = mainurl),
            (indesof = (urlredirect = encodeURI(pgurl) + encodeURI(t) + (void 0 == n ? "" : n)).indexOf("/review/")),
            ajaxLogin((urlredirectTo = urlredirect.substr(urlredirect))));
}
function ChkLogin_Raterr(e, t, n, a) {
    return "0" == e
        ? ((indesof = (urlredirect = "/signup/login/login_now.php?add=" + encodeURI("/review/" + CatName + "-review-" + n) + encodeURI(t) + (void 0 == a ? "" : a)).indexOf("/review/")),
            ajaxLogin((urlredirectTo = urlredirect.substr(indesof))),
            "false")
        : "true";
}
function OverallRatingrr(e, t, n, a) {
    ShowGraph1(e, t, n, a);
}
function ajaxTooltip() {
    $(".tooltip").on({
        mouseenter: function () {
            for (var e = $(this).find(".tooltip-content"), t = $(this).attr("class").split(" "), n = 0; n < t.length; n++) {
                switch (t[n]) {
                    case "left":
                        e.css({ "margin-left": -($(e).width() + 15) + "px", "margin-top": -$(this).height() + "px" });
                        break;
                    case "right":
                        e.css({ "margin-left": $(this).width() + 5 + "px", "margin-top": -$(this).height() + "px" });
                        break;
                    case "top":
                        e.css("margin-top", -($(this).height() + $(e).height() + 5) + "px");
                }
                $(this).find(".tooltip-content").css("display", "block");
            }
        },
        mouseleave: function () {
            $(".tooltip-content").hide();
        },
    });
}
function ajaxTooltip1(e) {
    $("#iconLI" + e + " .tooltip").on({
        mouseenter: function () {
            for (var e = $(this).find(".tooltip-content"), t = $(this).attr("class").split(" "), n = 0; n < t.length; n++) {
                switch (t[n]) {
                    case "left":
                        e.css({ "margin-left": -($(e).width() + 15) + "px", "margin-top": -$(this).height() + "px" });
                        break;
                    case "right":
                        e.css({ "margin-left": $(this).width() + 5 + "px", "margin-top": -$(this).height() + "px" });
                        break;
                    case "top":
                        e.css("margin-top", -($(this).height() + $(e).height() + 5) + "px");
                }
                $(this).find(".tooltip-content").css("display", "block");
            }
        },
        mouseleave: function () {
            $("#iconLI" + e + " .tooltip-content").hide();
        },
    });
}
function MoreMemberReviews(e) {
    "no records" == e ? (divMoreReviews.innerHTML = "<span class='font'>No records found.</span>") : (divMoreReviews.innerHTML = e),
        (tabMoreMemRev.className = "tabs_blue"),
        (tabEditorsPick.className = "tabs_grey"),
        linkMoreMemRev.removeAttribute("href"),
        linkEditorsPick.setAttribute("href", "javascript:Ajax(EditorsPick,'EditorsPick=1&Random=" + Math.random() + "')");
}
function EditorsPick(e) {
    "no records" == e ? (divMoreReviews.innerHTML = "<span class='font'>No records found.</span>") : (divMoreReviews.innerHTML = e),
        (tabMoreMemRev.className = "tabs_grey"),
        (tabEditorsPick.className = "tabs_blue"),
        linkEditorsPick.removeAttribute("href"),
        linkMoreMemRev.setAttribute("href", "javascript:Ajax(MoreMemberReviews,'" + MoreMemRevUrl + Math.random() + "')");
}
function ShowCommentsRatingrr(e, t, n, a, r, s, o) {
    if (((divComments = document.getElementById(t)), "no records" != e)) {
        (e = e.replace("&lt;br/&gt;", "\r\n")), (Rate_Comment = s), $(divComments).find("#hidCmmtCnt").remove(), (divComments.innerHTML = e), $(divComments).parent().slideDown();
        var l = $("#" + a).val();
        if ("show" == o) $("#" + n).hide();
        else if (submitclick && parseInt(l) > 3)
            $("#" + n)
                .html("View " + (parseInt(l) - 3) + " more comment")
                .show(),
                $("#" + n)
                    .parent()
                    .show(),
                (submitclick = !1),
                $("#" + r).val(13);
        else if ($("#" + r).val() - 10 < parseInt(l)) {
            $("#" + n).show();
            var c = parseInt(l) - ($("#" + r).val() - 10);
            c > 1
                ? ($("#" + n)
                    .html("View " + c + " more comments")
                    .show(),
                    $("#" + t)
                        .parent()
                        .find(".text-center")
                        .show())
                : 1 == c
                    ? ($("#" + n)
                        .html("View " + c + " more comment")
                        .show(),
                        $("#" + t)
                            .parent()
                            .find(".text-center")
                            .show())
                    : $("#" + n).hide();
        } else $("#" + n).hide();
        !0 == FocusOnComments && (window.location.hash = "#comments"), (divComments.style.display = "block");
    } else "no records" == e && $(divComments).parent().is(":visible") ? $(divComments).parent().slideUp() : $(divComments).parent().slideDown(), (divComments.style.display = "none"), $("#" + n).hide();
}
function ShowCorpCommentsrr(e, t, n, a, r, s) {
    if ("no records" != e) {
        if (((e = e.replace("&lt;br/&gt;", "\r\n")), "edit" == (buttonclicked = FindButtonClickedrr(s)))) var o = $(editabletr).offset().top;
        $("#" + t).html(e),
            "edit" == buttonclicked
                ? ($("html,body").animate({ scrollTop: parseInt(o) - 180 }, "slow"),
                    $("#" + a)
                        .text("Comment updated successfully.")
                        .css("color", "#3c763d")
                        .show())
                : $("#" + a).html(""),
            $("#" + n).val(""),
            $("#" + r).show(),
            $("#" + s).hide(),
            DisableButtonrr(!1, r, s);
    } else $("#" + t).hide();
}
function ShowMoreCommentsrr(e, t, n, a, r, s) {
    var o = $("#" + a).val();
    if (((divComments = document.getElementById(t)), "no records" != e)) {
        var l = parseInt(s);
        if (o > l) {
            var c = parseInt(o) - parseInt(s);
            c > 1 ? $("#" + n).html("View " + c + " more comments") : $("#" + n).html("View " + c + " more comment");
        } else $("#" + n).hide();
        (l = parseInt(s) + 10),
            $("#" + r).val(l),
            (divComments.innerHTML = e),
            (o.value = document.getElementById("hidCmmtCnt").value),
            !0 == FocusOnComments && (window.location.hash = "#comments"),
            !0 == FocusOnAddComments && "" != document.getElementById("hidAddCommentId").value && ViewmoreFocus(),
            (divComments.style.display = "block");
    }
}
function EditCommentrr(e, t, n, a, r) {
    var s = $(e).parent().siblings(0).html();
    (editabletr = $(e).closest(".corp-response")),
        (selEdit = a),
        (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = s.replace("...", "").replace("READ MORE", "").replace("Read More", "")).replace(/<(?!br\s*\/?)[^>]+>/g, "")).replace("(<(/)*p>)", "<br/>")).replace(
            "(\n)",
            "<br/>"
        )).replace("((s)*<(/)*br(/)*>(s)*){2,}", "<br/><br/>")).replace("(<(/)*br(/)*>)", "\n")).replace(/<br>/g, "\n")).replace(/<BR>/g, "\n")).replace(/&nbsp;/g, " ")).replace(/&amp;/g, "&")).replace(/&lt;/g, "<")).replace(
            /&gt;/g,
            ">"
        )).replace(/<a target.*?>/g, "")).replace(/<\/a>/g, "")).replace(/<(|\n)*?>/g, "")).trim()),
        (hidCommentId.value = t),
        $(e).closest(".divcomment").siblings(0).find(".comment-box").val(s),
        $(e).closest(".divcomment").siblings(0).find(".pull-right").children(".addcomment").hide(),
        $(e).closest(".divcomment").siblings(0).find(".pull-right").children(".updatecomment").show(),
        $("html,body").animate({ scrollTop: $(e).closest(".divcomment").siblings(0).find(".comment-box").offset().top - 180 }, "slow"),
        $(e).closest(".divcomment").siblings(0).find(".comment-box").focus();
}
function EditCorpCommentrr(e, t, n, a, r) {
    var s = $(e).parent().siblings(0).html();
    (editabletr = $(e).closest(".corp-response")),
        (selEdit = a),
        (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = (s = s.replace("...", "").replace("READ MORE", "").replace("Read More", "")).replace(/<(?!br\s*\/?)[^>]+>/g, "")).replace("(<(/)*p>)", "<br/>")).replace(
            "(\n)",
            "<br/>"
        )).replace("((s)*<(/)*br(/)*>(s)*){2,}", "<br/><br/>")).replace("(<(/)*br(/)*>)", "\n")).replace(/<br>/g, "\n")).replace(/<BR>/g, "\n")).replace(/&nbsp;/g, " ")).replace(/&amp;/g, "&")).replace(/&lt;/g, "<")).replace(
            /&gt;/g,
            ">"
        )).replace(/<a target.*?>/g, "")).replace(/<\/a>/g, "")).replace(/<(|\n)*?>/g, "")),
        $(e).closest(".divcorpcomment").siblings(1).find("textarea").val(s),
        (hidCorpCommentId.value = t),
        $(e).closest(".divcorpcomment").siblings(1).find(".pull-right").children(".addcorpcomment").hide(),
        $(e).closest(".divcorpcomment").siblings(1).find(".pull-right").children(".updatecorpcomment").show(),
        $("html,body").animate({ scrollTop: $(e).closest(".divcorpcomment").siblings(1).find("textarea").offset().top - 180 }, "slow"),
        $(e).closest(".divcorpcomment").siblings(1).find("textarea").focus();
}
function AjaxPostcorprr(e, t, n, a, r, s, o) {
    var l = new CreateRequest();
    (l.ajaxObject.onreadystatechange = function () {
        4 == l.ajaxObject.readyState &&
            (e(l.ajaxObject.responseText, n, a, r, s, o),
                t.includes("AddCorpComment=1") &&
                ($("#" + n)
                    .parent()
                    .siblings(1)
                    .find(".pull-right")
                    .find(".pull-right > span > span")
                    .html(
                        parseInt(
                            $("#" + n)
                                .parent()
                                .siblings(1)
                                .find(".pull-right")
                                .find(".pull-right > span > span")
                                .html()
                        ) + 1
                    ),
                    $("#" + r)
                        .text("Comment added successfully.")
                        .css("color", "#3c763d")
                        .show()));
    }),
        l.ajaxObject.open("POST", "/review/reviewajax.php", !0),
        l.ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded"),
        l.ajaxObject.setRequestHeader("Content-length", t.length),
        l.ajaxObject.setRequestHeader("Connection", "close"),
        l.ajaxObject.send(t);
}
function corp_AddCommentrr(e, t, n, a, r, s, o, l) {
    !0 == ValidateCorpCommentrr($("#" + n).val(), a) &&
        (0 != e
            ? (DisableButtonrr(!0, r, s), AjaxPostcorprr(ShowCorpCommentsrr, "AddCorpComment=1&PostId=" + o + "&Rid=" + l + "&Comment=" + UrlEncode($("#" + n).val()) + "&loadhead=1&rar=1", t, n, a, r, s))
            : (ajaxLogin("/review/ReviewAjax.php?AddCorpComment=1&PostId=" + o + "&Rid=" + l + "&Comment=" + UrlEncode($("#" + n).val()) + "&redirectToRAR=1&cat_name=" + CatName + "&loadhead=1&what=1"),
                createCookie("fbLoginRedirection1", "/review/ReviewAjax.php?AddCorpComment=1&PostId=" + o + "&Rid=" + l + "&Comment=" + UrlEncode($("#" + n).val()) + "&redirectToRAR=1&cat_name=" + CatName + "&loadhead=1&what=1", 30)));
}
function corp_AddComment_other(e, t, n, a, r, s, o, l) {
    !0 == ValidateCorpCommentrr($("#" + n).val(), a) &&
        (0 != e
            ? (DisableButtonrr(!0, r, s), AjaxPostcorprr(ShowCorpCommentsrr, "AddCorpComment=1&PostId=" + o + "&Rid=" + l + "&Comment=" + UrlEncode($("#" + n).val()) + "&loadhead=1&rar=1", t, n, a, r, s))
            : ajaxLogin("/review/ReviewAjax.php?AddCorpComment=1&PostId=" + o + "&Rid=" + l + "&Comment=" + UrlEncode($("#" + n).val()) + "&redirectToRAR_other=1&cat_name=" + CatName + "&loadhead=1&what=1"));
}
function corp_UpdateCommentrr(e, t, n, a, r, s, o) {
    !0 == ValidateCorpCommentrr($("#" + t).val(), n) &&
        (DisableButtonrr(!0, a, r),
            AjaxPostcorprr(ShowCorpCommentsrr, "UpdateCorpComment=1&CommentId=" + hidCorpCommentId.value + "&PostId=" + s + "&Rid=" + o + "&Comment=" + UrlEncode($("#" + t).val()) + "&loadhead=1&rar=1", e, t, n, a, r));
}
function AddOnlyCommentrr(e, t, n, a, r, s, o, l, c, d) {
    if ((ChkLoginrr(e, "", ""), "login" != e)) {
        if ("bad word(s)" == e.substring(0, 11).toLowerCase())
            $("#" + n)
                .html("<span class='icon-tool-tip'></span> &nbsp; " + e + ".")
                .css("color", "red")
                .show();
        else {
            var p;
            if ("edit" == (p = FindButtonClickedrr(s))) {
                hidCommentId.value;
                var m = $(editabletr).offset().top;
                $("#" + n)
                    .text("Comment updated successfully.")
                    .css("color", "#3c763d")
                    .show(),
                    ShowCommentsRatingrr(e, t, l, o, c, !1),
                    $("#" + o).val(),
                    $("html,body").animate({ scrollTop: parseInt(m) - 180 }, "slow"),
                    (hidCommentId.value = "");
            } else
                (Add_Comment = !0),
                    $("#" + n)
                        .text("Comment posted successfully.")
                        .css("color", "#3c763d")
                        .show(),
                    $("#" + o).val(parseInt($("#" + o).val()) + 1),
                    $("#" + a)
                        .closest(".comment.hide")
                        .siblings(".count-section")
                        .find(".comment-clk")
                        .find("span:nth-child(2)")
                        .text("Comments " + $("#" + o).val()),
                    ShowCommentsRatingrr(e, t, l, o, c, !1);
            $("#" + a).val(""), $("#" + r).show(), $("#" + s).hide();
        }
    }
    DisableButtonrr(!1, r, s);
}
function RateNU_Commentrr(e, t, n, a, r, s, o, l, c) {
    if ((ChkLoginrr(e, "", ""), "login" != e)) {
        if ("bad word(s)" == e.substring(0, 11).toLowerCase())
            $("#" + n)
                .html("<span class='icon-tool-tip'></span> &nbsp; " + e + ".")
                .css("color", "red")
                .show();
        else if ("reload comment" == e) window.location.href = "/comment/readcomment.php?rid=" + Rid;
        else if ("reload" == e) window.location.reload();
        else {
            Add_Comment = !0;
            var d = e.split("||");
            $("#" + l).val(parseInt($("#" + l).val()) + 1),
                $("#" + t).html(d[0]),
                $("#" + t).is(":visible") || $("#" + t).slideToggle(),
                $("#" + c).html("<a>&nbsp;" + d[1] + "</a>" + d[2]),
                $("#" + n).html(""),
                $("#" + a).val(""),
                (hidCommentId.value = ""),
                $("#" + o).html("<img src='/Images/like-icon.svg' class='like-image-new'/><span class='nu-color'>Not Useful</span>"),
                $("#" + a)
                    .closest(".comment.hide")
                    .siblings(".count-section")
                    .find(".comment-clk")
                    .find("span:nth-child(2)")
                    .text("Comments " + $("#" + l).val()),
                (Rate_Comment = !1);
        }
    }
    DisableButtonrr(!1, r, s);
}
function ValidateCorpCommentrr(e, t) {
    if (
        "block" ==
        $("#" + t)
            .closest(".response")
            .find("[id$=customer]")
            .css("display")
    )
        return $("#" + t).html('<span class="icon-tool-tip"></span> &nbsp;Please click "YES" or "NO" to justify your comments!'), $("#" + t).css("display", "block"), $(".corp-box").siblings(".comment").slideDown(), !1;
    if ("" == e.trim())
        return (
            $("#" + t)
                .html("<span class='icon-tool-tip'></span> &nbsp; This information is required.")
                .css("color", "red")
                .show(),
            !1
        );
    if ("False" == canPostComntonResponse1)
        return (
            $("#" + t)
                .html("<span class='icon-tool-tip'></span> &nbsp; Access Not Granted.")
                .css("color", "red")
                .show(),
            !1
        );
    if (!(3 > CountWordsrr(e))) return !0;
    if (e.length < 2e3)
        return (
            $("#" + t)
                .html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters.")
                .css("color", "red")
                .show(),
            !1
        );
    if (e.length >= 2e3)
        return (
            $("#" + t)
                .html("")
                .hide(),
            !0
        );
}
function ValidateCommentrr(e, t, n) {
    if ("" == e.trim())
        return (
            $("#" + t)
                .html("<span class='icon-tool-tip'></span> &nbsp; This information is required.")
                .css("color", "red")
                .show(),
            !1
        );
    if ("False" == canPostComntOnReview)
        return (
            $("#" + t)
                .html("<span class='icon-tool-tip'></span> &nbsp; Access Not Granted.")
                .css("color", "red")
                .show(),
            !1
        );
    if (3 > CountWordsrr(e)) {
        if (e.length <= 2e3)
            return (
                $("#" + t)
                    .html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 2000 characters.")
                    .css("color", "red")
                    .show(),
                !1
            );
        if (e.length > 2e3)
            return (
                $("#" + t)
                    .html("")
                    .hide(),
                !0
            );
    } else if (!checkCommentCount(n))
        return (
            window.parent.$("#commentpopimg").attr("src", "../Images/comment_popup_desktop.png"),
            window.parent.$("#commentpopimg").attr("width", "400px"),
            window.parent.$(".to-top").css("display", "none"),
            window.parent.$(".imgPastePrevent1,#commentpopimg").css("display", "block"),
            window.parent.$(".black-layer").css("visibility", "visible"),
            window.parent.$(".black-layer").css("display", "block"),
            window.parent.$("#mainBody").css("overflow-y", "hidden"),
            !1
        );
    else return !0;
}
function checkCommentCount(e) {
    var t,
        n = !1;
    return (
        (t = CatId),
        $.ajax({
            url: "/review/CorporateResponse.ashx",
            contentType: "application/json; charset=utf-8",
            dataType: "text",
            async: !1,
            data: { type: "commentcount", corp: !1, cat_id: t, login_id: loginid, reviewid: e, corp_name: corporateName, corp_product: iscorp },
            responseType: "text/html",
            success: function (e) {
                "success" == e && (n = !0);
            },
        }),
        n
    );
}
function checkRatingCount(e) {
    var t,
        n = !1;
    return (
        (t = CatId),
        $.ajax({
            url: "/review/CorporateResponse.ashx",
            contentType: "application/json; charset=utf-8",
            dataType: "text",
            async: !1,
            data: { type: "ratecount", corp: !1, cat_id: t, login_id: loginid, reviewid: e, corp_name: corporateName, corp_product: iscorp },
            responseType: "text/html",
            success: function (e) {
                "success" == e && (n = !0);
            },
        }),
        n
    );
}
function FindButtonClickedrr(e) {
    var t;
    return !1 == $("#" + e).is(":visible") ? "add" : "edit";
}
function CountWordsrr(e) {
    var t = /&nbsp;/gi,
        n = (e = e.replace(t, "")).trim(),
        a = /^[^A-Za-z0-9]+/gi,
        r = n.replace(a, ""),
        s = (rExp = ""),
        o = r.replace(s, " "),
        l = o.split(" "),
        c = 0;
    if (l.length - 1 <= 5e3) {
        var d,
            l = o.split("\n"),
            p = 0;
        if (l.length >= 1)
            for (p = 0; p < l.length; p++) {
                d = l[p].split(" ");
                for (var m = 0; m < d.length; m++) "" != d[m].trim() && (c += 1);
            }
        else for (var m = 0; m < l.length; m++) "" != l[m].trim() && (c += 1);
    } else for (var m = 0; m < l.length; m++) "" != l[m].trim() && (c += 1);
    return n.length < 2 && (c = 0), c;
}
function Ratingrr(e, t, n, a, r, s, o, l, c, d, p, m, h, u, g, v, b) {
    debugger;
    if ("btnAjxVU" == e) {
        if (!checkRatingCount(t))
            return (
                window.parent.$("#ratepopimg").attr("src", "../Images/rate_popup_web.png"),
                window.parent.$("#ratepopimg").attr("width", "400px"),
                window.parent.$(".to-top").css("display", "none"),
                window.parent.$(".imgPastePrevent2,#ratepopimg").css("display", "block"),
                window.parent.$(".black-layer").css("visibility", "visible"),
                window.parent.$(".black-layer").css("display", "block"),
                window.parent.$("#mainBody").css("overflow-y", "hidden"),
                !1
            );
        Ajaxresrr(VUrr, "rid=" + t + "&rating=4&catname=&loadhead=" + n + "&arateid=" + r, r, t, o, l);
    } else if ("btnAjxU" == e) {
        if (!checkRatingCount(t))
            return (
                window.parent.$("#ratepopimg").attr("src", "../Images/rate_popup_web.png"),
                window.parent.$("#ratepopimg").attr("width", "400px"),
                window.parent.$(".to-top").css("display", "none"),
                window.parent.$(".imgPastePrevent2,#ratepopimg").css("display", "block"),
                window.parent.$(".black-layer").css("visibility", "visible"),
                window.parent.$(".black-layer").css("display", "block"),
                window.parent.$("#mainBody").css("overflow-y", "hidden"),
                !1
            );
        Ajaxresrr(Urr, "rid=" + t + "&rating=2&catname=&loadhead=" + n + "&arateid=" + r, r, t, o, l);
    } else if ("btnAjxNU" == e) {
        if (!checkRatingCount(t))
            return (
                window.parent.$("#ratepopimg").attr("src", "../Images/rate_popup_web.png"),
                window.parent.$("#ratepopimg").attr("width", "400px"),
                window.parent.$(".to-top").css("display", "none"),
                window.parent.$(".imgPastePrevent2,#ratepopimg").css("display", "block"),
                window.parent.$(".black-layer").css("visibility", "visible"),
                window.parent.$(".black-layer").css("display", "block"),
                window.parent.$("#mainBody").css("overflow-y", "hidden"),
                !1
            );
        AjaxresAllrr(NUrr, "rid=" + t + "&rating=-4&catname=&loadhead=" + n + "&arateid=" + r, r, t, c, d, p, m, h, u, g, v, b, o, l);
    }
}
function Ajaxresrr(e, t, n, a, r, s, o, l) {
    $("#" + n)
        .parent()
        .siblings("img")
        .show(),
        $("#" + n)
            .parent()
            .hide(),
        $("#" + n)
            .parent()
            .siblings(".like-count")
            .hide();
    var c = new CreateRequest();
    (c.ajaxObject.onreadystatechange = function () {
        4 == c.ajaxObject.readyState && e(c.ajaxObject.responseText, n, a, r, s, o, l);
    }),
        c.ajaxObject.open("GET", "/review/reviewratingrestaurant.aspx?" + t, !0),
        c.ajaxObject.send(null);
}
function VUrr(e, t, n, a, r) {
    if ((ChkLoginrr(e, ""), "" != e && "login" != e)) {
        $("#" + a)
            .html("")
            .hide();
        var s = e.split("|");
        "corporate cannot rate reviews." == e.toLowerCase()
            ? ($("#" + r).show(),
                $("#" + r).html(s[0]),
                $("#" + t)
                    .parent()
                    .hide())
            : ($("#" + r).hide(),
                $("#" + t).html(s[0]),
                $("#" + t)
                    .parent()
                    .show()),
            $("#" + t)
                .parent()
                .siblings(0)
                .html(s[1]),
            $("#" + t)
                .parent()
                .siblings(0)
                .attr("onclick", "ratingMore_Ajax123('" + n + "');");
    }
    (Rate_Comment = !1),
        $("#" + t)
            .parent()
            .siblings("img")
            .hide(),
        -1 == e.toString().toLowerCase().indexOf("cannot rate") &&
        ($("#" + t)
            .parent()
            .siblings(".like-count")
            .show(),
            $("#" + t)
                .parent()
                .show());
}
function Urr(e, t, n, a, r) {
    if (
        (ChkLoginrr(e, ""),
            $("#" + a)
                .html("")
                .hide(),
            "" != e && "login" != e)
    ) {
        var s = e.split("|");
        "corporate cannot rate reviews." == e.toLowerCase()
            ? ($("#" + r).show(),
                $("#" + r).html(s[0]),
                $("#" + t)
                    .parent()
                    .hide())
            : ($("#" + r).hide(),
                $("#" + t).html(s[0]),
                $("#" + t)
                    .parent()
                    .show()),
            $("#" + t)
                .parent()
                .siblings(0)
                .html(s[1]),
            $("#" + t)
                .parent()
                .siblings(0)
                .attr("onclick", "ratingMore_Ajax123('" + n + "');");
    }
    (Rate_Comment = !1),
        $("#" + t)
            .parent()
            .siblings("img")
            .hide(),
        -1 == e.toString().toLowerCase().indexOf("cannot rate") &&
        ($("#" + t)
            .parent()
            .siblings(".like-count")
            .show(),
            $("#" + t)
                .parent()
                .show());
}
function NUrr(e, t, n, a, r, s, o, l, c, d, p, m, h, u) {
    if ((ChkLoginrr(e, ""), "login" != e)) {
        if ("write comment" == e)
            $("#" + h)
                .html("<span class='icon-tool-tip'></span> &nbsp; Please fill in a comment to justify your rating for this review.")
                .css("color", "red")
                .show(),
                (Rate_Comment = !0),
                (FocusOnComments = !0),
                AjaxByHashrr(ShowCommentsRatingrr, "ShowComments=" + n + "&Random=" + a + "&skip=" + r + "mergeparent=" + s + "&parent" + o, l, c, d, p, !0);
        else if ("" != e && "login" != e) {
            var g = e.split("|");
            "corporate cannot rate reviews." == e.toLowerCase()
                ? ($("#" + u).show(),
                    $("#" + u).html(g[0]),
                    $("#" + t)
                        .parent()
                        .hide(),
                    $("#" + t)
                        .parent()
                        .siblings(".like-count")
                        .hide())
                : ($("#" + u).hide(),
                    $("#" + t).html(g[0]),
                    $("#" + t)
                        .parent()
                        .show()),
                $("#" + t)
                    .parent()
                    .siblings(0)
                    .html(g[1]),
                $("#" + t)
                    .parent()
                    .siblings(0)
                    .attr("onclick", "ratingMore_Ajax123('" + n + "');");
        }
    }
    $("#" + t)
        .parent()
        .siblings("img")
        .hide(),
        -1 == e.toString().toLowerCase().indexOf("cannot rate") &&
        ($("#" + t)
            .parent()
            .siblings(".like-count")
            .show(),
            $("#" + t)
                .parent()
                .show());
}
function DisableButtonrr(e, t, n) {
    !0 == e ? ($("#" + t).attr("disabled", "disabled"), $("#" + n).attr("disabled", "disabled")) : ($("#" + t).removeAttr("disabled"), $("#" + n).removeAttr("disabled"));
}
function UrlEncode(e) {
    return (e = encodeURIComponent((e = e.replace(/\+/g, "%2b"))));
}
function htmlEncode(e) {
    return $("<div/>").text(e).html();
}
function ratingMore_Ajax123(e) {
    $("#dvpopupbox .dvpopupbox").load("/review/rating-list_ajax.aspx?rid=" + e), openModal("#dvpopupbox");
}
function showMore(e, t) {
    t.preventDefault(), $(e).hide(), $(e).siblings(".moreellipses").hide(), $(e).siblings(".morecontent").show(), $(e).closest(".more").siblings(".share").removeClass("hide");
}
function setheight() {
    try {
        var e = 0,
            t = $("#variants .row.list > .col-3")
                .map(function () {
                    return $(this).height();
                })
                .get(),
            e = Math.max.apply(null, t);
        e > 0 && $("#variants .row.list > .col-3 .gridl").css({ height: e - 15 + "px" });
    } catch (n) { }
}
function addcomments(e, t, n, a, r, s, o, l, c, d, p, m) {
    !0 == ValidateCommentrr($("#" + l).val(), o, e) &&
        (DisableButtonrr(!0, c, d),
            !1 == Rate_Comment
                ? AjaxPostrr(
                    AddOnlyCommentrr,
                    "Rid=" + e + "&AddComment=" + UrlEncode($("#" + l).val()) + "&loadhead=1&rar=1",
                    t,
                    o,
                    l,
                    c,
                    d,
                    a,
                    n,
                    r,
                    $("#" + t)
                        .next()
                        .val()
                )
                : AjaxPostrr(RateNU_Commentrr, "Rid=" + e + "&RateComment=" + UrlEncode($("#" + l).val()) + "&catname=" + CatName + "&loadhead=1&rar=1&arateid=" + p, t, o, l, c, d, p, a, m));
}
function showcomments(e, t, n, a, r, s, o, l, c, d, p) {
    "" == $("#" + o).html()
        ? (AjaxByHashrr(ShowCommentsRatingrr, "ShowComments=" + t + "&Random=" + n + "&skip=" + a + "&mergeparent=" + r + "&rar=1&parent=" + s, o, l, c, d, !1, p),
            $(e).closest(".count-section").siblings(".response").is(":visible") && $(e).closest(".count-section").siblings(".response").slideUp())
        : ($(e).closest(".count-section").siblings(".response").is(":visible") && !$(e).closest(".count-section").siblings(".comment").is(":visible") && $(e).closest(".count-section").siblings(".response").slideUp(),
            $("#" + o)
                .parent()
                .slideToggle());
}
function updatecomments(e, t, n, a, r, s, o, l, c, d) {
    !0 == ValidateCommentrr($("#" + l).val(), o, e) &&
        (DisableButtonrr(!0, c, d),
            AjaxPostrr(
                AddOnlyCommentrr,
                "Rid=" + e + "&EditCommentId=" + hidCommentId.value + "&Comment=" + UrlEncode($("#" + l).val()) + "&rar=1&count=" + $("#" + r).val(),
                t,
                o,
                l,
                c,
                d,
                a,
                n,
                r,
                $("#" + t)
                    .next()
                    .val()
            ));
}
function showSection(e) {
    switch (($("#dvAll,#dvVU,#dvU,#dvNU").hide(), $("#liAll,#liVU,#liU,#liNU").removeClass("active"), e)) {
        case "all":
        default:
            $("#dvAll").show(), $("#liAll").addClass("active");
            break;
        case "vu":
            $("#dvVU").show(), $("#liVU").addClass("active");
            break;
        case "u":
            $("#dvU").show(), $("#liU").addClass("active");
            break;
        case "nu":
            $("#dvNU").show(), $("#liNU").addClass("active");
    }
}
function setCookie(e, t) {
    if (!checklogin()) return !1;
    var n = new Date();
    n.setTime(n.getTime() + 31536e6);
    var a = "expires=" + n.toUTCString(),
        r = "path=/";
    return (document.cookie = e + "=" + t + "; " + a + "; " + r), !0;
}
function setCookiesrch(e, t) {
    var n = new Date();
    n.setTime(n.getTime() + 31536e6);
    var a = "expires=" + n.toUTCString(),
        r = "path=/";
    document.cookie = e + "=" + t + "; " + a + "; " + r;
}
function setCookieCorp(e, t) {
    if (!checkloginCorp()) return !1;
    var n = new Date();
    n.setTime(n.getTime() + 31536e6);
    var a = "expires=" + n.toUTCString(),
        r = "path=/";
    return (document.cookie = e + "=" + t + "; " + a + "; " + r), !0;
}
function hideBlackLayer() {
    $(".black-layer").hide();
}
function setFocusToHeaderSrch() {
    document.getElementById("txtproduct").focus();
}
function CheckIfCookie(e) {
    setCookieCorp("brandReply", "1") && (window.location.href = e);
}
function ShowGraph1(e, t, n, a) {
    if ("" != e) {
        ajaxTooltip();
        var r = e.split("|");
        (document.getElementById(t).innerHTML = r[0]), (document.getElementById(n).innerHTML = r[1]), $("#" + t.replace("arate", "dvResponse")).html(r[2]), $("#" + n).attr("onclick", "ratingMore_Ajax123('" + a + "');");
    }
}
function getCorpResponse(acorp) {
    var reviewid = $(acorp).attr("reviewid"),
        userid = $(acorp).attr("userid"),
        aid = $(acorp).attr("id"),
        divcorpid = $(acorp).attr("divcorpid");
    $.ajax({
        url: "/review/CorporateResponse.ashx",
        contentType: "application/json; charset=utf-8",
        dataType: "text",
        data: { type: "corpresp", review_id: reviewid, Random: Math.random(), corp: !1, Session: strSession, corpname: corporateName, catid: cid, catname: prod, sessionname: strUsrName },
        responseType: "text/html",
        success: function (data) {
            $("#" + divcorpid).html(data);
            let onFullComm = $("#lnkFullComm").attr("onclick");
            onFullComm && eval(onFullComm), $(".row .gallery-thumbnails").lightGallery({ selector: ".g-imgbox" });
        },
    }),
        "Brand Response" == $(acorp).find("span:eq(1)").text() && $(acorp).closest(".count-section").siblings(".response").slideToggle(),
        Rebindcorp();
}
function bindreviewcontent(e, t, n, a, r, s, o, l, c, d, p) {
    $.ajax({
        url: "/review/CorporateResponse.ashx",
        type: "POST",
        contentType: "application/x-www-form-urlencoded",
        dataType: "text",
        async: !1,
        data: { type: "review", reviewid: e, corp: !1, isvideo: n, fbmessage: a, catid: r, prodimg: s, twittermsg: o, twitterlnk: l, catname: c, rating_str: d, usession: parseInt(usessions) },
        responseType: "text/html",
        success: function (e) {
            $(t).closest(".reviewdata").html(e), ajaxTooltip1(p);
        },
        error: function (e, t, n) {
            window.location.href = "/error.php";
        },
    });
}
function bindShareAll(e, t, n, a, r, s, o, l, c, d, p, m) {
    "" == $(t).children(".sharedivdata").html().trim()
        ? $.ajax({
            url: "/review/CorporateResponse.ashx",
            type: "POST",
            contentType: "application/x-www-form-urlencoded",
            dataType: "text",
            async: !1,
            data: { type: "share_rar", reviewid: e, corp: !1, isvideo: n, fbmessage: a, catid: r, prodimg: s, twittermsg: o, twitterlnk: l, catname: c, rating_str: d, usession: parseInt(usessions), brandname: m },
            responseType: "text/html",
            success: function (e) {
                $(t).children(".sharedivdata").html(e), $(t).children(".sharedivdata").show();
            },
            error: function (e, t, n) {
                window.location.href = "/error.php";
            },
        })
        : $(t).children(".sharedivdata").show();
}
function bindblogcontent(e, t, n, a, r) {
    $.ajax({
        url: "/review/CorporateResponse.ashx",
        type: "POST",
        contentType: "application/x-www-form-urlencoded",
        dataType: "text",
        data: { type: "blog", blogid: e, corp: !1, canonicalURL: n, tweetTitle: a, username: r },
        responseType: "text/html",
        success: function (e) {
            $(t).closest(".reviewdata").html(e);
        },
        error: function (e, t, n) {
            window.location.href = "/error.php";
        },
    });
}
function createurlforpaging() {
    var e,
        t = $("#ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_ddlSorting"),
        n = sortorder;
    return (
        (n = "" == n ? "d" : n.charAt(0)),
        0 == t.value && (e = pgurl + "-sort-msdate-order-" + n),
        1 == t.value && (e = pgurl + "-sort-rating-order-" + n),
        2 == t.value && (e = pgurl + "-sort-avgrating-order-" + n),
        3 == t.value && (e = pgurl + "-sort-trustedcircle-order-" + n),
        4 == t.value && (e = pgurl + "-sort-read-order-" + n),
        e
    );
}
function dissCounter(e) {
    var t = e.value.replace(/\s+/g, " ").length,
        n = e.parentNode;
    (t < 5 || t > 500) &&
        ((n.parentElement.children[3].style.color = "#FD3A02"),
            t < 5 ? (n.parentElement.children[3].innerHTML = 500 - t) : (n.parentElement.children[3].innerHTML = "-" + (t - 500)),
            n.parentElement.children[2].setAttribute("disabled", "")),
        ((t >= 5 && t < 500) || 0 == t) && ((n.parentElement.children[3].style.color = "#76A44E"), (n.parentElement.children[3].innerHTML = 500 - t), n.parentElement.children[2].removeAttribute("disabled"));
}
function askQuestion(e, t) {
    document.getElementById("askquestion").disabled = !0;
    var n = $("#txtQueArea").val(),
        a = CatId;
    if ("" == n.replace(/\s+/g, " ").replace(/(<([^>]+)>)/gi, "")) return $("#errCommentrr").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").show(), !1;
    $.get("/product/product_discussion_ajax.aspx?cid=" + a + "&valid=1&ques=" + UrlEncode1(n).replace(/\s+/g, " ").replace("#", "hhash") + "&ask=1&timestamp=" + new Date().getTime(), function (t) {
        if (t.indexOf("Bad word(s)") > -1)
            return (document.getElementById("errCommentrr").style.display = "block"), (document.getElementById("errCommentrr").innerHTML = "<span>" + t + "</span>"), (document.getElementById("askquestion").disabled = !1), !1;
        if (t.indexOf("success") > -1) {
            $(e).parent().siblings("#emptytext").hide(), (document.getElementById("errCommentrr").style.display = "none"), (document.getElementById("errCommentrr").innerHTML = "");
            var a = t.substring(t.indexOf("|") + 1);
            $("#txtQueArea").val(""), (document.getElementById("askquestion").disabled = !1);
            var r = "";
            $(e).parent().parent().children("ul").length > 0 ? (r = "") : (r += ""),
                (r =
                    (r = r + '<div class="answer"><div class="row table"><div class="qnauserpic" > <a href="/' + strUsrName + '"><div class="profile-img"><img src="' + strUsrIcon + '" /></div></a></div>') +
                    '<div class="ans-content"><div class="row qatitle" onclick="javascript:userAnswerNew(event,this);"><p>' +
                    n +
                    "</p>"),
                (r += '<p class="notify">few seconds ago</p>'),
                (r =
                    (r =
                        (r = r + '<p class="notify">By: <a id="hypUser" href="/' + strUsrName + '/timeline">' + strUsrName + "</a></p>") +
                        '<p class="notify numbers"><span class="icon-comment"></span>Answers: <span id="spn' +
                        a +
                        '">0</span></p></div>') +
                    '<div class="answer-field" style="overflow: hidden; display: none;"><p class="warning hide" id="errCommentans"></p><span><textarea placeholder="Write your answer..." onkeyup="dissCounter(this);"></textarea></span><button class="btn btn-secondary" onclick="javascript:answerQuestion(this,' +
                    a +
                    ');return false;">Submit</button><span class="pull-right text-right">500</span></div></div>'),
                (r += '<div class="text-right"><a class="btn btn-link btn-light"  onclick="javascript:answerQuesNew(event,this);">Answer</a></div></div></div>'),
                $("#quesdata").after(r),
                $(e).siblings(".pull-right").html("500"),
                $(".answer .btn-link").click(function (e) {
                    $(this).parent().parent().siblings(".answer-field").slideToggle(500), e.stopPropagation();
                }),
                $(".h2val1").html("500");
        }
    });
}
function answerQuestion(e, t) {
    document.getElementById("answer").disabled = !0;
    var n = $(e).parent().children(2).children("textarea").val(),
        a = CatId;
    if ((e.parentNode, "" == n.replace(/\s+/g, " ").replace(/(<([^>]+)>)/gi, "")))
        return $(e).parent().children("p").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").show(), (document.getElementById("answer").disabled = !1), !1;
    $(e).parent().children("p").html(""),
        $.get("/product/product_discussion_ajax.aspx?cid=" + a + "&valid=1&anstxt=" + UrlEncode1(n).replace(/\s+/g, " ").replace("#", "hhash") + "&quesId=" + t + "&ans=1&timestamp=" + new Date().getTime(), function (n) {
            if ("" != n) {
                if (n.indexOf("Bad word(s)") > -1)
                    return (
                        (document.getElementById("diverror_discussion").style.display = "block"), (document.getElementById("diverror_discussion").innerHTML = "<span>" + n + "</span>"), (document.getElementById("answer").disabled = !1), !1
                    );
                (document.getElementById("diverror_discussion").style.display = "none"),
                    (document.getElementById("diverror_discussion").innerHTML = ""),
                    $(e).parent().children(2).children("textarea").val(""),
                    (document.getElementById("answer").disabled = !1);
                var a,
                    r = "";
                (r += '<div class="user-answer">'),
                    (r += "<div>"),
                    (r = r + '<p class="br-none lh20">' + n.split("|")[0] + "</p>"),
                    (r += '<p class="notify">few seconds ago</p>'),
                    (r += '<p class="notify">'),
                    (r = r + 'By: <a id="hypUsrAns" href="/' + strUsrName + '/timeline">' + strUsrName + "</a> "),
                    (r += "</p>"),
                    (r += "</div>"),
                    (r += "</div>"),
                    null != $(e).parent().siblings(".user-answers").html()
                        ? ((r += $(e).parent().siblings(".user-answers").html()), $(e).parent().siblings(".user-answers").html(r), $(e).siblings(".pull-right").html("500"))
                        : ($(e)
                            .parent()
                            .parent()
                            .append('<div class="row user-answers display" id="dvanswer">' + r + "</div>"),
                            $(e).siblings(".pull-right").html("500"));
                var s = parseInt($("#spn" + t).html());
                $("#spn" + t).html(s + 1), $(".h2val").html("500"), $(e).parent().siblings(".user-answers").slideDown({ easing: "easeInQuad" });
            }
        });
}
function showMorePagesrr(e, t, n, a) {
    var r = $("#spnPaging"),
        s = "",
        o = "",
        s = "<li>  <a class='btn btn-link' href= '" + pgurl.replace("-page-", "") + "'>1</a></li><li><span style='cursor:pointer' onClick=\"return showLessPagesrr(" + e + ", " + t + ", '" + n + "', " + a + ');"><b>...</b></span></li> ';
    for (
        intMorePage + 9 < e
            ? ((loopPages = 9),
                (tabThisPage = 10),
                (o =
                    (o = "<li> <span style='cursor:pointer' onClick=\"return showMorePagesrr(" + e + ", " + t + ", '" + n + "', " + a + ');"><b>...</b></span></li>') +
                    "<li>  <a class='btn btn-link' href= '" +
                    pgurl +
                    e +
                    "'>" +
                    e +
                    "</a></li>"))
            : (tabThisPage = loopPages = e - intMorePage),
        i = intMorePage;
        i <= loopPages + intMorePage;
        i++
    )
        s = i == t ? s + " <li> <a class='btn btn-link active'>" + i + "</a> </li>" : s + " <li> <a class='btn btn-link' href='" + pgurl + i + "'>" + i + "</a></li>";
    (intMorePage += tabThisPage), (intLessPage += 10), r.html(s + o);
}
function showLessPagesrr(e, t, n, a) {
    var r = $("#spnPaging"),
        s = "",
        o = "";
    for (
        intLessPage > 11 &&
        (o =
            "<li>  <a class='btn btn-link' href= '" + pgurl.replace("-page-", "") + "'>1</a></li><li><span style='cursor:pointer' onClick=\"return showLessPagesrr(" + e + ", " + t + ", '" + n + "', " + a + ');"><b>...</b></span></li>'),
        i = intLessPage - 1;
        i >= intLessPage - 10;
        i--
    )
        s = i == t ? "<li> <a class='btn btn-link active'>" + i + "</a></li> " + s : "<li> <a class='btn btn-link' href='" + pgurl + i + "'>" + i + "</a></li> " + s;
    (strMore = "<li><span style='cursor:pointer' onClick=\"return showMorePagesrr(" + e + ", " + t + ", '" + n + "', " + a + ');"><b>...</b></span></li>'),
        r.html(o + s + strMore + "<li><a class='btn btn-link' href='" + pgurl + e + "'><b>" + e + "</b></a></li>"),
        (intLessPage -= 10),
        intMorePage > 11 && (intMorePage -= tabThisPage),
        (tabThisPage = 10);
}
$(document).ready(function () {
    (btnSubmit = document.getElementById("btnSubmit")),
        (divCorpComments = document.getElementById("corp_divComments")),
        (linkpostcomment = document.getElementById("linkpostcomment")),
        (btnEdit = document.getElementById("btnEdit")),
        (txtComment = document.getElementById("txtComment")),
        (corp_txtComment = document.getElementById("corp_txtComment")),
        (hidCommentId = document.getElementById("hidCommentId")),
        (corp_btnSubmit = document.getElementById("corp_btnSubmit")),
        (corp_btnEdit = document.getElementById("corp_btnEdit"));
}),
    $(".AjxLayrClose").click(function (e) {
        $("#popuplayer1").hide(), void 0 != urlredirectTo && -1 != urlredirectTo.indexOf("ratereview") && (urlredirectTo = urlredirectTo.replace("-ratereview", "").replace("&ratereview=1", ""));
    }),
    $(document).ready(function () {
        var e = $("#ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_btnwritereview").attr("onclick");
        $("#btnWritereview_scroll").attr("onclick", e), $("#imgWriteReview").attr("onclick", e), $(".your-rating-star").attr("onclick", e);
        var t = new Date();
        t.setTime(t.getTime());
        var n = "expires=" + t.toUTCString();
        (document.cookie = "brandReply=0; " + n),
            ajaxTooltip(),
            $(".like-image-new").each(function () {
                var e = $(this).parent().attr("reviewid"),
                    t = $(this).parent().attr("userid"),
                    n = $(this).parent().attr("id"),
                    a = $(this).parent().attr("divlikeid"),
                    r = $(this).parent().attr("divcorpid"),
                    s = $(this).parent().attr("is_rate"),
                    o = $(this).parent().attr("href_arr");
                if (-6 != s || "" != iscorp || (iscorp == corporateName && "" != iscorp))
                    $.ajax({
                        url: "/review/CorporateResponse.ashx",
                        contentType: "application/json; charset=utf-8",
                        dataType: "text",
                        data: { type: "like", OverallGraph: e, u: t, Random: Math.random(), arateid: n, corp: !1, Session: strSession, corpname: corporateName, catid: cid, catname: prod, sessionname: strUsrName, divcorprespid: r },
                        responseType: "text/html",
                        success: function (t) {
                            ShowGraph1(t, n, a, e);
                        },
                    });
                else {
                    if (
                        (ajaxTooltip(),
                            (document.getElementById(n).innerHTML = "<img src='/Images/like-icon.svg' class='like-image-new'/><span>Like</span>"),
                            (document.getElementById(a).innerHTML = "<a style='margin-left: 3px;'>0</a>"),
                            "0" != userId)
                    )
                        $("#" + n.replace("arate", "dvResponse")).html("");
                    else {
                        var l = "<a id='areply' onclick=~CheckIfCookie('" + o + "')~ style='cursor:pointer'><span class='icon-reply' style='font-size: 17px; color: rgba(36,44,66,.5);'></span><span id='resplink'>Reply as Brand</span></a>";
                        $("#" + n.replace("arate", "dvResponse")).html(l.replace("~", '"').replace("~", '"'));
                    }
                    $("#" + a).attr("onclick", "ratingMore_Ajax123('" + e + "');");
                }
            }),
            1 == editreview && ($(".advice-section").hide(), $("#starsep").hide(), $(".rar-section-divider").hide());
    }),
    $(document).mouseup(function (e) {
        var t = $(".sharedivdata");
        t.is(e.target) || 0 !== t.has(e.target).length || t.hide();
    });
var intMorePage = 11,
    intLessPage = 1,
    tabThisPage = 10;
function UrlEncode1(e) {
    return (e = (e = encodeURIComponent ? encodeURIComponent(e) : encodeURI(e)).replace(/\+/g, "%2B"));
}
try {
    if (sel >= 11) {
        var mod = sel % 10;
        if (0 == mod)
            var intMorePage = sel - mod + 1,
                intLessPage = sel - mod - 9;
        else
            var intMorePage = sel - mod + 11,
                intLessPage = sel - mod + 1;
        var tabThisPage = 10;
    } else
        var intMorePage = 11,
            intLessPage = 1,
            tabThisPage = 10;
} catch (e) { }
function chkCommentToClose(e) {
    var t = new CreateRequest();
    (t.ajaxObject.onreadystatechange = function n() {
        4 == t.ajaxObject.readyState &&
            ("success" == (emailflag = t.ajaxObject.responseText)
                ? (document.location.href = document.getElementById(custnolink).value)
                : ((document.getElementById("customer").style.display = "none"),
                    (document.getElementById("corp_errComment_" + e).innerHTML = "<span>Please fill in a comment for this response</span>"),
                    (document.getElementById("corp_errComment_" + e).style.display = "block"),
                    $(".corp-box").siblings(".comment").slideDown(),
                    $("#lnkFullComm").hide()));
    }),
        t.ajaxObject.open("GET", "/withoutlogin.aspx?postid=" + $("#hdnResponseID").val() + "&resp=no", !0),
        t.ajaxObject.send(null);
}
$(function () {
    function e() {
        if (navigator.geolocation)
            try {
                navigator.geolocation.getCurrentPosition(t, n, { timeout: 1e4 });
            } catch (e) {
                n();
            }
        else n();
    }
    function t(e) {
        setCookiesrch("currLatLong", (currLatLong = (geo_loc = a(e)).split(",")));
    }
    function n() {
        currLatLong = 0;
        try {
            $.get(
                "https://ipapi.co/json",
                function (e) {
                    if (null != e && "" != e)
                        try {
                            (html5Lat = e.latitude), (html5Lon = e.longitude), (currLatLong = (currLatLong = html5Lat.toFixed(8) + ", " + html5Lon.toFixed(8)).split(",")), setCookiesrch("currLatLong", currLatLong);
                        } catch (t) {
                            setCookiesrch("currLatLong", currLatLong);
                        }
                },
                "json"
            );
        } catch (e) {
            currLatLong = 0;
        }
    }
    function a(e) {
        return (html5Lat = e.coords.latitude), (html5Lon = e.coords.longitude), html5Lat.toFixed(8) + ", " + html5Lon.toFixed(8);
    }
    function r(e) {
        for (var t = e + "=", n = decodeURIComponent(document.cookie).split(";"), a = 0; a < n.length; a++) {
            for (var r = n[a]; " " == r.charAt(0);) r = r.substring(1);
            if (0 == r.indexOf(t)) return r.substring(t.length, r.length);
        }
        return "";
    }
    $(document).ready(function () {
        currLatLong = 0;
        var t = r("currLatLong");
        "" == t || "0" == t ? e() : (currLatLong = t);
    }),
        $("#txtRarTabSearch").autocomplete({
            source: function (e, t) {
                var n,
                    a,
                    r,
                    s,
                    o,
                    l,
                    c = 0,
                    d = e.term;
                (d = stripHTML(d)), (e.term = d), "" == d.replace(/[^\w\s]/gi, "") && (c = 1), (srctype = srctype1), (txtId = "txtRarTabSearch"), "Search Product, Reviews and Ratings" == d && (d = "");
                var p = "{contextKey:'" + (n = srchcat) + "|0||',count:10,prefixText:'" + d + "',type:'" + srctype1 + "'}";
                if (d.trim().length >= 2 && 0 == c) {
                    if ((prevparameters == p && (dupreq = !0), (prevparameters = p), !0 == dupreq && void 0 != prevmsgd)) {
                        var a = prevmsgd;
                        (msgdlength = a.length),
                            t(
                                $.map(a, function (e) {
                                    if (null != e) {
                                        var t,
                                            n = e.split("|");
                                        return 0 == n[1]
                                            ? { label: '<b style="padding-left: 7px;">' + n[0].replace("repme", stripHTML($("#txtRarTabSearch").val())) + "</b>  ", value: n[1], catid: n[1], parent2: n[6] }
                                            : 111111 == n[1]
                                                ? { label: '<span ><span style="color: #6d6d6d;">' + n[0] + "</span>", value: 111111, catid: n[1], parent2: n[6], url: n[9] }
                                                : ((t = '<span ><span style="color: #6d6d6d;">' + n[0] + "</span>" + n[10] + n[3]),
                                                    n[2] > 0 && (t = t + ' <span  style="font-size:11px;color:#44a512;">(' + n[2] + " Variants)</span>"),
                                                    (t += "</span>"),
                                                    (t += '<div class="clear"></div>'),
                                                {
                                                    label: (t = t + ' <span style="font-size:11px;color:#44a512;">' + n[5] + "</span>"),
                                                    value: n[0] + "-" + n[1],
                                                    catid: n[1],
                                                    parent2: n[6],
                                                    level1: n[7],
                                                    ptype: n[8],
                                                    valueUrl: n[9],
                                                    isCorp: n[10],
                                                });
                                    }
                                })
                            ),
                            (dupreq = !1);
                    } else
                        xhr1 && 4 != xhr1.readyState && xhr1.abort(),
                            (xhr1 = $.ajax({
                                type: "GET",
                                url: "/web/search.asmx/GetAutoCompleteProductSearch",
                                data: { contextKey: "'" + n + "|0||'", strProductSrh: "'" + d.replace("'", "\\'") + "'", currLatLong: "'" + currLatLong + "'", isPreWrite: "0" },
                                contentType: "application/json; charset=utf-8",
                                dataType: "json",
                                success: function (e) {
                                    if ($("#txtRarTabSearch").val() == d) {
                                        var n, a;
                                        (prevmsg = e),
                                            (msgdlength = (n = e.d ? e.d : e).length),
                                            (prevmsgd = n),
                                            t(
                                                $.map(n, function (e) {
                                                    if (null != e) {
                                                        var t = e.split("|");
                                                        return 0 == t[1]
                                                            ? (1 == n.length && insertSearch(document.getElementById("txtRarTabSearch").value, "No Action", btoa(window.location.href), ""),
                                                                { label: '<b style="padding-left: 7px;">' + t[0].replace("repme", stripHTML($("#txtRarTabSearch").val())) + "</b>  ", value: t[1], catid: t[1], parent2: t[6] })
                                                            : 111111 == t[1]
                                                                ? { label: '<span ><span style="color: #6d6d6d;">' + t[0] + "</span>", value: 111111, catid: t[1], parent2: t[6], url: t[9] }
                                                                : ((a = '<span><span style="color: #6d6d6d;">' + t[0] + "</span>" + t[10] + t[3]),
                                                                    t[2] > 0 && (a = a + ' <span  style="font-size:11px;color:#44a512;">(' + t[2] + " Variants)</span>"),
                                                                    (a += "</span>"),
                                                                    (a += '<div class="clear"></div>'),
                                                                {
                                                                    label: (a = a + ' <span style="font-size:11px;color:#44a512;">' + t[5] + "</span>"),
                                                                    value: t[0] + "-" + t[1],
                                                                    catid: t[1],
                                                                    parent2: t[6],
                                                                    level1: t[7],
                                                                    ptype: t[8],
                                                                    valueUrl: t[9],
                                                                    isCorp: t[10],
                                                                });
                                                    }
                                                })
                                            ),
                                            (srctype = srctype1);
                                    }
                                },
                                error: function (e) { },
                            }));
                } else
                    prevparameters == p && (dupreq = !0),
                        (prevparameters = p),
                        !0 == dupreq && void 0 != prevmsgd
                            ? ((msgdlength = (a = prevmsgd).length),
                                t(
                                    $.map(a, function (e) {
                                        if (null != e)
                                            return 0 == (s = e.split("|"))[1]
                                                ? ("" != s[2] && "" == s[3]
                                                    ? (o = s[2].split("~"))[1]
                                                        ? ((r = '<span ><span class="search-span-headAnchor" style="color: #6d6d6d;"><b>' + o[0] + "</b></span></span>"), (l = o[1]))
                                                        : ((r = '<span ><span class="search-span-head" style="color: #6d6d6d;"><b>' + o[0] + "</b></span></span>"), (l = ""))
                                                    : (r = '<span ><span style="color: #6d6d6d;">' + s[2] + "</span></span>"),
                                                    { label: r, value: "Redirecting", catid: s[1], parent2: s[6], innValueUrl: l, valueUrl: s[3] })
                                                : ((r = '<span ><span style="color: #6d6d6d;">' + s[0] + "</span>" + s[12]),
                                                    s[4] > 0 && (r = r + ' <span  style="font-size:11px;color:#44a512;padding-top: 3px;">(' + s[4] + " Variants)</span>"),
                                                    (r += "</span>"),
                                                    (r += '<div class="clear"></div>'),
                                                {
                                                    label: (r = r + ' <span style="font-size:11px;color:#44a512;padding-top: 3px;">' + s[7] + "</span>"),
                                                    value: s[0] + "-" + s[1],
                                                    catid: s[1],
                                                    parent2: s[6],
                                                    level1: s[8],
                                                    ptype: s[9],
                                                    valueUrl: s[11],
                                                    isCorp: s[12],
                                                });
                                    })
                                ),
                                $(".search-span-head").parent().parent().css({ background: "rgba(204,204,204,0.3)", cursor: "default" }),
                                $(".search-span-headAnchor").parent().parent().css({ background: "rgba(204,204,204,0.3)" }),
                                (dupreq = !1))
                            : (xhr1 && 4 != xhr1.readyState && xhr1.abort(),
                                (xhr1 = $.ajax({
                                    type: "GET",
                                    url: "/web/search.asmx/GetAutoCompleteProductSearchFixed",
                                    contentType: "application/json; charset=utf-8",
                                    dataType: "json",
                                    success: function (e) {
                                        var n, a, r, s, o;
                                        (prevmsg = e),
                                            (msgdlength = (n = e.d ? e.d : e).length),
                                            (prevmsgd = n),
                                            t(
                                                $.map(n, function (e) {
                                                    if (null != e)
                                                        return 0 == (r = e.split("|"))[1]
                                                            ? ("" != r[2] && "" == r[3]
                                                                ? (s = r[2].split("~"))[1]
                                                                    ? ((a = '<span ><span class="search-span-headAnchor" style="color: #6d6d6d;"><b>' + s[0] + "</b></span></span>"), (o = s[1]))
                                                                    : ((a = '<span ><span class="search-span-head" style="color: #6d6d6d;"><b>' + s[0] + "</b></span></span>"), (o = ""))
                                                                : (a = '<span ><span style="color: #6d6d6d;">' + r[2] + "</span></span>"),
                                                                { label: a, value: "Redirecting", catid: r[1], parent2: r[6], innValueUrl: o, valueUrl: r[3] })
                                                            : ((a = '<span ><span style="color: #6d6d6d;">' + r[0] + "</span>" + r[12]),
                                                                r[4] > 0 && (a = a + ' <span style="font-size:11px;color:#44a512;padding-top: 3px;">(' + r[4] + " Variants)</span>"),
                                                                (a += "</span>"),
                                                                (a += '<div class="clear"></div>'),
                                                            {
                                                                label: (a = a + ' <span style="font-size:11px;color:#44a512;padding-top: 3px;">' + r[7] + "</span>"),
                                                                value: r[0] + "-" + r[1],
                                                                catid: r[1],
                                                                parent2: r[6],
                                                                level1: r[8],
                                                                ptype: r[9],
                                                                valueUrl: r[11],
                                                                isCorp: r[12],
                                                            });
                                                })
                                            ),
                                            (srctype = srctype1),
                                            $(".search-span-head").parent().parent().css({ background: "rgba(204,204,204,0.3)", cursor: "default" }),
                                            $(".search-span-headAnchor").parent().parent().css({ background: "rgba(204,204,204,0.3)" });
                                    },
                                    error: function (e) { },
                                })));
            },
            minLength: 0,
            selectFirst: !0,
            select: function (e, t) {
                if ("0" != t.item.parent2 && void 0 != t.item.parent2) {
                    let n = r("srchparent2");
                    setCookiesrch("srchparent2", (n = "" == n || "0" == n ? t.item.parent2 : n + "," + t.item.parent2));
                }
                if ("0" != t.item.catid && "11111111" != t.item.catid && "111111" != t.item.catid && "Redirecting" != t.item.catid && void 0 != t.item.catid) {
                    let a = r("srchcatid");
                    setCookiesrch("srchcatid", (a = "" == a || "0" == a ? t.item.catid : a + "," + t.item.catid));
                }
                var s = "";
                if (($("#ui_element").find(".sb_dropdown").hide(), 0 == t.item.value)) {
                    var o = document.getElementById("CategorySP"),
                        l = "";
                    null != o && (l = "&amp;p=" + o.options[o.selectedIndex].value),
                        (s = mshost + "search/prodsrch.aspx?data=" + encodeURIComponent(this.value.toLowerCase()).replace(/%20/g, "+") + decodeURIComponent("%26type=%26p=") + srchcat),
                        msgdlength > 1 ? (window.location.href = s) : (window.location = s),
                        insertSearch(document.getElementById("txtRarTabSearch").value, "Clicked on see more", btoa(window.location.href), btoa(s));
                } else if (111111 == t.item.value) window.location.href = t.item.url;
                else if ("Redirecting" == t.item.value) {
                    var c = t.item.valueUrl,
                        d = t.item.innValueUrl;
                    c ? (window.location.href = c) : d ? (window.location.href = d) : (t.item.value = "");
                } else {
                    t.item.value;
                    var c = t.item.valueUrl;
                    t.item.level1,
                        t.item.parent2,
                        t.item.ptype,
                        (s = c),
                        "11111111" == t.item.catid
                            ? insertSearch(document.getElementById("txtRarTabSearch").value, "Clicked on Category link", btoa(window.location.href), btoa(s))
                            : insertSearch(document.getElementById("txtRarTabSearch").value, "Clicked on product link", btoa(window.location.href), btoa(s)),
                        (window.location.href = s),
                        (document.getElementById("txtRarTabSearch").value = "");
                }
            },
        }),
        $("#txtRarTabSearch").click(function () {
            $(this).autocomplete("search");
        });
});
;
var UFO = { req: ["movie", "width", "height", "majorversion", "build"], opt: ["play", "loop", "menu", "quality", "scale", "salign", "wmode", "bgcolor", "base", "flashvars", "devicefont", "allowscriptaccess", "seamlesstabbing"], optAtt: ["id", "name", "align"], optExc: ["swliveconnect"], ximovie: "ufo.swf", xiwidth: "215", xiheight: "138", ua: navigator.userAgent.toLowerCase(), pluginType: "", fv: [0, 0], foList: [], create: function (e, t) { !UFO.uaHas("w3cdom") || UFO.uaHas("ieMac") || (UFO.getFlashVersion(), UFO.foList[t] = UFO.updateFO(e), UFO.createCSS("#" + t, "visibility:hidden;"), UFO.domLoad(t)) }, updateFO: function (e) { return void 0 !== e.xi && "true" == e.xi && (void 0 === e.ximovie && (e.ximovie = UFO.ximovie), void 0 === e.xiwidth && (e.xiwidth = UFO.xiwidth), void 0 === e.xiheight && (e.xiheight = UFO.xiheight)), e.mainCalled = !1, e }, domLoad: function (e) { var t = setInterval(function () { (null != document.getElementsByTagName("body")[0] || null != document.body) && null != document.getElementById(e) && (UFO.main(e), clearInterval(t)) }, 250); void 0 !== document.addEventListener && document.addEventListener("DOMContentLoaded", function () { UFO.main(e), clearInterval(t) }, null) }, main: function (e) { var t = UFO.foList[e]; t.mainCalled || (UFO.foList[e].mainCalled = !0, document.getElementById(e).style.visibility = "hidden", UFO.hasRequired(e) && (UFO.hasFlashVersion(parseInt(t.majorversion, 10), parseInt(t.build, 10)) ? (void 0 !== t.setcontainercss && "true" == t.setcontainercss && UFO.setContainerCSS(e), UFO.writeSWF(e)) : "true" == t.xi && UFO.hasFlashVersion(6, 65) && UFO.createDialog(e)), document.getElementById(e).style.visibility = "visible") }, createCSS: function (e, t) { var i = document.getElementsByTagName("head")[0], a = UFO.createElement("style"); if (UFO.uaHas("ieWin") || a.appendChild(document.createTextNode(e + " {" + t + "}")), a.setAttribute("type", "text/css"), a.setAttribute("media", "screen"), i.appendChild(a), UFO.uaHas("ieWin") && document.styleSheets && document.styleSheets.length > 0) { var o = document.styleSheets[document.styleSheets.length - 1]; "object" == typeof o.addRule && o.addRule(e, t) } }, setContainerCSS: function (e) { var t = UFO.foList[e], i = /%/.test(t.width) ? "" : "px", a = /%/.test(t.height) ? "" : "px"; UFO.createCSS("#" + e, "width:" + t.width + i + "; height:" + t.height + a + ";"), "100%" == t.width && UFO.createCSS("body", "margin-left:0; margin-right:0; padding-left:0; padding-right:0;"), "100%" == t.height && (UFO.createCSS("html", "height:100%; overflow:hidden;"), UFO.createCSS("body", "margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;")) }, createElement: function (e) { return UFO.uaHas("xml") && void 0 !== document.createElementNS ? document.createElementNS("http://www.w3.org/1999/xhtml", e) : document.createElement(e) }, createObjParam: function (e, t, i) { var a = UFO.createElement("param"); a.setAttribute("name", t), a.setAttribute("value", i), e.appendChild(a) }, uaHas: function (e) { var t = UFO.ua; switch (e) { case "w3cdom": return void 0 !== document.getElementById && void 0 !== document.getElementsByTagName && (void 0 !== document.createElement || void 0 !== document.createElementNS); case "xml": for (var i = document.getElementsByTagName("meta"), a = i.length, o = 0; o < a; o++)if (/content-type/i.test(i[o].getAttribute("http-equiv")) && /xml/i.test(i[o].getAttribute("content"))) return !0; return !1; case "ieMac": return /msie/.test(t) && !/opera/.test(t) && /mac/.test(t); case "ieWin": return /msie/.test(t) && !/opera/.test(t) && /win/.test(t); case "gecko": return /gecko/.test(t) && !/applewebkit/.test(t); case "opera": return /opera/.test(t); case "safari": return /applewebkit/.test(t); default: return !1 } }, getFlashVersion: function () { if (0 == UFO.fv[0]) { if (navigator.plugins && "object" == typeof navigator.plugins["Shockwave Flash"]) { UFO.pluginType = "npapi"; var e = navigator.plugins["Shockwave Flash"].description; if (void 0 !== e) { var t = parseInt((e = e.replace(/^.*\s+(\S+\s+\S+$)/, "$1")).replace(/^(.*)\..*$/, "$1"), 10), i = /r/.test(e) ? parseInt(e.replace(/^.*r(.*)$/, "$1"), 10) : 0; UFO.fv = [t, i] } } else if (window.ActiveXObject) { UFO.pluginType = "ax"; try { var a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7") } catch (o) { try { var a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); UFO.fv = [6, 0], a.AllowScriptAccess = "always" } catch (n) { if (6 == UFO.fv[0]) return } try { var a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash") } catch (r) { } } if ("object" == typeof a) { var e = a.GetVariable("$version"); void 0 !== e && (e = e.replace(/^\S+\s+(.*)$/, "$1").split(","), UFO.fv = [parseInt(e[0], 10), parseInt(e[2], 10)]) } } } }, hasRequired: function (e) { for (var t = UFO.req.length, i = 0; i < t; i++)if (void 0 === UFO.foList[e][UFO.req[i]]) return !1; return !0 }, hasFlashVersion: function (e, t) { return UFO.fv[0] > e || UFO.fv[0] == e && UFO.fv[1] >= t }, writeSWF: function (e) { var t = UFO.foList[e], i = document.getElementById(e); if ("npapi" == UFO.pluginType) { if (UFO.uaHas("gecko") || UFO.uaHas("xml")) { for (; i.hasChildNodes();)i.removeChild(i.firstChild); var a = UFO.createElement("object"); a.setAttribute("type", "application/x-shockwave-flash"), a.setAttribute("data", t.movie), a.setAttribute("width", t.width), a.setAttribute("height", t.height); for (var o = UFO.optAtt.length, n = 0; n < o; n++)void 0 !== t[UFO.optAtt[n]] && a.setAttribute(UFO.optAtt[n], t[UFO.optAtt[n]]); for (var r = UFO.opt.concat(UFO.optExc), o = r.length, n = 0; n < o; n++)void 0 !== t[r[n]] && UFO.createObjParam(a, r[n], t[r[n]]); i.appendChild(a) } else { for (var l = "", r = UFO.opt.concat(UFO.optAtt).concat(UFO.optExc), o = r.length, n = 0; n < o; n++)void 0 !== t[r[n]] && (l += " " + r[n] + '="' + t[r[n]] + '"'); i.innerHTML = '<embed type="application/x-shockwave-flash" src="' + t.movie + '" width="' + t.width + '" height="' + t.height + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + l + "></embed>" } } else if ("ax" == UFO.pluginType) { for (var s = "", o = UFO.optAtt.length, n = 0; n < o; n++)void 0 !== t[UFO.optAtt[n]] && (s += " " + UFO.optAtt[n] + '="' + t[UFO.optAtt[n]] + '"'); for (var h = "", o = UFO.opt.length, n = 0; n < o; n++)void 0 !== t[UFO.opt[n]] && (h += '<param name="' + UFO.opt[n] + '" value="' + t[UFO.opt[n]] + '" />'); var c = "https:" == window.location.protocol ? "https:" : "http:"; i.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + s + ' width="' + t.width + '" height="' + t.height + '" codebase="' + c + "//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + t.majorversion + ",0," + t.build + ',0"><param name="movie" value="' + t.movie + '" />' + h + "</object>" } }, createDialog: function (e) { var t = UFO.foList[e]; UFO.createCSS("html", "height:100%; overflow:hidden;"), UFO.createCSS("body", "height:100%; overflow:hidden;"), UFO.createCSS("#xi-con", "position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;"), UFO.createCSS("#xi-dia", "position:absolute; left:50%; top:50%; margin-left: -" + Math.round(parseInt(t.xiwidth, 10) / 2) + "px; margin-top: -" + Math.round(parseInt(t.xiheight, 10) / 2) + "px; width:" + t.xiwidth + "px; height:" + t.xiheight + "px;"); var i = document.getElementsByTagName("body")[0], a = UFO.createElement("div"); a.setAttribute("id", "xi-con"); var o = UFO.createElement("div"); o.setAttribute("id", "xi-dia"), a.appendChild(o), i.appendChild(a); var n = window.location; if (UFO.uaHas("xml") && UFO.uaHas("safari")) var r = document.getElementsByTagName("title")[0].firstChild.nodeValue = document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0, 47) + " - Flash Player Installation"; else var r = document.title = document.title.slice(0, 47) + " - Flash Player Installation"; var l = "ax" == UFO.pluginType ? "ActiveX" : "PlugIn", s = void 0 !== t.xiurlcancel ? "&xiUrlCancel=" + t.xiurlcancel : "", h = void 0 !== t.xiurlfailed ? "&xiUrlFailed=" + t.xiurlfailed : ""; UFO.foList["xi-dia"] = { movie: t.ximovie, width: t.xiwidth, height: t.xiheight, majorversion: "6", build: "65", flashvars: "MMredirectURL=" + n + "&MMplayerType=" + l + "&MMdoctitle=" + r + s + h }, UFO.writeSWF("xi-dia") }, expressInstallCallback: function () { var e = document.getElementsByTagName("body")[0], t = document.getElementById("xi-con"); e.removeChild(t), UFO.createCSS("body", "height:auto; overflow:auto;"), UFO.createCSS("html", "height:auto; overflow:auto;") }, cleanupIELeaks: function () { for (var e = document.getElementsByTagName("object"), t = e.length, i = 0; i < t; i++)for (var a in e[i].style.display = "none", e[i]) "function" == typeof e[i][a] && (e[i][a] = null) } }; void 0 !== window.attachEvent && UFO.uaHas("ieWin") && window.attachEvent("onunload", UFO.cleanupIELeaks);;
function dissCounter(e) { var n = e.value.replace(/\s+/g, " ").length, s = e.parentNode; (n < 5 || n > 500) && (s.parentElement.children[3].style.color = "#FD3A02", n < 5 ? s.parentElement.children[3].innerHTML = 500 - n : s.parentElement.children[3].innerHTML = "-" + (n - 500), s.parentElement.children[2].setAttribute("disabled", "")), (n >= 5 && n < 500 || 0 == n) && (s.parentElement.children[3].style.color = "#76A44E", s.parentElement.children[3].innerHTML = 500 - n, s.parentElement.children[2].removeAttribute("disabled")) } function askQuestion(e, n) { document.getElementById("askquestion").disabled = !0; var s = $("#txtQueArea").val(), t = CatId; if ("" == s.replace(/\s+/g, " ").replace(/(<([^>]+)>)/ig, "")) return $("#errCommentrr").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").show(), document.getElementById("askquestion").disabled = !1, !1; $.get("/product/product_discussion_ajax.aspx?cid=" + t + "&valid=1&ques=" + UrlEncode1(s).replace(/\s+/g, " ").replace("#", "hhash") + "&ask=1&timestamp=" + new Date().getTime(), function (n) { if (n.indexOf("Bad word(s)") > -1) return document.getElementById("errCommentrr").style.display = "block", document.getElementById("errCommentrr").innerHTML = "<span>" + n + "</span>", document.getElementById("askquestion").disabled = !1, !1; if (n.indexOf("success") > -1) { $(e).parent().siblings("#emptytext").hide(), document.getElementById("errCommentrr").style.display = "none", document.getElementById("errCommentrr").innerHTML = ""; var t = n.substring(n.indexOf("|") + 1); $("#txtQueArea").val(""), document.getElementById("askquestion").disabled = !1; var i = ""; $(e).parent().parent().children("ul").length > 0 ? i = "" : i += "", i = (i = i + '<div class="answer"><div class="row table"><div class="qnauserpic" > <a href="/' + strUsrName + '"><div class="profile-img"><img src="' + strUsrIcon + '" /></div></a></div>') + '<div class="ans-content"><div class="row qatitle" onclick="javascript:userAnswerNew(event,this);"><p>' + s + "</p>", i += '<p class="notify">few seconds ago</p>', i = (i = (i = i + '<p class="notify">By: <a id="hypUser" href="/' + strUsrName + '/timeline">' + strUsrName + "</a></p>") + '<p class="notify numbers"><span class="icon-comment"></span>Answers: <span id="spn' + t + '">0</span></p></div>') + '<div class="answer-field" style="overflow: hidden; display: none;"><p class="warning hide" id="errCommentans"></p><span><textarea placeholder="Write your answer..." onkeyup="dissCounter(this);"></textarea></span><button class="btn btn-secondary" id="anser" onclick="javascript:answerQuestion(this,' + t + ');return false;">Submit</button><span class="pull-right text-right">500</span></div></div>', i += '<div class="text-right"><a class="btn btn-link btn-light"  onclick="javascript:answerQuesNew(event,this);">Answer</a></div></div></div>', $("#quesdata").after(i), $(e).siblings(".pull-right").html("500"), $(".answer .btn-link").click(function (e) { $(this).parent().parent().siblings(".answer-field").slideToggle(500), e.stopPropagation() }), $(".h2val1").html("500") } }) } function answerQuestion(e, n) { document.getElementById("answer").disabled = !0; var s = $(e).parent().children(2).children("textarea").val(); $(e).parent().children(2).children("textarea").val(""); var t = CatId; if (e.parentNode, "" == s.replace(/\s+/g, " ").replace(/(<([^>]+)>)/ig, "")) return $(e).parent().children("p").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").show(), document.getElementById("answer").disabled = !1, !1; $(e).parent().children("p").html(""), $.get("/product/product_discussion_ajax.aspx?cid=" + t + "&valid=1&anstxt=" + UrlEncode1(s).replace(/\s+/g, " ").replace("#", "hhash") + "&quesId=" + n + "&ans=1&timestamp=" + new Date().getTime(), function (s) { if ("" != s) { if (s.indexOf("Bad word(s)") > -1) return document.getElementById("diverror_discussion").style.display = "block", document.getElementById("diverror_discussion").innerHTML = "<span>" + s + "</span>", document.getElementById("answer").disabled = !1, !1; document.getElementById("diverror_discussion").style.display = "none", document.getElementById("diverror_discussion").innerHTML = "", $(e).parent().children(2).children("textarea").val(""), document.getElementById("answer").disabled = !1; var t, i = ""; i += '<div class="user-answer">', i += "<div>", i = i + '<p class="br-none lh20">' + s.split("|")[0] + "</p>", i += '<p class="notify">few seconds ago</p>', i += '<p class="notify">', i = i + 'By: <a id="hypUsrAns" href="/' + strUsrName + '/timeline">' + strUsrName + "</a> ", i += "</p>", i += "</div>", i += "</div>", null != $(e).parent().siblings(".user-answers").html() ? (i += $(e).parent().siblings(".user-answers").html(), $(e).parent().siblings(".user-answers").html(i), $(e).siblings(".pull-right").html("500")) : ($(e).parent().parent().append('<div class="row user-answers display" id="dvanswer">' + i + "</div>"), $(e).siblings(".pull-right").html("500")); var r = parseInt($("#spn" + n).html()); $("#spn" + n).html(r + 1), $(".h2val").html("500"), $(e).parent().siblings(".user-answers").slideDown({ easing: "easeInQuad" }) } }) } function UrlEncode1(e) { return e = (e = encodeURIComponent ? encodeURIComponent(e) : encodeURI ? encodeURI(e) : escape(e)).replace(/\+/g, "%2B") };
/*! lightgallery - v1.2.19 - 2016-05-17
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ !function (e, s, t, i) { "use strict"; var l = { mode: "lg-slide", cssEasing: "ease", easing: "linear", speed: 400, height: "", width: "", addClass: "", startClass: "", backdropDuration: 150, hideBarsDelay: 6e3, useLeft: !1, closable: !0, loop: !0, escKey: !0, keyPress: !0, controls: !0, slideEndAnimatoin: !1, hideControlOnEnd: !0, mousewheel: !0, getCaptionFromTitleOrAlt: !0, appendSubHtmlTo: ".lg-sub-html", preload: 1, showAfterLoad: !0, selector: "", selectWithin: "", nextHtml: "", prevHtml: "", index: !1, iframeMaxWidth: "100%", download: !1, counter: !0, appendCounterTo: ".lg-toolbar", swipeThreshold: 50, enableSwipe: !0, enableDrag: !0, dynamic: !1, dynamicEl: [], galleryId: 1 }; function o(s, i) { if (this.el = s, this.$el = e(s), this.s = e.extend({}, l, i), this.s.dynamic && "undefined" !== this.s.dynamicEl && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) throw "When using dynamic mode, you must also define dynamicEl as an Array."; return this.modules = {}, this.lGalleryOn = !1, this.lgBusy = !1, this.hideBartimeout = !1, this.isTouch = "ontouchstart" in t.documentElement, this.s.slideEndAnimatoin && (this.s.hideControlOnEnd = !1), this.s.dynamic ? this.$items = this.s.dynamicEl : "this" === this.s.selector ? this.$items = this.$el : "" !== this.s.selector ? this.s.selectWithin ? this.$items = e(this.s.selectWithin).find(this.s.selector) : this.$items = this.$el.find(e(this.s.selector)) : this.$items = this.$el.children(), this.$slide = "", this.$outer = "", this.init(), this } o.prototype.init = function () { var t = this; t.s.preload > t.$items.length && (t.s.preload = t.$items.length); var i = s.location.hash; i.indexOf("lg=" + this.s.galleryId) > 0 && (t.index = parseInt(i.split("&slide=")[1], 10), e("body").addClass("lg-from-hash"), e("body").hasClass("lg-on") || setTimeout(function () { t.build(t.index), e("body").addClass("lg-on") })), t.s.dynamic ? (t.$el.trigger("onBeforeOpen.lg"), t.index = t.s.index || 0, e("body").hasClass("lg-on") || setTimeout(function () { t.build(t.index), e("body").addClass("lg-on") })) : t.$items.on("click.lgcustom", function (s) { try { s.preventDefault(), s.preventDefault() } catch (i) { s.returnValue = !1 } t.$el.trigger("onBeforeOpen.lg"), t.index = t.s.index || t.$items.index(this), e("body").hasClass("lg-on") || (t.build(t.index), e("body").addClass("lg-on")) }) }, o.prototype.build = function (s) { var t = this; t.structure(), e.each(e.fn.lightGallery.modules, function (s) { t.modules[s] = new e.fn.lightGallery.modules[s](t.el) }), t.slide(s, !1, !1), t.s.keyPress && t.keyPress(), t.$items.length > 1 && (t.arrow(), setTimeout(function () { t.enableDrag(), t.enableSwipe() }, 50), t.s.mousewheel && t.mousewheel()), t.counter(), t.closeGallery(), t.$el.trigger("onAfterOpen.lg"), t.$outer.on("mousemove.lg click.lg touchstart.lg", function () { t.$outer.removeClass("lg-hide-items"), clearTimeout(t.hideBartimeout), t.hideBartimeout = setTimeout(function () { t.$outer.addClass("lg-hide-items") }, t.s.hideBarsDelay) }) }, o.prototype.structure = function () { var t, i = "", l = "", o = 0, a = "", n = this; for (e("body").append('<div class="lg-backdrop"></div>'), e(".lg-backdrop").css("transition-duration", this.s.backdropDuration + "ms"), o = 0; o < this.$items.length; o++)i += '<div class="lg-item"></div>'; if (this.s.controls && this.$items.length > 1 && (l = '<div class="lg-actions"><div class="icon-previous">' + this.s.prevHtml + '</div><div class="icon-next">' + this.s.nextHtml + "</div></div>"), ".lg-sub-html" === this.s.appendSubHtmlTo && (a = " "), t = '<div class="container"><div class="lg-outer ' + this.s.addClass + " " + this.s.startClass + '"><div class="lg-toolbar group"><span class="icon-close"></span></div>' + l + '<div class="lg" style="width:' + this.s.width + "; height:" + this.s.height + '"><div class="lg-inner">' + i + "</div>" + a + "</div></div>", e("body").append(t), this.$outer = e(".lg-outer"), this.$slide = this.$outer.find(".lg-item"), this.s.useLeft ? (this.$outer.addClass("lg-use-left"), this.s.mode = "lg-slide") : this.$outer.addClass("lg-use-css3"), n.setTop(), e(s).on("resize.lg orientationchange.lg", function () { setTimeout(function () { n.setTop() }, 100) }), this.$slide.eq(this.index).addClass("lg-current"), this.doCss() ? this.$outer.addClass("lg-css3") : (this.$outer.addClass("lg-css"), this.s.speed = 0), this.$outer.addClass(this.s.mode), this.s.enableDrag && this.$items.length > 1 && this.$outer.addClass("lg-grab"), this.s.showAfterLoad && this.$outer.addClass("lg-show-after-load"), this.doCss()) { var d = this.$outer.find(".lg-inner"); d.css("transition-timing-function", this.s.cssEasing), d.css("transition-duration", this.s.speed + "ms") } e(".lg-backdrop").addClass("in"), setTimeout(function () { n.$outer.addClass("lg-visible") }, this.s.backdropDuration), this.prevScrollTop = e(s).scrollTop() }, o.prototype.setTop = function () { if ("100%" !== this.s.height) { var t = e(s).height(), i = (t - parseInt(this.s.height, 10)) / 2, l = this.$outer.find(".lg"); t >= parseInt(this.s.height, 10) ? l.css("top", i + "px") : l.css("top", "0px") } }, o.prototype.doCss = function () { return !!function () { var e = ["transition", "MozTransition", "WebkitTransition", "OTransition", "msTransition", "KhtmlTransition"], s = t.documentElement, i = 0; for (i = 0; i < e.length; i++)if (e[i] in s.style) return !0 }() }, o.prototype.isVideo = function (e, s) { if (t = this.s.dynamic ? this.s.dynamicEl[s].html : this.$items.eq(s).attr("data-html"), !e && t) return { html5: !0 }; var t, i = e.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i), l = e.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i), o = e.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i), a = e.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i); return i ? { youtube: i } : l ? { vimeo: l } : o ? { dailymotion: o } : a ? { vk: a } : void 0 }, o.prototype.counter = function () { this.s.counter && e(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + "</span></div>") }, o.prototype.addHtml = function (s) { var t, i = null; if (this.s.dynamic ? this.s.dynamicEl[s].subHtmlUrl ? t = this.s.dynamicEl[s].subHtmlUrl : i = this.s.dynamicEl[s].subHtml : this.$items.eq(s).attr("data-sub-html-url") ? t = this.$items.eq(s).attr("data-sub-html-url") : (i = this.$items.eq(s).attr("data-sub-html"), this.s.getCaptionFromTitleOrAlt && !i && (i = this.$items.eq(s).attr("title") || this.$items.eq(s).find("img").first().attr("alt"))), !t) { if (null != i) { var l = i.substring(0, 1); ("." === l || "#" === l) && (i = e(i).html()) } else i = "" } ".lg-sub-html" === this.s.appendSubHtmlTo ? t ? this.$outer.find(this.s.appendSubHtmlTo).load(t) : this.$outer.find(this.s.appendSubHtmlTo).html(i) : t ? this.$slide.eq(s).load(t) : this.$slide.eq(s).append(i), null != i && ("" === i ? this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html") : this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")), this.$el.trigger("onAfterAppendSubHtml.lg", [s]) }, o.prototype.preload = function (e) { var s = 1, t = 1; for (s = 1; s <= this.s.preload && !(s >= this.$items.length - e); s++)this.loadContent(e + s, !1, 0); for (t = 1; t <= this.s.preload && !(e - t < 0); t++)this.loadContent(e - t, !1, 0) }, o.prototype.loadContent = function (t, i, l) { var o, a, n, d, r, h, g = this, u = !1, c = function (t) { for (var i = [], l = [], o = 0; o < t.length; o++) { var n = t[o].split(" "); "" === n[0] && n.splice(0, 1), l.push(n[0]), i.push(n[1]) } for (var d = e(s).width(), r = 0; r < i.length; r++)if (parseInt(i[r], 10) > d) { a = l[r]; break } }; if (g.s.dynamic) g.s.dynamicEl[t].poster && (u = !0, n = g.s.dynamicEl[t].poster), h = g.s.dynamicEl[t].html, a = g.s.dynamicEl[t].src, g.s.dynamicEl[t].responsive && c(g.s.dynamicEl[t].responsive.split(",")), d = g.s.dynamicEl[t].srcset, r = g.s.dynamicEl[t].sizes; else { if (g.$items.eq(t).attr("data-poster") && (u = !0, n = g.$items.eq(t).attr("data-poster")), h = g.$items.eq(t).attr("data-html"), a = g.$items.eq(t).attr("href") || g.$items.eq(t).attr("data-src"), g.$items.eq(t).attr("data-responsive")) { var m = g.$items.eq(t).attr("data-responsive").split(","); c(m) } d = g.$items.eq(t).attr("data-srcset"), r = g.$items.eq(t).attr("data-sizes") } var p = !1; g.s.dynamic ? g.s.dynamicEl[t].iframe && (p = !0) : "true" === g.$items.eq(t).attr("data-iframe") && (p = !0); var f = g.isVideo(a, t); if (!g.$slide.eq(t).hasClass("lg-loaded")) { if (p) g.$slide.eq(t).prepend('<div class="lg-video-cont" style="max-width:' + g.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + a + '"  allowfullscreen="true"></iframe></div></div>'); else if (u) { var v = ""; v = f && f.youtube ? "lg-has-youtube" : f && f.vimeo ? "lg-has-vimeo" : "lg-has-html5", g.$slide.eq(t).prepend('<div class="lg-video-cont ' + v + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + n + '" /></div></div>') } else f ? (g.$slide.eq(t).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'), g.$el.trigger("hasVideo.lg", [t, a, h])) : g.$slide.eq(t).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + a + '" /><div class="lg-sub-html"></div></div>'); if (g.$el.trigger("onAferAppendSlide.lg", [t]), o = g.$slide.eq(t).find(".lg-object"), r && o.attr("sizes", r), d) { o.attr("srcset", d); try { picturefill({ elements: [o[0]] }) } catch (y) { console.error("Make sure you have included Picturefill version 2") } } ".lg-sub-html" !== this.s.appendSubHtmlTo && g.addHtml(t), g.$slide.eq(t).addClass("lg-loaded") } g.$slide.eq(t).find(".lg-object").on("load.lg error.lg", function () { var s = 0; l && !e("body").hasClass("lg-from-hash") && (s = l), setTimeout(function () { g.$slide.eq(t).addClass("lg-complete"), g.$el.trigger("onSlideItemLoad.lg", [t, l || 0]) }, s) }), f && f.html5 && !u && g.$slide.eq(t).addClass("lg-complete"), !0 === i && (g.$slide.eq(t).hasClass("lg-complete") ? g.preload(t) : g.$slide.eq(t).find(".lg-object").on("load.lg error.lg", function () { g.preload(t) })) }, o.prototype.slide = function (s, t, i) { var l, o = this.$outer.find(".lg-current").index(), a = this; if (!a.lGalleryOn || o !== s) { var n = this.$slide.length, d = a.lGalleryOn ? this.s.speed : 0, r = !1, h = !1; if (!a.lgBusy) { if (this.s.download && ((l = a.s.dynamic ? !1 !== a.s.dynamicEl[s].downloadUrl && (a.s.dynamicEl[s].downloadUrl || a.s.dynamicEl[s].src) : "false" !== a.$items.eq(s).attr("data-download-url") && (a.$items.eq(s).attr("data-download-url") || a.$items.eq(s).attr("href") || a.$items.eq(s).attr("data-src"))) ? (e("#lg-download").attr("href", l), a.$outer.removeClass("lg-hide-download")) : a.$outer.addClass("lg-hide-download")), this.$el.trigger("onBeforeSlide.lg", [o, s, t, i]), a.lgBusy = !0, clearTimeout(a.hideBartimeout), ".lg-sub-html" === this.s.appendSubHtmlTo && setTimeout(function () { a.addHtml(s) }, d), this.arrowDisable(s), t) { var g = s - 1, u = s + 1; 0 === s && o === n - 1 ? (u = 0, g = n - 1) : s === n - 1 && 0 === o && (u = 0, g = n - 1), this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"), a.$slide.eq(g).addClass("lg-prev-slide"), a.$slide.eq(u).addClass("lg-next-slide"), a.$slide.eq(s).addClass("lg-current") } else a.$outer.addClass("lg-no-trans"), this.$slide.removeClass("lg-prev-slide lg-next-slide"), s < o ? (h = !0, 0 !== s || o !== n - 1 || i || (h = !1, r = !0)) : s > o && (r = !0, s !== n - 1 || 0 !== o || i || (h = !0, r = !1)), h ? (this.$slide.eq(s).addClass("lg-prev-slide"), this.$slide.eq(o).addClass("lg-next-slide")) : r && (this.$slide.eq(s).addClass("lg-next-slide"), this.$slide.eq(o).addClass("lg-prev-slide")), setTimeout(function () { a.$slide.removeClass("lg-current"), a.$slide.eq(s).addClass("lg-current"), a.$outer.removeClass("lg-no-trans") }, 50); a.lGalleryOn ? (setTimeout(function () { a.loadContent(s, !0, 0) }, this.s.speed + 50), setTimeout(function () { a.lgBusy = !1, a.$el.trigger("onAfterSlide.lg", [o, s, t, i]) }, this.s.speed)) : (a.loadContent(s, !0, a.s.backdropDuration), a.lgBusy = !1, a.$el.trigger("onAfterSlide.lg", [o, s, t, i])), a.lGalleryOn = !0, this.s.counter && e("#lg-counter-current").text(s + 1) } } }, o.prototype.goToNextSlide = function (e) { var s = this; !s.lgBusy && (s.index + 1 < s.$slide.length ? (s.index++, s.$el.trigger("onBeforeNextSlide.lg", [s.index]), s.slide(s.index, e, !1)) : s.s.loop ? (s.index = 0, s.$el.trigger("onBeforeNextSlide.lg", [s.index]), s.slide(s.index, e, !1)) : s.s.slideEndAnimatoin && (s.$outer.addClass("lg-right-end"), setTimeout(function () { s.$outer.removeClass("lg-right-end") }, 400))) }, o.prototype.goToPrevSlide = function (e) { var s = this; !s.lgBusy && (s.index > 0 ? (s.index--, s.$el.trigger("onBeforePrevSlide.lg", [s.index, e]), s.slide(s.index, e, !1)) : s.s.loop ? (s.index = s.$items.length - 1, s.$el.trigger("onBeforePrevSlide.lg", [s.index, e]), s.slide(s.index, e, !1)) : s.s.slideEndAnimatoin && (s.$outer.addClass("lg-left-end"), setTimeout(function () { s.$outer.removeClass("lg-left-end") }, 400))) }, o.prototype.keyPress = function () { var t = this; this.$items.length > 1 && e(s).on("keyup.lg", function (e) { t.$items.length > 1 && (37 === e.keyCode && (e.preventDefault(), t.goToPrevSlide()), 39 === e.keyCode && (e.preventDefault(), t.goToNextSlide())) }), e(s).on("keydown.lg", function (e) { !0 === t.s.escKey && 27 === e.keyCode && (e.preventDefault(), t.$outer.hasClass("lg-thumb-open") ? t.$outer.removeClass("lg-thumb-open") : t.destroy()) }) }, o.prototype.arrow = function () { var e = this; this.$outer.find(".icon-previous").on("click.lg", function () { e.goToPrevSlide() }), this.$outer.find(".icon-next").on("click.lg", function () { e.goToNextSlide() }) }, o.prototype.arrowDisable = function (e) { !this.s.loop && this.s.hideControlOnEnd && (e + 1 < this.$slide.length ? this.$outer.find(".lg-next").removeAttr("disabled").removeClass("disabled") : this.$outer.find(".lg-next").attr("disabled", "disabled").addClass("disabled"), e > 0 ? this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled") : this.$outer.find(".lg-prev").attr("disabled", "disabled").addClass("disabled")) }, o.prototype.setTranslate = function (e, s, t) { this.s.useLeft ? e.css("left", s) : e.css({ transform: "translate3d(" + s + "px, " + t + "px, 0px)" }) }, o.prototype.touchMove = function (s, t) { var i = t - s; Math.abs(i) > 15 && (this.$outer.addClass("lg-dragging"), this.setTranslate(this.$slide.eq(this.index), i, 0), this.setTranslate(e(".lg-prev-slide"), -this.$slide.eq(this.index).width() + i, 0), this.setTranslate(e(".lg-next-slide"), this.$slide.eq(this.index).width() + i, 0)) }, o.prototype.touchEnd = function (e) { var s = this; "lg-slide" !== s.s.mode && s.$outer.addClass("lg-slide"), this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity", "0"), setTimeout(function () { s.$outer.removeClass("lg-dragging"), e < 0 && Math.abs(e) > s.s.swipeThreshold ? s.goToNextSlide(!0) : e > 0 && Math.abs(e) > s.s.swipeThreshold ? s.goToPrevSlide(!0) : 5 > Math.abs(e) && s.$el.trigger("onSlideClick.lg"), s.$slide.removeAttr("style") }), setTimeout(function () { s.$outer.hasClass("lg-dragging") || "lg-slide" === s.s.mode || s.$outer.removeClass("lg-slide") }, s.s.speed + 100) }, o.prototype.enableSwipe = function () { var e = this, s = 0, t = 0, i = !1; e.s.enableSwipe && e.isTouch && e.doCss() && (e.$slide.on("touchstart.lg", function (t) { e.$outer.hasClass("lg-zoomed") || e.lgBusy || (t.preventDefault(), e.manageSwipeClass(), s = t.originalEvent.targetTouches[0].pageX) }), e.$slide.on("touchmove.lg", function (l) { e.$outer.hasClass("lg-zoomed") || (l.preventDefault(), t = l.originalEvent.targetTouches[0].pageX, e.touchMove(s, t), i = !0) }), e.$slide.on("touchend.lg", function () { e.$outer.hasClass("lg-zoomed") || (i ? (i = !1, e.touchEnd(t - s)) : e.$el.trigger("onSlideClick.lg")) })) }, o.prototype.enableDrag = function () { var t = this, i = 0, l = 0, o = !1, a = !1; t.s.enableDrag && !t.isTouch && t.doCss() && (t.$slide.on("mousedown.lg", function (s) { !t.$outer.hasClass("lg-zoomed") && (e(s.target).hasClass("lg-object") || e(s.target).hasClass("lg-video-play")) && (s.preventDefault(), t.lgBusy || (t.manageSwipeClass(), i = s.pageX, o = !0, t.$outer.scrollLeft += 1, t.$outer.scrollLeft -= 1, t.$outer.removeClass("lg-grab").addClass("lg-grabbing"), t.$el.trigger("onDragstart.lg"))) }), e(s).on("mousemove.lg", function (e) { o && (a = !0, l = e.pageX, t.touchMove(i, l), t.$el.trigger("onDragmove.lg")) }), e(s).on("mouseup.lg", function (s) { a ? (a = !1, t.touchEnd(l - i), t.$el.trigger("onDragend.lg")) : (e(s.target).hasClass("lg-object") || e(s.target).hasClass("lg-video-play")) && t.$el.trigger("onSlideClick.lg"), o && (o = !1, t.$outer.removeClass("lg-grabbing").addClass("lg-grab")) })) }, o.prototype.manageSwipeClass = function () { var e = this.index + 1, s = this.index - 1, t = this.$slide.length; this.s.loop && (0 === this.index ? s = t - 1 : this.index === t - 1 && (e = 0)), this.$slide.removeClass("lg-next-slide lg-prev-slide"), s > -1 && this.$slide.eq(s).addClass("lg-prev-slide"), this.$slide.eq(e).addClass("lg-next-slide") }, o.prototype.mousewheel = function () { var e = this; e.$outer.on("mousewheel.lg", function (s) { s.deltaY && (s.deltaY > 0 ? e.goToPrevSlide() : e.goToNextSlide(), s.preventDefault()) }) }, o.prototype.closeGallery = function () { var s = this, t = !1; this.$outer.find(".icon-close").on("click.lg", function () { s.destroy() }), s.s.closable && (s.$outer.on("mousedown.lg", function (s) { t = !!(e(s.target).is(".lg-outer") || e(s.target).is(".lg-item ") || e(s.target).is(".lg-img-wrap")) }), s.$outer.on("mouseup.lg", function (i) { (e(i.target).is(".lg-outer") || e(i.target).is(".lg-item ") || e(i.target).is(".lg-img-wrap") && t) && !s.$outer.hasClass("lg-dragging") && s.destroy() })) }, o.prototype.destroy = function (t) { var i = this; t || i.$el.trigger("onBeforeClose.lg"), e(s).scrollTop(i.prevScrollTop), t && (i.s.dynamic || this.$items.off("click.lg click.lgcustom"), e.removeData(i.el, "lightGallery")), this.$el.off(".lg.tm"), e.each(e.fn.lightGallery.modules, function (e) { i.modules[e] && i.modules[e].destroy() }), this.lGalleryOn = !1, clearTimeout(i.hideBartimeout), this.hideBartimeout = !1, e(s).off(".lg"), e("body").removeClass("lg-on lg-from-hash"), i.$outer && i.$outer.removeClass("lg-visible"), e(".lg-backdrop").removeClass("in"), setTimeout(function () { i.$outer && i.$outer.remove(), e(".lg-backdrop").remove(), t || i.$el.trigger("onCloseAfter.lg") }, i.s.backdropDuration + 50) }, e.fn.lightGallery = function (s) { return this.each(function () { if (e.data(this, "lightGallery")) try { e(this).data("lightGallery").init() } catch (t) { console.error("lightGallery has not initiated properly") } else e.data(this, "lightGallery", new o(this, s)) }) }, e.fn.lightGallery.modules = {} }(jQuery, window, document), $(document).ready(function () { });;
/*! lightgallery - v1.2.19 - 2016-05-17
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ !function (t, e, i, o) { "use strict"; var h = { thumbnail: !0, animateThumb: !0, currentPagerPosition: "middle", thumbWidth: 120, thumbContHeight: 100, thumbMargin: 5, exThumbImage: !1, showThumbByDefault: !0, toogleThumb: !0, pullCaptionUp: !0, enableThumbDrag: !0, enableThumbSwipe: !0, swipeThreshold: 50, loadYoutubeThumbnail: !0, youtubeThumbSize: 1, loadVimeoThumbnail: !0, vimeoThumbSize: "thumbnail_small", loadDailymotionThumbnail: !0 }, u = function (e) { return this.core = t(e).data("lightGallery"), this.core.s = t.extend({}, h, this.core.s), this.$el = t(e), this.$thumbOuter = null, this.thumbOuterWidth = 0, this.thumbTotalWidth = this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin), this.thumbIndex = this.core.index, this.left = 0, this.init(), this }; u.prototype.init = function () { var e = this; this.core.s.thumbnail && this.core.$items.length > 1 && (this.core.s.showThumbByDefault && setTimeout(function () { e.core.$outer.addClass("lg-thumb-open") }, 700), this.core.s.pullCaptionUp && this.core.$outer.addClass("lg-pull-caption-up"), this.build(), this.core.s.animateThumb ? (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss() && this.enableThumbDrag(), this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss() && this.enableThumbSwipe(), this.thumbClickable = !1) : this.thumbClickable = !0, this.toogle(), this.thumbkeyPress()), t(".lg-outer .lg-inner,.icon-previous,.icon-next").on({ mouseover: function () { t(".lg-outer .lg-thumb-outer").fadeOut("fast") }, mouseleave: function () { t(".lg-outer .lg-thumb-outer").fadeIn("fast") } }) }, u.prototype.build = function () { var i, o = this, h = "", u = ""; switch (this.core.s.vimeoThumbSize) { case "thumbnail_large": u = "640"; break; case "thumbnail_medium": u = "200x150"; break; case "thumbnail_small": u = "100x75" }function s(t, e, i) { var s, r = o.core.isVideo(t, i) || {}, a = ""; r.youtube || r.vimeo || r.dailymotion ? r.youtube ? s = o.core.s.loadYoutubeThumbnail ? "//img.youtube.com/vi/" + r.youtube[1] + "/" + o.core.s.youtubeThumbSize + ".jpg" : e : r.vimeo ? o.core.s.loadVimeoThumbnail ? (s = "//i.vimeocdn.com/video/error_" + u + ".jpg", a = r.vimeo[1]) : s = e : r.dailymotion && (s = o.core.s.loadDailymotionThumbnail ? "//www.dailymotion.com/thumbnail/video/" + r.dailymotion[1] : e) : s = e, h += '<div data-vimeo-id="' + a + '" class="lg-thumb-item" style="width:' + o.core.s.thumbWidth + "px; margin-right: " + o.core.s.thumbMargin + 'px"><img src="' + s + '" /></div>', a = "" } if (o.core.$outer.addClass("lg-has-thumb"), o.core.$outer.append('<div class="lg-thumb-outer"><div class="lg-thumb group"></div></div>'), o.$thumbOuter = o.core.$outer.find(".lg-thumb-outer"), o.thumbOuterWidth = o.$thumbOuter.width(), o.core.s.animateThumb && o.core.$outer.find(".lg-thumb").css({ width: o.thumbTotalWidth + "px", position: "relative" }), this.core.s.animateThumb && o.$thumbOuter.css("height", o.core.s.thumbContHeight + "px"), o.core.s.dynamic) for (var r = 0; r < o.core.s.dynamicEl.length; r++)s(o.core.s.dynamicEl[r].src, o.core.s.dynamicEl[r].thumb, r); else o.core.$items.each(function (e) { o.core.s.exThumbImage ? s(t(this).attr("href") || t(this).attr("data-src"), t(this).attr(o.core.s.exThumbImage), e) : s(t(this).attr("href") || t(this).attr("data-src"), t(this).find("img").attr("data-src"), e) }); o.core.$outer.find(".lg-thumb").html(h), (i = o.core.$outer.find(".lg-thumb-item")).each(function () { var e = t(this), i = e.attr("data-vimeo-id"); i && t.getJSON("//www.vimeo.com/api/v2/video/" + i + ".json?callback=?", { format: "json" }, function (t) { e.find("img").attr("src", t[0][o.core.s.vimeoThumbSize]) }) }), i.eq(o.core.index).addClass("active"), o.core.$el.on("onBeforeSlide.lg.tm", function () { i.removeClass("active"), i.eq(o.core.index).addClass("active") }), i.on("click.lg touchend.lg", function () { var e = t(this); setTimeout(function () { (!o.thumbClickable || o.core.lgBusy) && o.core.doCss() || (o.core.index = e.index(), o.core.slide(o.core.index, !1, !0)) }, 50) }), o.core.$el.on("onBeforeSlide.lg.tm", function () { o.animateThumb(o.core.index) }), t(e).on("resize.lg.thumb orientationchange.lg.thumb", function () { setTimeout(function () { o.animateThumb(o.core.index), o.thumbOuterWidth = o.$thumbOuter.width() }, 200) }) }, u.prototype.setTranslate = function (t) { this.core.$outer.find(".lg-thumb").css({ transform: "translate3d(-" + t + "px, 0px, 0px)" }) }, u.prototype.animateThumb = function (t) { var e, i = this.core.$outer.find(".lg-thumb"); if (this.core.s.animateThumb) { switch (this.core.s.currentPagerPosition) { case "left": e = 0; break; case "middle": e = this.thumbOuterWidth / 2 - this.core.s.thumbWidth / 2; break; case "right": e = this.thumbOuterWidth - this.core.s.thumbWidth }this.left = (this.core.s.thumbWidth + this.core.s.thumbMargin) * t - 1 - e, this.left > this.thumbTotalWidth - this.thumbOuterWidth && (this.left = this.thumbTotalWidth - this.thumbOuterWidth), this.left < 0 && (this.left = 0), this.core.lGalleryOn ? (i.hasClass("on") || this.core.$outer.find(".lg-thumb").css("transition-duration", this.core.s.speed + "ms"), this.core.doCss() || i.animate({ left: -this.left + "px" }, this.core.s.speed)) : this.core.doCss() || i.css("left", -this.left + "px"), this.setTranslate(this.left) } }, u.prototype.enableThumbDrag = function () { var i = this, o = 0, h = 0, u = !1, s = !1, r = 0; i.$thumbOuter.addClass("lg-grab"), i.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb", function (t) { i.thumbTotalWidth > i.thumbOuterWidth && (t.preventDefault(), o = t.pageX, u = !0, i.core.$outer.scrollLeft += 1, i.core.$outer.scrollLeft -= 1, i.thumbClickable = !1, i.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing")) }), t(e).on("mousemove.lg.thumb", function (t) { u && (r = i.left, s = !0, h = t.pageX, i.$thumbOuter.addClass("lg-dragging"), (r -= h - o) > i.thumbTotalWidth - i.thumbOuterWidth && (r = i.thumbTotalWidth - i.thumbOuterWidth), r < 0 && (r = 0), i.setTranslate(r)) }), t(e).on("mouseup.lg.thumb", function () { s ? (s = !1, i.$thumbOuter.removeClass("lg-dragging"), i.left = r, Math.abs(h - o) < i.core.s.swipeThreshold && (i.thumbClickable = !0)) : i.thumbClickable = !0, u && (u = !1, i.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")) }) }, u.prototype.enableThumbSwipe = function () { var t = this, e = 0, i = 0, o = !1, h = 0; t.core.$outer.find(".lg-thumb").on("touchstart.lg", function (i) { t.thumbTotalWidth > t.thumbOuterWidth && (i.preventDefault(), e = i.originalEvent.targetTouches[0].pageX, t.thumbClickable = !1) }), t.core.$outer.find(".lg-thumb").on("touchmove.lg", function (u) { t.thumbTotalWidth > t.thumbOuterWidth && (u.preventDefault(), i = u.originalEvent.targetTouches[0].pageX, o = !0, t.$thumbOuter.addClass("lg-dragging"), h = t.left, (h -= i - e) > t.thumbTotalWidth - t.thumbOuterWidth && (h = t.thumbTotalWidth - t.thumbOuterWidth), h < 0 && (h = 0), t.setTranslate(h)) }), t.core.$outer.find(".lg-thumb").on("touchend.lg", function () { t.thumbTotalWidth > t.thumbOuterWidth && o ? (o = !1, t.$thumbOuter.removeClass("lg-dragging"), Math.abs(i - e) < t.core.s.swipeThreshold && (t.thumbClickable = !0), t.left = h) : t.thumbClickable = !0 }) }, u.prototype.toogle = function () { this.core.s.toogleThumb && this.core.$outer.addClass("lg-can-toggle") }, u.prototype.thumbkeyPress = function () { var i = this; t(e).on("keydown.lg.thumb", function (t) { 38 === t.keyCode ? (t.preventDefault(), i.core.$outer.addClass("lg-thumb-open")) : 40 === t.keyCode && (t.preventDefault(), i.core.$outer.removeClass("lg-thumb-open")) }) }, u.prototype.destroy = function () { this.core.s.thumbnail && this.core.$items.length > 1 && (t(e).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"), this.$thumbOuter.remove(), this.core.$outer.removeClass("lg-has-thumb")) }, t.fn.lightGallery.modules.Thumbnail = u }(jQuery, window, document);;
function Rebindcorp() { $(".icon-reply").parent("a").unbind("click").click(function (e) { "Brand Response" == $(this).find("span:eq(1)").text() && (e.preventDefault(), $(this).closest(".count-section").siblings(".response").slideToggle()) }), $(".comment textarea").on("click focus", function (e) { $(this).css("height", "100px"), $(this).off(), $(this).parent().siblings(".expand-comment").slideDown("fast") }) } function openModal(e) { $(".black-layer").css("visibility", "visible"), $(e).addClass("modal"), $(e).find(".icon-close").remove(), $(e).append('<span class="icon-close"></span>'), $("body").css({ "overflow-y": "hidden", width: "100%" }), $(".black-layer, " + e + ".modal .icon-close").click(function () { $(".black-layer").css("visibility", "hidden"), $("body").css("overflow-y", "auto"), $(e).hide().removeClass("modal") }) } $(document).ready(function () { var e = 0; $(".w-r-panel textarea").on("click focus", function (i) { 0 == e && ($(this).animate({ height: "200" }), e += 1), $(this).siblings(".review-help").addClass("review-help-add"), $(this).siblings(".review-help").css("right", -($(".field-outline .review-help").width() + 46)), $(this).parent().siblings(".expand-wr").slideDown(), i.stopPropagation() }), $('.check-wrap input[type="checkbox"]').click(function () { !0 == $(this).prop("checked") ? $(this).parent().addClass("checked") : $(this).parent().removeClass("checked") }), $(".prod-var .view-var").click(function (e) { e.preventDefault(), $(this).siblings("ul").slideToggle(), $(this).find("span").toggleClass("icon-drop-down icon-next") }), $(function () { $(".open-all a").click(function () { $(this).parent().siblings(".more-brands-div").slideToggle() }) }); var i = document.getElementsByTagName("textarea")[0], t = document.getElementsByClassName("char-count")[0]; i && (i.onkeyup = function () { var e = i.value; "925642336" == document.getElementById("hdfCatID").value || "" != document.getElementById("hdfVerifiedReviews").value || 1 == document.getElementById("hdfVerifiedDraft").value ? 0 == e.length ? t.innerHTML = "" : (e.length >= 50 ? t.style.color = "green" : t.style.color = "red", t.innerHTML = e.length) : 0 == e.length ? t.innerHTML = "" : (e.length >= 100 ? t.style.color = "green" : t.style.color = "red", t.innerHTML = e.length) }), $(function () { $(".pages li").click(function () { $(this).find("button").addClass("active"), $(this).siblings().find("button").removeClass("active") }) }), $(".toggle div.obtitle").click(function () { $(this).siblings(".toggle-content").slideToggle(), $(this).find(".icon-drop-down").toggleClass("icon-next", "icon-drop-down") }), $("button.quote").click(function () { $(this).parent().parent().hide().siblings(".thank-quote").show() }), $(".edit-comment").click(function (e) { e.preventDefault(), $(this).hide(); var i = $(this).parent().siblings(0).find(".brand-comment"); $(this).parent().siblings(0).find(".brand-comment").hide(0, function () { var e = $(this).text().replace(/\.../g, "").replace("READ MORE", "").replace("Read More", ""), t = $("<textarea/>").attr("id", "txtResponse"); t.val(e), $(t).insertAfter(i), $(".button-events").show() }), $(".corp-response #btnCancel").click(function () { $(".brand-comment,.edit-comment").show(), $("#txtResponse,.button-events").hide() }) }), $(".grid-view").click(function () { $(".categories .list .box").wrap("<div class='col-3'></div>").addClass("gridl"), $(".categories .bygdbox,.categories .cat-pagination").wrap("<div class='col-12'></div>"), $(".categories .list").css("margin", "0px -15px"), $(".list-view").css("pointer-events", "auto"), $(".grid-view").css("pointer-events", "none"), $(".grid-view > span").removeClass("unrated-star"), $(".list-view > span").addClass("unrated-star"), $(".gridview").show(), $(".gridview > div").show(), $(".dvListingAds").hide(); try { var e = $(".row.list .col-3 div.rtitle").map(function () { return $(this).height() }).get(), i = Math.max.apply(null, e); i > 0 && $(".row.list .col-3 .gridl div.rtitle").css({ height: i + "px" }) } catch (t) { } try { var i = 0, e = $(".row.list .col-3").map(function () { return $(this).height() }).get(), i = Math.max.apply(null, e); i > 0 && $(".row.list .col-3 .gridl").css({ height: i - 35 + "px" }) } catch (n) { } }), $(".list-view").click(function () { $(".row.list .col-3 .gridl").removeAttr("style"), $(".row.list .col-3 .gridl .rtitle").removeAttr("style"), $(".categories .list .box").unwrap().removeClass("gridl"), $(".categories .bygdbox,.categories .cat-pagination").unwrap(), $(".list-view").css("pointer-events", "none"), $(".grid-view").css("pointer-events", "auto"), $(".categories .list").css("margin", "0px"), $(".grid-view > span").addClass("unrated-star"), $(".list-view > span").removeClass("unrated-star"), $(".gridview").hide(), $(".dvListingAds").show() }), $(function () { $("#tablist").length > 0 && $(window).on("scroll", function () { if ($("#tablist").position().top - $(window).scrollTop() < 0) { $(".fixed-menu").slideDown(), $(".list-menu >li:first-child").addClass("active"); var e = $(document).scrollTop(); $(".fixed-menu .list-menu .scroll").each(function () { var i = $(this), t = $(i.find("a").attr("href")); if (t.is(":visible")) { var n = t.position(); n.top - 60 < e + $("#fixed-menu").height() && n.top + t.height() >= e + $("#fixed-menu").height() - 60 ? ($(".fixed-menu .list-menu .scroll").removeClass("active"), i.addClass("active")) : i.removeClass("active") } }) } else $(".fixed-menu").slideUp() }) }), $(".scroll, .gallery-thumbnails .thumb-count, .full-spec").on("click", function () { $("body, html").animate({ scrollTop: $($(this).find("a").attr("href")).position().top - $("#fixed-menu").height() }, "fast") }), $(".to-top").click(function (e) { e.preventDefault(), $("html,body ").animate({ scrollTop: 0 }, 600) }), $(".tabable-accordion .table-head.open+.table-content").css("display", "block"), $(".tabable-accordion .table-head").click(function () { if (!0 == $(this).hasClass("open")) $(this).siblings(".table-content").slideUp({ duration: 300, easing: "easeInQuad", complete: function () { $(this).siblings(".table-head").removeClass("open") } }); else { var e; $(this).siblings(".table-content").slideDown({ duration: 300, easing: "easeInQuad", complete: function () { $(this).siblings(".table-head").addClass("open"), $(".tabable-accordion .table-content").not(this).slideUp({ duration: 300, easing: "easeInQuad", complete: function () { $(this).siblings(".table-head").removeClass("open") } }) } }) } e = $("#explore .tabable-accordion").offset().top - 50, $("html,body").animate({ scrollTop: e }, "slow") }); var n = function () { document.getElementsByClassName("choosephoto")[0].click() }; $(".get-file").on("click", function () { $(this).parent().find(".choosephoto").click() }), $(".chosefile").on("click", function () { n() }), $("#choosephoto").change(function () { (function e(i) { if (i.files && i.files[0]) { var t = new FileReader, n = i.files[0].size / 1024 / 1024, s = i.files[0].name.split(".").pop(); console.log(s + " " + n + " MB"), t.onload = function (e) { $(".up-img").attr("src", e.target.result).show(), $(".upload-section .icon-add").hide(), $(".get-file").unbind("click") }, t.readAsDataURL(i.files[0]) } })(this) }), $(".add-image .icon-close").click(function (e) { $(".upload-section .icon-add").show(), $(".up-img").hide(), e.stopPropagation(), $(".get-file").bind("click", function (e) { n() }) }), $(".w-r-panel textarea").on("focusout", function (e) { e.preventDefault(), $(".review-help").removeClass("review-help-add").css("right", "-300px") }), $(".tolerence-div h4").on("click", function () { $(".tolerence-div > ul").slideToggle(), $(this).find("span").toggleClass("icon-expand icon-collapse") }), $(".product-details .more-guide").parent().find(".specification table").height() > 270 ? ($(".product-details .more-guide").parent().find(".specification .col-6:eq(0)").css("height", "270px"), $(".product-details .more-guide").show(), $(".product-details .more-guide").click(function (e) { e.preventDefault(), $(this).hide().parent().find(".specification .col-6:eq(0)").css({ height: "auto" }).height() })) : $(".product-details .more-guide").hide(), askQuestionNew = function (e) { $("#quesdata").siblings("#emptytext").hide(), e.preventDefault(), $("#quesdata").slideToggle({ easing: "easeInQuad" }) }, answerQuesNew = function (e, i) { e.preventDefault(), e.stopPropagation(), $(i).parent().siblings().find(".answer-field").slideToggle({ easing: "easeInQuad" }) }, userAnswerNew = function (e, i) { e.preventDefault(), $(i).siblings(".user-answers").slideToggle({ easing: "easeInQuad" }) }, $(".tabs li a").click(function (e) { e.preventDefault(), $(this).parent().addClass("active").siblings().removeClass("active") }), $(".notify-me").click(function () { openModal(".email-alert-box") }), $("#quote").click(function () { openModal(".get-quote") }), $(".salesfrm").click(function () { openModal(".sales-frm") }), $(".review .read-more").click(function (e) { e.preventDefault(), $(this).toggle().parent().siblings(".expand-review").slideToggle() }), $(".like-count").click(function (e) { e.preventDefault(), openModal(".user-rating-show") }), $(".comment-clk,div > .icon-not-useful-filled").click(function (e) { e.preventDefault() }), $(".breply-clk").click(function (e) { e.preventDefault(), $(this).parent().parent().siblings(".cresbox").toggleClass("corp-resbox").slideToggle() }), setTimeout(function () { $(".fullcommunictn a").unbind("click").parent(".fullcommunictn").click(function (e) { e.preventDefault(), $(this).hide().siblings(".comment").slideDown() }) }, 2e3), $(".cust-share").click(function () { !1 == $(this).find(".dropdown-tip").is(":visible") ? $(this).find(".dropdown-tip").css("display", "block") : $(this).find(".dropdown-tip").css("display", "none") }), $(".addfrbx span a").click(function (e) { e.preventDefault(), $(this).parent().hide().siblings().addClass("show") }), $(".comment textarea").on("click focus", function (e) { $(this).css("height", "100px"), $(this).off(), $(this).parent().siblings(".expand-comment").slideDown("fast") }), rate(".expressrating", "rated-star", "unrated-star"), $(".your-rating-star").on({ mouseover: function () { $(this).children().removeClass("unrated-star").addClass("rated-star") }, mouseleave: function () { $(this).children().removeClass("rated-star").addClass("unrated-star") } }) }), $("#lightgallery > div:lt(4)").show(); var rate = function (e, i, t) { $(e).on({ mouseover: function () { $(this).prevAll().andSelf().removeClass(t).addClass(i) }, mouseleave: function () { $(this).prevAll().andSelf().removeClass(i).addClass(t), ".w-r-panel .express-ratings div" != e && $(".click-star-txt").text("YOUR RATING ON") } }) }; function editContent(e) { "bold" == $(e).attr("class") && document.execCommand("bold") };
var revHidskip, urlredirect1, indesof1, urlredirectTo1, url, firstload = 0, tempno = 1, submitclick = !1, hashid = window.location.href.substring(window.location.href.indexOf("#")); function CallOtherReviews() { 0 == isBot && ($.ajax({ async: !0, type: "GET", url: mshost + "review/OtherReviews_RR.aspx?cat_id=" + catid + "&parent=" + parent1 + "&parent2=" + parent2 + "&level1=" + level1 + "&isAdvice=" + advice + "&mergeparent=" + mergeparent + "&ismerge_new=" + ismerge_new + "&revDate=" + revDate + "&prodImage=" + productimg + "&twitter=" + twitter.replace("|", " ").replace("#", "%23") + "&iscorpproduct=" + iscorp + "&reviewId=" + revId + "&isArch=" + isArch, contentType: "application/json; charset=utf-8", dataType: "text", success: function (e) { $("#divMoreReview").html(e); var t = $("#ctl00_ctl00_ContentPlaceHolderFooter_ContentPlaceHolderBody_customheader_btnwritereview").attr("onclick"); $("#btnWritereview_scroll").attr("onclick", t), $("#imgWriteReview").attr("onclick", t), $(".your-rating-star").attr("onclick", t), $(".comment textarea").on("click focus", function (e) { $(this).css("height", "100px"), $(this).off(), $(this).parent().siblings(".expand-comment").slideDown("fast") }), setTimeout(function () { $(".like-image-new").each(function () { var e = $(this).parent().attr("reviewid"), t = $(this).parent().attr("userid"), a = $(this).parent().attr("id"), n = $(this).parent().attr("divlikeid"); Ajaxresor(OverallRatingrr, "OverallGraph=" + e + "&u=" + t + "&Random=" + Math.random() + "&arateid=" + a, a, n, e) }) }, 1e3) } }), $.ajax({ async: !0, type: "GET", url: mshost + "product/product_discussion_readall.aspx?cid=" + catid + "&timestamp=" + new Date().getTime(), contentType: "application/json; charset=utf-8", dataType: "text", success: function (e) { $("#ask-question").html(e) } })) } -1 != hashid.indexOf("#") && $("#fixed-menu").hide(), $(document).ready(function () { if ($("form#upload-form").attr("enctype", "multipart/form-data").attr("encoding", "multipart/form-data"), "" !== lt2 && "0" !== lt2 || $("#locationmap").hide(), $("#lightgallery").lightGallery(), $(".row .gallery-thumbnails").lightGallery({ selector: ".g-imgbox" }), document.getElementById("hidskip").value = 13, "" != scrollToDiv) { var e = new Date; e.setTime(e.getTime()), eraseCookie("scrollDiv"), window.scrollTo(0, $("#" + scrollToDiv).offset().top - 100) } setTimeout(function () { if ((Ajaxres(OverallRating, "OverallGraph=" + Rid + "&u=" + revAuthor + "&Random=" + Math.random()), 1 != isBot) ? 2 != firstload && (AjaxByHash(ShowComments, "ShowComments=" + Rid + "&Random=" + Math.random() + "&skip=" + revHidskip.value + "&mergeparent=" + mergeparent + "&parent=" + parent1), firstload = 1) : document.getElementById("linkpostcomment").style.display = "none", "True" == commentforRating && NU("write comment"), "True" == showResponse && (AjaxByHash(ShowCorpComments, "ShowCorpComments=" + PostId + "&Random=" + Math.random() + "&corpname=" + coname), "1" == openComm && $(".fullcommunictn").trigger("click")), "True" == isVidAd) try { $("#dvRHS").html('<iframe src="' + mshost + "review/RR_ADS.aspx?cat_id=" + catid + "&review_key=" + reviewkey + '" style="width:300px;height:250px;overflow:auto;" scrolling="no" allowfullscreen></iframe>') } catch (e) { } else try { $("#dvRHS").html('<iframe src="' + mshost + "DisplayAd.aspx?cid=" + catId + '&size=300-250&type=reviews" style="width:300px;height:250px;overflow:auto;border:0;" scrolling="no"></iframe>') } catch (t) { } }, 1e3), "" != iscorp && $.ajax({ url: "/review/CorporateResponse.ashx", async: !0, type: "POST", contentType: "application/x-www-form-urlencoded", dataType: "text", data: { catid: catid, mergedprods: mergedprods, mergeparent: mergeparent, corp: !0 }, responseType: "text/html", success: function (e) { $("#idcorpresp").html(e), $("#idcorpresp").show() }, error: function (e, t, a) { } }) }); var element_r = $("#dvRatingWidget"), tcount_r = 1; $(window).scroll(function () { var e = element_r.offset(), t = element_r.outerHeight(), a = document.documentElement.scrollTop; e.top + t - a < $(window).height() && 1 == tcount_r && (tcount_r = 2, CallOtherReviews()) }); var prevScrollpos = window.pageYOffset; function PostQuestion(e) { return "" == $(e).siblings(".field-outline").find("textarea").val() ? ($(e).siblings(".warning").html("This information is required.").show(), !1) : (ajaxLogin("/product/product_discussion_ajax.aspx?cid=" + catid + "&ques=" + $(e).siblings("span").children("textarea")[0].value + "&ask=0&rr=1&rid=" + reviewkey), !1) } function PostAnswer(e, t) { return "" == $(e).siblings(".field-outline").find("textarea").val() ? ($(e).siblings(".warning").html("This information is required.").show(), !1) : (ajaxLogin("/product/product_discussion_ajax.aspx?cid=" + catid + "&anstxt=" + $(e).siblings("span").children("textarea")[0].value + "&quesId=" + t + "&ans=0&rr=1&rid=" + reviewkey), !1) } function postResponseRR(e) { var t = document.getElementById(txtRespId).value, a = document.getElementById(hidimg1ID).value, n = document.getElementById(hidimg2ID).value; if (!validateResponse(e)) return !1; var s = { CorpResponse: t, rid: Rid, img1ID: a, img2ID: n }, o = new CreateRequest; return o.ajaxObject.onreadystatechange = function () { if (4 == o.ajaxObject.readyState) { if ("success" === o.ajaxObject.responseText.replaceAll('"', "")) { var e = window.location.protocol + window.location.host + window.location.pathname + "#dvCorpResponse"; window.location.href = e } else { var e = window.location.protocol + window.location.host + window.location.pathname + "#dvCorpResponse"; window.location.href = e } } }, o.ajaxObject.open("POST", mshost + "apiMSDashboard/dashboard/postResponseRR", !0), o.ajaxObject.setRequestHeader("Content-Type", "application/json"), o.ajaxObject.setRequestHeader("Connection", "close"), o.ajaxObject.send(JSON.stringify(s)), !1 } function EditResponseRR(e) { var t = document.getElementById("txtResponse").value, a = document.getElementById(hidimg1ID).value, n = document.getElementById(hidimg2ID).value, s = PostId; if ("" !== s) { if (!validateEditResponse()) return !1; var o = document.getElementById("txtResponse").value; document.getElementById(hdnResponseid).value = o; var r = { CorpResponse: t, rid: Rid, responseId: s, img1ID: a, img2ID: n }, l = new CreateRequest; return l.ajaxObject.onreadystatechange = function () { if (4 == l.ajaxObject.readyState) { if ("success" === l.ajaxObject.responseText.replaceAll('"', "")) { var e = window.location.protocol + window.location.host + window.location.pathname + "#dvCorpResponse"; window.location.href = e } else { var e = window.location.protocol + window.location.host + window.location.pathname + "#dvCorpResponse"; window.location.href = e } } }, l.ajaxObject.open("POST", mshost + "apiMSDashboard/dashboard/updateResponseRR", !0), l.ajaxObject.setRequestHeader("Content-Type", "application/json"), l.ajaxObject.setRequestHeader("Connection", "close"), l.ajaxObject.send(JSON.stringify(r)), !1 } } function validateResponse(e) { var t = document.getElementById(txtRespId).value; return "" == t.trim() ? ($("#err_Response").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").css("color", "red").show(), !1) : 3 > CountWords(t) ? ($("#err_Response").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 5000 characters.").css("color", "red").show(), !1) : t.length > 5e3 ? ($("#err_Response").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 5000 characters.").css("color", "red").show(), !1) : ($(e).addClass("jsdisable"), !0) } function hidewarningmsg() { $("#warningmsg").hide() } function validateEditResponse() { var e = document.getElementById("txtResponse").value; return "" == e.trim() ? ($("#err_EditResponse").html("<span class='icon-tool-tip'></span> &nbsp; This information is required.").css("color", "red").show(), !1) : 3 > CountWords(e) ? ($("#err_EditResponse").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 5000 characters.").css("color", "red").show(), !1) : !(e.length > 5e3) || ($("#err_EditResponse").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 5000 characters.").css("color", "red").show(), !1) } function textResCounter(e) { var t = $("#" + txtRespId).val(), a = $("#txtResponse").val(); "insert" == e ? t.length > 5e3 ? ($("#err_Response").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 5000 characters").css("color", "red").show(), $("#" + btnRespId).prop("disabled", !0)) : ($("#err_Response").html("").hide(), $("#" + btnRespId).prop("disabled", !1)) : a.length > 5e3 ? ($("#err_EditResponse").html("<span class='icon-tool-tip'></span> &nbsp; Minimum 3 words and Maximum 5000 characters").css("color", "red").show(), $("#" + btnEditRespId).prop("disabled", !0)) : ($("#err_EditResponse").html("").hide(), $("#" + btnEditRespId).prop("disabled", !1)), t.length > 100 && $(".comment-box1").css("height", "152px") } function wrapNode(e, t) { var a = document.createElement(t), n = e.parentNode; a.appendChild(e.cloneNode(!0)), n.replaceChild(a, e) } $(window).scroll(function () { var e = window.pageYOffset; if (prevScrollpos > e || prevScrollpos < e) for (var t = document.querySelectorAll("#searchDropDown"), a = 0; a < t.length; a++)"block" == t[a].style.display && (t[a].style.display = "none"); prevScrollpos = e }), $(document).ready(function () { if ($("#btnBrandReply").click(function (e) { 0 == loginid ? (indesof1 = LoginUrl.indexOf("/review/"), ajaxLoginCorp(urlredirectTo1 = LoginUrl.substr(indesof1))) : (e.preventDefault(), $(this).siblings(".cresbox").toggleClass("corp-resbox").slideToggle()) }), $("#" + lnkeditrespid).click(function (e) { e.preventDefault(), $(this).hide(); var t = $(this).parent().siblings(0).find(".brand-comment"); $(this).parent().siblings(0).find(".brand-comment").hide(0, function () { var e = $(this).html(); e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = (e = e.replace("READ MORE...", "").replace("Read More...", "").replace("...", "")).replace(/<(?!br\s*\/?)[^>]+>/g, "")).replace("(<(/)*p>)", "<br/>")).replace("(\n)", "<br/>")).replace("((s)*<(/)*br(/)*>(s)*){2,}", "<br/><br/>")).replace("(<(/)*br(/)*>)", "\n")).replace(/<br>/g, "\n")).replace(/<BR>/g, "\n")).replace(/&nbsp;/g, " ")).replace(/&amp;/g, "&")).replace(/&lt;/g, "<")).replace(/&gt;/g, ">")).replace(/<a target.*?>/g, "")).replace(/<\/a>/g, "")).replace(/<(|\n)*?>/g, ""); var a = $("<span/>").attr("id", "err_EditResponse").attr("class", "warning hide"); $(a).insertBefore(t); var n = $("<textarea/>").attr("id", "txtResponse").attr("onkeyup", 'textResCounter("edit")').attr("onkeydown", 'textResCounter("edit")'); n.val(e), $(n).insertAfter(t), $(".button-events").show() }), $(".corp-response #btnCancel").click(function () { $(".brand-comment,.edit-comm").show(), $("#txtResponse,.button-events").hide() }) }), 1 == brandRespond) { try { $("#btnBrandReply").trigger("click") } catch (e) { } $("html,body").animate({ scrollTop: $("#btnBrandReply").offset().top - 180 }, "slow"), document.getElementById(txtRespId).focus(); var t = new Date; t.setTime(t.getTime()), eraseCookie("brandReply") } else if (2 == brandRespond) { $(".edit-comm").trigger("click"), $("html,body").animate({ scrollTop: $("#btnCancel").offset().top - 200 }, "slow"); var t = new Date; t.setTime(t.getTime()), eraseCookie("brandReply") } }), $("#btnCancel").click(function () { $("#err_EditResponse").html("").hide() }); for (var iframes = document.getElementsByTagName("iframe"), i = 0; i < iframes.length; i++)wrapNode(iframes[i], "div"); function question() { document.getElementById("ask").style.visibility = "hidden", document.getElementById("question-box").style.display = "", $("#txtQueArea").focus() } function showMore(e, t) { t.preventDefault(), $(e).hide(), $(e).siblings(".moreellipses").hide(), $(e).siblings(".morecontent").show() } function setResponseToHidden() { if (!validateEditResponse()) return !1; var e = document.getElementById("txtResponse").value; document.getElementById(hdnResponseid).value = e } function ratingMore_Ajax12(e) { $("#dvpopupbox .dvpopupbox").load("rating-list_ajax.aspx?rid=" + e), openModal("#dvpopupbox") } function showSection(e) { switch ($("#dvAll,#dvVU,#dvU,#dvNU").hide(), $("#liAll,#liVU,#liU,#liNU").removeClass("active"), e) { case "all": default: $("#dvAll").show(), $("#liAll").addClass("active"); break; case "vu": $("#dvVU").show(), $("#liVU").addClass("active"); break; case "u": $("#dvU").show(), $("#liU").addClass("active"); break; case "nu": $("#dvNU").show(), $("#liNU").addClass("active") } } function viewComments() { parseInt(0) != revHidskip.value && (1 == revHidskip.value && (revHidskip.value = 13), Ajax(ShowMoreComments, "ShowMoreComments=" + Rid + "&Random=" + Math.random() + "&skip=" + revHidskip.value + "&mergeparent=" + mergeparent + "&parent=" + parent1)) } function setFocusToHeaderSrch() { document.getElementById("txtproduct").focus() } function chkCommentToClose() { var e = new CreateRequest; e.ajaxObject.onreadystatechange = function t() { 4 == e.ajaxObject.readyState && ("success" == (emailflag = e.ajaxObject.responseText) ? document.location.href = document.getElementById(custnolink).value : (document.getElementById(customerid).style.display = "none", document.getElementById("corp_errComment").innerHTML = "<span>Please fill in a comment for this response</span>", document.getElementById("corp_errComment").style.display = "block", $(".corp-box").siblings(".comment").slideDown(), $("#lnkFullComm").hide())) }, e.ajaxObject.open("GET", "/withoutlogin.aspx?postid=" + PostId + "&resp=no", !0), e.ajaxObject.send(null) } function hideBlackLayer() { $(".black-layer").hide() } function alpha_fb_click() { $.ajax({ url: "/review/CorporateResponse.ashx", contentType: "application/json; charset=utf-8", dataType: "text", data: { type: "fb_banner_click", corp: !1 }, responseType: "text/html", success: function (e) { } }) };
