var currentPage = 1; var displayNoOfPages = 3; var lastPageIndex = 0; var totalRecords = 0; var RecordOnPage = 12; //var RecordOnPage = 0; //var ThemePath = 'http://gemfind.org/RingBuilder_New/Themes/WhiteTheme/'; var CustID = ''; var ScrollCurrentPage = 2; var ScrollRecordOnPage = 3; var ScrolllastPageIndex = 0; var Carat = ''; var SelectedFilter = ''; var sldPriceMin; var sldPriceMax; var PriceMin = ''; var PriceMax = ''; var minPriceVal = 0; var maxPriceVal = 100000; var sldpriceMin = 0; var sldpriceMax = 100000; var priceid = 0; var lastshape = ''; var DealerLink = ''; var MetalType = ''; var MetalTag = ''; var ThemeName = ''; var OrderBy = 'COST ASC'; var CenterStone = ''; var Collection = ''; var CollectionIds = ''; var objProcessBar; var webCall = null; var gridViewId = '1'; var ShowPrice = ''; var DID = ''; var CollectionId = ''; var CountryTaxRate = ''; var CountryCode = ''; var IsFB = 0; var IsMLRB = 0; var shape = ''; var vendorName = ''; var BreakForScroll = false; var BreakForScrollTop = false; var TempScroll = ''; var tempRecordOnPage = 0; var VendorBind = 0; var TmpcurrentPage = 0; var TmpRecordOnPage = 0; var TmpScrollCurrentPage = 0; var TmpScrollRecordOnPage = 0; var RecordOnPageTemp = 0; var SettingSearch = ''; var IsfromScroll = 0; var IsSettingName = 0; var cacheData = new Array(); // This is our cache var Isdiamond = 0; var RingURL = ''; var DiamondURL = ''; var Track = ''; function LoadData() { $(".main_left_side").hide(); objProcessBar = document.getElementById("divProcessBar"); o = document.getElementById("divResult"); objProcessBar.style.left = getAbsLeft(o) - 200 + 'px'; objProcessBar.style.top = getAbsTop(o) - 200 + 'px'; setPriceSlider(); if ($j.cookie("currentPage") != null) TmpcurrentPage = $j.cookie("currentPage"); if ($j.cookie("RecordOnPage") != null) RecordOnPage = $j.cookie("RecordOnPage"); if ($j.cookie("RecordOnPageTemp") != null) TmpRecordOnPage = $j.cookie("RecordOnPageTemp"); if ($j.cookie("ScrollCurrentPage") != null) ScrollCurrentPage = $j.cookie("ScrollCurrentPage"); if ($j.cookie("ScrollRecordOnPage") != null) ScrollRecordOnPage = $j.cookie("ScrollRecordOnPage"); if ($j.cookie("MetalTag") != null) MetalTag = $j.cookie("MetalTag"); //if ($j.cookie("MetalType") != null) // MetalType = $j.cookie("MetalType"); //if (Collection.length == 0) { // if ($j.cookie("Collection") != null) // Collection = $j.cookie("Collection"); //} //if ($j.cookie("CenterStone") != null) // CenterStone = $j.cookie("CenterStone"); if ($j.cookie("Orderby") != null) OrderBy = $j.cookie("Orderby"); if ($j.cookie("GridViewId") != null) gridViewId = $j.cookie("GridViewId"); //if ($j.cookie("CollectionIds") != null) // CollectionIds = $j.cookie("CollectionIds"); if (gridViewId == '1') { //RecordOnPage = 6; $("#view1").css('display', 'block'); $("#view2").css('display', 'none'); $j('#imgView1').attr('src', 'Themes/' + ThemeName + '/images/pagina_img11b.png'); $j('#imgView2').attr('src', 'Themes/' + ThemeName + '/images/pagina_img22.png'); } else if (gridViewId == '2') { //RecordOnPage = 12; $("#view1").css('display', 'none'); $("#view2").css('display', 'block'); $j('#imgView1').attr('src', 'Themes/' + ThemeName + '/images/pagina_img11.png'); $j('#imgView2').attr('src', 'Themes/' + ThemeName + '/images/pagina_img22b.png'); } if (TmpcurrentPage != 0) { if (TmpcurrentPage == 1) { if (ScrollRecordOnPage != 0) { RecordOnPageTemp = parseInt(ScrollCurrentPage) * parseInt(ScrollRecordOnPage); } } else { currentPage = TmpcurrentPage; RecordOnPageTemp = parseInt(ScrollCurrentPage) * parseInt(ScrollRecordOnPage) - ((parseInt(TmpcurrentPage) - 1) * parseInt(RecordOnPage)); } } // Collection = ""; RingURL = $('#hndRingUrl').val(); DiamondURL = $('#hndDiamondUrl').val(); SetCssClass(); getVendorDropdown(); DynamicDropdown(); CallAjaxRequest(); //if (VendorBind == 0) //{ // $("#BrandNameDiv").hide(); // $("#CollectiionDiv").attr("style", "width:100%"); //} SendHeight(); $j(window).trigger('resize'); } function SetCssClass() { var i = 0; if ('li_' + CenterStone == 'li_Asscher') { $j('#li_Asscher').removeClass('lst'); $j('#li_Asscher').addClass('lst_active'); } else { $j('#li_' + CenterStone).addClass('lid_active'); } // For Bottome if ('lib_' + CenterStone == 'lib_Asscher') { $j('#lib_Asscher').removeClass('lst'); $j('#lib_Asscher').addClass('lst_active'); } else { $j('#lib_' + CenterStone).addClass('lid_active'); } if (MetalTag != '') $j('#' + MetalTag).addClass('lid_active'); if (CollectionIds != '') { var coll = CollectionIds.split(','); if (coll.length > 0) { for (i = 0; i < coll.length; i++) { if (coll[i] != '') $j('#' + coll[i]).addClass('li_active'); } } } } function CallAjaxRequestMore() { if (webCall != null) { webCall.abort(); } //RecordPerPage(); if (Collection == 'Platique,' || Collection == 'Platique') { MetalType = 'Platinum Silver'; $("#ddlSelectMetal").val('9'); } if (RecordOnPage == 12) { RecordOnPage = 24; } else { RecordOnPage += 12; //RecordOnPage += RecordOnPage; } objProcessBar.style.display = ''; webCall = $j.ajax({ type: "POST", url: "GetDiamondSearchDetailsResp.asmx/OMLoadData", data: "{DealerLink:'" + DealerLink + "',MetalType:'" + MetalType + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',OrderBy:'" + OrderBy + "',PageNumber:'" + currentPage + "',RecordOnPage:'" + RecordOnPage + "',CenterStone:'" + CenterStone + "',Collection:'" + Collection + "',gridViewId:'" + gridViewId + "',ShowPrice:'" + ShowPrice + "',DID:'" + DID + "',ThemeName:'" + ThemeName + "',SettingSearch:'" + SettingSearch + "',Isdiamond:'" + Isdiamond + "',CustID:'" + CustID + "',CountryTaxRate:'" + CountryTaxRate + "',CountryCode:'" + CountryCode + "',Track:'" + Track + "',IsFB:'" + IsFB + "',IsMLRB:'" + IsMLRB + "',Carat:'" + Carat + "'}", contentType: "application/json; charset=utf-8", dataType: "json", async: true, cache: false, processData: false, success: function (response) { if (response != null) { if (response.d.dtData.length > 0) { if (IsfromScroll == 1) { $j('#divResult').append(response.d.dtData[0]["GridData"]); } else { $j('#divResult').html(response.d.dtData[0]["GridData"]); } totalRecords = parseInt($j('#hdnTotalRecords').val()); $j("#ddlPageSort").msDropDown(); $j("#ddlSelectMetal").msDropDown(); $j("#ddlSelectMetalMini").msDropDown(); $j("#ddlPriceSort").msDropDown(); $j("#ddlRecoPerPage").msDropDown(); $j("#ddlRecoPerPage_view2").msDropDown(); $j("#ddlRecoPerPage_Resp").msDropDown(); if (totalRecords != 0) { displayPageNumbers(); $j(".low_price").show(); $j("#spTotalSettings").html(totalRecords); } else { ClearTopBottomPaging(); $j("#spTotalSettings").html("0"); } // ------------ sumeet 23-sept-13 ------------// if (gridViewId == 1) { //RecordPerPage(); $j('.divProductStyle').css('height', '40px'); $j('.mediume_cr_bg_shape ul li').css('margin', '3px'); //------------ End -------------// } else if (gridViewId == 2) { //RecordPerPage(); $j('.divProductStyle').css('height', '43px'); $j('.mediume_cr_bg_shape ul li').css('margin', '0px'); } objProcessBar.style.display = 'none'; //For collection if (Collection != '') { if (CollectionId != '') { $j('#' + CollectionId).addClass('li_active'); } else { $j("#ulSettings li p").each(function () { var str = $j(this).text(); str = str.replace(/\s/g, ''); if (Collection == "Three Stone," && str == "Three-Stone") str = "Three Stone"; if (str + "," == Collection) { var id = $j(this).parent()[0].id; $j('#' + id).addClass('li_active'); } }); } } $j.cookie("currentPage", currentPage, { expires: 1 }); $j.cookie("RecordOnPage", RecordOnPage, { expires: 1 }); $j.cookie("RecordOnPageTemp", RecordOnPageTemp, { expires: 1 }); $j.cookie("ScrollCurrentPage", ScrollCurrentPage, { expires: 1 }); $j.cookie("ScrollRecordOnPage", ScrollRecordOnPage, { expires: 1 }); $j('.productimage').fadeIn("slow"); setTimeout("RecreateDropDown()", 5000); MakeChangeInHeight(); //setTimeout("SendHeight()", 3000); // alert("currentPage: " + currentPage + ',RecordOnPage : ' + RecordOnPage + ',lastPageIndex : ' + lastPageIndex + ',ScrollCurrentPage : ' + ScrollCurrentPage + ',ScrollRecordOnPage : ' + ScrollRecordOnPage + ',ScrolllastPageIndex : ' + ScrolllastPageIndex); } } else { objProcessBar.style.display = 'none'; } }, error: function (msg) { objProcessBar.style.display = 'none'; } }); } function MakeChangeInHeight() { var $imgs = $j(".productimage"); imgAmount = $imgs.length; imgCounter = 1; var imageLoaded = function () { SendHeight(); } $j('.productimage').each(function () { var tmpImg = new Image(); tmpImg.onload = imageLoaded; tmpImg.src = $(this).attr('src'); }); } function CallAjaxRequest() { if (webCall != null) { webCall.abort(); } RecordOnPage; if (Collection == 'Platique,' || Collection == 'Platique') { MetalType = 'Platinum Silver'; $("#ddlSelectMetal").val('9'); } var count = 0; if (CenterStone == "") { count = 1; CenterStone = "Round,Princess,Cushion,Oval,Asscher,Emerald,Marquise,Pear,Heart,Radiant"; } objProcessBar.style.display = ''; webCall = $j.ajax({ type: "POST", url: "GetDiamondSearchDetailsResp.asmx/OMLoadData", data: "{DealerLink:'" + DealerLink + "',MetalType:'" + MetalType + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',OrderBy:'" + OrderBy + "',PageNumber:'" + currentPage + "',RecordOnPage:'" + RecordOnPage + "',CenterStone:'" + CenterStone + "',Collection:'" + Collection + "',gridViewId:'" + gridViewId + "',ShowPrice:'" + ShowPrice + "',DID:'" + DID + "',ThemeName:'" + ThemeName + "',SettingSearch:'" + SettingSearch + "',Isdiamond:'" + Isdiamond + "',CustID:'" + CustID + "',CountryTaxRate:'" + CountryTaxRate + "',CountryCode:'" + CountryCode + "',Track:'" + Track + "',IsFB:'" + IsFB + "',IsMLRB:'" + IsMLRB + "',VendorName:'" + vendorName + "',Carat:'" + Carat + "'}", contentType: "application/json; charset=utf-8", dataType: "json", async: true, cache: false, processData: false, success: function (response) { if (response != null) { $j(window).trigger('resize'); if (response.d.dtData.length > 0) { if (IsfromScroll == 1) { $j('#divResult').append(response.d.dtData[0]["GridData"]); } else { $j('#divResult').html(response.d.dtData[0]["GridData"]); } totalRecords = parseInt($j('#hdnTotalRecords').val()); $j("#ddlPageSort").msDropDown(); $j("#ddlSelectMetal").msDropDown(); $j("#ddlSelectMetalMini").msDropDown(); $j("#ddlPriceSort").msDropDown(); $j("#ddlRecoPerPage").msDropDown(); $j("#ddlRecoPerPage_view2").msDropDown(); $j("#ddlRecoPerPage_Resp").msDropDown(); if (totalRecords != 0) { displayPageNumbers(); $j(".low_price").show(); $j("#spTotalSettings").html(totalRecords); } else { ClearTopBottomPaging(); $j("#spTotalSettings").html("0"); } // ------------ sumeet 23-sept-13 ------------// if (gridViewId == 1) { $('#view1').css('display', 'block'); $('#view2').css('display', 'none'); $j('.divProductStyle').css('height', '40px'); $j('.mediume_cr_bg_shape ul li').css('margin', '3px'); //------------ End -------------// } else if (gridViewId == 2) { $('#view1').css('display', 'none'); $('#view2').css('display', 'block'); $j('.divProductStyle').css('height', '43px'); $j('.mediume_cr_bg_shape ul li').css('margin', '0px'); } objProcessBar.style.display = 'none'; //For collection if (Collection != '') { if (CollectionId != '') { $j('#' + CollectionId).addClass('li_active'); } else { $j("#ulSettings li p").each(function () { var str = $j(this).text(); str = str.replace(/\s/g, ''); if (Collection == "Three Stone," && str == "Three-Stone") str = "Three Stone"; if (str + "," == Collection) { var id = $j(this).parent()[0].id; $j('#' + id).addClass('li_active'); } }); } } $j.cookie("currentPage", currentPage, { expires: 1 }); $j.cookie("RecordOnPage", RecordOnPage, { expires: 1 }); $j.cookie("RecordOnPageTemp", RecordOnPageTemp, { expires: 1 }); $j.cookie("ScrollCurrentPage", ScrollCurrentPage, { expires: 1 }); $j.cookie("ScrollRecordOnPage", ScrollRecordOnPage, { expires: 1 }); $j('.productimage').fadeIn("slow"); setTimeout("RecreateDropDown()", 5000); //setTimeout("SendHeight()", 3000); var $imgs = $j("#divResult").find("img"); imgAmount = $imgs.length; if ($j('#hdnIsOneStep').val() == 'False') { $j('#step2').css('display', 'block'); $j('#step3').css('display', 'block'); $j('#linkChooseYourSetting').html('1 . Choose Your Setting'); $j('#step1').css('background', 'url("../images/right_arrowe.png ") no-repeat scroll right center'); $j('#step1').css('width', '33%'); $j('#divChooseDiamond').css('display', 'block'); $j('#divdiamondbrd').css('display', 'block'); } imgCounter = 0; $imgs.load(function () { imgCounter++; if (imgCounter === imgAmount) { SendHeight(); } }); SendHeight(); // alert("currentPage: " + currentPage + ',RecordOnPage : ' + RecordOnPage + ',lastPageIndex : ' + lastPageIndex + ',ScrollCurrentPage : ' + ScrollCurrentPage + ',ScrollRecordOnPage : ' + ScrollRecordOnPage + ',ScrolllastPageIndex : ' + ScrolllastPageIndex); } } else { objProcessBar.style.display = 'none'; } }, error: function (msg) { objProcessBar.style.display = 'none'; } }); if (count == 1) CenterStone = ""; } function SetViewCart() { window.location = "https://www.gemfind.net/dealerid_display/secure/ShoppingCart_New.aspx?ToolType=Ringbuilder&DealerID=" + DealerLink; //if (AlternateShoppingCartURL=='') // window.location = "https://www.gemfind.net/dealerid_display/secure/ShoppingCart_New.aspx?DealerID=" + DealerLink; //else // window.location = AlternateShoppingCartURL; } function SendHeight() { var parent_url2 = ''; parent_url2 = DiamondURL; parent_url = RingURL.split(','); //parent_url = 'http://10.1.1.105/Gemsource2.html'; //if (DealerLink == '2390') { // parent_url = 'http://www.diamondselect.com/ring-builder/'; // parent_url2 = 'https://www.diamondselect.com/ring-builder/'; //} for (var i = 0; i < parent_url.length; i++) { if (parent_url[i] != '') XD.postMessage($("#mainbdy").height() + 100, parent_url[i], parent); } //if (parent_url2 != '') // XD.postMessage($("#mainbdy").height() + 100, parent_url2, parent); return false; } function getfocus(obj, val) { if (obj.value == val) { obj.value = ''; } } function lostfocus(obj, val) { if (obj.value == '') { obj.value = val; } } function getAbsLeft(o) { oLeft = o.offsetLeft while (o.offsetParent != null) { oParent = o.offsetParent oLeft += oParent.offsetLeft o = oParent } return oLeft } function getAbsTop(o) { oTop = o.offsetTop while (o.offsetParent != null) { oParent = o.offsetParent oTop += oParent.offsetTop o = oParent } return oTop } //Price //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var priceStep = 50; var varInstanceId = 0; function logposition(value) { var minp = 0; var maxp = 100; // The result should be between 100 an 10000000 var minv = Math.log(100);; var maxv = Math.log(sldpriceMax); // calculate adjustment factor var scale = (maxv - minv) / (maxp - minp); return Math.round((Math.log(value) - minv) / scale + minp); } function logslider(position) { if (position == 0) return 0; // position will be between 0 and 100 var minp = 0; var maxp = 100; // The result should be between 100 an 10000000 var minv = Math.log(100);; var maxv = Math.log(sldpriceMax); // calculate adjustment factor var scale = (maxv - minv) / (maxp - minp); return Math.round(Math.exp(minv + scale * (position - minp))); } function setPriceSlider() { var Minp = 0; var Maxp = 0; var sldpriceMin = 0; var sldpriceMax = 100000; PriceMin = $j('#hndPriceMin').val(); if (($j('#hndPriceMax').val()) != '') { PriceMax = $j('#hndPriceMax').val(); } //PriceMax = $j('#hdnPriceMax2').val(); if (PriceMin != '' || PriceMin == 0) sldpriceMin = PriceMin; if (PriceMax != '') { sldpriceMax = PriceMax; } $j("#price-range").slider({ range: true, min: 0, max: 100, values: [new Number(logposition(sldpriceMin)).toString(), new Number(logposition(sldpriceMax)).toString()], start: function (event, ui) { }, slide: function (event, ui) { Minp = logslider(ui.values[0]); var num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Minp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMin").text(num.toFormatted()); Maxp = logslider(ui.values[1]); num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Maxp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMax").text(num.toFormatted()); curVal = ui.value; }, stop: function (event, ui) { PriceMin = logslider(ui.values[0]); PriceMax = logslider(ui.values[1]); $j('#hndPriceMin').val(PriceMin); $j('#hndPriceMax').val(PriceMax); TempScroll = ''; currentPage = 1; RecordOnPageTemp = RecordOnPage; if (gridViewId == '2') ScrollCurrentPage = 3; else ScrollCurrentPage = 2; CallAjaxRequest(); } }); Minp = logslider($j("#price-range").slider("values", 0)); var num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Minp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMin").text(num.toFormatted()); var Maxp = logslider($j("#price-range").slider("values", 1)); num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Maxp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMax").text(num.toFormatted()); $j("#price-range1").slider({ range: true, min: 0, max: 100, values: [new Number(logposition(sldpriceMin)).toString(), new Number(logposition(sldpriceMax)).toString()], start: function (event, ui) { }, slide: function (event, ui) { Minp = logslider(ui.values[0]); var num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Minp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMin1").val(num.toFormatted()); Maxp = logslider(ui.values[1]); num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Maxp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMax1").val(num.toFormatted()); curVal = ui.value; }, stop: function (event, ui) { PriceMin = logslider(ui.values[0]); PriceMax = logslider(ui.values[1]); $j('#hndPriceMin').val(PriceMin); $j('#hndPriceMax').val(PriceMax); TempScroll = ''; currentPage = 1; RecordOnPageTemp = RecordOnPage; if (gridViewId == '2') ScrollCurrentPage = 3; else ScrollCurrentPage = 2; CallAjaxRequest(); } }); Minp = logslider($j("#price-range1").slider("values", 0)); var num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Minp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMin1").val(num.toFormatted()); var Maxp = logslider($j("#price-range1").slider("values", 1)); num = new NumberFormat(); num.setInputDecimal('.'); num.setNumber(Maxp); // obj.value is '5000000.50' num.setPlaces('0', false); num.setCurrencyValue('$'); num.setCurrency(true); num.setCurrencyPosition(num.LEFT_OUTSIDE); num.setNegativeFormat(num.LEFT_DASH); num.setNegativeRed(false); num.setSeparators(true, ',', ','); $j("#lblpriceMax1").val(num.toFormatted()); } //////// End Price ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function RecreateDropDown() { $j("#ddlSelectMetal").msDropDown(); } function ChangeMetalType() { SelectedFilter = "MetalType"; currentPage = 1; MetalType = $j("#ddlSelectMetal option:selected").text(); //Collection = ""; //CenterStone = ""; DynamicDropdown(); CallAjaxRequest(); } function ChangeMetalTypeMini() { SelectedFilter = "MetalType"; currentPage = 1; MetalType = $j("#ddlSelectMetalMini option:selected").text(); Collection = ""; CenterStone = ""; DynamicDropdown(); CallAjaxRequest(); } function SearchSettingmobile() { SettingSearch = $j('#txtSearchMobile').val(); if (SettingSearch == 'Search Setting #') SettingSearch = ''; currentPage = 1; CallAjaxRequest(); } function SearchSetting() { SettingSearch = $j('#txtSearch').val(); if (SettingSearch == 'Search Setting #') SettingSearch = ''; currentPage = 1; CallAjaxRequest(); } function ChangePageSort() { var SelVal = $j('#ddlPageSort').val(); if (SelVal == "0") OrderBy = "COST ASC"; else if (SelVal == "1") OrderBy = "COST DESC"; else if (SelVal == "2") OrderBy = "METAL ASC"; else if (SelVal == "3") OrderBy = "METAL DESC"; else if (SelVal == "4") OrderBy = "SettingID ASC"; else if (SelVal == "5") OrderBy = "SettingID DESC"; $j.cookie("Orderby", OrderBy, { expires: 1 }); CallAjaxRequest(); } function ChangePriceSort() { var SelVal = $j('#ddlPriceSort').val(); if (SelVal == "0") OrderBy = "COST ASC"; else if (SelVal == "1") OrderBy = "COST DESC"; else if (SelVal == "2") OrderBy = "METAL ASC"; else if (SelVal == "3") OrderBy = "METAL DESC"; else if (SelVal == "4") OrderBy = "SettingID ASC"; else if (SelVal == "5") OrderBy = "SettingID DESC"; $j.cookie("Orderby", OrderBy, { expires: 1 }); CallAjaxRequest(); } function ChangeGridView(girdId) { var temp = 0; gridViewId = girdId; if (gridViewId == '1') { $('#view1').css('display', 'block'); $('#view2').css('display', 'none'); RecordOnPageTemp = 6; ScrollCurrentPage = 2; if (currentPage != '1') { ScrollCurrentPage = ((currentPage * RecordOnPage) / ScrollRecordOnPage); currentPage = Math.ceil((((currentPage - 1) * RecordOnPage) + 1) / 6); } //RecordOnPage = 6; RecordOnPage = $j('#ddlRecoPerPage').val(); ScrollRecordOnPage = 3; $j('#imgView1').attr('src', 'Themes/' + ThemeName + '/images/pagina_img11b.png'); $j('#imgView2').attr('src', 'Themes/' + ThemeName + '/images/pagina_img22.png'); } else if (gridViewId == '2') { $('#view1').css('display', 'none'); $('#view2').css('display', 'block'); RecordOnPageTemp = 12; ScrollCurrentPage = 3; if (currentPage != '1') { ScrollCurrentPage = ((currentPage * RecordOnPage) / ScrollRecordOnPage) - 1; currentPage = Math.round(((currentPage * RecordOnPage) + 1) / 12); } //RecordOnPage = 12; RecordOnPage = $j('#ddlRecoPerPage_view2').val(); ScrollRecordOnPage = 4; $j('#imgView1').attr('src', 'Themes/' + ThemeName + '/images/pagina_img11.png'); $j('#imgView2').attr('src', 'Themes/' + ThemeName + '/images/pagina_img22b.png'); } $j.cookie("GridViewId", gridViewId, { expires: 1 }); CallAjaxRequest(); } function ChangeCenterStone(shape) { ClearCenterStoneCss(); //if ('li_' + shape == 'li_Asscher') { // $j('#li_Asscher').removeClass('lst'); // $j('#li_Asscher').addClass('lst_active'); //} //else { // $j('#li_' + shape).removeClass('lst'); // $j('#li_' + shape).addClass('lid_active'); //} //// For bottome //if ('lib_' + shape == 'lib_Asscher') { // $j('#lib_Asscher').removeClass('lst'); // $j('#lib_Asscher').addClass('lst_active'); //} //else { // $j('#lib_' + shape).removeClass('lst'); // $j('#lib_' + shape).addClass('lid_active'); //} $('#lib_' + lastshape).removeClass('lst_active'); if (CenterStone == shape) { $('#lib_' + shape).removeClass('img-bor1'); $('#lib_' + shape).removeClass('lst_active'); CenterStone = CenterStone.replace(shape, ''); } else { $('#lib_' + shape).addClass('img-bor1'); $('#lib_'+ shape).addClass('lst_active'); CenterStone = shape; SelectedFilter = "Shape"; } //CenterStone = shape; currentPage = 1; RecordOnPageTemp = RecordOnPage; if (gridViewId == '2') ScrollCurrentPage = 3; else ScrollCurrentPage = 2; TempScroll = ''; $j.cookie("CenterStone", CenterStone, { expires: 1 }); //Collection = ""; //MetalType = ""; DynamicDropdown(); CallAjaxRequest(); lastshape = shape; } function ClearCenterStoneCss() { $j('#li_Round').removeClass('lid_active'); $j('#li_Radiant').removeClass('lid_active'); $j('#li_Princess').removeClass('lid_active'); $j('#li_Pear').removeClass('lid_active'); $j('#li_Oval').removeClass('lid_active'); $j('#li_Marquise').removeClass('lid_active'); $j('#li_Heart').removeClass('lid_active'); $j('#li_Emerald').removeClass('lid_active'); $j('#li_Cushion').removeClass('lid_active'); $j('#li_Asscher').removeClass('lst_active'); $j('#li_Asscher').removeClass('lst'); // For bottome $j('#lib_Round').removeClass('lid_active'); $j('#lib_Radiant').removeClass('lid_active'); $j('#lib_Princess').removeClass('lid_active'); $j('#lib_Pear').removeClass('lid_active'); $j('#lib_Oval').removeClass('lid_active'); $j('#lib_Marquise').removeClass('lid_active'); $j('#lib_Heart').removeClass('lid_active'); $j('#lib_Emerald').removeClass('lid_active'); $j('#lib_Cushion').removeClass('lid_active'); $j('#lib_Asscher').removeClass('lst_active'); $j('#lib_Asscher').removeClass('lst'); } function displayPageNumbers() { var strPaging = ''; var tempPageIndex = 0; var topPageText = ''; var BottomPageText = ''; //strPaging = "