var ThemeName = 'WhiteTheme';
var curVal = 0;
var curVal2 = 0;
var selectedShape = '';
var objProcessBar;
var HasLink = '';
var GFLinkOption = 0;
var detailsLink = 'MasterLinkDiamondDetails.aspx';
var centerStonesThatFit = '';
var centerStoneMinCarat = '';
var centerStoneMaxCarat = '';
var DID = '';
//Parameters to Pass
var flgShowPolish = false;
var flgShowSymmetry = false;
var flgShowDepth = false;
var flgShowTable = false;
var flgShowFluor = false;
var flgShowCutGrade = false;
var dealerID = 720;
var shapeList = 'Round';
var polishList = '';
var SymmetryList = '';
var FluorescenceList = '';
var CutGradeList = '';
var ColorList = '';
var ClarityList = '';
var certificate = '%';
var skuNo = '';
var pairCode = 1;
var orderBy = 'FltPrice'
var orderType = 'Asc';
var OrderByCompare = "FltPrice";
var OrderTypeCompare = "Asc";
var SortTd = '';
var BreakForScroll = false;
var BreakForScrollTop = false;
var cutgradeMin = 1;
var cutgradeMax = 6;
var symmetryMin = 1;
var symmetryMax = 5;
var polishMin = 1;
var polishMax = 5;
var fluorescenceMin = 1;
var fluorescenceMax = 6;
var caratMin = 0;
var caratMax = 15.00;
var colorMin = 68;
var colorMax = 75;
var clarityMin = 1;
var clarityMax = 9;
var IntensityMin = 1;
var IntensityMax = 10;
var depthMin = 0;
var depthMax = 100;
var tableMin = 0;
var tableMax = 100;
var caratPriceMin = 0;
var caratPriceMax = 100000;
var minCaratPriceVal = 0;
var maxCaratPriceVal = 100000;
var minPriceVal = 0;
var maxPriceVal = 100000;
var minSizeVal = 0;
var maxSizeVal = 15;
var pageSize = 12;
var currentPage = 1;
var totalPages = 0;
var showPrices = 1;
var showPopup = true;
var totalRecords = 0;
var totalCompareRecords = 0;
var tblDiamonds;
var displayNoOfPages = 3;
var ctw = '';
var webCall = null;
//////////////////////
var dvDiamonds; //Diamond DataView
var dvCompareDiamonds; //Diamond DataView
////////////////////////////////////////////////////////////////////////////////////////////////////////
var PriceMin = '';
var PriceMax = '';
var minPriceVal = 0;
var maxPriceVal = 100000;
var sldpriceMin = 0;
var sldpriceMax = 100000;
var priceid = 0;
var SOrigin = '';
var Qtype = 0;
var skunum = '';
//code by hemali
var parent_url = '';
var SMenuId = '';
function send() {
var Message = '';
var arrVals = '';
var valToCheck = '';
var MenuId = 1;
parent_url = parent_url.replace('*', '#');
var tempParent_url = parent_url.split('#');
var URLParent = '';
if (tempParent_url.length > 1) {
URLParent = tempParent_url[1];
}
else {
URLParent = parent_url;
}
if (URLParent.indexOf('-') >= 0) {
arrVals = URLParent.split('-');
valToCheck = arrVals[0];
}
else
valToCheck = URLParent;
switch (valToCheck) {
case "DiamondListing":
var arrValues = URLParent.split('|');
for (var i = 0; i < arrValues.length; i++) {
var arrSub = arrValues[i].split('-');
if (arrSub.length == 2) {
switch (arrSub[0]) {
case 'DiamondListing':
MenuId = arrSub[1];
break;
}
}
}
break;
}
SMenuId = MenuId;
Message = 'menu=' + MenuId + '&did=' + DID + '&dtheme=' + ThemeName;
XD.postMessage(Message, parent_url, parent);
return false;
}
function SetTopLinkHRef() {
if (parent_url != '') {
$('#alinkColorSearch').attr('href', $('#alinkColorSearch').attr('href') + "&Parent_url=" + parent_url.replace('#', '*').replace('DiamondListing-' + SMenuId, 'DiamondListing-13').replace('?', '$').replace('&', '^'));
$('#alinkRequestDiamond').attr('href', $('#alinkRequestDiamond').attr('href') + "&Parent_url=" + parent_url.replace('#', '*').replace('DiamondListing-' + SMenuId, 'DiamondListing-14').replace('?', '$').replace('&', '^'));
$('#alinkStandard').attr('href', $('#alinkStandard').attr('href') + "&Parent_url=" + parent_url.replace('#', '*').replace('?', '$').replace('&', '^'));
$('#alinkAdvanced').attr('href', $('#alinkAdvanced').attr('href') + "&Parent_url=" + parent_url.replace('#', '*').replace('?', '$').replace('&', '^'));
$('#alinkBackToSearch').attr('href', $('#alinkBackToSearch').attr('href') + "&Parent_url=" + parent_url.replace('#', '*').replace('?', '$').replace('&', '^'));
}
}
//end code
function loadInitialData() {
//Code by Hemali - 6th Feb,2013
$('#hndParentURL').val(parent_url);
SetTopLinkHRef();
//End code
$('#divFavorite').show();
$("#ddlDayOptions1").msDropDown();
$("#ddlMonthOptions1").msDropDown();
$("#ddlYearOptions1").msDropDown();
$("#ddlHourOptions1").msDropDown();
$("#ddlFormatOptions1").msDropDown();
if (DID != '') {
objProcessBar = document.getElementById("divProcessBar");
o = document.getElementById("divResult");
objProcessBar.style.left = getAbsLeft(o) - 5 + 'px';
objProcessBar.style.top = getAbsTop(o) + 33 + 'px';
currentPage = 1;
}
objProcessBar = document.getElementById("divProcessBar");
o = document.getElementById("divResult");
objProcessBar.style.left = getAbsLeft(o) + 'px';
objProcessBar.style.top = getAbsTop(o) + 33 + 'px';
}
function fnResetSearch() {
skunum = "";
CallAjaxRequestForDiamondGrid();
}
function KeyPressSearchBySku(e) {
if (typeof e == 'undefined' && window.event) { e = window.event; }
if (e.keyCode == 13) {
SearchBySku();
}
}
function SearchBySku() {
if ($('#txtSearch').val() != "")
skunum = $('#txtSearch').val();
else
skunum = "";
CallAjaxRequestForDiamondGrid();
}
//Call function to call service used to load diamonds
function CallAjaxRequestForDiamondGrid() {
if (Qtype == 1) {
pageSize = 7;
}
if (webCall != null) {
webCall.abort();
}
document.getElementById("divProcessBar").style.top = '500px';
$('#divProcessBar').height('294px');
$('#divProcessBar').css('padding-top', '92px');
document.getElementById("divProcessBar").style.display = '';
webCall = $.ajax({
type: "POST",
url: "GetMasterDiamondSearchDataNew.asmx/LoadDiamonds",
data: "{dealerID:'" + dealerID + "',shapeList:'" + shapeList + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',caratMin:'" + parseFloat(caratMin) + "',caratMax:'" + parseFloat(caratMax) + "',colorMin:'" + colorMin + "',colorMax:'" + colorMax + "',clarityMin:'" + clarityMin + "',clarityMax:'" + clarityMax + "',cutgradeMin:'" + cutgradeMin + "',cutgradeMax:'" + cutgradeMax + "',symmetryMin:'" + symmetryMin + "',symmetryMax:'" + symmetryMax + "',polishMin:'" + polishMin + "',polishMax:'" + polishMax + "',fluorescenceMin:'" + fluorescenceMin + "',fluorescenceMax:'" + fluorescenceMax + "',certificate:'" + certificate + "',skuNo:'" + skunum + "',pairCode:'" + pairCode + "',pageSize:'" + pageSize + "',currentPage:'" + currentPage + "',orderBy:'" + orderBy + "',orderType:'" + orderType + "',detailsLink:'" + detailsLink + "',DID:'" + DID + "',depthMin:'" + depthMin + "',depthMax:'" + depthMax + "',tableMin:'" + tableMin + "',tableMax:'" + tableMax + "',caratPriceMin:'" + caratPriceMin + "',caratPriceMax:'" + caratPriceMax + "',ThemeName:'" + ThemeName + "',ShowPrice:'" + showPrices + "',BindWhat:'All',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',CutGradeList:'" + CutGradeList + "',ColorList:'" + ColorList + "',ClarityList:'" + ClarityList + "',DealerCompnayName:'" + "" + "',SOrigin:'" + SOrigin + "',Parent_url:'" + parent_url + "',IsHeartStar:'" + Qtype + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response != null) {
if (response.d.dtHTMLData.length > 0) {
var strHtml = '';
if (response.d.dtHTMLData[0]["HTMLData"].charAt(0) == '1') {
$(".scr_bot").css("display", "none");
strHtml = response.d.dtHTMLData[0]["HTMLData"].substring(1, response.d.dtHTMLData[0]["HTMLData"].length);
}
else {
//SetStandardCriteria();
$(".scr_bot").css("display", "");
strHtml = response.d.dtHTMLData[0]["HTMLData"];
}
$('#divResult').html(strHtml);
totalRecords = $('#hndTotalDiamonds').val();
// $('#divDiamondsList').hide();
// LoadGridScroll();
$("#ddlSort").msDropDown();
displayPageNumbers();
document.getElementById("divProcessBar").style.display = 'none';
//$("#divProcessBar").css("display", "none");
//Select First Diamond Preview in right side
if ($('#hndFDiamondId').val() != undefined) {
ShowPopupDetails($('#hndFDiamondId').val(), $('#hndFShape').val(), $('#hndFPrice').val(), $('#hndFCut').val(), $('#hndFColor').val(), $('#hndFClarity').val(), $('#hndFOrigin').val());
}
}
}
else {
document.getElementById("divProcessBar").style.display = 'none';
//$("#divProcessBar").css("display", "none");
}
},
error: function (msg) {
document.getElementById("divProcessBar").style.display = 'none';
//$("#divProcessBar").css("display", "none");
}
});
}
function LoadDiamondForScrollBottomForGrid(obj, SearchId) {
if (!BreakForScroll && ((parseInt(currentPage) + 1) <= Math.ceil(totalRecords / pageSize))) {
BreakForScroll = true;
document.getElementById("divProcessBar").style.display = '';
currentPage = parseInt(currentPage) + 1;
$.ajax({
type: "POST",
url: "GetMasterDiamondSearchDataNew.asmx/LoadDiamonds",
data: "{dealerID:'" + dealerID + "',shapeList:'" + shapeList + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',caratMin:'" + parseFloat(caratMin) + "',caratMax:'" + parseFloat(caratMax) + "',colorMin:'" + colorMin + "',colorMax:'" + colorMax + "',clarityMin:'" + clarityMin + "',clarityMax:'" + clarityMax + "',cutgradeMin:'" + cutgradeMin + "',cutgradeMax:'" + cutgradeMax + "',symmetryMin:'" + symmetryMin + "',symmetryMax:'" + symmetryMax + "',polishMin:'" + polishMin + "',polishMax:'" + polishMax + "',fluorescenceMin:'" + fluorescenceMin + "',fluorescenceMax:'" + fluorescenceMax + "',certificate:'" + certificate + "',skuNo:'" + skuNo + "',pairCode:'" + pairCode + "',pageSize:'" + pageSize + "',currentPage:'" + currentPage + "',orderBy:'" + orderBy + "',orderType:'" + orderType + "',detailsLink:'" + detailsLink + "',DID:'" + DID + "',depthMin:'" + depthMin + "',depthMax:'" + depthMax + "',tableMin:'" + tableMin + "',tableMax:'" + tableMax + "',caratPriceMin:'" + caratPriceMin + "',caratPriceMax:'" + caratPriceMax + "',ThemeName:'" + ThemeName + "',ShowPrice:'" + showPrices + "',BindWhat:'Diamond',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',Parent_url:'" + parent_url + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response != null) {
if (response.d.dtHTMLData.length > 0) {
$('#divDiamondsList').hide();
$('#divDiamondsList').html(response.d.dtHTMLData[0]["HTMLData"]);
//LoadGridScrollPaging();
LoadGridScroll();
BreakForScroll = false;
document.getElementById("divProcessBar").style.display = 'none';
}
}
else {
document.getElementById("divProcessBar").style.display = 'none';
}
},
error: function (msg) {
document.getElementById("divProcessBar").style.display = 'none';
}
});
}
}
function LoadDiamondForScrollTopForGrid(obj, SearchId) {
if (!BreakForScroll && !BreakForScrollTop && ((parseInt(currentPage) - 1) > 0)) {
BreakForScrollTop = true;
document.getElementById("divProcessBar").style.display = '';
currentPage = parseInt(currentPage) - 1;
$.ajax({
type: "POST",
url: "GetMasterDiamondSearchDataNew.asmx/LoadDiamonds",
data: "{dealerID:'" + dealerID + "',shapeList:'" + shapeList + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',caratMin:'" + parseFloat(caratMin) + "',caratMax:'" + parseFloat(caratMax) + "',colorMin:'" + colorMin + "',colorMax:'" + colorMax + "',clarityMin:'" + clarityMin + "',clarityMax:'" + clarityMax + "',cutgradeMin:'" + cutgradeMin + "',cutgradeMax:'" + cutgradeMax + "',symmetryMin:'" + symmetryMin + "',symmetryMax:'" + symmetryMax + "',polishMin:'" + polishMin + "',polishMax:'" + polishMax + "',fluorescenceMin:'" + fluorescenceMin + "',fluorescenceMax:'" + fluorescenceMax + "',certificate:'" + certificate + "',skuNo:'" + skuNo + "',pairCode:'" + pairCode + "',pageSize:'" + pageSize + "',currentPage:'" + currentPage + "',orderBy:'" + orderBy + "',orderType:'" + orderType + "',detailsLink:'" + detailsLink + "',DID:'" + DID + "',depthMin:'" + depthMin + "',depthMax:'" + depthMax + "',tableMin:'" + tableMin + "',tableMax:'" + tableMax + "',caratPriceMin:'" + caratPriceMin + "',caratPriceMax:'" + caratPriceMax + "',ThemeName:'" + ThemeName + "',ShowPrice:'" + showPrices + "',BindWhat:'Diamond',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',Parent_url:'" + parent_url + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response != null) {
if (response.d.dtHTMLData.length > 0) {
$('#divDiamondsList').hide();
$('#divDiamondsList').html(response.d.dtHTMLData[0]["HTMLData"]);
LoadGridScroll();
BreakForScrollTop = false;
document.getElementById("divProcessBar").style.display = 'none';
}
}
else {
document.getElementById("divProcessBar").style.display = 'none';
}
},
error: function (msg) {
document.getElementById("divProcessBar").style.display = 'none';
}
});
}
}
function CheckUncheckFavoriteDiamond(chk) {
var strDiamonds = $('#hndChkDiamonds').val();
var ComapreCount = $('#hndCompareCount').val();
var strCompareDiamonds = $('#hndCompareDiamondsDetail').val();
if (chk.checked == true) {
strDiamonds = strDiamonds + chk.value + ',';
strCompareDiamonds = strCompareDiamonds + chk.value + ',';
ComapreCount = parseInt(ComapreCount) + 1;
$('#hndCompareCount').val(ComapreCount);
$('#spanDCompareCount').html(' (' + ComapreCount + ')');
}
else {
strDiamonds = strDiamonds.replace(chk.value + ',', '');
strCompareDiamonds = strCompareDiamonds.replace(chk.value + ',', '');
ComapreCount = parseInt(ComapreCount) - 1;
$('#hndCompareCount').val(ComapreCount);
$('#spanDCompareCount').html(' (' + ComapreCount + ')');
}
$('#hndChkDiamonds').val(strDiamonds);
$('#hndCompareDiamondsDetail').val(strCompareDiamonds);
}
function AddToCompaire(DiamondID) {
var strDiamonds = $('#hndChkDiamonds').val();
var ComapreCount = $('#hndCompareCount').val();
var strCompareDiamonds = $('#hndCompareDiamondsDetail').val();
strDiamonds = strDiamonds + DiamondID + ',';
strCompareDiamonds = strCompareDiamonds + DiamondID + ',';
ComapreCount = parseInt(ComapreCount) + 1;
$('#hndCompareCount').val(ComapreCount);
$('#hndChkDiamonds').val(strDiamonds);
$('#hndCompareDiamondsDetail').val(strCompareDiamonds);
alert("Diamond Added To Compare");
}
function FbShareClick(imgpath, ProductName, ProductDesc, url) {
var u = url;
window.open('http://www.facebook.com/sharer.php?s=100&p[title]=' + ProductName + '&p[url]=' + encodeURIComponent(u) + '&p[summary]=' + encodeURIComponent(ProductDesc) + '&p[images][0]=' + encodeURIComponent(imgpath) + '');
}
//function ShowPopupDetails(intDiamondId, Shape, Price, Cut, Color, Clarity) {
//}
function ShowPopupDetails(intDiamondId, Shape, Price, Cut, Color, Clarity, Origin) {
var pos = $('#divDiamondsList').position();
if (pos.top == 0) {
$("#divDiamondsList").css({ top: '1px' });
}
// else {
// var tope = pos.top + 1;
// $("#divDiamondsList").css({ top: '' + tope + 'px' });
// }
setBottomContent(Cut, Color, Clarity);
var strFavDiamonds = $('#hndChkDiamonds').val();
var strCompareDiamonds = $('#hndCompareDiamonds').val();
strFavDiamonds = strFavDiamonds.substring(0, strFavDiamonds.length - 1);
var tmpCollection = $("tr[id^=tr]");
for (var i = 0; i < tmpCollection.length; i++) {
if (tmpCollection[i].id == 'tr' + intDiamondId) {
$('#tr' + intDiamondId).addClass('Activetr');
$('#img' + intDiamondId).attr('src', 'Themes/' + ThemeName + '/images/eyes_White_img.png');
}
else {
$(tmpCollection[i]).removeClass('Activetr');
var imgId = tmpCollection[i].id.replace('tr', 'img');
$('#' + imgId).attr('src', 'Themes/' + ThemeName + '/images/View_image.png');
}
}
$('#divRightTopContent').empty();
var str = '';
str += '
DIAMOND PREVIEW
';
str += '';
str += '
';
str += '
';
str += '';
str += '' + Price + '
';
str += '';
str += 'Stock Number: ' + intDiamondId + '
';
str += '';
if (Origin != '') {
if (Origin.substring(0, 5).toLowerCase() == "canad") {
str += '
';
}
}
//str += '
';
//str += '
';
//str += '
';
str += '
';
str += '';
}
else {
str += 'View Details';
}
}
else {
//str += 'View';
if (certificate == '%') {
str += 'View Details';
}
else {
str += 'View Details';
}
}
str += '';
}
else {
str += 'Add To Compare';
}
str += '';
$('#divRightTopContent').html(str);
}
function setBottomContent(Cut, Color, Clarity) {
$('#liFair').find('a').css('color', '#808285');
$('#liGood').find('a').css('color', '#808285');
$('#liVery').find('a').css('color', '#808285');
$('#liExcellent').find('a').css('color', '#808285');
$('#liIdeal').find('a').css('color', '#808285');
$('#liD').find('a').css('color', '#808285');
$('#liE').find('a').css('color', '#808285');
$('#liF').find('a').css('color', '#808285');
$('#liG').find('a').css('color', '#808285');
$('#liH').find('a').css('color', '#808285');
$('#liI').find('a').css('color', '#808285');
$('#liJ').find('a').css('color', '#808285');
$('#liK').find('a').css('color', '#808285');
$('#liL').find('a').css('color', '#808285');
$('#liM').find('a').css('color', '#808285');
$('#liN').find('a').css('color', '#808285');
$('#liO').find('a').css('color', '#808285');
$('#liP').find('a').css('color', '#808285');
$('#liFL').find('a').css('color', '#808285');
$('#liIF').find('a').css('color', '#808285');
$('#liVVS1').find('a').css('color', '#808285');
$('#liVVS2').find('a').css('color', '#808285');
$('#liVS1').find('a').css('color', '#808285');
$('#liVS2').find('a').css('color', '#808285');
$('#liSI1').find('a').css('color', '#808285');
$('#liSI2').find('a').css('color', '#808285');
$('#liI1').find('a').css('color', '#808285');
$('#liI2').find('a').css('color', '#808285');
switch (Cut.toUpperCase()) {
case 'FAIR':
$("#divCutContent").html("As determined by GIA, this diamond has been cut to yield more carat weight from the diamond rough. A fair cut will produce some brilliance, but will not be as brilliant as a higher cut grade.");
break;
case 'GOOD':
$("#divCutContent").html("As determined by GIA, this diamond has been cut to allow it to reflect most light that enters. A good cut is often significantly less expensive than a very good cut and is an acceptable choice for most jewelry.");
break;
case 'VERY GOOD':
case 'PREMIUM':
$("#divCutContent").html("A diamond with a Very Good cut has a balance of weight retention and brilliance. Because of this you can get a diamond with very good light return at a very good price.");
break;
case 'EXCELLENT':
case 'IDEAL':
$("#divCutContent").html("GIA uses the term “Excellent” to describe “Ideal Cut” diamonds while other grading Laboratories use the term “Ideal” (A GIA Excellent will fall into the Ideal category.) Ideal Cut diamonds will usually display a maximum amount of brilliance and scintillation. These diamonds experience additional weight loss during cutting required to produce the most brilliant diamond and are generally more expensive.");
break;
default:
$("#divCutContent").html("Cut is important because it is a direct indica- tion of the brilliance and sparkle of a diamond. Diamonds with perfect clarity or color but which are badly cut can appear dull and life- less, but finely cut diamonds can in many");
break;
}
//For Color
switch (Color.toUpperCase()) {
case 'J':
$("#divColorContent").html("Slight color visible. This diamond, when cut to ideal proportions, produces a warm brilliancy not found in the higher grade colors. As the least expensive diamonds in the near-colorless range, J color diamonds present good value in diamond color, so you can buy a larger diamond for the price. Note: If this diamond has medium or strong blue fluorescence, its color tint will be partially masked, making the diamond appear whiter to the eye.");
break;
case 'I':
$("#divColorContent").html("Minimally visible color. This diamond, when cut to ideal proportions, produces a warm brilliancy not found in the higher grade colors. I color diamonds are less expensive than other diamonds, so you can buy a larger diamond for the same price as a higher color grade. Note: If this diamond has medium or strong blue fluorescence, its slight tint will be partially masked, making the diamond appear whiter to the eye.");
break;
case 'H':
$("#divColorContent").html("Practically colorless. This diamond offers an exceptional balance of color and cost in the near-colorless range. If you choose an H color grade diamond, you can buy a larger diamond for the same the price as a higher color grade. The very slight tint is generally not noticeable, unless compared against diamonds or a higher color grade.");
break;
case 'G':
$("#divColorContent").html("Practically colorless. This diamond is nearly colorless. A diamond with G color has an extremely faint tint that is only noticeable to a trained gemologist. G color diamonds make for beautiful jewelry and they offer an outstanding value, since they are less expensive than the colorless grades, but appear to the eye to be colorless when mounted.");
break;
case 'F':
$("#divColorContent").html("Virtually colorless. No color is visible to an untrained eye in an F color diamond. As the least expensive diamond color in the colorless range, F color diamonds display minimal color difference from D or E color diamonds and offer a lower price.");
break;
case 'E':
$("#divColorContent").html("This diamond is colorless to the unaided eye. Only a trained gemologist using special equipment can determine any color difference between a D and an E color diamond.");
break;
case 'D':
$("#divColorContent").html("This diamond are absolutely colorless. A diamond of this color grade is highly prized, as a diamond with less color has never been found. This color grade of diamond is the highest, the most rare and the most expensive.");
break;
default:
$("#divColorContent").html("The color of a diamond results from light passing through chemical impurities and/or defects is the crystalline structure. These in- clusions alter the amount of light absorption pattern so that color is visible to the human");
break;
}
//For Clarity
switch (Clarity.toUpperCase()) {
case 'SI2':
$("#divClarityContent").html("The inclusions in this diamond can be visible at 10x power magnification. Inclusions in diamonds with an SI2 grade clarity may be visible to the unaided eye. SI2 grade diamonds are more common, so they are less expensive and present a great value.");
break;
case 'SI1':
$("#divClarityContent").html("The inclusions in this diamond can be visible at 10x power magnification. Inclusions in diamonds with SI grade clarity might be visible to the unaided eye. SI1 grade diamonds are not as rare as VS1 and VS2 grade diamonds, so they are less expensive and present a great value.");
break;
case 'VS2':
$("#divClarityContent").html("This diamond has few, very small inclusions. The inclusions are difficult to see under a 10x power magnification, and are typically never visible to the naked eye. VS2 grade diamonds present an excellent value in clarity because they are usually free of visible blemishes, and they are less expensive than higher clarity grades.");
break;
case 'VS1':
$("#divClarityContent").html("This diamond has few, very small inclusions. The inclusions are very difficult to see under a 10x power magnification, and are almost never visible to the naked eye. VS1 grade diamonds present an excellent value in clarity because they are typically free of visible blemishes, and they are less expensive than higher clarity grades.");
break;
case 'VVS2':
$("#divClarityContent").html("This diamond has very few, tiny inclusions. The inclusions in this diamond are extremely difficult to identify even when viewed under a microscope at 30x power magnification. Diamonds of this grade of clarity are very rare.");
break;
case 'VVS1':
$("#divClarityContent").html("This diamond is colorless to the unaided eye. Only a trained gemologist using special equipment can determine any color difference between a D and an E color diamond.");
break;
case 'IF':
$("#divClarityContent").html("This diamond has no internal identifying characteristics, even when viewed under a microscope at extreme magnification. These diamonds are not graded flawless usually because of very slight surface markings or minor details in their polish. Diamonds of this grade of clarity are extremely rare.");
break;
case 'FL':
$("#divClarityContent").html("Completely flawless. This diamond has absolutely no internal or external identifying characteristics, even when viewed under a microscope at extreme magnification. The polish and external features on these diamonds are perfect. The brilliance, scintillation and fire possessed by this diamond are unparalleled. Diamonds of this grade of clarity are the most rare and the most highly valued.");
break;
default:
$("#divClarityContent").html("The clarity of a diamond is a measure of the number and type of inclusions within the dia- mond and on its surface. The fewer the inclu- sions visible under a 10X magnifier, the higher the clarity grade which ranges from flawless");
break;
}
if (Cut.toUpperCase() == "PREMIUM") {
$('#liVery').find('a').css('color', '#363636');
}
else {
if (Cut.toUpperCase() != "N/A")
$('#li' + Cut).find('a').css('color', '#363636');
}
$('#li' + Color).find('a').css('color', '#363636');
$('#li' + Clarity).find('a').css('color', '#363636');
$("#spCut").html(Cut);
$("#spColor").html(Color);
$("#spClarity").html(Clarity);
LoadScrollBottomContent();
}
function LoadScrollBottomContent() {
$("#divCutContent").jScrollPane({ scrollbarWidth: 13, scrollbarMargin: 0, showArrows: false, arrowSize: 0, maintainPosition: false });
$("#divColorContent").jScrollPane({ scrollbarWidth: 13, scrollbarMargin: 0, showArrows: false, arrowSize: 0, maintainPosition: false });
$("#divClarityContent").jScrollPane({ scrollbarWidth: 13, scrollbarMargin: 0, showArrows: false, arrowSize: 0, maintainPosition: false });
}
//Code by hemali - 6th Feb,2013
function alinkCompareDiamond() {
var strDiamonds = $('#hndCompareDiamondsDetail').val();
if (strDiamonds == '') {
alert('Please Select Diamonds.');
}
else {
strDiamonds = strDiamonds.substring(0, strDiamonds.length - 1);
window.location = "MasterlinkCompareDiamond.aspx?Dealerlink=" + dealerID + "&Diamonds=" + strDiamonds + "&T=D&ThemeName=" + ThemeName + "&Parent_url=" + parent_url.replace('#', '*').replace('DiamondListing-1', 'DiamondListing-15').replace('?', '$').replace('&', '^');
}
}
function fnSort(strSort) {
var sotrType = 'Asc';
if (strSort == orderBy) {
if (orderType == "Asc")
sotrType = 'Desc';
else
sotrType = 'Asc';
}
orderBy = strSort;
orderType = sotrType;
currentPage = 1;
CallAjaxRequestForDiamondGrid();
}
function LoadGridScroll() {
$("#divDiamondsList").jScrollPane({ scrollbarWidth: 17, scrollbarMargin: 0, showArrows: false, arrowSize: 0, maintainPosition: false });
$('#divDiamondsList').show();
}
function LoadGridScrollPaging() {
$("#divDiamondsList").jScrollPane({ scrollbarWidth: 17, scrollbarMargin: 0, showArrows: false, arrowSize: 0, IsFromPager: true, maintainPosition: false });
$("#divDiamondsList").css({ top: '0px' });
$('#divDiamondsList').show();
}
//Get absolute left position of any control passed
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 getfocus(obj, val) {
var objValue = '';
objValue = $('#' + obj).val();
if (objValue == 'Your Name') {
$('#' + obj).val('');
}
if (objValue == 'Your E-Mail Address') {
$('#' + obj).val('');
}
if (objValue == 'Your Phone Number') {
$('#' + obj).val('');
}
if (objValue == 'Write A Personal Message') {
$('#' + obj).val('');
}
if (objValue == 'Friend E-Mail Address') {
$('#' + obj).val('');
}
if (objValue == 'Subject') {
$('#' + obj).val('');
}
if (objValue == 'Write A Personal Message') {
$('#' + obj).val('');
}
if (objValue == 'E-Mail Address') {
$('#' + obj).val('');
}
if (objValue == 'Password') {
$('#' + obj).val('');
}
if (objValue == 'Full Name') {
$('#' + obj).val('');
}
if (objValue == 'X:XX') {
$('#' + obj).val('');
}
if (objValue == 'Add a comment.') {
$('#' + obj).val('');
}
if (objValue == 'Jewelry Search') {
$('#' + obj).val('');
}
if (objValue == 'Comment') {
$('#' + obj).val('');
}
}
function lostfocus(obj, val) {
if (document.getElementById(obj).value == '') {
document.getElementById(obj).value = val;
}
}
function emailValidation(TxtId) {
var emailRegEx = /^([a-zA-Z0-9])(([a-zA-Z0-9])*([\._-])?([a-zA-Z0-9]))*@(([a-zA-Z0-9\-])+(\.))+([a-zA-Z]{2,4})+$/
if (document.getElementById(TxtId).value.search(emailRegEx) == -1) //if match failed
{
document.getElementById(TxtId).focus();
alert("invalid Email!!!");
}
}
function CheckSeeInStore() {
var strComment = document.getElementById("txtSeeInStore1");
var strFullName = $('#txtSeeInStoreFullName').val();
var strEmail = $('#txtSeeInStoreEmail').val();
if (strComment.value != "" && strComment.value != "Comment" && strFullName != '' && strFullName != 'Full Name' && strEmail != '' && strEmail != 'E-Mail Address') {
return true;
}
else {
alert("Enter Required Information!...");
return false;
}
}
//Code by hemali - 6th Feb,2013
function alinkCompareDiamondFromLink() {
var strDiamondsFromHf = $('#hndCompareDiamondsDetail').val();
if (strDiamondsFromHf != '') {
strDiamondsFromHf = strDiamondsFromHf.substring(0, strDiamondsFromHf.length - 1);
window.location = "MasterlinkCompareDiamond.aspx?Dealerlink=" + dealerID + "&Diamonds=" + strDiamondsFromHf + "&T=D&ThemeName=" + ThemeName + "&Parent_url=" + parent_url.replace('#', '*').replace('DiamondListing-1', 'DiamondListing-15').replace('?', '$').replace('&', '^');
}
else {
if ($.cookie("DiamondIDs") != null) {
var strDiamonds = $.cookie("DiamondIDs");
var CType = $.cookie("CType");
if (strDiamonds == null) {
alinkCompareDiamond();
}
else {
window.location = "MasterlinkCompareDiamond.aspx?Dealerlink=" + dealerID + "&Diamonds=" + strDiamonds + "&T=" + CType + "&ThemeName=" + ThemeName + "&Parent_url=" + parent_url.replace('#', '*').replace('DiamondListing-1', 'DiamondListing-15').replace('?', '$').replace('&', '^');
}
}
else {
alinkCompareDiamond();
}
}
}
//Page Numbers
function displayPageNumbers() {
var strPaging = '';
var tempPageIndex = 0;
var topClick = "";
var BottomClick = "";
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 / pageSize);
if (tempPageIndex >= displayNoOfPages && tempPageIndex < lastPageIndex) {
topClick += "onclick=\"PagerClick('" + tempPageIndex + "');\"";
}
else if (currentPage > 1) {
topClick += "onclick=\"PagerClick('" + iNo2 + "');\"";
}
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;
//vaibhav
if (tempPageIndex > lastPageIndex && currentPage != lastPageIndex)
tempPageIndex = tempPageIndex - 1;
if (tempPageIndex <= lastPageIndex) {
BottomClick += "onclick=\"PagerClick('" + iNo + "');\"";
}
var Compare = ""
var TopHTML = ' ' + strPaging;
TopHTML += '';
var BottomHTML = ' ';
BottomHTML += strPaging + '';
//var TopHTML = strPaging + ' ';
//var BottomHTML = strPaging + '';
$("#divTopPaging").html('');
$("#divBottomPaging").html(Compare + '');
}
function PagerClick(intpageNo) {
currentPage = new Number(intpageNo);
CallAjaxRequestForDiamondGrid();
}
function ChangeImgSrc(imgId, Temp) {
var trid = imgId.replace('img', 'tr');
var className = $('#' + trid).attr('class');
if (Temp == '1') {
$('#' + imgId).attr('src', 'Themes/' + ThemeName + '/images/eyes_White_img.png');
}
else if (Temp == '2') {
if (className != 'Activetr') {
$('#' + imgId).attr('src', 'Themes/' + ThemeName + '/images/View_image.png');
}
}
}
function fnddlSort() {
var sortval = $('#ddlSort').val();
if (sortval == '1') {
orderBy = 'FltPrice';
orderType = 'Desc';
CallAjaxRequestForDiamondGrid();
}
else if (sortval == '2') {
orderBy = 'FltPrice';
orderType = 'Asc';
CallAjaxRequestForDiamondGrid();
}
}
//new Method
function OnClickDropAHint() {
// $('.diamond_report').css("display", "none");
$('#Hidediv').hide();
$('#divDropHint').show();
// $('#divLinks').show();
}
function OnClickCancelHint() {
$('#divProdDetlBottom').show();
$('#divDropHint').hide();
$('#divLinks').show();
$('#Hidediv').css("display", "block");
}
function getfocusnew(obj, val) {
if (obj.value == val) {
obj.value = '';
}
}
function lostfocusnew(obj, val) {
if (obj.value == '') {
obj.value = val;
}
}
function ShowDivInCenter() {
try {
var divplatId = document.getElementById('divFlag');
var left = divplatId.offsetLeft;
var top = divplatId.offsetTop;
var divId = "divArrow";
var contdivId = "outerpop-up";
var ojbDiv = document.getElementById(divId);
var divheight = $('#outerpop-up').height();
//debugger
ojbDiv.style.left = 429 + 'px';
ojbDiv.style.top = divheight - 82 + 'px';
ojbDiv = document.getElementById(contdivId);
ojbDiv.style.top = top - 50 + 'px';
ojbDiv.style.left = left - 447 + 'px';
}
catch (e) { alert(e); }
}
function PmouseOver() {
ShowDivInCenter();
$('div#outerpop-up').show();
$('div#pop-up').show();
}
function closethediv() {
$('div#outerpop-up').hide();
}
function popupover() {
if ($("div#outerpop-up").is(":visible")) {
}
else {
$('div#outerpop-up').show();
}
}
function MM_openBrWindow(theURL, winName, features) {
window.open(theURL, winName, features);
}
function ShowPopupImage() {
$(".diamond_detail").hide();
$("#imgpopup").show();
}
function HidePopupimag() {
$(".diamond_detail").show();
$("#imgpopup").hide();
}