var isie8 = true;
var ThemeName = 'WhiteTheme';
var CustID = '';
var curVal = 0;
var curVal2 = 0;
var selectedShape = '';
var objProcessBar = '';
var HasLink = '';
var GFLinkOption = 0;
var detailsLink = 'BuildRingStep2DiamondDetail.aspx';
var CountryTaxRate = '';
var CountryCode = '';
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 CutGradeList = '';
var ColorList = '';
var ClarityList = '';
var SymmetryList = '';
var FluorescenceList = '';
var Cut = '';
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 SettingSKU = '';
var pageSize = 6;
var currentPage = 1;
var totalPages = 0;
var showPrices = true;
var showPopup = true;
var totalRecords = 0;
var totalCompareRecords = 0;
var tblDiamonds;
var displayNoOfPages = 3;
var ctw = '';
var webCall = null;
var ExtraQStr = '';
var SOrigin = '';
var TotalPrice = '';
//////////////////////
var dvDiamonds; //Diamond DataView
var dvCompareDiamonds; //Diamond DataView
/////////////////////////////////////////////////////////////////////////////////////////////////
//For Silder
var curVal = 0;
var curVal2 = 0;
var SimpleOverLay = '#FFFFFF';
var SimpleSelectedOverLay = '#E0E0E0';
var SimpleOverLayAdv = '#FFFFFF';
var SimpleSelectedOverLayAdv = '#E0E0E0';
var sldCaratMin;
var sldCaratMax;
var sldCutGradeMin;
var sldCutGradeMax;
var sldColorMin;
var sldColorMax;
var sldClarityMin;
var sldClarityMax;
var sldIntensityMin;
var sldIntensityMax;
var sldPriceMin;
var sldPriceMax;
var sldPolishMin;
var sldPolishMax;
var sldSymmetryMin;
var sldSymmetryMax;
var sldFluorescenceMin;
var sldFluorescenceMax;
var sldDepthMin;
var sldDepthMax;
var sldTableMin;
var sldTableMax;
////////////////////////////////////////////////////////////////////////////////////////////////////////
var PriceMin = '';
var PriceMax = '';
var minPriceVal = 0;
var maxPriceVal = 100000;
var sldpriceMin = 0;
var sldpriceMax = 100000;
var priceid = 0;
var ShowInternalLink = 0;
var Isdiamond = 0;
var AppointDate = '';
var AppointMon = 0;
var AppointDay = 0;
var AppointYer = 0;
var RingURL;
var DiamondURL;
var locationID = 1;
var addressList = '';
var locationList = '';
var customerZipcode = '';
var geocoder;
var map;
var map2;
var srcLat = '';
var srcLong = '';
var distance = '';
var marker;
var directionsDisplay;
var directionsService;
var StockNo = '';
var Log_ID = '';
var JCLog_ID = '';
var mileData = '';
var lowestMile = 50;
var ipAddress = '0';
var HasRetailerLocator = false;
var SelectRetailerAddress = '';
var ID = '';
var IsInJc = '';
var markersmain = [];
var VideoImageName;
function loadInitialData() {
Gethightwidth();
if (DID != '') {
currentPage = 1;
}
if (VideoImageName != "" && VideoImageName != undefined)
ChangeVideo();
LoadGridScroll();
//---------------------- change by sumeet 11-Nov --------------------------------///
RingURL = $('#hndRingUrl').val();
DiamondURL = $('#hndDiamondUrl').val();
// ---------------- End---------------- ///
}
function showPositionDetail(position) {
var lat = position.coords.latitude;
var long = position.coords.longitude;
var latlng = new google.maps.LatLng(lat, long)
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'latLng': latlng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
for (var i = 0; i < results[0].address_components.length; i++) {
var address = results[0].address_components[i];
if (address.types[0] == "postal_code") {
customerZipcode = address.long_name;
$('#txtZipCode').val(customerZipcode);
LoadMap();
}
}
}
});
}
function showErrorDetail(error) {
switch (error.code) {
case error.PERMISSION_DENIED:
break;
case error.POSITION_UNAVAILABLE:
break;
case error.TIMEOUT:
break;
case error.UNKNOWN_ERROR:
break;
}
}
function Gethightwidth() {
var $loading = $("#divProcessBar");
var windowH = $(window).height();
var windowW = $(window).width();
var left = ((windowW - $loading.outerWidth()) / 2 + $(document).scrollLeft());
var top = ((windowH - $loading.outerHeight()) / 2 + $(document).scrollTop());
$("#divProcessBar").css("left", parseInt(left) + 100 + "px");
$("#divProcessBar").css("top", parseInt(top) + 300 + "px");
}
//Call function to call service used to load diamonds
function CallAjaxRequestForDiamondGrid() {
Gethightwidth();
// var PageSize = 9;
if (webCall != null) {
webCall.abort();
}
objProcessBar = document.getElementById("divProcessBar");
document.getElementById("divProcessBar").style.display = '';
webCall = $.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/LabGrownDiamonds",
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:'All',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',ExtraQStr:'" + ExtraQStr + "',CutGradeList:'" + CutGradeList + "',ColorList:'" + ColorList + "',ClarityList:'" + ClarityList + "',BindCheckbox:'0',SOrigin:'" + SOrigin + "',Isdiamond:'" + Isdiamond + "',CustID:'" + CustID + "',SettingSKU:'" + SettingSKU + "',CountryTaxRate:'" + CountryTaxRate + "'}",
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 {
$(".scr_bot").css("display", "");
strHtml = response.d.dtHTMLData[0]["HTMLData"];
}
$('#divResult').html(strHtml);
totalRecords = $('#hndTotalDiamonds').val();
if (totalRecords > 0) {
displayPageNumbers();
}
$("#ddlSort").msDropDown();
ForPopup();
document.getElementById("divProcessBar").style.display = 'none';
if (ShowInternalLink == 0) {
$(".similar_tx").children("p").children("a.poplight").hide();
}
else {
$(".similar_tx").children("p").children("a.poplight").show();
}
setTimeout("SendHeight()", 3000);
setLiDesign();
}
}
else {
setTimeout("SendHeight()", 3000);
document.getElementById("divProcessBar").style.display = 'none';
}
},
error: function (msg) {
document.getElementById("divProcessBar").style.display = 'none';
}
});
ScheduleViewingData();
}
function CallAjaxRequestForIDCDiamondGrid() {
Gethightwidth();
// var PageSize = 9;
if (webCall != null) {
webCall.abort();
}
objProcessBar = document.getElementById("divProcessBar");
document.getElementById("divProcessBar").style.display = '';
webCall = $.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/LoadIDCDiamonds",
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:'All',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',ExtraQStr:'" + ExtraQStr + "',CutGradeList:'" + CutGradeList + "',ColorList:'" + ColorList + "',ClarityList:'" + ClarityList + "',BindCheckbox:'0',SOrigin:'" + SOrigin + "',Isdiamond:'" + Isdiamond + "',CustID:'" + CustID + "',SettingSKU:'" + SettingSKU + "',CountryTaxRate:'" + CountryTaxRate + "'}",
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 {
$(".scr_bot").css("display", "");
strHtml = response.d.dtHTMLData[0]["HTMLData"];
}
$('#divResult').html(strHtml);
DdlAddress_Detail();
totalRecords = $('#hndTotalDiamonds').val();
if (totalRecords > 0) {
displayPageNumbers();
}
$("#ddlSort").msDropDown();
ForPopup();
document.getElementById("divProcessBar").style.display = 'none';
if (ShowInternalLink == 0) {
$(".similar_tx").children("p").children("a.poplight").hide();
}
else {
$(".similar_tx").children("p").children("a.poplight").show();
}
setTimeout("SendHeight()", 3000);
setLiDesign();
}
}
else {
setTimeout("SendHeight()", 3000);
document.getElementById("divProcessBar").style.display = 'none';
}
},
error: function (msg) {
document.getElementById("divProcessBar").style.display = 'none';
}
});
ScheduleViewingData();
}
//JC
function SendHeight() {
// ---------------- NC 11-Nov -------------
var parent_url2 = '';
if (DiamondURL != undefined)
parent_url2 = DiamondURL.split(',');
parent_url = RingURL;
XD.postMessage($("#mainbdy").height() + 300, parent_url, parent);
for (var i = 0; i < parent_url2.length; i++) {
if (parent_url2[i] != '')
XD.postMessage($("#mainbdy").height() + 80, parent_url2[i], parent);
}
return false;
// ----------------- End ------------------
}
function CallAjaxRequestMore() {
Gethightwidth();
if (webCall != null) {
webCall.abort();
}
if (pageSize == 6) {
pageSize = 12;
}
else {
pageSize += 6;
}
objProcessBar = document.getElementById("divProcessBar");
document.getElementById("divProcessBar").style.display = '';
webCall = $.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/LabGrownDiamonds",
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:'All',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',ExtraQStr:'" + ExtraQStr + "',CutGradeList:'" + CutGradeList + "',ColorList:'" + ColorList + "',ClarityList:'" + ClarityList + "',BindCheckbox:'0',SOrigin:'" + SOrigin + "',Isdiamond:'" + Isdiamond + "',CustID:'" + CustID + "',SettingSKU:'" + SettingSKU + "',CountryTaxRate:'" + CountryTaxRate + "'}",
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 {
$(".scr_bot").css("display", "");
strHtml = response.d.dtHTMLData[0]["HTMLData"];
}
$('#divResult').html(strHtml);
totalRecords = $('#hndTotalDiamonds').val();
if (totalRecords > 0) {
displayPageNumbers();
}
$("#ddlSort").msDropDown();
ForPopup();
document.getElementById("divProcessBar").style.display = 'none';
if (ShowInternalLink == 0) {
$(".similar_tx").children("p").children("a.poplight").hide();
}
else {
$(".similar_tx").children("p").children("a.poplight").show();
}
setTimeout("SendHeight()", 3000);
}
}
else {
setTimeout("SendHeight()", 3000);
document.getElementById("divProcessBar").style.display = 'none';
}
},
error: function (msg) {
document.getElementById("divProcessBar").style.display = 'none';
}
});
ScheduleViewingData();
}
//END
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;
if (tempPageIndex <= lastPageIndex) {
BottomClick += "onclick=\"PagerClick('" + iNo + "');\"";
}
var TopHTML = ' ' + strPaging + '';
var BottomHTML = ' ' + strPaging + '';
$("#divTopPaging").html('');
$("#divBottomPaging").html('');
}
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 fnddlSort() {
var sortval = $('#ddlSort').val();
if (sortval == '1') {
orderBy = 'FltPrice';
orderType = 'Desc';
CallAjaxRequest();
}
else if (sortval == '2') {
orderBy = 'FltPrice';
orderType = 'Asc';
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.png');
}
}
}
function ShowPopupDetails(intDiamondId, Shape, Price, Cut, Color, Clarity) {
}
function PagerClick(intpageNo) {
currentPage = new Number(intpageNo);
CallAjaxRequestForDiamondGrid();
}
function ForPopup() {
$('a.poplight[href^=#]').click(function () {
var popID = $(this).attr('rel'); //Get Popup Name
var popURL = $(this).attr('href'); //Get Popup href to define size
//Pull Query & Variables from href URL
var query = popURL.split('?');
var dim = query[1].split('&');
var popWidth = dim[0].split('=')[1]; //Gets the first query string value
//Fade in the Popup and add close button
$('#' + popID).fadeIn().css({ 'width': Number(popWidth) }).prepend('');
var popMargTop = ($(window).height() - 80) / 2;
var popMargLeft = (parseInt(popWidth) + 85) / 2;
//alert(popMargTop);
//Apply Margin to Popup
$('#' + popID).css({
'margin-top': -popMargTop,
'margin-left': -popMargLeft
});
//Fade in Background
$('body').append(''); //Add the fade layer to bottom of the body tag.
$('#fade').css({ 'filter': 'alpha(opacity=80)' }).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies
return false;
});
//Close Popups and Fade Layer
$('a.close, #fade').live('click', function () { //When clicking on the close or fade layer...
$('#fade , .popup_block').fadeOut(function () {
$('#fade, a.close').remove(); //fade them both out
});
return false;
});
}
function HideShow(objShow, objHide, liObj) {
$("." + objShow).show();
$("." + objHide).hide();
ChangeScroll();
$("#liItemDetails a").removeClass("topnav_active");
$("#liSpecification a").removeClass("topnav_active");
$("#" + liObj.id + " a").addClass("topnav_active");
$("#DivEmailtoFriend").hide();
$("#DivDropAHint").hide();
$("#Divletusknow").hide();
$("#divScheduleView").hide();
$(".canadianrocks_ba").hide();
$(".divBothSide").show();
}
function ChangeScroll() {
$('#detail_bx_bg').jScrollPaneRemove();
LoadGridScroll();
}
function LoadGridScroll() {
//$("#detail_bx_bg").jScrollPane({ scrollbarWidth: 20, scrollbarMargin: 0, showArrows: true, arrowSize: 0, arrowSize: 16, dragMaxHeight: 100 });
}
//For Schedule Viewing(zishan)
function ScheduleViewingData() {
if (AppointMon != '' && AppointMon != 0 && AppointDay != '' && AppointDay != 0 && AppointYer != '' && AppointYer != 0) {
AppointDate = new Date(AppointYer, AppointMon - 1, AppointDay);
}
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/BindCustomerAppointments",
data: "{DealerLink:'" + dealerID + "',ThemeName:'" + ThemeName + "',AppointDate:'" + AppointDate + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (data) {
$("#spnDealerCompany").text(data.d.dtAppointments[0]["DealerCompany"]);
$("#spnAddress").text(data.d.dtAppointments[0]["DealerAddress"]);
$("#spnCity").text(data.d.dtAppointments[0]["DealerCity"]);
$("#spnState").text(data.d.dtAppointments[0]["DealerState"]);
$("#spnZip").text(data.d.dtAppointments[0]["DealerZip"]);
$("#spnPhone").text(data.d.dtAppointments[0]["DealerPhone"]);
$("#divddlAppnt").html(data.d.dtAppointments[0]["HTMLData"]);
if (data.d.dtAppointments[0]["HTMLDataTime"].length > 0)
$("#divddlAppntTime").html(data.d.dtAppointments[0]["HTMLDataTime"]);
},
error: function (msg) {
}
});
}
function CancelSch() {
$("#txtAppntMsg").val("");
$("#txtAppntDate").val("");
$("#ddlAppnt > [value='0']").attr("selected", "true");
$("#ddlAppntTime > [value='0']").attr("selected", "true");
}
function ScheduleView(SID) {
if (Page_ClientValidate('SchView')) {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/ScheduleViewing",
data: "{DealerLink:'" + dealerID + "',SID:'" + SID + "',DID:'" + qurDID + "',URL:'" + window.location.href + "',qurShape:'" + qurShape + "',qurCTW:'" + qurctw + "',txtAppntMsg:'" + $('#txtAppntMsg').val() + "',txtAppntDate:'" + $('#txtAppntDate').val() + "',hndAppntTime:'" + $('#hndAppntTime').val() + "',ThemeName:'" + ThemeName + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
$('#txtAppntMsg').val("");
$('#txtAppntDate').val("");
$('#hndAppntTime').val("");
$("#ddlAppnt > [value='0']").attr("selected", "true");
$("#ddlAppntTime > [value='0']").attr("selected", "true");
location.reload();
},
error: function (msg) {
}
});
}
else {
}
}
//End Schedule Viewing
//For MultiAddress Scroll(zishan)
function LoadSimilarProductScroll() {
setTimeout('LoadSimilar();', 1000);
}
function LoadSimilar() {
$('#MultiAddr').css('margin-left', '-13px');
$('#MultiAddr').adGallery();
}
//End
//For All Popups(zishan)
function HideShowPopup(objShow, objHide) {
$(".diamond_text_bg").hide();
$(".setting_text_bg").hide();
$("#DivEmailtoFriend").hide();
$("#DivDropAHint").hide();
$("#Divletusknow").hide();
$("#divScheduleView").hide();
$("#" + objShow).show();
}
function HideShowPopupIDC(objShow, objHide) {
$(".diamond_text_bg").hide();
$(".setting_text_bg").hide();
$("#DivEmailtoFriend").hide();
$("#DivDropAHint").hide();
$("#Divletusknow").hide();
$("#divScheduleView").hide();
$("#" + objShow).show();
}
function hideView(objHide) {
$(".diamond_text_bg").show();
$("#" + objHide).hide();
}
function setLiDesign() {
var VisibleCnt1 = 0;
var VisibleCnt2 = 0;
$('#ulRowDtls li').each(function (e, i) {
if ($(i).css('display') != 'none') {
if (VisibleCnt1 % 2 != 0) {
$(i).addClass('gary');
}
VisibleCnt1++;
}
});
}
function showcanadian() {
$(".canadianrocks_ba").show();
$(".divBothSide").hide();
$("#DivEmailtoFriend").hide();
$("#DivDropAHint").hide();
$("#Divletusknow").hide();
$("#divScheduleView").hide();
}
//End
//Code for process image on add to cart
function showprocess() {
objProcessBar = document.getElementById("divProcessBarCart");
o = document.getElementById("imgbtnAddToCart");
$("#imgbtnAddToCart").attr('onmouseout', 'Themes / WhiteTheme / images / add_to_shoping_cart.jpg');
objProcessBar.style.left = getAbsLeft(o) + 40 + 'px';
objProcessBar.style.top = getAbsTop(o) + 'px';
$("#divProcessBarCart").css("display", "block");
}
function showprocessRing() {
objProcessBar = document.getElementById("divProcessBarRingCart");
o = document.getElementById("imgbtnAddToCart");
$("#imgbtnAddToCart").attr('onmouseout', 'Themes / WhiteTheme / images / add_to_shoping_cart.jpg');
objProcessBar.style.left = getAbsLeft(o) + 156 + 'px';
objProcessBar.style.top = getAbsTop(o) + 'px';
$("#divProcessBarRingCart").css("display", "block");
}
function hideprocess() {
objProcessBar.style.display = 'none';
}
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 lightbox_close() {
$('#light').css('display', 'none');
$('#fade').css('display', 'none');
}
function lightbox_open() {
window.scrollTo(0, 0);
$('#light').css('display', 'block');
$('#fade').css('display', 'block');
}
function ShowAddressDrop(val) {
$('#hndAppntTime').val(val);
}
function SearchDiamond() {
if ($("#txtSearch").val() != "" && $("#txtSearch").val() != "Search Diamond Stock #")
skuNo = $("#txtSearch").val();
else
skuNo = "";
CallAjaxRequestForIDCDiamondGrid();
}
function ResetNoResultRequest() {
//$('#txtNoReFirstName').attr('placeholder', 'First Name');
//$('#txtNoReLastName').attr('placeholder', 'First Name');
//$('#txtNoRePhoneNumber').attr('placeholder', 'First Name');
//$('#txtNoReEmailAddress').attr('placeholder', 'First Name');
//$('#txtNoReComments').attr('placeholder', 'First Name');
$('#txtNoReFirstName').val('');
$('#txtNoReLastName').val('');
$('#txtNoRePhoneNumber').val('');
$('#txtNoReEmailAddress').val('');
$('#txtNoReComments').val('Add Comments Here ...');
}
function SendNoResultRequest() {
var strFirstName = $('#txtNoReFirstName').val();
var strLastName = $('#txtNoReLastName').val();
var strPhoneNumber = $('#txtNoRePhoneNumber').val();
var strEmailAddress = $('#txtNoReEmailAddress').val();
var strComment = $('#txtNoReComments').val();
var count = 0;
var strSubject = 'Request - No Diamonds Listed In That Range';
if (strFirstName != "" && strFirstName != "First Name" && strLastName != "" && strLastName != "Last Name"
&& strPhoneNumber != "" && strPhoneNumber != "Phone Number" && strEmailAddress != "" && strEmailAddress != "E-Mail Address"
&& strComment != "" && strComment != "Add Comments Here ...") {
var emailRegEx = /^([a-zA-Z0-9])(([a-zA-Z0-9])*([\._-])?([a-zA-Z0-9]))*@(([a-zA-Z0-9\-])+(\.))+([a-zA-Z]{2,4})+$/
if (strEmailAddress.search(emailRegEx) == -1) {
count = count + 1;
}
if (count === 0) {
window.scrollTo(0, 0);
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/SendMailToRetailerForNoResults",
data: "{FirstName:'" + strFirstName + "',LastName:'" + strLastName + "',PhoneNumber:'" + strPhoneNumber + "',EmailAddress:'" + strEmailAddress + "',Comment:'" + strComment + "',intDealerID:'" + dealerID + "',Subject:'" + strSubject + "',shapeList:'" + shapeList + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',caratMin:'" + parseFloat(caratMin) + "',caratMax:'" + parseFloat(caratMax) + "',colorMin:'" + colorMin + "',colorMax:'" + colorMax + "',clarityMin:'" + clarityMin + "',clarityMax:'" + clarityMax + "',cutgradeMin:'" + cutgradeMin + "',cutgradeMax:'" + cutgradeMax + "',certificate:'" + certificate + "',depthMin:'" + depthMin + "',depthMax:'" + depthMax + "',tableMin:'" + tableMin + "',tableMax:'" + tableMax + "',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',CutGradeList:'" + CutGradeList + "',ColorList:'" + ColorList + "',ClarityList:'" + ClarityList + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response.d != '') {
alert("Mail send successfully.");
ResetNoResultRequest();
}
else {
alert("Error in Sending Mail");
}
},
error: function () {
}
});
}
else {
alert("Enter Valid E-mail Address.");
}
}
else {
alert("Please Enter Required Information.");
}
}
//end
function SendIDCNoResultRequest() {
var strFirstName = $('#txtNoReFirstName').val();
var strLastName = $('#txtNoReLastName').val();
var strPhoneNumber = $('#txtNoRePhoneNumber').val();
var strEmailAddress = $('#txtNoReEmailAddress').val();
var strComment = $('#txtNoReComments').val();
var strlocation = $('#ddAddress').val();
if (strlocation == 0)
strlocation = $('#ddAddress_detail').val();
var count = 0;
var strSubject = 'Request - No Diamonds Listed In That Range';
if (strFirstName != "" && strFirstName != "First Name" && strLastName != "" && strLastName != "Last Name"
&& strPhoneNumber != "" && strPhoneNumber != "Phone Number" && strEmailAddress != "" && strEmailAddress != "E-Mail Address"
&& strComment != "" && strComment != "Add Comments Here ..." && strlocation != 0) {
var emailRegEx = /^([a-zA-Z0-9])(([a-zA-Z0-9])*([\._-])?([a-zA-Z0-9]))*@(([a-zA-Z0-9\-])+(\.))+([a-zA-Z]{2,4})+$/
if (strEmailAddress.search(emailRegEx) == -1) {
count = count + 1;
}
if (count === 0) {
window.scrollTo(0, 0);
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/SendMailToRetailerIDCForNoResults",
data: "{FirstName:'" + strFirstName + "',LastName:'" + strLastName + "',PhoneNumber:'" + strPhoneNumber + "',EmailAddress:'" + strEmailAddress + "',Comment:'" + strComment + "',Location:'" + strlocation + "',intDealerID:'" + dealerID + "',Subject:'" + strSubject + "',shapeList:'" + shapeList + "',priceMin:'" + PriceMin + "',priceMax:'" + PriceMax + "',caratMin:'" + parseFloat(caratMin) + "',caratMax:'" + parseFloat(caratMax) + "',colorMin:'" + colorMin + "',colorMax:'" + colorMax + "',clarityMin:'" + clarityMin + "',clarityMax:'" + clarityMax + "',cutgradeMin:'" + cutgradeMin + "',cutgradeMax:'" + cutgradeMax + "',certificate:'" + certificate + "',depthMin:'" + depthMin + "',depthMax:'" + depthMax + "',tableMin:'" + tableMin + "',tableMax:'" + tableMax + "',polishList:'" + polishList + "',SymmetryList:'" + SymmetryList + "',FluorescenceList:'" + FluorescenceList + "',CutGradeList:'" + CutGradeList + "',ColorList:'" + ColorList + "',ClarityList:'" + ClarityList + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response.d != '') {
alert("Mail send successfully.");
ResetNoResultRequest();
}
else {
alert("Error in Sending Mail");
}
},
error: function () {
}
});
}
else {
alert("Enter Valid E-mail Address.");
}
}
else {
alert("Please Enter Required Information.");
}
}
function DdlAddress() {
// The select element to be replaced:
var select = $('select.sel_drp');
var selectBoxContainer = $('').attr('width', select.outerWidth()).attr('class', 'ddlIsVisibles').html('
');
var dropDown = $('
').attr('class', 'dropDown');
var selectBox = selectBoxContainer.find('.selectBox3');
// Looping though the options of the original select element
select.find('option').each(function (i) {
var option = $(this);
//if (i == select.attr('selectedIndex')) {
// selectBox.html('' + option.text() + '');
//}
var SelectedOptText = '';
if (i == select.attr('selectedIndex')) {
if (option.text().length > 50) {
SelectedOptText = option.text().substring(0, 50) + "...";
}
else {
SelectedOptText = option.text();
}
selectBox.html('' + SelectedOptText + '');
}
// As of jQuery 1.4.3 we can access HTML5
// data attributes with the data() method.
if (option.attr('data-skip')) {
return true;
}
// Creating a dropdown item according to the
// data-icon and data-html-text HTML5 attributes:
var li = $('- ').html('' + option.text() + '');
li.click(function () {
if (option.text().length > 50) {
SelectedOptText = option.text().substring(0, 50) + "...";
}
else {
SelectedOptText = option.text();
}
selectBox.html('' + SelectedOptText + '');
dropDown.trigger('hide');
// When a click occurs, we are also reflecting
// the change on the original select element:
select.val(option.val());
var liValue = option.val();
return false;
});
dropDown.append(li);
});
selectBoxContainer.append(dropDown.hide());
select.hide().after(selectBoxContainer);
// Binding custom show and hide events on the dropDown:
dropDown.bind('show', function () {
if (dropDown.is(':animated')) {
//return false;
}
selectBox.addClass('expanded');
if (isie8)
dropDown.show();
else
dropDown.slideDown();
}).bind('hide', function () {
if (dropDown.is(':animated')) {
//return false;
}
selectBox.removeClass('expanded');
if (isie8)
dropDown.hide();
else
dropDown.slideUp();
}).bind('toggle', function () {
if (selectBox.hasClass('expanded')) {
dropDown.trigger('hide');
}
else {
dropDown.trigger('show');
}
});
selectBox.click(function () {
dropDown.trigger('toggle');
return false;
});
// If we click anywhere on the page, while the
// dropdown is shown, it is going to be hidden:
$(document).click(function () {
dropDown.trigger('hide');
});
}
$(document).ready(function myfunction() {
DdlAddress();
DdlAddress_Detail();
});
function DdlAddress_Detail() {
var select = $('select.sel_drp_detail');
var selectBoxContainer = $('
').attr('width', select.outerWidth()).attr('class', 'ddlIsVisibles').html('
');
var dropDown = $('
';
var StrMarker = '';
StrMarker = '';
StrMarker = StrMarker + '
' + storeName + "
";
StrMarker = StrMarker + '
' + address + ',
' + city + ', ' + state + ' ' + postalCode + '
';
if (website != '') {
if (website.toLowerCase().indexOf("http") >= 0)
StrMarker = StrMarker + '
';
else
StrMarker = StrMarker + '
';
}
StrMarker = StrMarker + '
Distance: ' + Number(milesa).toFixed(2) + ' miles
';
if (result["IsInJC"] == "0")
Log_ID = Log_ID + ID + ",";
else
JCLog_ID = JCLog_ID + ID + ",";
$(".DivRetailerList").append(RetailerHTML);
marker = new google.maps.Marker({
position: new google.maps.LatLng(lat, lng),
map: map,
title: result["StoreName"]
});
var infowindow = new google.maps.InfoWindow({
content: StrMarker
});
marker.infowindow = infowindow;
markersmain.push(marker);
google.maps.event.addListener(marker, 'click', function () {
for (var m = 0; m < markersmain.length; m++)
markersmain[m].infowindow.close();
infowindow.open(this.get('map'), this);
});
}
}
}
});
}
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 ($('#' + TxtId).val().search(emailRegEx) == -1) {
$('#' + TxtId).val('');
$('#' + TxtId).focus();
return false;
}
else
return true;
}
function SubmitNoRetailerFountInquiry() {
if ($("#CustName").val() != '' && $("#CustEmail").val() != '') {
$("#msgCustName").text('');
$("#msgCustEmail").text('');
if (!emailValidation("CustEmail")) {
$("#msgCustEmail").text('Enter valid Email');
return false;
}
var strYourName = $("#CustName").val();
var strYourEmail = $("#CustEmail").val();
var strPhone = $("#CustPhone").val();
var strComment = $("#CustComment").val();
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/SendMailNoRetailerFound",
data: "{DealerID:'" + dealerID + "',DetailURL:'" + window.location.href + "',strYourName:'" + strYourName + "',strYourMail:'" + strYourEmail + "',strComment:'" + strComment + "',strPhone:'" + strPhone + "',customerZipcode:'" + customerZipcode + "',DID:'" + DID + "',Shape:'" + Cut + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (data) {
if (data.d != null) {
$("#CustName").val('');
$("#CustEmail").val('');
$("#CustPhone").val('');
$("#CustComment").val('');
$("#NoRetailerFound").hide();
$(".SearchRetailer").hide();
$("#SuccessInquiryForm").show();
}
},
error: function (msg) {
}
});
}
else {
$("#msgCustName").text('Enter Name');
$("#msgCustEmail").text('Enter Email');
}
}
function CancelInquiry() {
$(".DivMainRetailerList").show();
$(".SearchRetailer").show();
$("#RetailerinquiryForm").hide();
$("#SuccessInquiryForm").hide();
}
function RetailerInquiry(id, IsinJc) {
ID = id;
IsInJc = IsinJc;
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/GetRetailerDetailByID",
data: "{retailerID:'" + ID + "',IsInJC:'" + IsinJc + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (data) {
if (data.d.DtRetailerDetail[0] != null) {
$(".DivMainRetailerList").hide();
$(".SearchRetailer").hide();
$("#RetailerinquiryForm").show();
var storeName = data.d.DtRetailerDetail[0]["StoreName"];
var address = data.d.DtRetailerDetail[0]["Address"];
var city = data.d.DtRetailerDetail[0]["City"];
var state = data.d.DtRetailerDetail[0]["State"];
var country = data.d.DtRetailerDetail[0]["Country"];
var postalCode = data.d.DtRetailerDetail[0]["Zipcode"];
var email = data.d.DtRetailerDetail[0]["Email"];
var website = data.d.DtRetailerDetail[0]["WebSite"];
var contactNumber = data.d.DtRetailerDetail[0]["Phone"];
$("#retailerStoreName").html(storeName);
var retailerAddress = address + "
" + city + ", " + state + " " + postalCode;
SelectRetailerAddress = address + ", " + city + ", " + state + "-" + postalCode;
$("#retailerAddress").html(retailerAddress);
$("#retailerPhone").html(contactNumber);
if (website != '') {
if (website.toLowerCase().indexOf("http") >= 0)
$("#visitretailer").attr('href', website);
else
$("#visitretailer").attr('href', 'http://' + website);
$("#visitretailer").show();
}
else {
$("#visitretailer").hide();
}
}
},
error: function (msg) {
}
});
}
function SubmitInquiryForm() {
if ($("#CustName_inquiry").val() != '' && $("#CustEmail_inquiry").val() != '') {
$("#SpCustName_inquiry").text('');
$("#SpCustEmail_inquiry").text('');
if (!emailValidation("CustEmail_inquiry")) {
$("#SpCustEmail_inquiry").text('Enter valid Email');
return false;
}
var strYourName = $("#CustName_inquiry").val();
var strYourEmail = $("#CustEmail_inquiry").val();
var strPhone = $("#CustPhone_inquiry").val();
var strComment = $("#CustComment_inquiry").val();
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/SendMailForinquiry",
data: "{DealerID:'" + dealerID + "',DetailURL:'" + window.location.href + "',strYourName:'" + strYourName + "',strYourMail:'" + strYourEmail + "',strComment:'" + strComment + "',strPhone:'" + strPhone + "',customerZipcode:'" + customerZipcode + "',ID:'" + ID + "',IsInJC:'" + IsInJc + "',DID:'" + DID + "',Shape:'" + Cut + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (data) {
if (data.d != null) {
$("#CustName_inquiry").val('');
$("#CustEmail_inquiry").val('');
$("#CustPhone_inquiry").val('');
$("#CustComment_inquiry").val('');
$("#RetailerinquiryForm").hide();
$("#SuccessInquiryForm").show();
}
},
error: function (msg) {
}
});
}
else {
$("#SpCustName_inquiry").text('Enter Name');
$("#SpCustEmail_inquiry").text('Enter Email');
}
}
function ChangeVideo() {
var iframe = document.getElementById('embedvideo2');
var VideoUrlheight = $('#VideoUrl').width();
//if (ManuID == '3596') {
// if (IsFirstLoad == 0) {
// if (iframe != "" || iframe != null) {
// window.open(iframe.src, '_blank');
// }
// }
// else { IsFirstLoad = 0;}
//}
//else {
//if ((iframe != "" || iframe != null) && iframe.src.indexOf('certimage') > 0) {
if (iframe != "" || iframe != null) {
//iframe.width = 450;
iframe.height = VideoUrlheight;
//if ((VideoUrlheight - 125) < 350)
// iframe.height = 350;
//else
// iframe.height = VideoUrlheight - 125;
iframe.src = iframe.src;
}
$('#VideoUrl').css('display', 'block');
$('#DiamondDet').css('display', 'none');
//}
}