var caratMin = 0;
var VideoFrame = '';
var caratMax = 15.00;
var sldCaratMin = 0;
var sldCaratMax = 7;
var ThemeName = '';
var SelecedShape = '';
var SelectedCarat = 1;
var SelShape = 'Round';
var dealerID = '720';
var ManuID = '';
var IsOneStep = '';
var qurShape;
var qurctw;
var qurDID;
var qurSID;
var CustID = '';
var AppointDate = '';
var AppointMon = 0;
var AppointDay = 0;
var AppointYer = 0;
var CountryTaxRate = '';
var CountryCode = '';
var IsGemstone = '';
var LocationID = '0';
var AppointDate_new = '';
var RingURL = '';
var DiamondURL = '';
var IsFB = 0;
var IsMLRB = 0;
var Track = '';
var CenterStonesThatFit= '';
var CenterStoneMinimumCarat = '';
var CenterStoneMaximumCarat = '';
function onload() {
LoadPopupbox();
LoadStartingPrice();
ChangeMetaltype();
//ChangeProductConfiguration();
if (IsOneStep == 'False') {
$('#step2').css('display', 'block');
$('#step3').css('display', 'block');
$('#linkChooseYourSetting').html('1 . Choose Your Setting');
//$('#step1').css('background', 'url("../images/right_arrowe.png ") no-repeat scroll right center');
$('#step1').css('width', '33%');
$('#divChooseDiamond').css('display', 'block');
$('#divdiamondbrd').css('display', 'block');
}
if (SelecedShape != '') {
$('#' + SelecedShape).css('border-bottom', '2px solid #4B68A2');
}
window.location.hash = '#mainbdy';
RingURL = $('#hndRingUrl').val();
DiamondURL = $('#hndDiamondUrl').val();
var loc = $('#ddAddress').val();
if (loc != '') {
$('#hdnLocId').val(loc);
}
}
function ChangeMetaltype()
{
var metal = getCookie("Metal");
if (metal != "-Select Metal-" || metal != "") {
ChangeProductConfigurationMetal();
}
}
$(document).ready(function myfunction() {
$(window).trigger('resize');
$(".ad-thumb-list").css('width', '100%');
$("#RequiredFieldValidator12").hide();
$(".main_left_side").hide();
//var str =
//if (str != "Select")
//$(".Note").hide();
var divAppend = "
";
$('body').append(divAppend);
});
$(window).resize(function () {
setgetwidth();
setTimeout("SendHeight()", 3000);
});
function setgetwidth() {
var width = $(window).width();
var percent = parseInt(width);
$(".main_left_side").css("width", '200px');
var rightsidewidth = parseInt(percent) - 210;
if (percent == 1920 && navigator.userAgent.indexOf("Chrome") > -1)
rightsidewidth = parseInt(percent) - 220;
if (width > 350) {
$(".main_right_side").css("width", "100%");
var rightWidth = $('.main_right_side').width();
$('.products_bg').css("width", parseInt(rightWidth) + "px");
}
else {
$(".main_right_side").css("width", 320 + "px !important");
$(".main_right_side").css("max-width", 320 + "px");
$('.products_bg').css("width", 320 + "px");
}
}
function SetViewCart() {
window.location = "https://www.gemfind.net/dealerid_display/secure/ShoppingCart_New.aspx?ToolType=Ringbuilder&DealerID=" + dealerID;
//if (AlternateShoppingCartURL=='')
// window.location = "https://www.gemfind.net/dealerid_display/secure/ShoppingCart_New.aspx?DealerID=" + dealerID;
//else
// window.location = AlternateShoppingCartURL;
}
function LoadStartingPrice() {
SelectedCarat = $('#hndCarat').val();
SelShape = $('#hndShape').val();
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/LoadStartingPrice",
data: "{DealerId:'" + dealerID + "',Shapes:'" + SelShape + "',CaratMin:'" + parseFloat(SelectedCarat) + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response != null) {
if (response.d.dtFinal.length > 0) {
if (response.d.dtFinal[0]["ddlHTML"] != null) {
$("#ddlDiamondQuality").html(response.d.dtFinal[0]["ddlHTML"]);
if (document.getElementById('ddlRingSize3') != null) {
$("#ddlDiamondqulity").msDropDown();
}
$(".diamond_quality").show();
$(".spShape").text($('#hfShape').val());
if ($('#HdnStartinPrice').val() != '')
$('#hfPriceMinMax').val($('#HdnStartinPrice').val());
if ($('#hfPriceMinMax').val() == '2600,4000,71,72,6,7')
$('#hfPriceMinMax').val('0,4000,71,72,6,7');
}
}
}
},
error: function (msg) {
}
});
ScheduleViewingData();
$("#ddlAppntTime").msDropDown();
}
function LoadPopupbox() {
$('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 SelectShapenew(shape, SID, imageID) {
shapeList = $('#hndSelectShapeList').val();
SetShapeCss(shape);
var imagePath = "";
if (document.getElementById('hfringImageUrl') != null)
imagePath = document.getElementById('hfringImageUrl').value
var objImage = document.getElementById(imageID);
var strURL = 'https://apps.gemfind.net/dealerid_display/CreateRingImage.aspx?sn=' + imagePath + '&cs=' + shape + '&ts=false&wi=650&hi=650&sid=' + SID;
objImage.src = strURL;
if (document.getElementById('hfShape') != null)
document.getElementById('hfShape').value = shape;
SelShape = shape;
$('#hndShape').val(shape);
LoadStartingPrice();
}
function SetShapeCss(shape) {
//$('#Round').closest('li').css('border-bottom', 'none');
//$('#Pear').closest('li').css('border-bottom', 'none');
//$('#Marquise').closest('li').css('border-bottom', 'none');
//$('#Heart').closest('li').css('border-bottom', 'none');
//$('#Radiant').closest('li').cs
s('border-bottom', 'none');
//$('#Oval').closest('li').css('border-bottom', 'none');
//$('#Emerald').closest('li').css('border-bottom', 'none');
//$('#Princess').closest('li').css('border-bottom', 'none');
//$('#Cushion').closest('li').css('border-bottom', 'none');
//$('#Asscher').closest('li').css('border-bottom', 'none');
$('#Round').css('border-bottom', 'none');
$('#Pear').css('border-bottom', 'none');
$('#Marquise').css('border-bottom', 'none');
$('#Heart').css('border-bottom', 'none');
$('#Radiant').css('border-bottom', 'none');
$('#Oval').css('border-bottom', 'none');
$('#Emerald').css('border-bottom', 'none');
$('#Princess').css('border-bottom', 'none');
$('#Cushion').css('border-bottom', 'none');
$('#Asscher').css('border-bottom', 'none');
$('#' + shape).css('border-bottom', '2px solid #4B68A2');
}
function LoadSimilarProductScroll() {
setTimeout('LoadSimilar();', 1000);
}
function LoadMultiAddr() {
setTimeout('LoadAddrs();', 1000);
}
function LoadSimilar() {
$('#gallery').adGallery();
}
function LoadAddrs() {
$('#MultiAddr').css('margin-left', '-13px');
$('#MultiAddr').adGallery();
}
function ClickSimilarSetting(url) {
window.location.href = url;
}
function getfocus(obj, val) {
if (obj.value == val) {
obj.value = '';
}
$('#imgCalender').click();
$('#imgHintCalender').click();
}
function lostfocus(obj, val) {
if (obj.value == '') {
obj.value = val;
}
}
function SelectDiamondSize(obj) {
SelShape
dealerID
$('#hndCarat').val($("#" + obj.id + " option:selected").val());
LoadStartingPrice();
}
function SelectDiamondQuality(obj) {
var ColorMin, ColorMax, ClarityMin, ClarityMax, PriceMin, PriceMax, Quality;
var vals = $("#" + obj.id + " option:selected").val().split('|');
Quality = vals[0];
PriceMin = vals[1];
PriceMax = vals[2];
if (Quality == 2) {
ColorMin = 73;
ColorMax = 74;
ClarityMin = 8;
ClarityMax = 9;
}
else if (Quality == 3) {
ColorMin = 71;
ColorMax = 72;
ClarityMin = 6;
ClarityMax = 7;
}
else {
ColorMin = 68;
ColorMax = 70;
ClarityMin = 1;
ClarityMax = 6;
}
if (Quality == 1 && document.getElementById("hfPriceMinMax") != null)
document.getElementById('hfPriceMinMax').value = "";
else if (document.getElementById("hfPriceMinMax") != null)
document.getElementById('hfPriceMinMax').value = PriceMin + "," + PriceMax + "," + ColorMin + "," + ColorMax + "," + ClarityMin + "," + ClarityMax;
}
function FbShareClick(app_id,imgpath, SettingName, DealerCompany, url) {
if (dealerID == "2926") {
var u = window.location.href;
var qry = u.split("?");
u = 'http://www.liordiamonds.com/ring-builder?Step=1&' + qry[1];
}
else {
var u = url;
}
window.open('https://www.facebook.com/dialog/feed?app_id=' + app_id + '&display=popup&caption=' + SettingName + '&link=' + encodeURIComponent(u) + '&picture=' + encodeURIComponent(imgpath) + '&redirect_uri=' + encodeURIComponent(u) + '&description=' + encodeURIComponent(DealerCompany) + '');
//window.open('http://www.facebook.com/sharer.php?s=100&p[title]=' + SettingName + '&p[url]=' + encodeURIComponent(u) + '&p[summary]=' + encodeURIComponent(DealerCompany) + '&p[images][0]=' + encodeURIComponent(imgpath) + '');
}
//Config Changes
function ChangeProductConfiguration(obj) {
var MetalType = '';
var MetalColor = '';
var GemstoneQuality = '';
var GemstoneSize = '';
var StyleNumber = $('#hdnprd_sku').val();
var URL = window.location.href;
var tmpSID;
var change = false;
var BindWhat = obj.id;
if ($("#ddlMetalTypeDetail option:selected").val() != 0) {
MetalType = $("#ddlMetalTypeDetail option:selected").val();
}
if ($("#ddlGemstoneQualityDetail").length > 0) {
if ($("#ddlGemstoneQualityDetail option:selected").val() != undefined) {
if ($("#ddlGemstoneQualityDetail option:selected").val() != 0) {
GemstoneQuality = $("#ddlGemstoneQualityDetail option:selected").val();
$("#GemstoneDiamondMax").val(GemstoneQuality);
}
}
}
if ($("#ddlGemstoneStoneDetail").length > 0) {
if ($("#ddlGemstoneStoneDetail option:selected").val() != undefined) {
if ($("#ddlGemstoneStoneDetail option:selected").val() != 0) {
GemstoneSize = $("#ddlGemstoneStoneDetail option:selected").val();
//var theSelect = document.getElementById('ddlGemstoneStoneDetail');
//$("#GemstoneDiamondMax").val(theSelect.options[theSelect.options.length - 1].value);
//$("#GemstoneDiamondMin").val($("#ddlGemstoneStoneDetail option:first").val());
$("#GemstoneDiamondMin").val(GemstoneSize);
}
}
}
if ($("#ddlMetalTypeDetail option:selected").val() != 0 != "")
change = true;
if (change) {
$('#divProcessBar').show();
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/OMChangeProductConfig",
data: "{DealerLink:'" + dealerID + "',MetalType:'" + MetalType + "',MetalColor:'" + MetalColor + "',StyleNumber:'" + StyleNumber + "',URL:'" + URL + "',QurShape:'" + qurShape + "',QurCTW:'" + qurctw + "',ThemeName:'" + ThemeName + "',QurDID:'" + qurDID + "',BindWhat:'" + BindWhat + "',CountryTaxRate:'" + CountryTaxRate + "',GemstoneQuality:'" + GemstoneQuality + "',GemstoneSize:'"+ GemstoneSize +"'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response.d != null) {
if (response.d.dtReturn != null) {
$('#prd_sku').html(response.d.dtReturn[0]["SettingNumber"]);
CenterStonesThatFit = response.d.dtReturn[0]["CenterStonesThatFit"];
CenterStoneMinimumCarat = response.d.dtReturn[0]["CenterStoneMinimumCarat"]
CenterStoneMaximumCarat = response.d.dtReturn[0]["CenterStoneMaximumCarat"]
$('#Hdn_SID').val(response.d.dtReturn[0]["SettingID"]);
$('#hdn_StyleNumber').val(response.d.dtReturn[0]["SettingNumber"]);
$('#SetPrice').html(response.d.dtReturn[0]["CurrencySymbol"] + Math.round(response.d.dtReturn[0]["Cost"]));
$('#hdn_WholesalePrice').val('$' + response.d.dtReturn[0]["OriginalCost"]);
$('.hone_margin_top').html(response.d.dtReturn[0]["SettingName"]);
$('#lftset_num').html(response.d.dtReturn[0]["SettingNumber"]);
$('#SpecSettingNumber').html(response.d.dtReturn[0]["SettingNumber"]);
$('#lftset_price').html('$' + Math.round(response.d.dtReturn[0]["Cost"]));
$('#lftset_name').html(response.d.dtReturn[0]["SettingName"]);
$('#lftset_cat').html(response.d.dtReturn[0]["Category"]);
$('#lftset_mtype').html(response.d.dtReturn[0]["Metal"]);
$('#SpecMetalType').html(response.d.dtReturn[0]["Metal"]);
$('#divBandMetal').html(response.d.dtReturn[0]["BandMetal"]);
$('#desc').html(response.d.dtReturn[0]["Description"]);
$('#ulShapes').html(response.d.dtReturn[0]["Alt_Shapes"]);
if (response.d.dtReturn[0]["AddImages"] != '')
$('#divAdditionalImages').html(response.d.dtReturn[0]["AddImages"]);
$('#SpecWidth').html(response.d.dtReturn[0]["Width"]);
$('#SpecProngMetal').html(response.d.dtReturn[0]["ProngMetal"]);
$('#SpecSettingType').html(response.d.dtReturn[0]["SettingType"]);
$('#SpecTab').html(response.d.dtReturn[0]["SpecTab"]);
$('#SpecSettingPrice').html('$' + Math.round(response.d.dtReturn[0]["Cost"]));
if (response.d.dtReturn[0]["Cost"] == "Call For Price") {
$('#lft_RingPrice').html('Call');
}
else if ($('#lft_RingPrice').html() == "Call") {
$('#lft_RingPrice').html('Call');
}
else {
if ($('#lft_DiaPrice').html() != null) {
var DiaPrice = Number($('#lft_DiaPrice').html().replace(',', '').replace('$', ''));
$('#lft_RingPrice').html('$' + Math.round(Math.round(response.d.dtReturn[0]["Cost"]) + Math.round(DiaPrice)));
}
else {
$('#lft_RingPrice').html('$' + Math.round(response.d.dtReturn[0]["Cost"]));
}
}
var shp;
if ($('#hfShape').val() != '' && $('#hfShape').val() != '0')
shp = $('#hfShape').val();
else
shp = 'Round';
var Imgsrc = 'https://apps.gemfind.net/dealerid_display/CreateRingImage.aspx?sn=' + response.d.dtReturn[0]["ImageURL"] + '&cs=' + shp + '&ts=false&wi=650&hi=650&sid=' + response.d.dtReturn[0]["SettingID"] + '&diamondCTW=1.50'
$('#imgSetting').attr('src', Imgsrc);
$('#lnkImage').attr('href', Imgsrc);
$('#Img1').attr('src', response.d.dtReturn[0]["ImageURL"]);
var VideoURL = response.d.dtReturn[0]["VideoURL"];
VideoFrame = response.d.dtReturn[0]["VideoTab"];
// $('.imagsetng').css('display', 'block');
if (VideoURL != "" && VideoURL != null) {
$('#Video_btn').show();
$('#Video').html("");
$('#Video').html(VideoFrame);
//$('#Video').css('display', 'none');
$('#Video_btn').html("Video");
$('.Flowplayer').css('display', 'block');
}
else
{
$('.imagsetng').css('display', 'block');
$('#Video_btn').hide();
$('#Video').html("");
}
Shadowbox.clearCache();
Shadowbox.setup();
$('#hfringImageUrl')
$('#Sco_Box').html(response.d.dtReturn[0]["SocialShareData"]);
$('#btnPrint').attr('href', response.d.dtReturn[0]["PrintHref"]);
$('#lnkbtnBuyWithOutStone').attr('href', 'javascript:BuyWithOutStone(' + response.d.dtReturn[0]["SettingID"] + ')');
var addyourdiamondhtml = 'Please Select Size';
if (ShowBuyWithoutCenterStone != "False") {
addyourdiamondhtml += '';
}
//$('.select_btn').html(addyourdiamondhtml);
$('#Req_info').html('Submit');
$('#DropHint').html('Request');
$('#Mail_Friend').html('Request');
$('#Sch_ViewSub').html('Schedule');
//tmpSID = response.d.dtReturn[0]["SettingID"];
//if (BindWhat != "ddlMetalTypeDetail") {
// $('#ringsize_bx').html(response.d.dtReturn[0]["ConfigMetalType"]);
// //$(".Note").show();
// $("#ddlMetalTypeDetail").val(MetalType);
// $("#ddlMetalTypeDetail").msDropDown();
//if ($("#single").text() != "Select Metal")
// $(".Note").hide();
//}
//$.ajax({
// type: "POST",
// url: "GetDiamondSearchDetailsResp.asmx/ChangeProductConfiguration",
// data: "{DealerLink:'" + dealerID + "',MetalType:'" + MetalType + "',MetalColor:'" + MetalColor + "',SID:'" + qurSID + "',BindWhat:'" + BindWhat + "'}",
// contentType: "application/json; charset=utf-8",
// dataType: "json",
// async: true,
// cache: false,
// processData: false,
// success: function (response) {
// if (response.d.dtReturn != null) {
// if (BindWhat != "ddlMetalTypeDetail") {
// $('#ringsize_bx').html(response.d.dtReturn[0]["ConfigMetalType"]);
// //$(".Note").show();
// $("#ddlMetalTypeDetail").val(MetalType);
// $("#ddlMetalTypeDetail").msDropDown();
// //if ($("#single").text() != "Select Metal")
// // $(".Note").hide();
// }
// }
// $('#divProcessBar').hide();
// },
// error: function (msg) {
// }
//});
}
}
$('#divProcessBar').hide();
},
error: function (msg) {
}
});
$('#hdnSKU').val(tmpSID);
} else {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/OMChangeProductConfiguration",
data: "{DealerLink:'" + dealerID + "',MetalType:'" + MetalType + "',MetalColor:'" + MetalColor + "',SID:'" + qurSID + "',BindWhat:'" + BindWhat + "',GemQuality:'" + GemstoneQuality + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response.d.dtReturn != null) {
if (BindWhat != "ddlMetalTypeDetail") {
$('#ringsize_bx').html(response.d.dtReturn[0]["ConfigMetalType"]);
//if ($("#single").text() != "Select Metal")
// $(".Note").hide();
$("#ddlMetalTypeDetail").msDropDown();
}
}
$('#divProcessBar').hide();
},
error: function (msg) {
}
});
}
$('#intrnl').click(function () {
$('#internal_SKU').html($('#hdn_StyleNumber').val());
$('#internal_Wholesale').html($('#hdn_WholesalePrice').val());
});
$('#ibntPassword').click(function () {
setTimeout(function () {
$('#internal_SKU').html($('#hdn_StyleNumber').val());
$('#internal_Wholesale').html($('#hdn_WholesalePrice').val());
}, 10000);
});
// DynamicDetailDropDown(obj);
}
function GotoSearch(SID) {
var Shp;
if ($('#hfShape').val() == '0')
Shp = qurShape;
else
Shp = $('#hfShape').val();
var RingSize = $("#ddlRingSize5 option:selected").val()
if (Page_ClientValidate('Cart')) {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/GotoDiamondSearch_RB",
data: "{DealerLink:'" + dealerID + "',SID:'" + SID + "',RingSize:'" + RingSize + "',hfPriceMinMax:'" + $('#hfPriceMinMax').val() + "',DID:'" + qurDID + "',ThemeName:'" + ThemeName + "',CTW:'" + qurctw + "',hndCarat:'" + $('#hndCarat').val() + "',hfShape:'" + Shp + "',CustID:'" + CustID + "',CountryTaxRate:'" + CountryTaxRate + "',CountryCode:'" + CountryCode + "',IsFB:'" + IsFB + "',IsMLRB:'" + IsMLRB + "',CenterStonesThatFit:'" + CenterStonesThatFit + "',CenterStoneMinimumCarat:'" + CenterStoneMinimumCarat + "',CenterStoneMaximumCarat:'" + CenterStoneMaximumCarat + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
window.location.href = response.d;
return false;
},
error: function (msg) {
}
});
} else {
$('#RequiredFieldValidator4').show();
}
}
function BuyWithOutStone(SID) {
var RingSize = $("#ddlRingSize5 option:selected").val()
if (Page_ClientValidate('Cart')) {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/BuyWithOutDiamond",
data: "{DealerLink:'" + dealerID + "',SID:'" + SID + "',RingSize:'" + RingSize + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
window.location.href = response.d;
},
error: function (msg) {
}
});
} else {
$('#RequiredFieldValidator4').show();
}
}
function RequestInfo(SID) {
if (Page_ClientValidate('Letus_Know')) {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/InquireAboutItem",
data: "{DealerLink:'" + dealerID + "',SID:'" + SID + "',qurShape:'" + qurShape + "',txtEmail:'" + $('#txtEmail').val() + "',txtName:'" + $('#txtName').val() + "',txtComments:'" + $('#txtComments').val() + "',ThemeName:'" + ThemeName + "',txtPhone:'" + $('#txtPhone').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
$('#txtEmail').val("");
$('#txtName').val("");
$('#txtComments').val("");
$('#txtPhone').val("");
location.reload();
},
error: function (msg) {
}
});
}
else {
}
}
function DropAHint(SID) {
if (Page_ClientValidate('HintReq')) {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/DropAHint",
data: "{DealerLink:'" + dealerID + "',SID:'" + SID + "',DID:'" + qurDID + "',URL:'" + window.location.href + "',qurShape:'" + qurShape + "',qurCTW:'" + qurctw + "',txtHintRecptEmail:'" + $('#txtHintRecptEmail').val() + "',txtHintRecptName:'" + $('#txtHintRecptName').val() + "',txtHintRecptReason:'" + $('#txtHintRecptReason').val() + "',ThemeName:'" + ThemeName + "',txtHintRecpMessage:'" + $('#txtHintRecpMessage').val() + "',,txtHintRecptGiftDeadline:'" + $('#txtHintRecptGiftDeadline').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
$('#txtHintRecptEmail').val("");
$('#txtHintRecptName').val("");
$('#txtHintRecptReason').val("");
$('#txtHintRecpMessage').val("");
$('#txtHintRecptGiftDeadline').val("");
location.reload();
},
error: function (msg) {
}
});
}
else {
}
}
function EmailToFriend(SID) {
if (Page_ClientValidate('Tell_Friend')) {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/EmailToFriend",
data: "{DealerLink:'" + dealerID + "',SID:'" + SID + "',qurShape:'" + qurShape + "',txtHintRecptEmail:'" + $('#txtHintRecptEmail').val() + "',txtHintRecptName:'" + $('#txtHintRecptName').val() + "',txtHintRecptReason:'" + $('#txtHintRecptReason').val() + "',ThemeName:'" + ThemeName + "',txtHintRecpMessage:'" + $('#txtHintRecpMessage').val() + "',,txtHintRecptGiftDeadline:'" + $('#txtHintRecptGiftDeadline').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
$('#txtHintRecptEmail').val("");
$('#txtHintRecptName').val("");
$('#txtHintRecptReason').val("");
$('#txtHintRecpMessage').val("");
$('#txtHintRecptGiftDeadline').val("");
location.reload();
},
error: function (msg) {
}
});
}
else {
}
}
//Ends
function HideShow(objShow, objHide, liObj) {
$("." + objShow).show();
$("." + objHide).hide();
$("#" + objShow).show();
$("#liItemDetails").removeClass("active");
$("#liSpecification").removeClass("active");
$("#" + liObj.id).addClass("active");
$("#DivEmailtoFriend").hide();
$("#DivDropAHint").hide();
$("#Divletusknow").hide();
$("#divScheduleView").hide();
setTimeout("SendHeight()", 500);
}
//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"]);
$("#spnDealerCompany").text(data.d.dtAppointments[0]["DealerCompany"]);
$("#spnDealerCompany1").text(data.d.dtAppointments[0]["DealerCompany"]);
$("#spnAddress").text(data.d.dtAppointments[0]["DealerAddress"]);
$("#spnAddress1").text(data.d.dtAppointments[0]["DealerAddress"]);
$("#HdAddTotalCount").val(data.d.dtAppointments[0]["TotalCount"]);
$("#spnCity").text(data.d.dtAppointments[0]["DealerCity"] + data.d.dtAppointments[0]["DealerState"] + data.d.dtAppointments[0]["DealerZip"]);
$("#spnCity1").text(data.d.dtAppointments[0]["DealerCity"] + data.d.dtAppointments[0]["DealerState"] + data.d.dtAppointments[0]["DealerZip"]);
$("#spnPhone").text(data.d.dtAppointments[0]["DealerPhone"]);
$("#spnPhone1").text(data.d.dtAppointments[0]["DealerPhone"]);
if (data.d.dtAppointments[0]["DealerZip"] != null) {
$('#MapAddress').val(data.d.dtAppointments[0]["DealerAddress"] + " " + data.d.dtAppointments[0]["DealerCity"] + data.d.dtAppointments[0]["DealerState"] + " " + data.d.dtAppointments[0]["DealerZip"]);
}
else {
$('#MapAddress').val(data.d.dtAppointments[0]["DealerAddress"] + " " + data.d.dtAppointments[0]["DealerCity"] + data.d.dtAppointments[0]["DealerState"]);
}
if (data.d.dtAppointments[0]["HTMLDataTime"].length > 0)
$("#divddlAppntTime").html(data.d.dtAppointments[0]["HTMLDataTime"]);
},
error: function (msg) {
}
});
$("#ddlAppntTime").msDropDown();
$("#ddAddress").msDropDown();
}
function CancelSch() {
$("#txtAppntMsg").val("");
$("#txtAppntDate").val("");
$("#ddlAppnt > [value='0']").attr("selected", "true");
$("#ddlAppntTime > [value='0']").attr("selected", "true");
}
function BindTimeDropdown(LocationID1) {
if (AppointMon != '' && AppointMon != 0 && AppointDay != '' && AppointDay != 0 && AppointYer != '' && AppointYer != 0) {
AppointDate = new Date(AppointYer, AppointMon - 1, AppointDay);
}
//AppointDate = new Date('2014','11', '22');
AppointDate = AppointDate_new;
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/BindTimeDropDown",
data: "{DealerLink:'" + dealerID + "',ThemeName:'" + ThemeName + "',AppointDate:'" + AppointDate + "',LocationID:'" + LocationID1 + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (data) {
if (data.d.dtAppointments[0]["HTMLDataTime"].length > 0) {
$("#div_closed").hide();
$("#divddlAppntTime").html(data.d.dtAppointments[0]["HTMLDataTime"]);
}
else {
$("#div_closed").show();
$("#divddlAppntTime").hide();
}
$("#ddlAppntTime").msDropDown();
},
error: function (msg) {
}
});
// $("#DrpContactPref").msDropDown();
$("#ddAddress").msDropDown();
}
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 {
}
}
$(document).ready(function myfunction() {
setTimeout("MakeChangeInHeight()", 3000);
});
function MakeChangeInHeight() {
var $imgs = $("#imgSetting");
imgAmount = $imgs.length;
imgCounter = 1;
var imageLoaded = function () {
setTimeout("SendHeight()", 3600);
}
$('#imgSetting').each(function () {
var tmpImg = new Image();
tmpImg.onload = imageLoaded;
tmpImg.src = $(this).attr('src');
});
}
//End Schedule Viewing
function SendHeight() {
var parent_url2 = '';
parent_url2 = DiamondURL;
parent_url = RingURL.split(',');
//if (dealerID == '2390') {
// parent_url = 'http://www.diamondselect.com/ring-builder/';
// parent_url2 = 'https://www.diamondselect.com/ring-builder/';
//}
for (var i = 0; i < parent_url.length; i++) {
if (parent_url[i] != '')
XD.postMessage($("#mainbdy").height() + 100, parent_url[i], parent);
}
if (parent_url2 != '')
XD.postMessage($("#mainbdy").height() + 100, parent_url2, parent);
return false;
}
function isTouchDevice() {
return "ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch;
}
//For All Popups(zishan)
function HideShowPopup(objShow, objHide) {
//if (!isTouchDevice()) {
$(".settingdetail_text_bg").hide();
$(".setting_text_bg").hide();
//}
$("#DivEmailtoFriend").hide();
$("#DivDropAHint").hide();
$("#Divletusknow").hide();
$("#divScheduleView").hide();
$("#" + objShow).show();
//$("html,body").scrollTop(0);
if (objShow == 'DivDropAHint')
$("#txtHintRecptName").focus();
else if (objShow == 'Divletusknow')
$("#txtName").focus();
else if (objShow == 'DivEmailtoFriend')
$("#txtYourName").focus();
else if (objShow == 'divScheduleView')
$("#ddlAppnt").focus();
else
$("#liItemDetails").focus();
setTimeout("SendHeight()", 3000);
}
function hideView(objHide) {
$(".settingdetail_text_bg").show();
$("#" + objHide).hide();
}
function getFocusdate() {
var Text = $('#txtAppntDate').val();
AppointDate_new = Text;
if (Text != '' && Text != 'When are you available?') {
$('#divddlAppntTime').css('display', 'Block');
} else {
$('#divddlAppntTime').css('display', 'none');
$('#div1').css('display', 'none');
$('#AppdateVali').css('display', 'none');
}
$("#ddlAppntTime").msDropDown();
BindTimeDropdown(LocationID);
}
function GetAddressID(ID) {
$j('#hdnLocId').val(ID);
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/GetAddress",
data: "{AddressID:'" + ID + "',DealerId:'" + dealerID + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (data) {
$("#spnDealerCompany").text(data.d.dtAddress[0]["DealerCompany"]);
$("#spnDealerCompany1").text(data.d.dtAddress[0]["DealerCompany"]);
$("#spnAddress").text(data.d.dtAddress[0]["DealerAddress"]);
$("#spnAddress1").text(data.d.dtAddress[0]["DealerAddress"]);
var zip = data.d.dtAddress[0]["DealerZip"];
if (zip != null) {
$("#spnCity").text(data.d.dtAddress[0]["DealerCity"] + data.d.dtAddress[0]["DealerState"] + data.d.dtAddress[0]["DealerZip"]);
$("#spnCity1").text(data.d.dtAddress[0]["DealerCity"] + data.d.dtAddress[0]["DealerState"] + data.d.dtAddress[0]["DealerZip"]);
}
else {
$("#spnCity").text(data.d.dtAddress[0]["DealerCity"] + data.d.dtAddress[0]["DealerState"]);
$("#spnCity1").text(data.d.dtAddress[0]["DealerCity"] + data.d.dtAddress[0]["DealerState"]);
}
//$("#spnState").text(data.d.dtAppointments[0]["DealerState"]);
//$("#spnZip").text(data.d.dtAppointments[0]["DealerZip"]);
$("#spnPhone").text(data.d.dtAddress[0]["DealerPhone"]);
$("#spnPhone1").text(data.d.dtAddress[0]["DealerPhone"]);
if (zip != null) {
$('#MapAddress').val(data.d.dtAddress[0]["DealerAddress"] + " " + data.d.dtAddress[0]["DealerCity"] + data.d.dtAddress[0]["DealerState"] + " " + data.d.dtAddress[0]["DealerZip"]);
$('#spnZip1').val(data.d.dtAddress[0]["DealerZip"])
}
else {
$('#MapAddress').val(data.d.dtAddress[0]["DealerAddress"] + " " + data.d.dtAddress[0]["DealerCity"] + data.d.dtAddress[0]["DealerState"]);
}
},
error: function (msg) {
}
});
BindTimeDropdown(ID);
}
function ShowAddressDrop(DateValue) {
$('#hndAppntTime').val(DateValue);
var AddressCount = $('#HdAddTotalCount').val();
if (AddressCount == 1)
{
//$('#div3').css('display', 'none')
}
else {
if (DateValue == 0) {
// $('#div3').css('display', 'none')
}
else {
$('#div3').css('display', 'Block');
$('#AppdateVali').css('display', 'none');
}
}
}
function ValidateEmail(email) {
var expr = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
return expr.test(email);
}
function HideSchView() {
if ($('#txtYName').val() == '') {
$('#RequiredFieldValidator7').css('display', 'Block');
return false;
}
if ($('#txtEmailChk').val() == '' ) {
$('#RequiredFieldValidator3').css('display', 'Block');
return false;
}
if (!ValidateEmail($('#txtEmailChk').val())) {
$('#RegularExpressionValidator2').css('display', 'Block');
return false;
}
if ($('#txtAppntMsg').val() == '') {
$('#RequiredFieldValidator5').css('display', 'Block');
return false;
}
var Text = $('#txtAppntDate').val();
if (Text == '' || Text == 'When are you available?') {
$('#RequiredFieldValidator6').css('display', 'Block');
return false;
}
var SelVal = $('#ddlAppntTime :selected').val();
if (SelVal == 0) {
$('#AppdateVali').css('display', 'Block');
return false;
}
$('#divScheduleView').css('display', 'none');
$('#divScheduleViewFinal').css('display', 'block');
$('#AppDate').text($('#txtAppntDate').val());
$('#AppTime').text($('#hndAppntTime').val());
}
function ShowAddressView() {
$('#divScheduleView').css('display', 'block');
$('#divScheduleViewFinal').css('display', 'none');
}
function MapOpen() {
var map_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,resizable=yes,";
map_setting += "scrollbars=yes,width=1000, height=600, left=100, top=25";
//var MapAddr = 'Pani Gate, Wadi, Vadodara, Gujarat, India,390017';
var MapAddr = $('#MapAddress').val();
window.open("https://maps.google.com/maps?daddr=" + MapAddr, "", map_setting);
};
function getfocus_sch(obj, val) {
if (obj.value == val) {
obj.value = '';
}
}
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 showprocessRequest() {
if ($('#txtName').val() != "" && $('#txtEmail').val() != "" && $('#txtPhone').val() != "") {
objProcessBar = document.getElementById("divProcessBarRequestInfo");
o = document.getElementById("btnSubmit");
$("#btnSubmit").attr('onmouseout', 'Themes / WhiteTheme / images / add_to_shoping_cart.jpg');
objProcessBar.style.left = getAbsLeft(o) - 11 + 'px';
objProcessBar.style.top = getAbsTop(o) - 7 + 'px';
$("#divProcessBarRequestInfo").css("display", "block");
}
}
function showprocessDropHint() {
if ($('#txtHintYourName').val() != "" && $('#txtHintYourEmail').val() != "" && $('#txtHintRecptName').val() != "" && $('#txtHintRecptEmail').val() != "" && $('#txtHintRecptReason').val() != "" && $('#txtHintRecpMessage').val() != "" && $('#txtHintRecptGiftDeadline').val() != "") {
objProcessBar = document.getElementById("divProcessBar_dropahint");
o = document.getElementById("lnkBtnSendRequest");
$("#lnkBtnSendRequest").attr('onmouseout', 'Themes / WhiteTheme / images / add_to_shoping_cart.jpg');
objProcessBar.style.left = getAbsLeft(o) - 11 + 'px';
objProcessBar.style.top = getAbsTop(o) - 7 + 'px';
$("#divProcessBar_dropahint").css("display", "block");
}
}
function showprocessEmail_Friend() {
if ($('#txtYourName()').val() != "" && $('#txtYourEmail').val() != "" && $('#txtYourFriendName').val() != "" && $('#txtYourFriendEmail').val() != "" && $('#txtTellFriendComment').val() != "") {
objProcessBar = document.getElementById("divProcessBarEmail_Friend");
o = document.getElementById("Email_Friend1");
$("#Email_Friend1").attr('onmouseout', 'Themes / WhiteTheme / images / add_to_shoping_cart.jpg');
objProcessBar.style.left = getAbsLeft(o) - 11 + 'px';
objProcessBar.style.top = getAbsTop(o) - 7 + 'px';
$("#divProcessBarEmail_Friend").css("display", "block");
}
}
function showprocessScheduleView() {
if ($('#txtSchedulName').val() != "" && $('#txtEmailChk').val() != "" && $('#txtSchedulPnone').val() != "" && $('#txtAppntMsg').val() != "" && $('#ddlAppntTime').val() != "0") {
objProcessBar = document.getElementById("divProcessBarScheduleView");
o = document.getElementById("LinkButton2");
$("#LinkButton2").attr('onmouseout', 'Themes / WhiteTheme / images / add_to_shoping_cart.jpg');
objProcessBar.style.left = getAbsLeft(o) - 11 + 'px';
objProcessBar.style.top = getAbsTop(o) - 7 + 'px';
$("#divProcessBarScheduleView").css("display", "block");
}
}
//validation for checking of dropdown value on button click.
function CheckMetalType()
{
var tmp = $("#ddlMetalTypeDetail option:selected").val();
if ($("#ddlRingSize5 option:selected").val() != 0) {
if (tmp == "0") {
$("#RequiredFieldValidator12").show();
return false;
}
else {
$("#RequiredFieldValidator12").hide();
return true;
}
}
else
{
$("#RequiredFieldValidator4").show();
return false;
}
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function ChangeProductConfigurationMetal() {
var MetalType = '';
var MetalColor = '';
var StyleNumber = $('#hdnprd_sku').val();
var URL = window.location.href;
var tmpSID;
var change = false;
var BindWhat = "ddlMetalTypeDetail";
var GemstoneQuality = '';
var GemstoneSize = '';
if ($("#ddlMetalTypeDetail option:selected").val() != 0) {
MetalType = $("#ddlMetalTypeDetail option:selected").val();
}
if ($("#ddlGemstoneQualityDetail option:selected").val() != 0) {
GemstoneQuality = $("#ddlGemstoneQualityDetail option:selected").val();
$("#GemstoneDiamondMax").val(GemstoneQuality);
}
if ($("#ddlGemstoneStoneDetail").length > 0) {
if ($("#ddlGemstoneStoneDetail option:selected").val() != undefined) {
if ($("#ddlGemstoneStoneDetail option:selected").val() != 0) {
GemstoneSize = $("#ddlGemstoneStoneDetail option:selected").val();
//var theSelect = document.getElementById('ddlGemstoneStoneDetail');
//$("#GemstoneDiamondMin").val($("#ddlGemstoneStoneDetail option:first").val());
//$("#GemstoneDiamondMax").val(theSelect.options[theSelect.options.length - 1].value);
$("#GemstoneDiamondMin").val(GemstoneSize);
}
}
}
if ($("#ddlMetalTypeDetail option:selected").val() != 0 != "")
change = true;
if (change) {
$('#divProcessBar').show();
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/OMChangeProductConfig",
data: "{DealerLink:'" + dealerID + "',MetalType:'" + MetalType + "',MetalColor:'" + MetalColor + "',StyleNumber:'" + StyleNumber + "',URL:'" + URL + "',QurShape:'" + qurShape + "',QurCTW:'" + qurctw + "',ThemeName:'" + ThemeName + "',QurDID:'" + qurDID + "',BindWhat:'" + BindWhat + "',CountryTaxRate:'" + CountryTaxRate + "',GemstoneQuality:'" + GemstoneQuality + "',GemstoneSize:'" + GemstoneSize + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response.d != null) {
if (response.d.dtReturn != null) {
$('#prd_sku').html(response.d.dtReturn[0]["SettingNumber"]);
CenterStonesThatFit = response.d.dtReturn[0]["CenterStonesThatFit"];
CenterStoneMinimumCarat = response.d.dtReturn[0]["CenterStoneMinimumCarat"]
CenterStoneMaximumCarat = response.d.dtReturn[0]["CenterStoneMaximumCarat"]
$('#Hdn_SID').val(response.d.dtReturn[0]["SettingID"]);
$('#hdn_StyleNumber').val(response.d.dtReturn[0]["SettingNumber"]);
$('#SetPrice').html(response.d.dtReturn[0]["CurrencySymbol"] + Math.round(response.d.dtReturn[0]["Cost"]));
$('#hdn_WholesalePrice').val('$' + response.d.dtReturn[0]["OriginalCost"]);
$('.hone_margin_top').html(response.d.dtReturn[0]["SettingName"]);
$('#lftset_num').html(response.d.dtReturn[0]["SettingNumber"]);
$('#SpecSettingNumber').html(response.d.dtReturn[0]["SettingNumber"]);
$('#lftset_price').html('$' + Math.round(response.d.dtReturn[0]["Cost"]));
$('#lftset_name').html(response.d.dtReturn[0]["SettingName"]);
$('#lftset_cat').html(response.d.dtReturn[0]["Category"]);
$('#lftset_mtype').html(response.d.dtReturn[0]["Metal"]);
$('#SpecMetalType').html(response.d.dtReturn[0]["Metal"]);
$('#divBandMetal').html(response.d.dtReturn[0]["BandMetal"]);
$('#desc').html(response.d.dtReturn[0]["Description"]);
$('#ulShapes').html(response.d.dtReturn[0]["Alt_Shapes"]);
if (response.d.dtReturn[0]["AddImages"] != '')
$('#divAdditionalImages').html(response.d.dtReturn[0]["AddImages"]);
$('#SpecWidth').html(response.d.dtReturn[0]["Width"]);
$('#SpecProngMetal').html(response.d.dtReturn[0]["ProngMetal"]);
$('#SpecSettingType').html(response.d.dtReturn[0]["SettingType"]);
$('#SpecTab').html(response.d.dtReturn[0]["SpecTab"]);
$('#SpecSettingPrice').html('$' + Math.round(response.d.dtReturn[0]["Cost"]));
if (response.d.dtReturn[0]["Cost"] == "Call For Price") {
$('#lft_RingPrice').html('Call');
}
else if ($('#lft_RingPrice').html() == "Call") {
$('#lft_RingPrice').html('Call');
}
else {
if ($('#lft_DiaPrice').html() != null) {
var DiaPrice = Number($('#lft_DiaPrice').html().replace(',', '').replace('$', ''));
$('#lft_RingPrice').html('$' + Math.round(Math.round(response.d.dtReturn[0]["Cost"]) + Math.round(DiaPrice)));
}
else {
$('#lft_RingPrice').html('$' + Math.round(response.d.dtReturn[0]["Cost"]));
}
}
var shp;
if ($('#hfShape').val() != '' && $('#hfShape').val() != '0')
shp = $('#hfShape').val();
else
shp = 'Round';
var Imgsrc = 'https://apps.gemfind.net/dealerid_display/CreateRingImage.aspx?sn=' + response.d.dtReturn[0]["ImageURL"] + '&cs=' + shp + '&ts=false&wi=650&hi=650&sid=' + response.d.dtReturn[0]["SettingID"] + '&diamondCTW=1.50'
$('#imgSetting').attr('src', Imgsrc);
$('#lnkImage').attr('href', Imgsrc);
$('#Img1').attr('src', response.d.dtReturn[0]["ImageURL"]);
var VideoURL = response.d.dtReturn[0]["VideoURL"];
VideoFrame = response.d.dtReturn[0]["VideoTab"];
// $('.imagsetng').css('display', 'block');
if (VideoURL != "" && VideoURL != null) {
$('#Video_btn').show();
$('#Video').html("");
$('#Video').html(VideoFrame);
//$('#Video').css('display', 'none');
$('#Video_btn').html("Video");
$('.Flowplayer').css('display', 'block');
}
else {
$('.imagsetng').css('display', 'block');
$('#Video_btn').hide();
$('#Video').html("");
}
Shadowbox.clearCache();
Shadowbox.setup();
$('#hfringImageUrl')
$('#Sco_Box').html(response.d.dtReturn[0]["SocialShareData"]);
$('#btnPrint').attr('href', response.d.dtReturn[0]["PrintHref"]);
$('#lnkbtnBuyWithOutStone').attr('href', 'javascript:BuyWithOutStone(' + response.d.dtReturn[0]["SettingID"] + ')');
var addyourdiamondhtml = 'Please Select Size';
if (ShowBuyWithoutCenterStone != "False") {
addyourdiamondhtml += '';
}
//$('.select_btn').html(addyourdiamondhtml);
$('#Req_info').html('Submit');
$('#DropHint').html('Request');
$('#Mail_Friend').html('Request');
$('#Sch_ViewSub').html('Schedule');
tmpSID = response.d.dtReturn[0]["SettingID"];
if (BindWhat != "ddlMetalTypeDetail") {
$('#ringsize_bx').html(response.d.dtReturn[0]["ConfigMetalType"]);
//$(".Note").show();
$("#ddlMetalTypeDetail").val(MetalType);
$("#ddlMetalTypeDetail").msDropDown();
//if ($("#single").text() != "Select Metal")
// $(".Note").hide();
}
if (BindWhat != "ddlGemstoneQualityDetail") {
$('#ringsize_bx').html(response.d.dtReturn[0]["ConfigGemstoneQuality"]);
//$(".Note").show();
$("#ddlGemstoneQualityDetail").val(GemstoneQuality);
$("#ddlGemstoneQualityDetail").msDropDown();
//if ($("#single").text() != "Select Metal")
// $(".Note").hide();
}
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/OMChangeProductConfiguration",
data: "{DealerLink:'" + dealerID + "',MetalType:'" + MetalType + "',MetalColor:'" + MetalColor + "',SID:'" + qurSID + "',BindWhat:'" + BindWhat + "',GemQuality:'" + GemstoneQuality + "',GemstoneSize:'" + GemstoneSize + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response.d.dtReturn != null) {
if (BindWhat != "ddlMetalTypeDetail") {
$('#ringsize_bx').html(response.d.dtReturn[0]["ConfigMetalType"]);
//$(".Note").show();
$("#ddlMetalTypeDetail").val(MetalType);
$("#ddlMetalTypeDetail").msDropDown();
//if ($("#single").text() != "Select Metal")
// $(".Note").hide();
}
}
$('#divProcessBar').hide();
},
error: function (msg) {
}
});
}
}
$('#divProcessBar').hide();
},
error: function (msg) {
}
});
$('#hdnSKU').val(tmpSID);
} else {
$.ajax({
type: "POST",
url: "GetDiamondSearchDetailsResp.asmx/OMChangeProductConfiguration",
data: "{DealerLink:'" + dealerID + "',MetalType:'" + MetalType + "',MetalColor:'" + MetalColor + "',SID:'" + qurSID + "',BindWhat:'" + BindWhat + "',GemStoneQuality:'" + GemstoneQuality + "',GemstoneSize:'" + GemstoneSize + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
processData: false,
success: function (response) {
if (response.d.dtReturn != null) {
if (BindWhat != "ddlMetalTypeDetail") {
$('#ringsize_bx').html(response.d.dtReturn[0]["ConfigMetalType"]);
//if ($("#single").text() != "Select Metal")
// $(".Note").hide();
$("#ddlMetalTypeDetail").msDropDown();
}
}
$('#divProcessBar').hide();
},
error: function (msg) {
}
});
}
$('#intrnl').click(function () {
$('#internal_SKU').html($('#hdn_StyleNumber').val());
$('#internal_Wholesale').html($('#hdn_WholesalePrice').val());
});
$('#ibntPassword').click(function () {
setTimeout(function () {
$('#internal_SKU').html($('#hdn_StyleNumber').val());
$('#internal_Wholesale').html($('#hdn_WholesalePrice').val());
}, 10000);
});
}
//function DynamicDetailDropDown(obj) {
// var MetalType = '';
// var StyleNumber = $('#hdnprd_sku').val();
// var settingdealer = $("[id$=settingdealerid]").val();
// var BindWhat = obj.id;
// if ($("#ddlMetalTypeDetail option:selected").val() != 0) {
// MetalType = $("#ddlMetalTypeDetail option:selected").val();
// }
// if (dealerID == "3710") {
// if ($("#ddlGemstoneQualityDetail option:selected").val() != 0) {
// GemstoneQuality = $("#ddlGemstoneQualityDetail option:selected").val();
// }
// }
// $.ajax({
// type: "POST",
// url: "GetDiamondSearchDetailsResp.asmx/DynamicMetalDropDownDetail",
// data: "{DealerLink:'" + dealerID + "',Sku:'" + StyleNumber + "',SettingDealerID:'" + settingdealer + "',metaltype:'" + MetalType + "',gemstoneQuality:'" + GemstoneQuality + "',Firsttime:0}",
// contentType: "application/json; charset=utf-8",
// dataType: "json",
// async: true,
// cache: false,
// processData: false,
// success: function (response) {
// if (response.d != null) {
// var dtMetal = re.d.finalOptions.split('|');
// var dtGemstone = "";
// if (BindWhat.toLowerCase() != "ddlMetalTypeDetail") {
// $("#ddlMetalTypeDetail").empty();
// $("#ddlMetalTypeDetail").append(dtMetal[0]);
// }
// if (BindWhat.toLowerCase() != "ddlGemstoneQualityDetail") {
// $("#ddlGemstoneQualityDetail").empty();
// $("#ddlGemstoneQualityDetail").append(dtMetal[1]);
// }
// }
// }
// });
//}
//End