var isie8 = false;
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 jq = $.noConflict();
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 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 Track = '';
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 LocationID = '0';
var AppointDate_new = '';
//////////////////////
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 hasvideo = "False";
var AppointDate = '';
var AppointMon = 0;
var AppointDay = 0;
var AppointYer = 0;
var RingURL;
var DiamondURL;
var IsFB = 0;
var IsMLDL = 0;
var MyRetailerID = 0;
var VideoImageName;
var ManuID;
var IsFirstLoad = 1;
$(Window).resize(function () {
SendHeight();
});
function loadInitialData() {
Gethightwidth();
if (DID != '') {
currentPage = 1;
}
LoadGridScroll();
//---------------------- change by sumeet 11-Nov --------------------------------///
RingURL = $('#hndRingUrl').val();
DiamondURL = $('#hndDiamondUrl').val();
// ---------------- End---------------- ///
jq("#ddlAppntTime").msDropDown();
}
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() {
var tmpShowAdvance = false;
Gethightwidth();
// var PageSize = 9;
if (webCall != null) {
webCall.abort();
}
skuNo = '';
objProcessBar = document.getElementById("divProcessBar");
document.getElementById("divProcessBar").style.display = '';
webCall = $.ajax({
type: "POST",
url: "DiamondSearch_Resp.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:'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 + "',VendorID:'" + VendorID + "',Track:'" + Track + "',IsFB:'" + IsFB + "',IsMLDL:'" + IsMLDL + "',MyRetailerID:'" + MyRetailerID + "',ShowAdvance:'" + tmpShowAdvance + "',HasVideo:'" + hasvideo + "'}",
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();
$("#divbtn_search").css("display", "none");
if (totalRecords > 0) {
displayPageNumbers();
}
jq("#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);
$("#tr" + DID).addClass("Activetr");
setLiDesign();
}
}
else {
setTimeout("SendHeight()", 3000);
document.getElementById("divProcessBar").style.display = 'none';
}
},
error: function (msg) {
document.getElementById("divProcessBar").style.display = 'none';
}
});
ScheduleViewingData();
}
//JC
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: "DiamondSearch_Resp.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 + "',VendorID:'" + VendorID + "',Track:'" + Track + "',IsFB:'" + IsFB + "'}",
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();
}
function SendHeight() {
// ---------------- NC 11-Nov -------------
var parent_url2 = '';
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() {
var tmpShowAdvance = false;
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: "DiamondSearch_Resp.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:'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 + "',VendorID:'" + VendorID + "',Track:'" + Track + "',IsFB:'" + IsFB + "',IsMLDL:'" + IsMLDL + "',MyRetailerID:'" + MyRetailerID + "',ShowAdvance:'" + tmpShowAdvance + "',HasVideo:'" + hasvideo + "'}",
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);
$("#tr" + DID).addClass("Activetr");
}
}
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 showprocessDropHint() {
$("#divLoader").show();
}
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
if (popID.indexOf('name_Video') > -1) {
var iframe = $('#tdEnlargevideo #embedvideo2');
if ((iframe != "" || iframe != null) && iframe[0].src.indexOf('certimage') > 0) {
iframe[0].src = iframe[0].src;
}
}
//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
jq('a.close, #fade').live('click', function () { //When clicking on the close or fade layer...
jq('#fade , .popup_block, .popup_block_video').fadeOut(function () {
jq('#fade, a.close').remove(); //fade them both out
});
return false;
});
}
function HideShow(objShow, objHide, liObj) {
$("." + objShow).show();
$("." + objHide).hide();
$("#liItemDetails a").removeClass("topnav_active");
$("#liSpecification a").removeClass("topnav_active");
$("#" + liObj.id + " a").addClass("topnav_active");
$("#liItemDetails").removeClass("active");
$("#liSpecification").removeClass("active");
$("#" + liObj.id).addClass("active");
$("#DivEmailtoFriend").hide();
$("#DivDropAHint").hide();
$("#Divletusknow").hide();
$("#divScheduleView").hide();
$(".canadianrocks_ba").hide();
$(".divBothSide").show();
ChangeScroll();
}
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 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: "DiamondSearch_Resp.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 bindtime() {
$("#ddlAppntTime").msDropDown();
}
function ScheduleViewingData() {
if (AppointMon != '' && AppointMon != 0 && AppointDay != '' && AppointDay != 0 && AppointYer != '' && AppointYer != 0) {
AppointDate = new Date(AppointYer, AppointMon - 1, AppointDay);
}
$.ajax({
type: "POST",
url: "DiamondSearch_Resp.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"]);
//$("#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"]);
}
},
error: function (msg) {
}
});
jq("#DrpContactPref").msDropDown();
jq("#ddAddress").msDropDown();
}
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: "DiamondSearch_Resp.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() {
//jq('#MultiAddr').css('margin-left', '-13px');
//jq('#MultiAddr').adGallery();
$('#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();
$("#" + objShow).addClass("det_right");
}
function hideView(objHide) {
$(".diamond_text_bg").show();
$("#" + objHide).hide();
$("#" + objShow).removeClass("det_right");
}
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 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 getfocus(obj, val) {
if (obj.value == val) {
obj.value = '';
}
//$('#imgCalender').click();
//$('#imgHintCalender').click();
}
function lostfocus(obj, val) {
if (obj.value == '') {
obj.value = val;
}
}
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) {
LocationID = ID;
$.ajax({
type: "POST",
url: "DiamondSearch_Resp.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() {
$("#divLoader").show();
if ($('#txtSchedulName').val() == '' || $('#txtSchedulName').val() == 'Your Email') {
$("#divLoader").hide();
$('#RequiredFieldValidator4').css('display', 'Block');
return false;
}
if ($('#txtEmailChk').val() == '' || $('#txtEmailChk').val() == 'Your Email') {
$("#divLoader").hide();
$('#RequiredFieldValidator3').css('display', 'Block');
return false;
}
if (!ValidateEmail($('#txtEmailChk').val())) {
$("#divLoader").hide();
$('#RegularExpressionValidator2').css('display', 'Block');
return false;
}
if ($('#txtSchedulPnone').val() == '' || $('#txtSchedulPnone').val() == 'Your Email') {
$("#divLoader").hide();
$('#RequiredFieldValidator7').css('display', 'Block');
return false;
}
if ($('#txtAppntMsg').val() == '') {
$("#divLoader").hide();
$('#RequiredFieldValidator5').css('display', 'Block');
return false;
}
var Text = $('#txtAppntDate').val();
if (Text == '' || Text == 'When are you available?') {
$("#divLoader").hide();
$('#RequiredFieldValidator6').css('display', 'Block');
return false;
}
var SelVal = $('#ddlAppntTime :selected').val();
if (SelVal == 0) {
$('#AppdateVali').css('display', 'Block');
return false;
}
var Name = $("#txtSchedulName").val().split(" ");
var FName = '';
var LName = '';
if (Name.length > 0)
FName = Name[0];
if (Name.length > 1)
LName = Name[1];
$("#pardot_email").val($("#txtEmailChk").val());
$("#pardot_fname").val(FName);
$("#pardot_lname").val(LName);
$("#pardot_phone").val($("#txtSchedulPnone").val());
$("#pardot_date").val($("#txtAppntDate").val());
$("#pardot_sku").val(DID);
$("#pardot_url").val(window.location.href);
$('#divScheduleView').css('display', 'none');
$('#divScheduleViewFinal').css('display', 'block');
$('#AppDate').text($('#txtAppntDate').val());
$('#AppTime').text($('#hndAppntTime').val());
$("#divLoader").hide();
}
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 SearchDiamond() {
if ($("#txtSearch").val() != "" && $("#txtSearch").val() != "Search Diamond Stock #")
skuNo = $("#txtSearch").val();
else
skuNo = "";
CallAjaxRequestForDiamondGrid();
}
function ResetNoResultRequest() {
$('#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: "DiamondSearch_Resp.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.");
}
}
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: "DiamondSearch_Resp.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_IDC');
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 () {
DdlAddress();
DdlAddress_Detail();
DdlAddress_IDCNO();
});
function DdlAddress_Detail() {
var select = $('select.sel_drp_detail');
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');
});
}
function DdlAddress_IDCNO() {
var select = $('select.sel_drp_IDCNO');
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');
});
}
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 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) {
iframe.src = iframe.src;
//iframe.width = 450;
iframe.height = VideoUrlheight;
//if ((VideoUrlheight - 125) < 350)
// iframe.height = 350;
//else
// iframe.height = VideoUrlheight - 125;
}
$('#VideoUrl').css('display', 'block');
$('#DiamondDet').css('display', 'None');
//}
}
function showEnlargevideo() {
$('#popup_name_Video').css('display', 'block');
$('#fade').css('display', 'block');
}
//end
function showprocessScheduleView() {
$("#divLoader").show();
if (dealerID == '3685') {
var Name = $("#txtSchedulName").val().split(" ");
var FName = '';
var LName = '';
if (Name.length > 0)
FName = Name[0];
if (Name.length > 1)
LName = Name[1];
$("#pardot_pixel").attr('src', 'http://go.pardot.com/l/209232/2016-07-18/72h?FirstName=' + FName + '&LastName=' + LName + '&Email=' + $("#txtEmailChk").val() + '&CellPhone=' + $("#txtSchedulPnone").val() + '&ProductSKU=' + DID + '&Date=' + $("#txtAppntDate").val() + '&StoreId=Arizona%20store:%20Store%20number%20401&ProductURL=' + encodeURIComponent(window.location.href));
}
}
//function CertificatePopup(CertificateURL) {
// var appendthis = ("");
// $("body").append(appendthis);
// $("#myModal").css("overflow-x", "hidden");
// $("#myModal").css("overflow-y", "auto");
// $(".modal-overlay").fadeTo(500, 0.7);
// $("body").css("overflow", "auto");
// var htmlIframebody = "