var currentPage = 1;
var displayNoOfPages = 3;
var lastPageIndex = 0;
var totalRecords = 0;
var RecordOnPage = 6;
var ThemePath = 'http://gemfind.org/RingBuilder_Infinity/Themes/WhiteTheme/';
var ScrollCurrentPage = 2;
var ScrollRecordOnPage = 3;
var ScrolllastPageIndex = 0;
var sldPriceMin;
var sldPriceMax;
var PriceMin = '';
var PriceMax = '';
var minPriceVal = 0;
var maxPriceVal = 100000;
var sldpriceMin = 0;
var sldpriceMax = 100000;
var priceid = 0;
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 BreakForScroll = false;
var BreakForScrollTop = false;
var TempScroll = '';
var tempRecordOnPage = 0;
var TmpcurrentPage = 0;
var TmpRecordOnPage = 0;
var TmpScrollCurrentPage = 0;
var TmpScrollRecordOnPage = 0;
var RecordOnPageTemp = 0;
var SettingSearch = '';
var cacheData = new Array(); // This is our cache
function LoadData() {
objProcessBar = document.getElementById("divProcessBar");
o = document.getElementById("divResult");
objProcessBar.style.left = getAbsLeft(o) + 'px';
objProcessBar.style.top = getAbsTop(o) + 'px';
setPriceSlider();
// MetalTag = 'White';
// MetalType = '14K White Gold';
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 ($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;
$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;
$j('#imgView1').attr('src', 'Themes/' + ThemeName + '/images/pagina_img11.png');
$j('#imgView2').attr('src', 'Themes/' + ThemeName + '/images/pagina_img22b.png');
}
//alert("currentPage: " + TmpcurrentPage + ',RecordOnPage : ' + TmpRecordOnPage + ',ScrollCurrentPage : ' + TmpScrollCurrentPage + ',ScrollRecordOnPage : ' + TmpScrollRecordOnPage );
// RecordOnPageTemp = RecordOnPage;
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));
}
}
SetCssClass();
// ChangeMetalType('White');
CallAjaxRequest();
}
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');
}
//$j('#li_' + 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 LoadCollectionScroll() {
$j('#ulSettings').jcarousel({
wrap: 'Simple',
visible: 7
});
}
function CallAjaxRequest() {
if (webCall != null) {
webCall.abort();
}
objProcessBar.style.display = '';
webCall = $j.ajax({
type: "POST",
url: "GetBuildRingStep1Data.asmx/LoadData",
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 + "'}",
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) {
//$j('#divResult').empty().jScrollPane({ scrollbarWidth: 11, scrollbarMargin: 0, showArrows: false, arrowSize: 0, IsFromPager: false, dragMaxHeight: 270 });
$j('#divResult').html(response.d.dtData[0]["GridData"]);
totalRecords = parseInt($j('#hdnTotalRecords').val());
$j("#ddlPageSort").msDropDown();
$j("#ddlSelectMetal").msDropDown();
if (totalRecords != 0)
displayPageNumbers();
else
ClearTopBottomPaging();
objProcessBar.style.display = 'none';
//For collection
if (Collection != '') {
if (CollectionId != '') {
$j('#' + CollectionId).addClass('li_active');
}
}
//LoadGridScroll();
$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");
// 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 LoadGridScroll() {
//$j("#divResult").jScrollPane({ scrollbarWidth: 11, scrollbarMargin: 0, showArrows: false, arrowSize: 0, IsFromPager: false, dragMaxHeight: 270 });
//$j("#divResult").css({ top: '0px' });
}
function LoadScrollGrid() {
//alert('1');
// $j("#divResult").jScrollPane({ scrollbarWidth: 11, scrollbarMargin: 0, showArrows: false, arrowSize: 0, IsFromPager: true, dragMaxHeight: 270 });
//$j("#divResult").jScrollPane({ scrollbarWidth: 11, scrollbarMargin: 0, showArrows: false, arrowSize: 0, IsFromPager: true, dragMaxHeight: 278 });
// $j("#divResult").css({ top: '0px' });
}
function LoadProductForScrollBottom(obj, SearchId) {
if (!BreakForScroll && ((ScrollCurrentPage + 1) <= Math.ceil(totalRecords / ScrollRecordOnPage))) {
BreakForScroll = true;
ScrollCurrentPage++;
TempScroll = '1';
BreakForScroll = false;
$j("#divProcessBar").ajaxStart(function () { $j(this).show(); });
$j.ajax({
type: "POST",
url: "GetBuildRingStep1Data.asmx/LoadDataWhenScroll",
data: "{DealerLink:'" + DealerLink + "',MetalType:'" + MetalType + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',OrderBy:'" + OrderBy + "',PageNumber:'" + ScrollCurrentPage + "',RecordOnPage:'" + ScrollRecordOnPage + "',CenterStone:'" + CenterStone + "',Collection:'" + Collection + "',gridViewId:'" + gridViewId + "',ShowPrice:'" + ShowPrice + "',DID:'" + DID + "',ThemeName:'" + ThemeName + "'}",
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) {
$j('#ulSetting').append(response.d.dtData[0]["GridData"]);
displayPageNumbersWhenScroll();
$j("#divProcessBar").ajaxStop(function () { $j(this).hide(); });
// $j("#divResult").jScrollPane({ scrollbarWidth: 11, scrollbarMargin: 0, showArrows: false, arrowSize: 0, IsFromPager: false, dragMaxHeight: 270 });
}
// alert("currentPage: " + currentPage + ',RecordOnPage : ' + RecordOnPage + ',lastPageIndex : ' + lastPageIndex + ',ScrollCurrentPage : ' + ScrollCurrentPage + ',ScrollRecordOnPage : ' + ScrollRecordOnPage + ',ScrolllastPageIndex : ' + ScrolllastPageIndex);
$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 });
}
else {
$j("#divProcessBar").ajaxStop(function () { $j(this).hide(); });
}
},
error: function (msg) {
$j("#divProcessBar").ajaxStop(function () { $j(this).hide(); });
}
});
}
}
function LoadProductForScrollTop(obj, SearchId) {
if (!BreakForScroll && !BreakForScrollTop && ((currentPage - 1) > 0)) {
BreakForScrollTop = true;
currentPage = currentPage - 1;
TempScroll = '1';
BreakForScrollTop = false;
CallAjaxRequest();
}
}
function ClearTopBottomPaging() {
$j("#PagingSummary1").html('');
$j("#PagingSummary2").html('');
$j("#Pager1").html('');
$j("#Pager2").html('');
$j('#divSort').hide();
$j('.sort-img').hide();
$j('.top_bo').hide();
$j('#divPopup').html('');
$j('#divPopup').removeClass('PopupDivOver3');
$j('#divPopup').removeClass('PopupDivOver2');
}
function displayPageNumbersWhenScroll() {
ScrolllastPageIndex = Math.ceil(totalRecords / ScrollRecordOnPage);
if (ScrollCurrentPage == ScrolllastPageIndex) {
$j("#ppage1").html(totalRecords);
$j("#ppage2").html(totalRecords);
}
else {
$j("#ppage1").html(parseInt(parseInt(ScrollCurrentPage) * parseInt(ScrollRecordOnPage)));
$j("#ppage2").html(parseInt(parseInt(ScrollCurrentPage) * parseInt(ScrollRecordOnPage)));
}
}
function displayPageNumbers() {
var strPaging = '';
var tempPageIndex = 0;
var topPageText = '';
var BottomPageText = '';
strPaging = "
";
if (currentPage % displayNoOfPages == 0) {
tempPageIndex = ((currentPage / displayNoOfPages) - 1) * displayNoOfPages;
}
else {
tempPageIndex = Math.floor(currentPage / displayNoOfPages) * displayNoOfPages;
}
var iNo2 = currentPage - 1;
lastPageIndex = Math.ceil(totalRecords / RecordOnPage);
if (tempPageIndex >= displayNoOfPages && tempPageIndex < lastPageIndex) {
topPageText += " ";
}
else if (currentPage > 1) {
topPageText += " ";
}
else {
topPageText += " ";
}
tempPageIndex++;
for (var i = 0; i < displayNoOfPages; i++) {
if (tempPageIndex > lastPageIndex) { break; }
if (currentPage == tempPageIndex) {
strPaging += "- " + tempPageIndex + "
";
}
else {
strPaging += "- " + tempPageIndex + "
";
}
tempPageIndex++;
}
var iNo = new Number(currentPage) + 1;
if (tempPageIndex <= lastPageIndex) {
BottomPageText += " ";
}
else
BottomPageText += " ";
if (currentPage == lastPageIndex) {
$j("#PagingSummary1").html('' + (((currentPage - 1) * RecordOnPage) + 1) + ' - ' + '
' + totalRecords + '
of ' + totalRecords + ' Items ');
$j("#PagingSummary2").html('' + (((currentPage - 1) * RecordOnPage) + 1) + ' - ' + '
' + totalRecords + '
of ' + totalRecords + ' Items ');
}
else {
$j("#PagingSummary1").html('' + (((currentPage - 1) * RecordOnPage) + 1) + ' - ' + '
' + parseInt((parseInt(currentPage) * parseInt(RecordOnPage))) + '
of ' + totalRecords + ' Items ');
$j("#PagingSummary2").html('' + (((currentPage - 1) * RecordOnPage) + 1) + ' - ' + '
' + parseInt((parseInt(currentPage) * parseInt(RecordOnPage))) + '
of ' + totalRecords + ' Items ');
}
$j("#Pager1").html(strPaging + topPageText + '
');
$j("#Pager2").html(strPaging + BottomPageText + '');
$j('#divSort').show();
$j('.sort-img').show();
$j('.top_bo').show();
}
function ChangeGridView(girdId) {
var temp = 0;
$j('#divPopup').html('');
$j('#divPopup').removeClass('PopupDivOver3');
$j('#divPopup').removeClass('PopupDivOver2');
gridViewId = girdId;
if (gridViewId == '1') {
RecordOnPageTemp = 6;
ScrollCurrentPage = 2;
if (currentPage != '1') {
ScrollCurrentPage = ((currentPage * RecordOnPage) / ScrollRecordOnPage);
currentPage = Math.ceil((((currentPage - 1) * RecordOnPage) + 1) / 6);
}
RecordOnPage = 6;
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') {
RecordOnPageTemp = 12;
ScrollCurrentPage = 3;
if (currentPage != '1') {
ScrollCurrentPage = ((currentPage * RecordOnPage) / ScrollRecordOnPage) - 1;
currentPage = Math.round(((currentPage * RecordOnPage) + 1) / 12);
}
RecordOnPage = 12;
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 PagerClick(intpageNo) {
currentPage = new Number(intpageNo);
//ScrollCurrentPage = currentPage;
if (gridViewId == '1') {
RecordOnPage = 6;
RecordOnPageTemp = 6;
ScrollRecordOnPage = 3;
ScrollCurrentPage = (currentPage * RecordOnPage) / ScrollRecordOnPage;
}
else if (gridViewId == '2') {
RecordOnPage = 12;
RecordOnPageTemp = 12;
ScrollRecordOnPage = 4;
ScrollCurrentPage = (currentPage * RecordOnPage) / ScrollRecordOnPage;
}
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 ChangeCenterStone(shape) {
ClearCenterStoneCss();
if ('li_' + shape == 'li_Asscher') {
$j('#li_Asscher').removeClass('lst');
$j('#li_Asscher').addClass('lst_active');
}
else {
$j('#li_' + shape).addClass('lid_active');
}
CenterStone = shape;
currentPage = 1;
RecordOnPageTemp = RecordOnPage;
if (gridViewId == '2')
ScrollCurrentPage = 3;
else
ScrollCurrentPage = 2;
TempScroll = '';
$j.cookie("CenterStone", CenterStone, { expires: 1 });
CallAjaxRequest();
}
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').addClass('lst');
}
function ChangeMetalType() {
currentPage = 1;
MetalType = $j("#ddlSelectMetal option:selected").text();
CallAjaxRequest();
}
//function ChangeMetalType(Metal) {
// ClearMetalTypeCss();
// TempScroll = '';
// currentPage = 1;
// RecordOnPageTemp = RecordOnPage;
// if (gridViewId == '2')
// ScrollCurrentPage = 3;
// else
// ScrollCurrentPage = 2;
// if (Metal == 'Yellow') {
// if (MetalTag == 'Yellow') {
// MetalType = '';
// MetalTag = '';
// }
// else {
// MetalTag = 'Yellow';
// MetalType = '14K Yellow Gold,18K Yellow Gold';
// $j('#' + Metal).addClass('lid_active');
// }
// }
// else if (Metal == 'White') {
// if (MetalTag == 'White') {
// MetalType = '';
// MetalTag = '';
// }
// else {
// MetalTag = 'White';
// MetalType = 'Palladium,18K White Gold,Platinum,14K White Gold';
// $j('#' + Metal).addClass('lid_active');
// }
// }
// $j.cookie("MetalType", MetalType, { expires: 1 });
// $j.cookie("MetalTag", MetalTag, { expires: 1 });
// CallAjaxRequest();
//}
function ClearMetalTypeCss() {
$j('#Yellow').removeClass('lid_active');
$j('#White').removeClass('lid_active');
}
function ChangeCollection(Coll, collid) {
TempScroll = '';
currentPage = 1;
RecordOnPageTemp = RecordOnPage;
if (gridViewId == '2')
ScrollCurrentPage = 3;
else
ScrollCurrentPage = 2;
CollectionId = '';
if (Collection == '') {
Collection = Coll + ',';
CollectionIds = collid + ',';
$j('#' + collid).addClass('li_active');
CallAjaxRequest();
}
else if (Collection == Coll) {
Collection = '';
CollectionIds = '';
$j('#' + collid).removeClass('li_active');
CallAjaxRequest();
}
else {
if (Collection.indexOf(Coll) != -1) {
Collection = Collection.replace(Coll + ',', '');
CollectionIds = CollectionIds.replace(collid + ',', '');
$j('#' + collid).removeClass('li_active');
CallAjaxRequest();
}
else {
Collection = Collection + Coll + ',';
CollectionIds = CollectionIds + collid + ',';
$j('#' + collid).addClass('li_active');
CallAjaxRequest();
}
}
$j.cookie("CollectionIds", CollectionIds, { expires: 1 });
$j.cookie("Collection", Collection, { expires: 1 });
// CallAjaxRequest();
}
//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;
PriceMin = $j('#hndPriceMin').val();
PriceMax = $j('#hndPriceMax').val();
//alert(PriceMax);
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) {
//curVal = ui.value;
//setPriceStepValue();
},
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, ',', ',');
//$("#lblpriceMax").text(sldpriceMax);
$j("#lblpriceMax").text(num.toFormatted());
//$("#price-range").slider();
}
function setPriceStepValue() {
if (curVal >= 0 && curVal <= 1000) {
$j("#price-range").slider("option", "step", 50);
}
else if (curVal > 1000 && curVal <= 5000) {
$j("#price-range").slider("option", "step", 100);
}
else if (curVal > 5000 && curVal <= 10000) {
$j("#price-range").slider("option", "step", 500);
}
else if (curVal > 10000 && curVal <= 50000) {
$j("#price-range").slider("option", "step", 1000);
}
else if (curVal > 50000 && curVal <= 100000) {
$j("#price-range").slider("option", "step", 2000);
}
}
//////// End Price /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function ViewDetailClick() {
window.location.href = $j('#alinkViewDetail').attr("href");
}
function ShowPopUp(objImage, objImagId, settingId, shapes, ImgPath, price, showprice, gridViewId, aSettinghref, DealerLink, DID, CurrentCollection, liId) {
var i = 0;
var class1 = '';
var class2 = '';
var class3 = '';
if (gridViewId == 1) {
class1 = "rollMargin";
class2 = "roll_bot";
class3 = "rg_ct";
$j('#divPopup').removeClass('PopupDivOver3');
$j("#divPopup").attr('class', 'PopupDivOver2');
}
else if (gridViewId == 2) {
class1 = "rollMargin1";
class2 = "roll_bot1";
class3 = "rg_ct1";
$j('#divPopup').removeClass('PopupDivOver2');
$j('#divPopup').addClass('PopupDivOver3');
}
var popupString = "";
popupString += "";
var DetailURL = $j('#hndDetailURL' + settingId).val();
//popupString += "
View Details > ";
popupString += "
View Details > ";
popupString += "
";
if (CurrentCollection != '' && (CurrentCollection.toLowerCase() == 'unique advantage' || CurrentCollection.toLowerCase() == 'petite collection' || CurrentCollection.toLowerCase() == 'petite halo collection')) {
popupString += "";
}
else {
popupString += "";
}
popupString += "";
var objDIV = document.getElementById("divPopup");
objDIV.innerHTML = popupString;
// var xPos = getAbsLeft(objImage);
// var yPos = getAbsTop(objImage);
var xPos = objImage.offsetLeft;
var yPos = objImage.offsetTop;
objDIV.style.left = xPos + 10 + 'px';
objDIV.style.top = yPos + 2 + 'px';
objDIV.style.display = 'block';
}
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
}
function SelectShape(shape, settingId, ImgPath, objImagId, gridViewId, DealerLink, DID) {
//var alinkid = objImagId.replace('divHoverImage', 'aSetting');
var alinkhref = "";
if (DID != 0 && DID != "0")
alinkhref = "../RingBuilder_Infinity/BuildRingStep1Detail.aspx?DealerLink=" + DealerLink + "&SID=" + settingId + "&shape=" + shape + "&DID=" + DID + "&ThemeName=" + ThemeName;
else
alinkhref = "../RingBuilder_Infinity/BuildRingStep1Detail.aspx?DealerLink=" + DealerLink + "&SID=" + settingId + "&shape=" + shape + "&ThemeName=" + ThemeName;
if (gridViewId == 1) {
$j('#' + objImagId).animate({ left: "+=500" }, 2000);
$j('#' + objImagId).attr("src", "http://dev.gemfind.net/dealerid_display/CreateRingImage.aspx?sn=" + ImgPath + "&cs=" + shape + "&ts=false&wi=225&hi=225&sid=" + settingId + "&DiamondCTW=1.50");
}
else {
$j('#' + objImagId).animate({ left: "+=500" }, 2000);
$j('#' + objImagId).attr("src", "http://dev.gemfind.net/dealerid_display/CreateRingImage.aspx?sn=" + ImgPath + "&cs=" + shape + "&ts=false&wi=169&hi=169&sid=" + settingId + "&DiamondCTW=1.50");
}
$j('#hndDetailURL' + settingId).val(alinkhref);;
$j('#alinkViewDetail').attr('href', alinkhref);
}
function getfocus(obj, val) {
if (obj.value == val) {
obj.value = '';
}
}
function lostfocus(obj, val) {
if (obj.value == '') {
obj.value = val;
}
}
function SearchSetting() {
SettingSearch = $j('#txtSearch').val();
if (SettingSearch == 'Search Settings')
SettingSearch = '';
currentPage = 1;
CallAjaxRequest();
}