var lang_urunStoguAsanDeger = 'Ürün stoğunu aşan bir değer girdiniz. Değer stok sayısı ile değiştirildi.'; var lang_yukleniyor = 'Yükleniyor ..'; var lang_lutfenBekleyin = 'Lütfen bekleyin ...'; var lang_kullaniciAdiDahaOnceAlinmis = 'Bu kullanıcı adı daha önce alınmış. Lütfen farklı bir kullanıcı adı girin.'; var lang_epostaDahaOnceAlinmis = 'Bu E-Posta adresi daha önce sisteme kayıt edilmiş.'; var lang_stoktaOlmayanUrunuEkleyemezsiniz = 'Stokta bulunmayan ürünü sepete ekleyemezsiniz.'; var lang_stoktlarimizdaYok = 'Stoklarımızda girdiğiniz adet kadar ürün bulunmamaktadır.'; var lang_lutfenSadeceRakkamKullanin = 'Lütfen adet girişlerinde sadece rakkam kullanın.'; var lang_onaySepet = 'Onay şıkkını işaretlemeden, ürünü sepete atamazsınız.'; var lang_urunVarSecim = 'Lütfen ürün varyasyon seçiminizi yapın.'; var lang_urunAnaVarSecim = 'Lütfen önce ürün ana varyasyon seçiminizi yapın.'; var lang_urunDefaIncelendi = '%urunadi% son 24 saatte %gosterim% defa incelendi.'; var lang_karsilastirmaEklendi = 'Ürün karşılaştırma listesine eklendi.'; var lang_listeEklendi = 'Ürün listenize eklendi.'; var lang_secimStokYok = 'İlgili seçim stokta bulunmamaktadır.'; var lang_ilceGonderimYok = 'Bu ilceye gonderimimiz yoktur.'; var lang_ilceKargoFark = 'Bu ilceye %fark% TL kargo farki uygulanmaktadır.'; var lang_hataliKullaniciVeyaSifre = 'Hatalı kullanıcı adı ve/veya şifre'; var lang_eksiksizDoldurun = 'Lütfen bilgileri eksiksiz doldurun'; var lang_hataliEposta = 'Hatalı e-posta adresi.'; var lang_iletisimOK = 'Sizinle ek kısa sürede iletişime geçeceğiz. Teşekkürler.'; var lang_sifreGuvenligi = 'Şifre Güvenliği'; var lang_karsilastirmaKaldirildi = 'Ürün karşılaştırma listenizden kaldırıldı.'; var lang_OK = 'Tamam'; var lang_tamam = 'Tamam'; var lang_onceAdresSecim = 'Lütfen önce adres seçiminizi yapın.'; var lang_onceKargoSecim = 'Lütfen kargo seçiminizi yapın.'; var lang_evet = 'Evet'; var lang_hayir = 'Hayır'; var lang_secimiTamamlayin = 'Lütfen seçimi tamamlayın.'; var lang_sepeteEklenmis = 'Ürün daha önce sepetinize eklenmiş'; var lang_sepeteEklendi = 'Ürün sepetinize eklendi.'; var lang_alisveriseDevamEt = 'Alışverişe Devam Et'; var lang_sepetimeGit = 'Sepetime Git'; var lang_adresSilOnay = 'Bu adres silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.'; var lang_guvenlikKodOnay = 'Lütfen güvenlik kodunu onaylayın.'; var lang_cepKaydedilmis = 'Bu cep telefonu numarası daha önce kaydedilmiş.'; var lang_urunYeniFiyat = 'Ürün Yeni Fiyatını Girin:'; var lang_guncelle = 'Güncelle'; var lang_hata = 'Hata'; var lang_fiyatGuncelleOK = 'Fiyat güncellendi'; var lang_fiyatGuncelleHata = 'Fiyat güncellenmedi.'; var lang_onaySiparis = 'Siparişi tamamlamak için, satın alma kurallarını onaylamanız gerekmektedir.'; var lang_onayOdemeTipi = 'Siparişi tamamlamak için bir ödeme yöntemi seçmelisiniz.'; var lang_kartBilgileriDoldurun = 'Lütfen kart bilgilerinizi eksiksiz doldurun.'; var lang_hataliKartNo = 'Geçersiz kart numarası.'; var siteDizini = '/'; var templateName = 'paradise'; console.log('%cYazılım : %cKiren Yazılım v5.2%c - https://www.kirenyazilim.com','color:green','','');var singlePaymentClicked = false; $(document).ready(function () { $(".pay-items div.card-headers").click(function () { if ( $(this).parent().find(".baska-kart").is(":visible") || !$(".siparis-onayla-button").is(":visible") ) return; if ( $("#gf_acceptRulesCB_satinalKural").length && !$("#gf_acceptRulesCB_satinalKural").is(":checked") ) { myalert(lang_onaySiparis, "warning"); return; } $(".pay-items.tabs-items.active .mobile-payment").html( $(".pay-items.tabs-items.active .mobile-payment").attr("desc") ); $(".pay-auto-cc").html("").hide(); $(".pay-items.tabs-items.active .card-bodys .credit-card").css( "opacity", 1 ); $(".pay-items,.cc-choice-container").removeClass("active"); $(this).parent().addClass("active"); $(".card-bodys").removeClass("d-block").addClass("d-none"); $(this) .parent() .find(".card-bodys") .addClass("d-block") .removeClass("d-none") .show(); if ($(this).parent().find(".pay-auto-load").length) { $(".pay-items.tabs-items.active .pay-auto-load") .html(ajaxLoaderDiv()) .show(); var payID = $(this).parent().find(".pay-auto-load").attr("data-loadID"); setPayType(payID); $.get( "page.php?act=satinal&op=odeme&paytype=" + payID + "&viewPopup=1&isAjax=1", function (data) { if (singlePaymentClicked) window.location.href = "page.php?act=satinal&op=odeme&paytype=" + payID; $(".pay-items.tabs-items.active .pay-auto-load").html( $(data).find("#shopphp-payment-body-step3").html() ); } ); } }); $(".cc-choice-container").click(function () { $(".cc-choice-container").removeClass("active"); $(this).addClass("active"); }); $(".credit-card").click(function () { $(".pay-items.tabs-items.active .card-bodys .credit-card").css( "opacity", 0.2 ); $(this).css("opacity", 1); $(".pay-items.tabs-items.active .pay-auto-cc").html(ajaxLoaderDiv()).show(); var payID = $(this).attr("data-bankID"); setPayType(payID); $.get( "page.php?act=satinal&op=odeme&paytype=" + payID + "&viewPopup=1&isAjax=1", function (data) { $(".pay-items.tabs-items.active .pay-auto-cc").html( $(data).find("#shopphp-payment-body-step3").html() ); } ); }); window.addEventListener("load", (event) => { $(".notAliciUpdate").bind("input propertychange", function () { siparisBilgiGuncelle(0, 0); }); }); function siparisKargoSecimListeGuncelle() { if (!$("#sepet-kargo-secim").length) { // $('#siparis-submit-button').after('
' + ajaxLoaderDiv() + '
'); $('#basket-right-container input').css('opacity',0.5).css('pointer-events','none'); $.get("include/ajaxLib.php?act=kargoArray", function (data) { if (data) $( '
  • ' + data + '
  • ' ).appendTo($("#basket-right-container .basket-right")); sepetHTMLGuncelle(""); }); } else { $("#sepet-kargo-secim select").html(""); $.get("include/ajaxLib.php?act=kargoArray", function (data) { $("#sepet-kargo-secim select").html(data); $('#payment-loader-div').remove(); $('#basket-right-container input').css('opacity',1).css('pointer-events','auto'); }); } $("#gf_info_kargoFirmaID").html(""); $(".kargo-secim").html("" + lang_lutfenBekleyin + ""); $(".kargo-secim").load( "include/mod_SiparisAdresSecim.php?siparisKargoListe=true", function () { $(".kargo-secim.disabled").removeClass("disabled").addClass("enabled"); $(".kargo-secim.enabled input").click(function () { $("#kargoFirmaID").val($(this).attr("kargoFirmaID")); $(".kargo-secim tr").removeClass("active"); $(this).parent().parent().addClass("active"); siparisBilgiGuncelle(true, false); $(this).addClass("active"); }); $(".kargo-secim.enabled input:first").click(); } ); } function siparisBilgiGuncelle(update, kargo) { if ($("#gf_kargoFirmaID").length && !$("#kargoFirmaID").val()) { $("#kargoFirmaID").val($("#gf_kargoFirmaID").val()); } $.ajax({ url: "include/ajaxLib.php?act=setSiparisAdresID&adresID=" + $("#adresID").val() + "&kargoFirmaID=" + $("#kargoFirmaID").val() + "&faturaID=" + $("#faturaID").val() + "&teslimatID=" + $("#teslimatID").val() + "&data_notAlici=" + $("#data_notAlici").val(), success: function (data) { if (update) sepetHTMLGuncelle(""); if (kargo) siparisKargoSecimListeGuncelle(); }, }); } window.addEventListener("load", (event) => { $("input[name=ceptel]").mask("(Z00) 000-0000", { translation: { Z: { pattern: /[1-9]/, optional: false, }, }, }); $("#teslimat-adres .adress-list:first .adres-items").click(function () { $("#teslimat-adres .adress-list:first .adres-items").removeClass( "active" ); $(this).addClass("active"); $("#adresID").val($(this).attr("adresID")); siparisBilgiGuncelle(false, true); }); $("#fatura-adres-load").click(function () { if (!$(this).is(":checked")) { if ($("#fatura-adres").html() == "") { $("#fatura-adres").html( $(".adress-list:first") .html() .replace(/name="adresID"/g, 'name="faturaID"') .replace(/adres-item-/g, "fatura-item-") ); $("#fatura-adres .adres-items").removeClass("active"); $("#fatura-adres .adres-items").click(function () { $("#fatura-adres .adres-items").removeClass("active"); $(this).addClass("active"); $("#faturaID").val($(this).attr("adresID")); siparisBilgiGuncelle(false, false); }); } } else { $("#faturaID").val(""); $("#fatura-adres").html(""); siparisBilgiGuncelle(false, false); } }); $(".teslimat-secim input").click(function () { $("#teslimatID").val($(this).attr("teslimatID")); $(".teslimat-secim tr").removeClass("active"); $(this).parent().parent().addClass("active"); $(this).addClass("active"); siparisBilgiGuncelle(true, false); }); $(".teslimat-secim input:first").click(); if ($(".addres-item").length == 1) $(".addres-item:first").click(); }); }); function ccFormKaldir() { $(".pay-items.tabs-items.active .card-bodys").show(); $(".pay-items.tabs-items.active .pay-auto-cc").html("").hide(); } function siparisiOnayla() { if ( $("#gf_acceptRulesCB_satinalKural").length && !$("#gf_acceptRulesCB_satinalKural").is(":checked") ) { myalert(lang_onaySiparis, "warning"); return; } if (!$(".pay-items.tabs-items.active").length) { myalert(lang_onayOdemeTipi, "warning"); return; } if ($(".pay-items.active .sp-payment form").length) { var stop = false; if ($("#card-number").length && !$("#card-number").val()) { stop = true; } if ($("#card-cvv").length && !$("#card-cvv").val()) { stop = true; } if ($("#card-name").length && !$("#card-name").val()) { stop = true; } if(!stop && $("#card-number").length && $('#card-number').hasClass('validate-cc-number') && !validateCardNumber($("#card-number").val().replace(/\s/g, ""))) { myalert((typeof lang_hataliKartNo === "undefined"?"Geçersiz kart numarası.":lang_hataliKartNo),"warning") stop = true; return; } if (stop) { myalert(lang_kartBilgileriDoldurun, "warning"); return; } else { if ($("#card-number").length) $("#card-number").val($("#card-number").val().replace(/\s/g, "")); $(".sp-payment form").submit(); $("div.payment").css({ opacity: 0.2, "pointer-events": "none" }); } } if ($(".pay-items.tabs-items.active .pay-auto-finish").length) { $(".siparis-onayla-button").hide(); if ($(".pay-items.tabs-items.active .mobile-payment").length) { $(".pay-items.tabs-items.active .mobile-payment").attr( "desc", $(".pay-items.tabs-items.active .mobile-payment").text() ); $(".pay-items.tabs-items.active .mobile-payment").html(ajaxLoaderDiv()); } else $(".pay-items.tabs-items.active .pay-auto-finish") .html(ajaxLoaderDiv()) .show(); var payID = $(".pay-items.tabs-items.active .pay-auto-finish").attr( "data-loadID" ); $.get( "page.php?act=satinal&op=odeme&paytype=" + payID + "&viewPopup=1&isAjax=1", function (data) { if ($(".pay-items.tabs-items.active .mobile-payment").length) $(".pay-items.tabs-items.active .mobile-payment").html( $(data).find("#shopphp-payment-body-step3").html() ); else $(".pay-items.tabs-items.active .pay-auto-finish").html( $(data).find("#shopphp-payment-body-step3").html() ); } ); return; } } function ccTaksitGosterim() { $(".sp-payment input").keyup(function () { if (this.value.length == this.maxLength) { var next = $(this).data("next"); $("#" + next).focus(); } }); $(".sp-payment select").change(function () { var next = $(this).data("next"); $("#" + next).focus(); }); if ($("#taksit-select select option").length < 2) return; $('
    ').appendTo( "#taksit-view" ); $( 'Taksit SeçenekleriToplam' ).appendTo("#taksit-view table"); $("").appendTo("#taksit-view table"); var ay, value, classAdd, setValue = ""; $("#taksit-select select option").each(function () { value = $(this).html(); if (value.includes(":")) { classAdd = ""; ay = $(this).attr("value"); var tID = $(this).attr("tID"); const vArray = value.split(" = "); const fArray = vArray[0].split(" : "); var f = fArray[1]; const tArray = f.toLocaleLowerCase().split(" x "); f = tArray[1] + " Taksit (" + tArray[0].replace("(", "").replace(")", "").toLocaleUpperCase() + ")"; if (!vArray[1]) { f = "Peşin"; } if ( ay > 1 && parseFloat( modMainPrice.replace(" ", "").replace("TL", "").replace(",", "") ) == parseFloat( vArray[1].replace(" ", "").replace("TL", "").replace(",", "") ) ) classAdd = "pesin"; $( '
    ' + f + "" + (vArray[1] ? vArray[1] : "") + "" ) .appendTo("#taksit-view table tbody") .click(function () { if($(this).attr("data-tid")) { $.get("include/ajaxLib.php?setTID=" + $(this).attr("data-tid"), function (data) { console.log('T:' + data); }); } $(".taksit-items").removeClass("active"); $(this).addClass("active"); $("#taksit-select select") .val($(this).attr("data-value")) .trigger("change"); setValue = $(this).text().replace("Peşin", "").replace(")", ") - "); if (!setValue) setValue = modMainPrice; $("li.tutar.tutar-son .sepet3").html(setValue); }); } }); if (!$("#taksit-select select option").length) $( '
    Peşin : ' + $(".credit-card.active").find("span.s1").html() + "" ).appendTo("#taksit-view table tbody"); if (!$("#taksit-select select").val()) $(".taksit-items:first").click(); } function setPayType(ID) { // $('#basket-right-container input').css('pointer-events','none'); $.get("include/mod_SiparisAdresSecim.php?setPayType=" + ID, function (data) { if (data == "OK") { sepetHTMLGuncelle(""); } else console.log("SetPayType Hata : " + data); }); } function ccformats(ele, e) { if (ele.value.length < 19) { ele.value = ele.value.replace(/\W/gi, "").replace(/(.{4})/g, "$1 "); return true; } else { return false; } } function numberValidation(e) { e.target.value = e.target.value.replace(/[^\d ]/g, ""); return false; } const validateCardNumber = number => { //Check if the number contains only numeric value //and is of between 13 to 19 digits const regex = new RegExp("^[0-9]{13,19}$"); if (!regex.test(number)){ return false; } return luhnCheck(number); } const luhnCheck = val => { let checksum = 0; // running checksum total let j = 1; // takes value of 1 or 2 // Process each digit one by one starting from the last for (let i = val.length - 1; i >= 0; i--) { let calc = 0; // Extract the next digit and multiply by 1 or 2 on alternative digits. calc = Number(val.charAt(i)) * j; // If the result is in two digits add 1 to the checksum total if (calc > 9) { checksum = checksum + 1; calc = calc - 10; } // Add the units element to the checksum total checksum = checksum + calc; // Switch the value of j if (j == 1) { j = 2; } else { j = 1; } } //Check if it is divisible by 10 or not. return (checksum % 10) == 0; } /* jQuery elevateZoom 3.0.8 - Demo's and documentation: - www.elevateweb.co.uk/image-zoom - Copyright (c) 2013 Andrew Eades - www.elevateweb.co.uk - Dual licensed under the LGPL licenses. - http://en.wikipedia.org/wiki/MIT_License - http://en.wikipedia.org/wiki/GNU_General_Public_License */ "function" !== typeof Object.create && (Object.create = function(d) { function h() {} h.prototype = d; return new h }); (function(d, h, l, m) { var k = { init: function(b, a) { var c = this; c.elem = a; c.$elem = d(a); c.imageSrc = c.$elem.data("zoom-image") ? c.$elem.data("zoom-image") : c.$elem.attr("src"); c.options = d.extend({}, d.fn.elevateZoom.options, b); c.options.tint && (c.options.lensColour = "none", c.options.lensOpacity = "1"); "inner" == c.options.zoomType && (c.options.showLens = !1); c.$elem.parent().removeAttr("title").removeAttr("alt"); c.zoomImage = c.imageSrc; c.refresh(1); d("#" + c.options.gallery + " a").click(function(a) { c.options.galleryActiveClass && (d("#" + c.options.gallery + " a").removeClass(c.options.galleryActiveClass), d(this).addClass(c.options.galleryActiveClass)); a.preventDefault(); d(this).data("zoom-image") ? c.zoomImagePre = d(this).data("zoom-image") : c.zoomImagePre = d(this).data("image"); c.swaptheimage(d(this).data("image"), c.zoomImagePre); return !1 }) }, refresh: function(b) { var a = this; setTimeout(function() { a.fetch(a.imageSrc) }, b || a.options.refresh) }, fetch: function(b) { var a = this, c = new Image; c.onload = function() { a.largeWidth = c.width; a.largeHeight = c.height; a.startZoom(); a.currentImage = a.imageSrc; a.options.onZoomedImageLoaded(a.$elem) }; c.src = b }, startZoom: function() { var b = this; b.nzWidth = b.$elem.width(); b.nzHeight = b.$elem.height(); b.isWindowActive = !1; b.isLensActive = !1; b.isTintActive = !1; b.overWindow = !1; b.options.imageCrossfade && (b.zoomWrap = b.$elem.wrap('
    '), b.$elem.css("position", "absolute")); b.zoomLock = 1; b.scrollingLock = !1; b.changeBgSize = !1; b.currentZoomLevel = b.options.zoomLevel; b.nzOffset = b.$elem.offset(); b.widthRatio = b.largeWidth / b.currentZoomLevel / b.nzWidth; b.heightRatio = b.largeHeight / b.currentZoomLevel / b.nzHeight; "window" == b.options.zoomType && (b.zoomWindowStyle = "overflow: hidden;background-position: 0px 0px;text-align:center;background-color: " + String(b.options.zoomWindowBgColour) + ";width: " + String(b.options.zoomWindowWidth) + "px;height: " + String(b.options.zoomWindowHeight) + "px;float: left;background-size: " + b.largeWidth / b.currentZoomLevel + "px " + b.largeHeight / b.currentZoomLevel + "px;display: none;z-index:100;border: " + String(b.options.borderSize) + "px solid " + b.options.borderColour + ";background-repeat: no-repeat;position: absolute;"); if ("inner" == b.options.zoomType) { var a = b.$elem.css("border-left-width"); b.zoomWindowStyle = "overflow: hidden;margin-left: " + String(a) + ";margin-top: " + String(a) + ";background-position: 0px 0px;width: " + String(b.nzWidth) + "px;height: " + String(b.nzHeight) + "px;float: left;display: none;cursor:" + b.options.cursor + ";px solid " + b.options.borderColour + ";background-repeat: no-repeat;position: absolute;" } "window" == b.options.zoomType && (lensHeight = b.nzHeight < b.options.zoomWindowWidth / b.widthRatio ? b.nzHeight : String(b.options.zoomWindowHeight / b.heightRatio), lensWidth = b.largeWidth < b.options.zoomWindowWidth ? b.nzWidth : b.options.zoomWindowWidth / b.widthRatio, b.lensStyle = "background-position: 0px 0px;width: " + String(b.options.zoomWindowWidth / b.widthRatio) + "px;height: " + String(b.options.zoomWindowHeight / b.heightRatio) + "px;float: right;display: none;overflow: hidden;z-index: 999;opacity:" + b.options.lensOpacity + ";filter: alpha(opacity = " + 100 * b.options.lensOpacity + "); zoom:1;width:" + lensWidth + "px;height:" + lensHeight + "px;background-color:" + b.options.lensColour + ";cursor:" + b.options.cursor + ";border: " + b.options.lensBorderSize + "px solid " + b.options.lensBorderColour + ";background-repeat: no-repeat;position: absolute;"); b.tintStyle = "display: block;position: absolute;background-color: " + b.options.tintColour + ";filter:alpha(opacity=0);opacity: 0;width: " + b.nzWidth + "px;height: " + b.nzHeight + "px;"; b.lensRound = ""; "lens" == b.options.zoomType && (b.lensStyle = "background-position: 0px 0px;float: left;display: none;border: " + String(b.options.borderSize) + "px solid " + b.options.borderColour + ";width:" + String(b.options.lensSize) + "px;height:" + String(b.options.lensSize) + "px;background-repeat: no-repeat;position: absolute;"); "round" == b.options.lensShape && (b.lensRound = "border-top-left-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + "px;border-top-right-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + "px;border-bottom-left-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + "px;border-bottom-right-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + "px;"); b.zoomContainer = d('
    '); d("body").append(b.zoomContainer); b.options.containLensZoom && "lens" == b.options.zoomType && b.zoomContainer.css("overflow", "hidden"); "inner" != b.options.zoomType && (b.zoomLens = d("
     
    ").appendTo(b.zoomContainer).click(function() { b.$elem.trigger("click") }), b.options.tint && (b.tintContainer = d("
    ").addClass("tintContainer"), b.zoomTint = d("
    "), b.zoomLens.wrap(b.tintContainer), b.zoomTintcss = b.zoomLens.after(b.zoomTint), b.zoomTintImage = d('').appendTo(b.zoomLens).click(function() { b.$elem.trigger("click") }))); isNaN(b.options.zoomWindowPosition) ? b.zoomWindow = d("
     
    ").appendTo("body").click(function() { b.$elem.trigger("click") }) : b.zoomWindow = d("
     
    ").appendTo(b.zoomContainer).click(function() { b.$elem.trigger("click") }); b.zoomWindowContainer = d("
    ").addClass("zoomWindowContainer").css("width", b.options.zoomWindowWidth); b.zoomWindow.wrap(b.zoomWindowContainer); "lens" == b.options.zoomType && b.zoomLens.css({ backgroundImage: "url('" + b.imageSrc + "')" }); "window" == b.options.zoomType && b.zoomWindow.css({ backgroundImage: "url('" + b.imageSrc + "')" }); "inner" == b.options.zoomType && b.zoomWindow.css({ backgroundImage: "url('" + b.imageSrc + "')" }); b.$elem.bind("touchmove", function(a) { a.preventDefault(); b.setPosition(a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]) }); b.zoomContainer.bind("touchmove", function(a) { "inner" == b.options.zoomType && b.showHideWindow("show"); a.preventDefault(); b.setPosition(a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]) }); b.zoomContainer.bind("touchend", function(a) { b.showHideWindow("hide"); b.options.showLens && b.showHideLens("hide"); b.options.tint && "inner" != b.options.zoomType && b.showHideTint("hide") }); b.$elem.bind("touchend", function(a) { b.showHideWindow("hide"); b.options.showLens && b.showHideLens("hide"); b.options.tint && "inner" != b.options.zoomType && b.showHideTint("hide") }); b.options.showLens && (b.zoomLens.bind("touchmove", function(a) { a.preventDefault(); b.setPosition(a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]) }), b.zoomLens.bind("touchend", function(a) { b.showHideWindow("hide"); b.options.showLens && b.showHideLens("hide"); b.options.tint && "inner" != b.options.zoomType && b.showHideTint("hide") })); b.$elem.bind("mousemove", function(a) { !1 == b.overWindow && b.setElements("show"); if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; b.lastX = a.clientX; b.lastY = a.clientY }); b.zoomContainer.bind("mousemove", function(a) { !1 == b.overWindow && b.setElements("show"); if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; b.lastX = a.clientX; b.lastY = a.clientY }); "inner" != b.options.zoomType && b.zoomLens.bind("mousemove", function(a) { if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; b.lastX = a.clientX; b.lastY = a.clientY }); b.options.tint && "inner" != b.options.zoomType && b.zoomTint.bind("mousemove", function(a) { if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; b.lastX = a.clientX; b.lastY = a.clientY }); "inner" == b.options.zoomType && b.zoomWindow.bind("mousemove", function(a) { if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; b.lastX = a.clientX; b.lastY = a.clientY }); b.zoomContainer.add(b.$elem).mouseenter(function() { !1 == b.overWindow && b.setElements("show") }).mouseleave(function() { b.scrollLock || b.setElements("hide") }); "inner" != b.options.zoomType && b.zoomWindow.mouseenter(function() { b.overWindow = !0; b.setElements("hide") }).mouseleave(function() { b.overWindow = !1 }); b.minZoomLevel = b.options.minZoomLevel ? b.options.minZoomLevel : 2 * b.options.scrollZoomIncrement; b.options.scrollZoom && b.zoomContainer.add(b.$elem).bind("mousewheel DOMMouseScroll MozMousePixelScroll", function(a) { b.scrollLock = !0; clearTimeout(d.data(this, "timer")); d.data(this, "timer", setTimeout(function() { b.scrollLock = !1 }, 250)); var e = a.originalEvent.wheelDelta || -1 * a.originalEvent.detail; a.stopImmediatePropagation(); a.stopPropagation(); a.preventDefault(); 0 < e / 120 ? b.currentZoomLevel >= b.minZoomLevel && b.changeZoomLevel(b.currentZoomLevel - b.options.scrollZoomIncrement) : b.options.maxZoomLevel ? b.currentZoomLevel <= b.options.maxZoomLevel && b.changeZoomLevel(parseFloat(b.currentZoomLevel) + b.options.scrollZoomIncrement) : b.changeZoomLevel(parseFloat(b.currentZoomLevel) + b.options.scrollZoomIncrement); return !1 }) }, setElements: function(b) { if (!this.options.zoomEnabled) return !1; "show" == b && this.isWindowSet && ("inner" == this.options.zoomType && this.showHideWindow("show"), "window" == this.options.zoomType && this.showHideWindow("show"), this.options.showLens && this.showHideLens("show"), this.options.tint && "inner" != this.options.zoomType && this.showHideTint("show")); "hide" == b && ("window" == this.options.zoomType && this.showHideWindow("hide"), this.options.tint || this.showHideWindow("hide"), this.options.showLens && this.showHideLens("hide"), this.options.tint && this.showHideTint("hide")) }, setPosition: function(b) { if (!this.options.zoomEnabled) return !1; this.nzHeight = this.$elem.height(); this.nzWidth = this.$elem.width(); this.nzOffset = this.$elem.offset(); this.options.tint && "inner" != this.options.zoomType && (this.zoomTint.css({ top: 0 }), this.zoomTint.css({ left: 0 })); this.options.responsive && !this.options.scrollZoom && this.options.showLens && (lensHeight = this.nzHeight < this.options.zoomWindowWidth / this.widthRatio ? this.nzHeight : String(this.options.zoomWindowHeight / this.heightRatio), lensWidth = this.largeWidth < this.options.zoomWindowWidth ? this.nzWidth : this.options.zoomWindowWidth / this.widthRatio, this.widthRatio = this.largeWidth / this.nzWidth, this.heightRatio = this.largeHeight / this.nzHeight, "lens" != this.options.zoomType && (lensHeight = this.nzHeight < this.options.zoomWindowWidth / this.widthRatio ? this.nzHeight : String(this.options.zoomWindowHeight / this.heightRatio), lensWidth = this.options.zoomWindowWidth < this.options.zoomWindowWidth ? this.nzWidth : this.options.zoomWindowWidth / this.widthRatio, this.zoomLens.css("width", lensWidth), this.zoomLens.css("height", lensHeight), this.options.tint && (this.zoomTintImage.css("width", this.nzWidth), this.zoomTintImage.css("height", this.nzHeight))), "lens" == this.options.zoomType && this.zoomLens.css({ width: String(this.options.lensSize) + "px", height: String(this.options.lensSize) + "px" })); this.zoomContainer.css({ top: this.nzOffset.top }); this.zoomContainer.css({ left: this.nzOffset.left }); this.mouseLeft = parseInt(b.pageX - this.nzOffset.left); this.mouseTop = parseInt(b.pageY - this.nzOffset.top); "window" == this.options.zoomType && (this.Etoppos = this.mouseTop < this.zoomLens.height() / 2, this.Eboppos = this.mouseTop > this.nzHeight - this.zoomLens.height() / 2 - 2 * this.options.lensBorderSize, this.Eloppos = this.mouseLeft < 0 + this.zoomLens.width() / 2, this.Eroppos = this.mouseLeft > this.nzWidth - this.zoomLens.width() / 2 - 2 * this.options.lensBorderSize); "inner" == this.options.zoomType && (this.Etoppos = this.mouseTop < this.nzHeight / 2 / this.heightRatio, this.Eboppos = this.mouseTop > this.nzHeight - this.nzHeight / 2 / this.heightRatio, this.Eloppos = this.mouseLeft < 0 + this.nzWidth / 2 / this.widthRatio, this.Eroppos = this.mouseLeft > this.nzWidth - this.nzWidth / 2 / this.widthRatio - 2 * this.options.lensBorderSize); 0 >= this.mouseLeft || 0 > this.mouseTop || this.mouseLeft > this.nzWidth || this.mouseTop > this.nzHeight ? this.setElements("hide") : (this.options.showLens && (this.lensLeftPos = String(this.mouseLeft - this.zoomLens.width() / 2), this.lensTopPos = String(this.mouseTop - this.zoomLens.height() / 2)), this.Etoppos && (this.lensTopPos = 0), this.Eloppos && (this.tintpos = this.lensLeftPos = this.windowLeftPos = 0), "window" == this.options.zoomType && (this.Eboppos && (this.lensTopPos = Math.max(this.nzHeight - this.zoomLens.height() - 2 * this.options.lensBorderSize, 0)), this.Eroppos && (this.lensLeftPos = this.nzWidth - this.zoomLens.width() - 2 * this.options.lensBorderSize)), "inner" == this.options.zoomType && (this.Eboppos && (this.lensTopPos = Math.max(this.nzHeight - 2 * this.options.lensBorderSize, 0)), this.Eroppos && (this.lensLeftPos = this.nzWidth - this.nzWidth - 2 * this.options.lensBorderSize)), "lens" == this.options.zoomType && (this.windowLeftPos = String(-1 * ((b.pageX - this.nzOffset.left) * this.widthRatio - this.zoomLens.width() / 2)), this.windowTopPos = String(-1 * ((b.pageY - this.nzOffset.top) * this.heightRatio - this.zoomLens.height() / 2)), this.zoomLens.css({ backgroundPosition: this.windowLeftPos + "px " + this.windowTopPos + "px" }), this.changeBgSize && (this.nzHeight > this.nzWidth ? ("lens" == this.options.zoomType && this.zoomLens.css({ "background-size": this.largeWidth / this.newvalueheight + "px " + this.largeHeight / this.newvalueheight + "px" }), this.zoomWindow.css({ "background-size": this.largeWidth / this.newvalueheight + "px " + this.largeHeight / this.newvalueheight + "px" })) : ("lens" == this.options.zoomType && this.zoomLens.css({ "background-size": this.largeWidth / this.newvaluewidth + "px " + this.largeHeight / this.newvaluewidth + "px" }), this.zoomWindow.css({ "background-size": this.largeWidth / this.newvaluewidth + "px " + this.largeHeight / this.newvaluewidth + "px" })), this.changeBgSize = !1), this.setWindowPostition(b)), this.options.tint && "inner" != this.options.zoomType && this.setTintPosition(b), "window" == this.options.zoomType && this.setWindowPostition(b), "inner" == this.options.zoomType && this.setWindowPostition(b), this.options.showLens && (this.fullwidth && "lens" != this.options.zoomType && (this.lensLeftPos = 0), this.zoomLens.css({ left: this.lensLeftPos + "px", top: this.lensTopPos + "px" }))) }, showHideWindow: function(b) { "show" != b || this.isWindowActive || (this.options.zoomWindowFadeIn ? this.zoomWindow.stop(!0, !0, !1).fadeIn(this.options.zoomWindowFadeIn) : this.zoomWindow.show(), this.isWindowActive = !0); "hide" == b && this.isWindowActive && (this.options.zoomWindowFadeOut ? this.zoomWindow.stop(!0, !0).fadeOut(this.options.zoomWindowFadeOut) : this.zoomWindow.hide(), this.isWindowActive = !1) }, showHideLens: function(b) { "show" != b || this.isLensActive || (this.options.lensFadeIn ? this.zoomLens.stop(!0, !0, !1).fadeIn(this.options.lensFadeIn) : this.zoomLens.show(), this.isLensActive = !0); "hide" == b && this.isLensActive && (this.options.lensFadeOut ? this.zoomLens.stop(!0, !0).fadeOut(this.options.lensFadeOut) : this.zoomLens.hide(), this.isLensActive = !1) }, showHideTint: function(b) { "show" != b || this.isTintActive || (this.options.zoomTintFadeIn ? this.zoomTint.css({ opacity: this.options.tintOpacity }).animate().stop(!0, !0).fadeIn("slow") : (this.zoomTint.css({ opacity: this.options.tintOpacity }).animate(), this.zoomTint.show()), this.isTintActive = !0); "hide" == b && this.isTintActive && (this.options.zoomTintFadeOut ? this.zoomTint.stop(!0, !0).fadeOut(this.options.zoomTintFadeOut) : this.zoomTint.hide(), this.isTintActive = !1) }, setLensPostition: function(b) {}, setWindowPostition: function(b) { var a = this; if (isNaN(a.options.zoomWindowPosition)) a.externalContainer = d("#" + a.options.zoomWindowPosition), a.externalContainerWidth = a.externalContainer.width(), a.externalContainerHeight = a.externalContainer.height(), a.externalContainerOffset = a.externalContainer.offset(), a.windowOffsetTop = a.externalContainerOffset.top, a.windowOffsetLeft = a.externalContainerOffset.left; else switch (a.options.zoomWindowPosition) { case 1: a.windowOffsetTop = a.options.zoomWindowOffety; a.windowOffsetLeft = +a.nzWidth; break; case 2: a.options.zoomWindowHeight > a.nzHeight && (a.windowOffsetTop = -1 * (a.options.zoomWindowHeight / 2 - a.nzHeight / 2), a.windowOffsetLeft = a.nzWidth); break; case 3: a.windowOffsetTop = a.nzHeight - a.zoomWindow.height() - 2 * a.options.borderSize; a.windowOffsetLeft = a.nzWidth; break; case 4: a.windowOffsetTop = a.nzHeight; a.windowOffsetLeft = a.nzWidth; break; case 5: a.windowOffsetTop = a.nzHeight; a.windowOffsetLeft = a.nzWidth - a.zoomWindow.width() - 2 * a.options.borderSize; break; case 6: a.options.zoomWindowHeight > a.nzHeight && (a.windowOffsetTop = a.nzHeight, a.windowOffsetLeft = -1 * (a.options.zoomWindowWidth / 2 - a.nzWidth / 2 + 2 * a.options.borderSize)); break; case 7: a.windowOffsetTop = a.nzHeight; a.windowOffsetLeft = 0; break; case 8: a.windowOffsetTop = a.nzHeight; a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); break; case 9: a.windowOffsetTop = a.nzHeight - a.zoomWindow.height() - 2 * a.options.borderSize; a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); break; case 10: a.options.zoomWindowHeight > a.nzHeight && (a.windowOffsetTop = -1 * (a.options.zoomWindowHeight / 2 - a.nzHeight / 2), a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize)); break; case 11: a.windowOffsetTop = a.options.zoomWindowOffety; a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); break; case 12: a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); break; case 13: a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); a.windowOffsetLeft = 0; break; case 14: a.options.zoomWindowHeight > a.nzHeight && (a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize), a.windowOffsetLeft = -1 * (a.options.zoomWindowWidth / 2 - a.nzWidth / 2 + 2 * a.options.borderSize)); break; case 15: a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); a.windowOffsetLeft = a.nzWidth - a.zoomWindow.width() - 2 * a.options.borderSize; break; case 16: a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); a.windowOffsetLeft = a.nzWidth; break; default: a.windowOffsetTop = a.options.zoomWindowOffety, a.windowOffsetLeft = a.nzWidth } a.isWindowSet = !0; a.windowOffsetTop += a.options.zoomWindowOffety; a.windowOffsetLeft += a.options.zoomWindowOffetx; a.zoomWindow.css({ top: a.windowOffsetTop }); a.zoomWindow.css({ left: a.windowOffsetLeft }); "inner" == a.options.zoomType && (a.zoomWindow.css({ top: 0 }), a.zoomWindow.css({ left: 0 })); a.windowLeftPos = String(-1 * ((b.pageX - a.nzOffset.left) * a.widthRatio - a.zoomWindow.width() / 2)); a.windowTopPos = String(-1 * ((b.pageY - a.nzOffset.top) * a.heightRatio - a.zoomWindow.height() / 2)); a.Etoppos && (a.windowTopPos = 0); a.Eloppos && (a.windowLeftPos = 0); a.Eboppos && (a.windowTopPos = -1 * (a.largeHeight / a.currentZoomLevel - a.zoomWindow.height())); a.Eroppos && (a.windowLeftPos = -1 * (a.largeWidth / a.currentZoomLevel - a.zoomWindow.width())); a.fullheight && (a.windowTopPos = 0); a.fullwidth && (a.windowLeftPos = 0); if ("window" == a.options.zoomType || "inner" == a.options.zoomType) 1 == a.zoomLock && (1 >= a.widthRatio && (a.windowLeftPos = 0), 1 >= a.heightRatio && (a.windowTopPos = 0)), a.largeHeight < a.options.zoomWindowHeight && (a.windowTopPos = 0), a.largeWidth < a.options.zoomWindowWidth && (a.windowLeftPos = 0), a.options.easing ? (a.xp || (a.xp = 0), a.yp || (a.yp = 0), a.loop || (a.loop = setInterval(function() { a.xp += (a.windowLeftPos - a.xp) / a.options.easingAmount; a.yp += (a.windowTopPos - a.yp) / a.options.easingAmount; a.scrollingLock ? (clearInterval(a.loop), a.xp = a.windowLeftPos, a.yp = a.windowTopPos, a.xp = -1 * ((b.pageX - a.nzOffset.left) * a.widthRatio - a.zoomWindow.width() / 2), a.yp = -1 * ((b.pageY - a.nzOffset.top) * a.heightRatio - a.zoomWindow.height() / 2), a.changeBgSize && (a.nzHeight > a.nzWidth ? ("lens" == a.options.zoomType && a.zoomLens.css({ "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" }), a.zoomWindow.css({ "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" })) : ("lens" != a.options.zoomType && a.zoomLens.css({ "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvalueheight + "px" }), a.zoomWindow.css({ "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" })), a.changeBgSize = !1), a.zoomWindow.css({ backgroundPosition: a.windowLeftPos + "px " + a.windowTopPos + "px" }), a.scrollingLock = !1, a.loop = !1) : (a.changeBgSize && (a.nzHeight > a.nzWidth ? ("lens" == a.options.zoomType && a.zoomLens.css({ "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" }), a.zoomWindow.css({ "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" })) : ("lens" != a.options.zoomType && a.zoomLens.css({ "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" }), a.zoomWindow.css({ "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" })), a.changeBgSize = !1), a.zoomWindow.css({ backgroundPosition: a.xp + "px " + a.yp + "px" })) }, 16))) : (a.changeBgSize && (a.nzHeight > a.nzWidth ? ("lens" == a.options.zoomType && a.zoomLens.css({ "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" }), a.zoomWindow.css({ "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" })) : ("lens" == a.options.zoomType && a.zoomLens.css({ "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" }), a.largeHeight / a.newvaluewidth < a.options.zoomWindowHeight ? a.zoomWindow.css({ "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" }) : a.zoomWindow.css({ "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" })), a.changeBgSize = !1), a.zoomWindow.css({ backgroundPosition: a.windowLeftPos + "px " + a.windowTopPos + "px" })) }, setTintPosition: function(b) { this.nzOffset = this.$elem.offset(); this.tintpos = String(-1 * (b.pageX - this.nzOffset.left - this.zoomLens.width() / 2)); this.tintposy = String(-1 * (b.pageY - this.nzOffset.top - this.zoomLens.height() / 2)); this.Etoppos && (this.tintposy = 0); this.Eloppos && (this.tintpos = 0); this.Eboppos && (this.tintposy = -1 * (this.nzHeight - this.zoomLens.height() - 2 * this.options.lensBorderSize)); this.Eroppos && (this.tintpos = -1 * (this.nzWidth - this.zoomLens.width() - 2 * this.options.lensBorderSize)); this.options.tint && (this.fullheight && (this.tintposy = 0), this.fullwidth && (this.tintpos = 0), this.zoomTintImage.css({ left: this.tintpos + "px" }), this.zoomTintImage.css({ top: this.tintposy + "px" })) }, swaptheimage: function(b, a) { var c = this, e = new Image; c.options.loadingIcon && (c.spinner = d("
    '), c.$elem.after(c.spinner)); c.options.onImageSwap(c.$elem); e.onload = function() { c.largeWidth = e.width; c.largeHeight = e.height; c.zoomImage = a; c.zoomWindow.css({ "background-size": c.largeWidth + "px " + c.largeHeight + "px" }); c.zoomWindow.css({ "background-size": c.largeWidth + "px " + c.largeHeight + "px" }); c.swapAction(b, a) }; e.src = a }, swapAction: function(b, a) { var c = this, e = new Image; e.onload = function() { c.nzHeight = e.height; c.nzWidth = e.width; c.options.onImageSwapComplete(c.$elem); c.doneCallback() }; e.src = b; c.currentZoomLevel = c.options.zoomLevel; c.options.maxZoomLevel = !1; "lens" == c.options.zoomType && c.zoomLens.css({ backgroundImage: "url('" + a + "')" }); "window" == c.options.zoomType && c.zoomWindow.css({ backgroundImage: "url('" + a + "')" }); "inner" == c.options.zoomType && c.zoomWindow.css({ backgroundImage: "url('" + a + "')" }); c.currentImage = a; if (c.options.imageCrossfade) { var f = c.$elem, g = f.clone(); c.$elem.attr("src", b); c.$elem.after(g); g.stop(!0).fadeOut(c.options.imageCrossfade, function() { d(this).remove() }); c.$elem.width("auto").removeAttr("width"); c.$elem.height("auto").removeAttr("height"); f.fadeIn(c.options.imageCrossfade); c.options.tint && "inner" != c.options.zoomType && (f = c.zoomTintImage, g = f.clone(), c.zoomTintImage.attr("src", a), c.zoomTintImage.after(g), g.stop(!0).fadeOut(c.options.imageCrossfade, function() { d(this).remove() }), f.fadeIn(c.options.imageCrossfade), c.zoomTint.css({ height: c.$elem.height() }), c.zoomTint.css({ width: c.$elem.width() })); c.zoomContainer.css("height", c.$elem.height()); c.zoomContainer.css("width", c.$elem.width()); "inner" != c.options.zoomType || c.options.constrainType || (c.zoomWrap.parent().css("height", c.$elem.height()), c.zoomWrap.parent().css("width", c.$elem.width()), c.zoomWindow.css("height", c.$elem.height()), c.zoomWindow.css("width", c.$elem.width())) } else c.$elem.attr("src", b), c.options.tint && (c.zoomTintImage.attr("src", a), c.zoomTintImage.attr("height", c.$elem.height()), c.zoomTintImage.css({ height: c.$elem.height() }), c.zoomTint.css({ height: c.$elem.height() })), c.zoomContainer.css("height", c.$elem.height()), c.zoomContainer.css("width", c.$elem.width()); c.options.imageCrossfade && (c.zoomWrap.css("height", c.$elem.height()), c.zoomWrap.css("width", c.$elem.width())); c.options.constrainType && ("height" == c.options.constrainType && (c.zoomContainer.css("height", c.options.constrainSize), c.zoomContainer.css("width", "auto"), c.options.imageCrossfade ? (c.zoomWrap.css("height", c.options.constrainSize), c.zoomWrap.css("width", "auto"), c.constwidth = c.zoomWrap.width()) : (c.$elem.css("height", c.options.constrainSize), c.$elem.css("width", "auto"), c.constwidth = c.$elem.width()), "inner" == c.options.zoomType && (c.zoomWrap.parent().css("height", c.options.constrainSize), c.zoomWrap.parent().css("width", c.constwidth), c.zoomWindow.css("height", c.options.constrainSize), c.zoomWindow.css("width", c.constwidth)), c.options.tint && (c.tintContainer.css("height", c.options.constrainSize), c.tintContainer.css("width", c.constwidth), c.zoomTint.css("height", c.options.constrainSize), c.zoomTint.css("width", c.constwidth), c.zoomTintImage.css("height", c.options.constrainSize), c.zoomTintImage.css("width", c.constwidth))), "width" == c.options.constrainType && (c.zoomContainer.css("height", "auto"), c.zoomContainer.css("width", c.options.constrainSize), c.options.imageCrossfade ? (c.zoomWrap.css("height", "auto"), c.zoomWrap.css("width", c.options.constrainSize), c.constheight = c.zoomWrap.height()) : (c.$elem.css("height", "auto"), c.$elem.css("width", c.options.constrainSize), c.constheight = c.$elem.height()), "inner" == c.options.zoomType && (c.zoomWrap.parent().css("height", c.constheight), c.zoomWrap.parent().css("width", c.options.constrainSize), c.zoomWindow.css("height", c.constheight), c.zoomWindow.css("width", c.options.constrainSize)), c.options.tint && (c.tintContainer.css("height", c.constheight), c.tintContainer.css("width", c.options.constrainSize), c.zoomTint.css("height", c.constheight), c.zoomTint.css("width", c.options.constrainSize), c.zoomTintImage.css("height", c.constheight), c.zoomTintImage.css("width", c.options.constrainSize)))) }, doneCallback: function() { this.options.loadingIcon && this.spinner.hide(); this.nzOffset = this.$elem.offset(); this.nzWidth = this.$elem.width(); this.nzHeight = this.$elem.height(); this.currentZoomLevel = this.options.zoomLevel; this.widthRatio = this.largeWidth / this.nzWidth; this.heightRatio = this.largeHeight / this.nzHeight; "window" == this.options.zoomType && (lensHeight = this.nzHeight < this.options.zoomWindowWidth / this.widthRatio ? this.nzHeight : String(this.options.zoomWindowHeight / this.heightRatio), lensWidth = this.options.zoomWindowWidth < this.options.zoomWindowWidth ? this.nzWidth : this.options.zoomWindowWidth / this.widthRatio, this.zoomLens && (this.zoomLens.css("width", lensWidth), this.zoomLens.css("height", lensHeight))) }, getCurrentImage: function() { return this.zoomImage }, getGalleryList: function() { var b = this; b.gallerylist = []; b.options.gallery && 1==2 ? d("#" + b.options.gallery + " a").each(function() { var a = ""; d(this).data("zoom-image") ? a = d(this).data("zoom-image") : d(this).data("image") && (a = d(this).data("image")); a == b.zoomImage ? b.gallerylist.unshift({ href: "" + a + "", title: d(this).find("img").attr("title"), type: 'image' }) : b.gallerylist.push({ href: "" + a + "", title: d(this).find("img").attr("title"), type: 'image' }) }) : b.gallerylist.push({ href: "" + b.zoomImage + "", title: d(this).find("img").attr("title"), type: 'image' }); return b.gallerylist }, changeZoomLevel: function(b) { this.scrollingLock = !0; this.newvalue = parseFloat(b).toFixed(2); newvalue = parseFloat(b).toFixed(2); maxheightnewvalue = this.largeHeight / (this.options.zoomWindowHeight / this.nzHeight * this.nzHeight); maxwidthtnewvalue = this.largeWidth / (this.options.zoomWindowWidth / this.nzWidth * this.nzWidth); "inner" != this.options.zoomType && (maxheightnewvalue <= newvalue ? (this.heightRatio = this.largeHeight / maxheightnewvalue / this.nzHeight, this.newvalueheight = maxheightnewvalue, this.fullheight = !0) : (this.heightRatio = this.largeHeight / newvalue / this.nzHeight, this.newvalueheight = newvalue, this.fullheight = !1), maxwidthtnewvalue <= newvalue ? (this.widthRatio = this.largeWidth / maxwidthtnewvalue / this.nzWidth, this.newvaluewidth = maxwidthtnewvalue, this.fullwidth = !0) : (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = newvalue, this.fullwidth = !1), "lens" == this.options.zoomType && (maxheightnewvalue <= newvalue ? (this.fullwidth = !0, this.newvaluewidth = maxheightnewvalue) : (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = newvalue, this.fullwidth = !1))); "inner" == this.options.zoomType && (maxheightnewvalue = parseFloat(this.largeHeight / this.nzHeight).toFixed(2), maxwidthtnewvalue = parseFloat(this.largeWidth / this.nzWidth).toFixed(2), newvalue > maxheightnewvalue && (newvalue = maxheightnewvalue), newvalue > maxwidthtnewvalue && (newvalue = maxwidthtnewvalue), maxheightnewvalue <= newvalue ? (this.heightRatio = this.largeHeight / newvalue / this.nzHeight, this.newvalueheight = newvalue > maxheightnewvalue ? maxheightnewvalue : newvalue, this.fullheight = !0) : (this.heightRatio = this.largeHeight / newvalue / this.nzHeight, this.newvalueheight = newvalue > maxheightnewvalue ? maxheightnewvalue : newvalue, this.fullheight = !1), maxwidthtnewvalue <= newvalue ? (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = newvalue > maxwidthtnewvalue ? maxwidthtnewvalue : newvalue, this.fullwidth = !0) : (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = newvalue, this.fullwidth = !1)); scrcontinue = !1; "inner" == this.options.zoomType && (this.nzWidth > this.nzHeight && (this.newvaluewidth <= maxwidthtnewvalue ? scrcontinue = !0 : (scrcontinue = !1, this.fullwidth = this.fullheight = !0)), this.nzHeight > this.nzWidth && (this.newvaluewidth <= maxwidthtnewvalue ? scrcontinue = !0 : (scrcontinue = !1, this.fullwidth = this.fullheight = !0))); "inner" != this.options.zoomType && (scrcontinue = !0); scrcontinue && (this.zoomLock = 0, this.changeZoom = !0, this.options.zoomWindowHeight / this.heightRatio <= this.nzHeight && (this.currentZoomLevel = this.newvalueheight, "lens" != this.options.zoomType && "inner" != this.options.zoomType && (this.changeBgSize = !0, this.zoomLens.css({ height: String(this.options.zoomWindowHeight / this.heightRatio) + "px" })), "lens" == this.options.zoomType || "inner" == this.options.zoomType) && (this.changeBgSize = !0), this.options.zoomWindowWidth / this.widthRatio <= this.nzWidth && ("inner" != this.options.zoomType && this.newvaluewidth > this.newvalueheight && (this.currentZoomLevel = this.newvaluewidth), "lens" != this.options.zoomType && "inner" != this.options.zoomType && (this.changeBgSize = !0, this.zoomLens.css({ width: String(this.options.zoomWindowWidth / this.widthRatio) + "px" })), "lens" == this.options.zoomType || "inner" == this.options.zoomType) && (this.changeBgSize = !0), "inner" == this.options.zoomType && (this.changeBgSize = !0, this.nzWidth > this.nzHeight && (this.currentZoomLevel = this.newvaluewidth), this.nzHeight > this.nzWidth && (this.currentZoomLevel = this.newvaluewidth))); this.setPosition(this.currentLoc) }, closeAll: function() { self.zoomWindow && self.zoomWindow.hide(); self.zoomLens && self.zoomLens.hide(); self.zoomTint && self.zoomTint.hide() }, changeState: function(b) { "enable" == b && (this.options.zoomEnabled = !0); "disable" == b && (this.options.zoomEnabled = !1) } }; d.fn.elevateZoom = function(b) { return this.each(function() { var a = Object.create(k); a.init(b, this); d.data(this, "elevateZoom", a) }) }; d.fn.elevateZoom.options = { zoomActivation: "hover", zoomEnabled: !0, preloading: 1, zoomLevel: 1, scrollZoom: !1, scrollZoomIncrement: 0.1, minZoomLevel: !1, maxZoomLevel: !1, easing: !1, easingAmount: 12, lensSize: 200, zoomWindowWidth: 400, zoomWindowHeight: 400, zoomWindowOffetx: 0, zoomWindowOffety: 0, zoomWindowPosition: 1, zoomWindowBgColour: "#fff", lensFadeIn: !1, lensFadeOut: !1, debug: !1, zoomWindowFadeIn: !1, zoomWindowFadeOut: !1, zoomWindowAlwaysShow: !1, zoomTintFadeIn: !1, zoomTintFadeOut: !1, borderSize: 4, showLens: !0, borderColour: "#888", lensBorderSize: 1, lensBorderColour: "#000", lensShape: "square", zoomType: "window", containLensZoom: !1, lensColour: "white", lensOpacity: 0.4, lenszoom: !1, tint: !1, tintColour: "#333", tintOpacity: 0.4, gallery: !1, galleryActiveClass: "zoomGalleryActive", imageCrossfade: !1, constrainType: !1, constrainSize: !1, loadingIcon: !1, cursor: "default", responsive: !0, onComplete: d.noop, onZoomedImageLoaded: function() {}, onImageSwap: d.noop, onImageSwapComplete: d.noop } })(jQuery, window, document);/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d= a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")), b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(), y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement; if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0, {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1, mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio= !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href"); "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload= this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href); f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload, e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin, outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}", g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll": "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside? h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth|| h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),cz||y>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&jz||y>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j
    ').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive? b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth), p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"=== f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d= b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d, e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('
    ').appendTo("body");var e=20=== d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery);var matched, browser; jQuery.uaMatch = function( ua ) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || /(webkit)[ \/]([\w.]+)/.exec( ua ) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || /(msie) ([\w.]+)/.exec( ua ) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || []; return { browser: match[ 1 ] || "", version: match[ 2 ] || "0" }; }; matched = jQuery.uaMatch( navigator.userAgent ); browser = {}; if ( matched.browser ) { browser[ matched.browser ] = true; browser.version = matched.version; } // Chrome is Webkit, but Webkit is also Safari. if ( browser.chrome ) { browser.webkit = true; } else if ( browser.webkit ) { browser.safari = true; } jQuery.browser = browser; ; (function ($) { $.fn.extend({ autocomplete: function (b, d) { var c = typeof b == "string"; d = $.extend({}, $.Autocompleter.defaults, { url: c ? b: null, data: c ? null: b, delay: c ? $.Autocompleter.defaults.delay: 10, max: d && !d.scroll ? 10 : 150 }, d); d.highlight = d.highlight || function (a) { return a }; d.formatMatch = d.formatMatch || d.formatItem; return this.each(function () { new $.Autocompleter(this, d) }) }, result: function (a) { return this.bind("result", a) }, search: function (a) { return this.trigger("search", [a]) }, flushCache: function () { return this.trigger("flushCache") }, setOptions: function (a) { return this.trigger("setOptions", [a]) }, unautocomplete: function () { return this.trigger("unautocomplete") } }); $.Autocompleter = function (o, r) { var t = { UP: 38, DOWN: 40, DEL: 46, TAB: 9, RETURN: 13, ESC: 27, COMMA: 188, PAGEUP: 33, PAGEDOWN: 34, BACKSPACE: 8 }; var u = $(o).attr("autocomplete", "off").addClass(r.inputClass); var p; var m = ""; var n = $.Autocompleter.Cache(r); var s = 0; var k; var h = { mouseDownOnSelect: false }; var l = $.Autocompleter.Select(r, o, selectCurrent, h); var j; $.browser.opera && $(o.form).bind("submit.autocomplete", function () { if (j) { j = false; return false } }); u.bind(($.browser.opera ? "keypress": "keydown") + ".autocomplete", function (a) { s = 1; k = a.keyCode; switch (a.keyCode) { case t.UP: a.preventDefault(); if (l.visible()) { l.prev() } else { onChange(0, true) } break; case t.DOWN: a.preventDefault(); if (l.visible()) { l.next() } else { onChange(0, true) } break; case t.PAGEUP: a.preventDefault(); if (l.visible()) { l.pageUp() } else { onChange(0, true) } break; case t.PAGEDOWN: a.preventDefault(); if (l.visible()) { l.pageDown() } else { onChange(0, true) } break; case r.multiple && $.trim(r.multipleSeparator) == "," && t.COMMA: case t.TAB: case t.RETURN: if (selectCurrent()) { a.preventDefault(); j = true; return false } break; case t.ESC: l.hide(); break; default: clearTimeout(p); p = setTimeout(onChange, r.delay); break } }).focus(function () { s++ }).blur(function () { s = 0; if (!h.mouseDownOnSelect) { hideResults() } }).click(function () { if (s++>1 && !l.visible()) { onChange(0, true) } }).bind("search", function () { var c = (arguments.length > 1) ? arguments[1] : null; function findValueCallback(q, a) { var b; if (a && a.length) { for (var i = 0; i < a.length; i++) { if (a[i].result.toLowerCase() == q.toLowerCase()) { b = a[i]; break } } } if (typeof c == "function") c(b); else u.trigger("result", b && [b.data, b.value]) } $.each(trimWords(u.val()), function (i, a) { request(a, findValueCallback, findValueCallback) }) }).bind("flushCache", function () { n.flush() }).bind("setOptions", function () { $.extend(r, arguments[1]); if ("data" in arguments[1]) n.populate() }).bind("unautocomplete", function () { l.unbind(); u.unbind(); $(o.form).unbind(".autocomplete") }); function selectCurrent() { var e = l.selected(); if (!e) return false; var v = e.result; m = v; if (r.multiple) { var b = trimWords(u.val()); if (b.length > 1) { var f = r.multipleSeparator.length; var c = $(o).selection().start; var d, progress = 0; $.each(b, function (i, a) { progress += a.length; if (c <= progress) { d = i; return false } progress += f }); b[d] = v; v = b.join(r.multipleSeparator) } v += r.multipleSeparator } u.val(v); hideResultsNow(); u.trigger("result", [e.data, e.value]); console.log(r.autoSubmit); if(r.autoSubmit) $(u).closest("form").submit(); return true } function onChange(b, c) { if (k == t.DEL) { l.hide(); return } var a = u.val(); if (!c && a == m) return; m = a; a = lastWord(a); if (a.length >= r.minChars) { u.addClass(r.loadingClass); if (!r.matchCase) a = a.toLowerCase(); request(a, receiveData, hideResultsNow) } else { stopLoading(); l.hide() } }; function trimWords(b) { if (!b) return [""]; if (!r.multiple) return [$.trim(b)]; return $.map(b.split(r.multipleSeparator), function (a) { return $.trim(b).length ? $.trim(a) : null }) } function lastWord(a) { if (!r.multiple) return a; var c = trimWords(a); if (c.length == 1) return c[0]; var b = $(o).selection().start; if (b == a.length) { c = trimWords(a) } else { c = trimWords(a.replace(a.substring(b), "")) } return c[c.length - 1] } function autoFill(q, a) { if (r.autoFill && (lastWord(u.val()).toLowerCase() == q.toLowerCase()) && k != t.BACKSPACE) { u.val(u.val() + a.substring(lastWord(m).length)); $(o).selection(m.length, m.length + a.length) } }; function hideResults() { clearTimeout(p); p = setTimeout(hideResultsNow, 200) }; function hideResultsNow() { var c = l.visible(); l.hide(); clearTimeout(p); stopLoading(); if (r.mustMatch) { u.search(function (a) { if (!a) { if (r.multiple) { var b = trimWords(u.val()).slice(0, -1); u.val(b.join(r.multipleSeparator) + (b.length ? r.multipleSeparator: "")) } else { u.val(""); u.trigger("result", null) } } }) } }; function receiveData(q, a) { if (a && a.length && s) { stopLoading(); l.display(a, q); autoFill(q, a[0].value); l.show() } else { hideResultsNow() } }; function request(f, d, g) { if (!r.matchCase) f = f.toLowerCase(); var e = n.load(f); if (e && e.length) { d(f, e) } else if ((typeof r.url == "string") && (r.url.length > 0)) { var c = { timestamp: +new Date() }; $.each(r.extraParams, function (a, b) { c[a] = typeof b == "function" ? b() : b }); $.ajax({ mode: "abort", port: "autocomplete" + o.name, dataType: r.dataType, url: r.url, data: $.extend({ q: lastWord(f), limit: r.max }, c), success: function (a) { var b = r.parse && r.parse(a) || parse(a); n.add(f, b); d(f, b) } }) } else { l.emptyList(); g(f) } }; function parse(c) { var d = []; var b = c.split("\n"); for (var i = 0; i < b.length; i++) { var a = $.trim(b[i]); if (a) { a = a.split("|"); d[d.length] = { data: a, value: a[0], result: r.formatResult && r.formatResult(a, a[0]) || a[0] } } } return d }; function stopLoading() { u.removeClass(r.loadingClass) } }; $.Autocompleter.defaults = { inputClass: "ac_input", resultsClass: "ac_results", loadingClass: "ac_loading", minChars: 1, delay: 400, matchCase: false, matchSubset: true, matchContains: false, cacheLength: 10, max: 100, mustMatch: false, extraParams: {}, selectFirst: true, autoSubmit: true, formatItem: function (a) { return a[0] }, formatMatch: null, autoFill: false, width: 0, multiple: false, multipleSeparator: ", ", highlight: function (b, a) { return b.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + a.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1") }, scroll: true, scrollHeight: 180 }; $.Autocompleter.Cache = function (g) { var h = {}; var j = 0; function matchSubset(s, a) { if (!g.matchCase) s = s.toLowerCase(); var i = s.indexOf(a); if (g.matchContains == "word") { i = s.toLowerCase().search("\\b" + a.toLowerCase()) } if (i == -1) return false; return i == 0 || g.matchContains }; function add(q, a) { if (j > g.cacheLength) { flush() } if (!h[q]) { j++ } h[q] = a } function populate() { if (!g.data) return false; var f = {}, nullData = 0; if (!g.url) g.cacheLength = 1; f[""] = []; for (var i = 0, ol = g.data.length; i < ol; i++) { var c = g.data[i]; c = (typeof c == "string") ? [c] : c; var d = g.formatMatch(c, i + 1, g.data.length); if (d === false) continue; var e = d.charAt(0).toLowerCase(); if (!f[e]) f[e] = []; var b = { value: d, data: c, result: g.formatResult && g.formatResult(c) || d }; f[e].push(b); if (nullData++ 0) { var c = h[k]; $.each(c, function (i, x) { if (matchSubset(x.value, q)) { a.push(x) } }) } } return a } else if (h[q]) { return h[q] } else if (g.matchSubset) { for (var i = q.length - 1; i >= g.minChars; i--) { var c = h[q.substr(0, i)]; if (c) { var a = []; $.each(c, function (i, x) { if (matchSubset(x.value, q)) { a[a.length] = x } }); return a } } } return null } } }; $.Autocompleter.Select = function (e, g, f, k) { var h = { ACTIVE: "ac_over" }; var j, active = -1, data, term = "", needsInit = true, element, list; function init() { if (!needsInit) return; element = $("
    ").hide().addClass(e.resultsClass).css("position", "absolute").appendTo(document.body); list = $("
      ").appendTo(element).mouseover(function (a) { if (target(a).nodeName && target(a).nodeName.toUpperCase() == 'LI') { active = $("li", list).removeClass(h.ACTIVE).index(target(a)); $(target(a)).addClass(h.ACTIVE) } }).click(function (a) { $(target(a)).addClass(h.ACTIVE); f(); g.focus(); return false }).mousedown(function () { k.mouseDownOnSelect = true }).mouseup(function () { k.mouseDownOnSelect = false }); if (e.width > 0) element.css("width", e.width); needsInit = false } function target(a) { var b = a.target; while (b && b.tagName != "LI") b = b.parentNode; if (!b) return []; return b } function moveSelect(b) { j.slice(active, active + 1).removeClass(h.ACTIVE); movePosition(b); var a = j.slice(active, active + 1).addClass(h.ACTIVE); if (e.scroll) { var c = 0; j.slice(0, active).each(function () { c += this.offsetHeight }); if ((c + a[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { list.scrollTop(c + a[0].offsetHeight - list.innerHeight()) } else if (c < list.scrollTop()) { list.scrollTop(c) } } }; function movePosition(a) { active += a; if (active < 0) { active = j.size() - 1 } else if (active >= j.size()) { active = 0 } } function limitNumberOfItems(a) { return e.max && e.max < a ? e.max: a } function fillList() { list.empty(); var b = limitNumberOfItems(data.length); for (var i = 0; i < b; i++) { if (!data[i]) continue; var a = e.formatItem(data[i].data, i + 1, b, data[i].value, term); if (a === false) continue; var c = $("
    • ").html(e.highlight(a, term)).addClass(i % 2 == 0 ? "ac_even": "ac_odd").appendTo(list)[0]; $.data(c, "ac_data", data[i]) } j = list.find("li"); if (e.selectFirst) { j.slice(0, 1).addClass(h.ACTIVE); active = 0 } if ($.fn.bgiframe) list.bgiframe() } return { display: function (d, q) { init(); data = d; term = q; fillList() }, next: function () { moveSelect(1) }, prev: function () { moveSelect( - 1) }, pageUp: function () { if (active != 0 && active - 8 < 0) { moveSelect( - active) } else { moveSelect( - 8) } }, pageDown: function () { if (active != j.size() - 1 && active + 8 > j.size()) { moveSelect(j.size() - 1 - active) } else { moveSelect(8) } }, hide: function () { element && element.hide(); j && j.removeClass(h.ACTIVE); active = -1 }, visible: function () { return element && element.is(":visible") }, current: function () { return this.visible() && (j.filter("." + h.ACTIVE)[0] || e.selectFirst && j[0]) }, show: function () { var a = $(g).offset(); element.css({ width: typeof e.width == "string" || e.width > 0 ? e.width: $(g).width(), top: a.top + g.offsetHeight, left: a.left }).show(); if (e.scroll) { list.scrollTop(0); list.css({ maxHeight: e.scrollHeight, overflow: 'auto' }); if ($.browser.msie && typeof document.body.style.maxHeight === "undefined") { var c = 0; j.each(function () { c += this.offsetHeight }); var b = c > e.scrollHeight; list.css('height', b ? e.scrollHeight: c); if (!b) { j.width(list.width() - parseInt(j.css("padding-left")) - parseInt(j.css("padding-right"))) } } } }, selected: function () { var a = j && j.filter("." + h.ACTIVE).removeClass(h.ACTIVE); return a && a.length && $.data(a[0], "ac_data") }, emptyList: function () { list && list.empty() }, unbind: function () { element && element.remove() } } }; $.fn.selection = function (b, f) { if (b !== undefined) { return this.each(function () { if (this.createTextRange) { var a = this.createTextRange(); if (f === undefined || b == f) { a.move("character", b); a.select() } else { a.collapse(true); a.moveStart("character", b); a.moveEnd("character", f); a.select() } } else if (this.setSelectionRange) { this.setSelectionRange(b, f) } else if (this.selectionStart) { this.selectionStart = b; this.selectionEnd = f } }) } var c = this[0]; if (c.createTextRange) { var e = document.selection.createRange(), orig = c.value, teststring = "<->", textLength = e.text.length; e.text = teststring; var d = c.value.indexOf(teststring); c.value = orig; this.selection(d, d + textLength); return { start: d, end: d + textLength } } else if (c.selectionStart !== undefined) { return { start: c.selectionStart, end: c.selectionEnd } } } })(jQuery);(function( $ ){ $.fn.reviewPassword = function( options ) { var settings = $.extend(true, { 'crackSpeed' : 200000000, 'tipSpace': 3, 'preventWeakSubmit': false, 'minValues': { 'size': 5, 'uniqueChars': 4, 'letters': 3, 'numbers': 1, 'specChars': 1, 'altCase': 0 } }, options); var internals = { tests : [ { "test": function ( str ) {return {'passed':str.length>=settings.minValues.size, 'found':false}; }, "error": "Your password is too short.", "details": "Use at least "+settings.minValues.size+" characters.", "type": "size", "size": 0 }, { "test": function ( str ) { var chars = new Object(); uniq = 0; for(x = 0; x < str.length; x++) { i = str.charAt(x); if (isNaN(chars[i])) { chars[i] =1 ; uniq++; } } return {'passed':uniq>=settings.minValues.uniqueChars, 'found':false}; }, "error": "The password is too uniform.", "details": "Use at least "+settings.minValues.uniqueChars+" unique characters.", "type": "uniqueChars", "size": 0 }, { "test": /[A-Za-z]/g, "error": "Add more alphabetic letters.", "details": "Use at least "+settings.minValues.letters+" letters.", "type": "letters", "size": 26 }, { "test": /\d/g, "error": "Add more numbers to strengthen your password.", "details": "For example: 'DuBEn748' instead of 'DuBEn'.", "type": "numbers", "size": 10 }, { "test": /[^A-Za-z0-9]/g, "error": "Add more special characters to strengthen your password.", "details": "For example: 'aLkyj%637*' instead of 'aLkyj637'.", "type": "specChars", "size":30 }, { "test": /[a-z][A-Z]|[A-Z][a-z]/g, "error": "Use alternating character case.", "details": "For example: 'TAmBoRin$31E' instead of 'tamborin$31e'.", "type": "altCase", "size": 26 } ], init: function ( options, passField ) { this.meta = this.buildPlugin(); this.passField = passField; passField.keyup($.proxy(this.review, this)); passField.focusin($.proxy(function (evt) {this.meta.plugin.fadeIn(100); this.passField.trigger('keyup');}, this)); passField.focusout($.proxy(function (evt) {this.meta.plugin.fadeOut(100)}, this)); if (settings.preventWeakSubmit) { passField.closest('form').submit($.proxy(function () { if (!this.data("reviewData").approved) { this.focus(); return false; } },this.passField)); } }, buildPlugin: function () { var meta = {"global":{} ,"level":{} , "stats":{}, "error": {}}; meta.plugin = $( '
      ', { 'class':'passTip', 'style':"display:none;"}); meta.plugin.append($('
      ', { 'class':'tri'})); var container = $('
      ', { 'class':'container round'}); container.append($('').html(lang_sifreGuvenligi + ":")); var qmeter = $('
      ', { 'class':'qmeter round'}); meta.level.bar = $('
      ', { 'class':'level round weak', style:'width:0%'}); meta.level.status = $('', {'class':'status'}).html("Weak"); qmeter.append(meta.level.bar).append(meta.level.status); container.append(qmeter); //container.append($('').html("Strength (entropy): ")); meta.stats.entropy = $('').html("0 bits."); //container.append(meta.stats.entropy); //container.append($('
      ')); //container.append($('').html("Bruteforce time: ")); meta.stats.bruteTime = $('').html(""); //container.append(meta.stats.bruteTime); var err = $('
      ', { 'class':'error round'}); meta.error.data = $(''); meta.error.details = $(''); err.append(meta.error.data).append($('
      ')).append(meta.error.details); //container.append(err); meta.plugin.append(container); $("body").append(meta.plugin); return meta; }, update: function () { var stat = this.meta.level.status; var bar = this.meta.level.bar; var entropy = this.data.entropy; this.meta.plugin.css({ "left": this.passField.offset().left+this.passField.width()+ settings.tipSpace, "top": this.passField.offset().top-27 }); this.meta.stats.entropy.html(this.data.entropy+(this.data.entropy==1? " bit." :" bits.")); this.meta.stats.bruteTime.html(this.data.bruteTime+"."); if (!this.data.ftest) this.meta.error.data.closest("div").hide(); else { this.meta.error.data.closest("div").show(); this.meta.error.data.html(this.data.ftest.error); this.meta.error.details.html(this.data.ftest.details); } q = this.data.quality*15 + this.data.entropy; q = q<200?q:200; combined = [ { "q": 50, "cls": "vweak", "caption": "1 / 5" }, { "q": 90, "cls": "weak", "caption": "2 / 5" }, { "q": 130, "cls": "good", "caption": "3 / 5" }, { "q": 160, "cls": "strong", "caption": "4 / 5" }, { "q": Infinity, "cls": "excellent", "caption": "5 / 5" }, ]; for (i=0; i<5; i++) { stage = combined[i]; if (q90, data: this.data }); } , humanTime: function ( seconds ) { return ''; var num = 0; unit = ""; if (seconds<1) { return "Less than a second"} else if (seconds<60) { num = Math.round (seconds); unit = " second"} else if (seconds<60*60) { num = Math.round (seconds / 60); unit = " minute"} else if (seconds<60*60*24) { num = Math.round (seconds / (60*60)); unit = " hour"} else if (seconds<60*60*24*30) { num = Math.round (seconds / (60*60*24)); unit = " day"} else if (seconds<60*60*24*30*12) { num = Math.round(seconds/(60*60*24*30)) ; unit = " month"} else if (seconds<60*60*24*30*12*1000) { num = Math.round(seconds/(60*60*24*30*12)) ; unit = " year"} else { return "More than a thousand years"} unit = num==1? unit: unit+"s"; return num + unit; }, review: function ( event ) { this.data = {ftest:false}; var password = this.passField.val(); var matchPat = function ( str, pat, count ) { var matches = str.match(pat); if (!isNaN(matches)) matches = []; if (matches.length>=count) return {'passed': true, 'found': matches.length>0}; else return {'passed': false}; } var symbPool = 0; $.each(this.tests, $.proxy(function ( c, v ) { var result = (typeof(v.test) == "function")? v.test(password) : matchPat(password, v.test, settings.minValues[v.type]); if (result.found) symbPool = symbPool + v.size; if (!result.passed) this.ftest = { error: v.error, details: v.details, type: v.type, num: c }; }, this.data)); var crackSeconds = Math.pow(symbPool,password.length) / (settings.crackSpeed*2); this.data.bruteTime = this.humanTime(crackSeconds); var entropy = Math.round(password.length* (Math.log(symbPool)/Math.log(2))); this.data.entropy = (isNaN(entropy) || entropy==-Infinity)? 0: entropy; this.data.quality = this.data.ftest? (this.tests.length-this.data.ftest.num-1): this.tests.length; this.update(); } }; internals.tests = internals.tests.reverse(); internals.init(settings, this); }; })( jQuery ); // jQuery Mask Plugin v1.14.15 // github.com/igorescobar/jQuery-Mask-Plugin var $jscomp={scope:{},findInternal:function(a,l,d){a instanceof String&&(a=String(a));for(var p=a.length,h=0;hd?g=10*e:f>=g&&f!==d?c.maskDigitPosMapOld[g]||(f=g,g=g-(l-h)-a,c.maskDigitPosMap[g]&&(g=f)):g>f&& (g=g+(h-l)+m)}return g},behaviour:function(f){f=f||window.event;c.invalid=[];var e=b.data("mask-keycode");if(-1===a.inArray(e,m.byPassKeys)){var e=c.getMasked(),g=c.getCaret();setTimeout(function(){c.setCaret(c.calculateCaretPosition())},a.jMaskGlobals.keyStrokeCompensation);c.val(e);c.setCaret(g);return c.callbacks(f)}},getMasked:function(a,b){var g=[],d=void 0===b?c.val():b+"",n=0,h=e.length,q=0,l=d.length,k=1,r="push",p=-1,t=0,y=[],v,z;f.reverse?(r="unshift",k=-1,v=0,n=h-1,q=l-1,z=function(){return-1< n&&-1 {}); if ( typeof jQuery.fn.live == "undefined" || !jQuery.isFunction(jQuery.fn.live) ) { jQuery.fn.extend({ live: function (event, callback) { if (this.selector) { jQuery(document).on(event, this.selector, callback); } }, }); } jQuery.fn.anchorAnimate = function (settings) { settings = jQuery.extend({ speed: 1000, }, settings ); return this.each(function () { var caller = this; $(caller).click(function (event) { event.preventDefault(); var locationHref = window.location.href; var elementClick = $(caller).attr("href"); var destination = $(elementClick).offset().top - 135; $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination, }, settings.speed, function () { //window.location.hash = elementClick } ); return false; }); }); }; function tabLoad(obj, filter, urunList, urunListShow) { if (!$(obj).find(".clear-space").length) { $(obj).html(ajaxLoaderDiv()); url = "include/ajaxLib.php?act=tabLoad&filter=" + filter + "&urunList=" + urunList + "&urunListShow=" + urunListShow + "&isAjax=1"; $.get(url, function (data) { $(obj).html(data + '
      '); $(".piyasa-indirim").each(function () { if ($(this).text() == "%" || !$(this).text()) $(this).remove(); }); }); } } function ajaxLoaderDiv() { return '
      '; } function sepetAdetGuncelle(lineID, adet) { //$('.basket-wrap:first').html(ajaxLoaderDiv()); url = "page.php?act=sepet&op=guncelle&lineID=" + lineID + "&adet=" + adet + "&viewPopup=1&isAjax=1"; $.get(url, function (data) { sepetHTMLGuncelle(data,true); }); } function sepetSecimGuncelle(paytype, taksit) { // return; // $('.basket-wrap:first').html(ajaxLoaderDiv()); url = "page.php?act=sepet&paytype=" + paytype + "&taksit=" + taksit + "&viewPopup=1&isAjax=1"; $.get(url, function (data) { sepetHTMLGuncelle(data); }); } function sepetSatirSil(lineID, urunID) { // $('.basket-wrap:first').html(ajaxLoaderDiv()); url = "page.php?act=sepet&op=sil&lineID=" + lineID + "&urunID=" + urunID + "&viewPopup=1&isAjax=1"; $.get(url, function (data) { sepetHTMLGuncelle(data,true); }); } function sepetBosalt(str) { Swal.fire({ text: str, icon: "warning", showCancelButton: true, confirmButtonText: lang_evet, cancelButtonText: lang_hayir, showCloseButton: true, }).then(function (result) { if (result.value) { url = "page.php?act=sepet&op=bosalt&viewPopup=1&isAjax=1"; $.get(url, function (data) { sepetHTMLGuncelle(data,true); }); } }); return false; } function sepetHTMLGuncelle(data,kargo = false) { $('.sepet-info').remove(); if (data != "") { updateSepetBilgi("#toplamFiyat,.toplamFiyat", "ModulFarkiIle"); updateSepetBilgi("#toplamKDVDahil,.toplamKDVDahil", "toplamKDVDahil"); updateSepetBilgi("#toplamUrun,.toplamUrun", "toplamUrun"); if ($(data).find(".basket-wrap").length > 0) $(".basket-wrap:first").html($(data).find(".basket-wrap:first").html()); var ul; if ($(data).find(".basket-wrap:first ul").length) ul = $(data).find(".basket-wrap:first ul").html(); $("#sepet-sub-info").html(ul); // if($('.shopphp-payment-body').length && !isMobile) { odemeSepetTasarimGuncelle(false); if(kargo) kargoListeGuncelle(); } reloadBasketDrawer(); } else { var url = "include/ajaxLib.php?act=sepetGoster"; $.get(url, function (data) { sepetHTMLGuncelle(data); if(kargo) kargoListeGuncelle(); }); } } function sepetAdresHTMLGuncelle() { var url = "page.php?act=satinal&op=adres"; $.get(url, function (data) { $(".basket-wrap").html($(data).find(".basket-wrap").html()); }); } function goUrun(urunID) { if (!urunID) return; url = "include/ajaxLib.php?act=getUrunLink&urunID=" + urunID; $.get(url, function (data) { window.location.href = data; }); } function goCat(catID) { if (!catID) return; url = "include/ajaxLib.php?act=getCategoryLink&catID=" + catID; $.get(url, function (data) { window.location.href = data; }); } function urunListAjax(id, catID, order, limit, urunlist, urunlistshow) { url = "include/ajaxLib.php?act=urunList&catID=" + catID + "&orderBy=" + encodeURIComponent(order) + "&limit=" + limit + "&urunlist=" + encodeURIComponent(urunlist) + "&urunlistshow=" + encodeURIComponent(urunlistshow); $.get(url, function (data) { $("#" + id).html(data); }); } function kategoriListAjax(id, parentID) { url = "include/ajaxLib.php?act=kategoriListOption&parentID=" + parentID; $.get(url, function (data) { $("#" + id).html(data); }); } function shopPHPPaymentStep2(formID) { if (typeof myShopPHPPaymentStep2 == "function") { return myShopPHPPaymentStep2(formID); } if ($("#adresID").length && !$("#adresID").val()) { myalert(lang_onceAdresSecim, "warning"); return; } if ($("#gf_kargoFirmaID").length && !$("#gf_kargoFirmaID").val()) { myalert(lang_onceKargoSecim, "warning"); return; } if ($("#gf_kargoFirmaID").length && !$("#kargoFirmaID").val()) { $("#kargoFirmaID").val($("#gf_kargoFirmaID").val()); } if ($(".kargo-liste").length && !$("#kargoFirmaID").val()) { myalert(lang_onceKargoSecim, "warning"); return; } $("#shopphp-payment-body-step3").html("").css("minHeight", "auto"); $("#shopphp-payment-body-step2").show().html(ajaxLoaderDiv()); if ($("#shopphp-payment-body-step2").length) $(window).scrollTop($("#shopphp-payment-body-step2").offset().top); $.ajax({ type: "POST", url: "page.php?act=satinal&op=adres&viewPopup=1&isAjax=1", data: $("#" + formID).serialize(), success: function (response) { window.location.href = "ac/satinal/secim"; return; if ($("#shopphp-payment-body-step2").length) $("#shopphp-payment-body-step1").hide("fast"); sepetAdresHTMLGuncelle(); $.get("ac/satinal/secim", function (data) { $(".shopphp-payment-body").html( $(data).find(".shopphp-payment-body").html() ); }); return; $.get("include/ajaxLib.php?act=siparisOdemeSecim", function (data) { if ($("#shopphp-payment-body-step2").length) $("#shopphp-payment-body-step2").html(data); else window.location.href = "ac/satinal/secim"; return; }); }, }); return false; } function shopPHPPaymentStep3(selectedPayType) { if (!$("#shopphp-payment-body-step3").length) { window.location.href = "page.php?act=satinal&op=odeme&paytype=" + encodeURIComponent(selectedPayType); return; } $("#shopphp-payment-body-step3").show().html(ajaxLoaderDiv()); $(window).scrollTop($("#shopphp-payment-body-step3").offset().top); $.ajax({ type: "GET", url: "page.php?act=satinal&op=odeme&paytype=" + encodeURIComponent(selectedPayType) + "&viewPopup=1&isAjax=1", success: function (response) { $("#shopphp-payment-body-step1").hide("fast"); $("#shopphp-payment-body-step2").hide("fast"); if ($(response).find("#shopphp-payment-body-step3").html() == null) { window.location.href = "page.php?act=satinal&op=odeme&paytype=" + encodeURIComponent(selectedPayType); return; } $("#shopphp-payment-body-step3").html( $(response).find("#shopphp-payment-body-step3").html() ); $("#shopphp-payment-body-step3").css("minHeight", "600px"); bindCCFunctions(); }, }); return false; } function liftOff() { window.location.reload(); } function urunAjax(urunID, loadID, listTemp, showTemp) { if (!listTemp) listTemp = "empty"; if (!$(".urun-ajax-" + urunID).length) return; $.get( "include/ajaxLib.php?act=tek-urun&purunID=" + urunID + "&urunID=" + loadID + "&list-temp=" + listTemp + "&show-temp=" + showTemp, function (data) { $(".urun-ajax-" + urunID).html($(data).html()); } ); } function urunFiyat(urunID, obj) { $.get("include/ajaxLib.php?act=urunFiyat&urunID=" + urunID, function (data) { $(obj).val(data); }); } function odemeKontrol(alt) { if ($("#odeme-onay").length && !$("#odeme-onay").is(":checked")) { myalert(alt, "warning"); return false; } return true; } function gfUrunFormSubmit(formID, urunID) { // var dataSerialize = $("#" + formID).serialize(); // $("#" + formID).html(ajaxLoaderDiv()); $.ajax({ type: "POST", processData: false, contentType: false, cache: false, url: "page.php?act=urunDetay&urunID=" + urunID + "&getOnlyResponse=1", data: new FormData($("#" + formID)[0]), success: function (response) { $("#" + formID).html(response); }, error: function (e) { $("#" + formID).html(e.responseText); }, }); return false; } function gfSiteFormSubmit(formID, act, data) { var dataSerialize = $("#" + formID).serialize(); $("#" + formID).html(ajaxLoaderDiv()); $.ajax({ type: "POST", url: "page.php?act=" + act + "&getOnlyResponse=1&data=" + data, data: dataSerialize, success: function (response) { $("#" + formID).html(response); }, }); return false; } function sepetEkleKontrol() { sepetEkleKontrolValue = true; if (typeof preSepetEkleKontrol == "function") { preSepetEkleKontrol(); } if (sepetEkleKontrolValue && typeof preSepetEkleKontrol2 == "function") { preSepetEkleKontrol2(); } updateSecimURL(); if ($("#urunKurallari").length) { if (!$("#urunKurallari").is(":checked")) { myalert(lang_onaySepet, "warning"); sepetEkleKontrolValue = false; } } for (var i = 1; i <= 10; i++) { if ( sepetEkleKontrolValue && $(".urunSecim_ozellik" + i + "detay li").length > 1 && !$(".urunSecim_ozellik" + i + "detay li.selected").length ) { myalert(lang_urunVarSecim, "warning"); sepetEkleKontrolValue = false; } } for (var i = 1; i <= 10; i++) { if ( sepetEkleKontrolValue && $("select[name=ozellik" + i + "detay] option").length > 1 && !$("select[name=ozellik" + i + "detay]").val() ) { myalert(lang_urunVarSecim, "warning"); sepetEkleKontrolValue = false; } } for (var i = 1; i <= 10; i++) { if ( sepetEkleKontrolValue && $("#urunSecim_ozellik" + i + "detay").length && !$("#urunSecim_ozellik" + i + "detay").val() ) { myalert(lang_urunVarSecim, "warning"); sepetEkleKontrolValue = false; } } return sepetEkleKontrolValue; } function urunTooltip(urunAdi, gosterim) { if (gosterim <= 1) return; var str = lang_urunDefaIncelendi; str = str.replace(/%gosterim%/i, gosterim).replace(/%urunadi%/i, urunAdi); $('
      ' + str + "
      ").appendTo("body"); $("#urunTooltip").fadeTo("fast", 0.7); setTimeout(function () { $("#urunTooltip").fadeTo("fast", 0, function () { $(this).remove(); }); }, 5000); } function ebultenSubmit(objid) { var email = $("#" + objid).val(); if (!Validate_Email_Address(email)) { myalert(lang_hataliEposta, "error"); return; } $.ajax({ url: "include/ajaxLib.php?act=ebulten&email=" + encodeURIComponent(email), success: function (data) { myalert(data, "success"); $("#" + objid).val(""); }, }); return false; } function getPaketAdet(val, plus) { val = parseInt(val); var r = 0; if(sepetCarpan === undefined) sepetCarpan = 1; if (!Array.isArray(adetArray)) return sepetCarpan; if (adetArray.length < 2) return sepetCarpan; var index = adetArray.indexOf(val); //if(index >= 0 && index < adetArray.length - 1) if (adetArray[index + plus]) r = adetArray[index + plus]; else return 0; return (r - val) * plus; } function azalt(input) { var eskiDeger = input.value; var adet = getPaketAdet(eskiDeger, -1); yeniDeger = parseInt(input.value) - adet; input.value = yeniDeger < adet ? eskiDeger : yeniDeger; return false; } function arttir(input) { var adet = getPaketAdet(input.value, 1); input.value = parseInt(input.value) + adet; return false; } function setImageMaxSideSize(selector, maxWidthSet, maxHeightSet) { $(selector).each(function () { var maxWidth = maxWidthSet; // Max width for the image var maxHeight = maxHeightSet; // Max height for the image var ratio = 0; // Used for aspect ratio var width = $(this).width(); // Current image width var height = $(this).height(); // Current image height // Check if the current width is larger than the max if (width > maxWidth) { ratio = maxWidth / width; // get ratio for scaling image $(this).css("width", maxWidth); // Set new width $(this).css("height", "auto"); // Scale height based on ratio height = height * ratio; // Reset height to match scaled image width = width * ratio; // Reset width to match scaled image } // Check if current height is larger than max if (height > maxHeight) { ratio = maxHeight / height; // get ratio for scaling image $(this).css("height", maxHeight); // Set new height $(this).css("width", "auto"); // Scale width based on ratio width = width * ratio; // Reset width to match scaled image height = height * ratio; // Reset height to match scaled image } }); } function ajaxKarsilastir() { $.ajax({ url: "include/ajaxLib.php?act=ajaxKarsilastir", success: function (data) { window.location.href = "page.php?act=karsilastir&" + data; // pencereAc('compare.php?' + data ,800,400); }, }); return false; } function karsilastirmaEkle(urunID) { $.ajax({ url: "include/ajaxLib.php?CookieInsertUrunID=" + encodeURIComponent(urunID), success: function (data) { $.ajax({ url: "include/ajaxLib.php?act=karsilastrimaListem", success: function (data) { $("#karsilastirmaListeBlock").html(data); myalert(lang_karsilastirmaEklendi, "success"); }, }); }, }); return false; } function karsilastirmaKaldir(urunID) { $.ajax({ url: "include/ajaxLib.php?CookieRemoveUrunID=" + encodeURIComponent(urunID), success: function (data) { $.ajax({ url: "include/ajaxLib.php?act=karsilastrimaListem", success: function (data) { $("#karsilastirmaListeBlock").html(data); myalert(lang_karsilastirmaKaldirildi, "success"); }, }); }, }); return false; } function alarmEkle(ftype, urunID) { $.ajax({ url: "include/ajaxLib.php?fa=true&ftype=" + encodeURIComponent(ftype) + "&urunID=" + encodeURIComponent(urunID), success: function (data) { myalert(data, "success"); }, }); return false; } function updateAnaResim(url, width) { return; } function uyelikIptal(str) { Swal.fire({ text: str, icon: "warning", showCancelButton: true, confirmButtonText: lang_evet, cancelButtonText: lang_hayir, showCloseButton: true, }).then(function (result) { if (result.value) { window.location.href = siteDizini + "page.php?act=logout&remove=true"; } }); } function updateOptionList(obj, stok) { if ($(obj) == null || stok == "") return; $(obj).find("option").remove(); var maxSatis = $(obj).parent().prop("max"); if (maxSatis) stok = Math.min(stok, maxSatis); stok = Math.min(stok, 100); for (var i = 0; i <= stok; i++) { if (i) $("").appendTo(obj); } } function moneyFormat3(num) { var p = num.toFixed(2).split("."); var out = "" + p[0] .split("") .reverse() .reduce(function (acc, num, i, orig) { return num + (i && !(i % 3) ? "," : "") + acc; }, "") + "." + p[1]; return out; } function updateShopPHPUrunFiyat(fark) { if (isNaN(fark)) fark = 0; $("#shopPHPUrunFiyatOrg").text(moneyFormat(shopPHPUrunFiyatOrg + fark)); $("#shopPHPUrunFiyatT").text( moneyFormat((shopPHPUrunFiyatOrg + fark) / shopPHPFiyatCarpanT) ); $("#shopPHPUrunFiyatOrg_KH").text( moneyFormat((shopPHPUrunFiyatOrg + fark) / (1 + shopPHPUrunKDV)) ); $("#shopPHPUrunFiyatYTL").text( moneyFormat((shopPHPUrunFiyatOrg + fark) * shopPHPFiyatCarpan) ); $("#shopPHPUrunFiyatYTL_KH").text( moneyFormat( ((shopPHPUrunFiyatOrg + fark) * shopPHPFiyatCarpan) / (1 + shopPHPUrunKDV) ) ); $("#shopPHPHavaleIndirim").text( moneyFormat( (shopPHPUrunFiyatOrg + fark) * shopPHPFiyatCarpan * (1 - shopPHPHavaleIndirim) ) ); $("#shopPHPTekCekimOran").text( moneyFormat( (shopPHPUrunFiyatOrg + fark) * shopPHPFiyatCarpan * (1 - shopPHPTekCekimOran) ) ); if (paytrURL) $("#paytr_taksit_guncelle").html( '
      ' ); } var shopPHPUrunFiyatOrg2 = 0; function updateUrunSecim(urunID, varID, varName, widthDetay, widthList, obj) { if (!shopPHPUrunFiyatOrg2) shopPHPUrunFiyatOrg2 = shopPHPUrunFiyatOrg; if ($(obj).hasClass("disabled")) { //myalert(lang_secimStokYok); return false; } // if (isMobile) $("html, body").animate({ scrollTop: 0 }, "slow"); $(obj).parent().find("li").removeClass("selected"); $(obj).addClass("selected"); $("input[name=" + varID + "]").val(varName); var varurl = ""; var url = ""; var currentID = parseInt(varID.replace("ozellik", "").replace("detay", "")); for (i = 1; i <= 10; i++) { if ($("input[name=ozellik" + i + "detay]").length) varurl += "&var" + i + "=" + encodeURIComponent($("input[name=ozellik" + i + "detay]").val()); if (i > currentID) { $("ul.urunSecim_ozellik" + i + "detay").css({'opacity':'0.4','pointer-events':'none'}); $("input[name=ozellik" + i + "detay]").val(""); } } if ($("input[name=ozellik" + (currentID + 1) + "detay]").length) { url = "include/ajaxLib.php?act=varListUpdate&seq=" + (currentID + 1) + "&urunID=" + urunID + varurl; $.get(url, function (data) { if (data) $( "ul.urunSecimID_" + urunID + ".urunSecim_ozellik" + (currentID + 1) + "detay" ).html(data).css({'opacity':'1','pointer-events':'auto'}) //$("ul.urunSecim_ozellik" + (currentID + 1) + "detay li:first").click(); }); } url = "include/ajaxLib.php?act=varKodKontrol&urunID=" + urunID + varurl; $.get(url, function (data) { if (data) $("#spUrunKodu").text(data); }); updateSecimURL(); updateVarResim(urunID, varID, varName); ajaxFiyatGuncelle(urunID); updateOptionList(".urunSepeteEkleAdet", $(obj).attr("stok")); return; } function updateVarResim(urunID, varID, varName) { // alert(urunID + '-' + varID + '-' + varName); var url = "include/ajaxLib.php?ajax=1&act=urunResimListContainer&urunID=" + encodeURIComponent(urunID); $.get(url, function (data) { // if(data) $("#urunResimListContainer").html(data); // alert(data); var widthDetay = 600; varID = varID.replace(/ozellik/i, "").replace(/detay/i, ""); var url = "include/ajaxLib.php?act=urunSecenekSecim&urunID=" + encodeURIComponent(urunID) + "&urunVarID=" + encodeURIComponent(varID) + "&urunVarName=" + encodeURIComponent(varName) + "&r=" + Math.floor(Math.random() * 99999); $(".lightbox .fancybox").attr("href", "include/resize.php?path=" + url); $.ajax({ url: url, success: function (data) { $("#loading").remove(); var obj = jQuery.parseJSON(data); if (!obj || obj.resim1 == null || !obj.resim1) return; $("#urunResimListContainer img").parent().parent().hide(); var url = ""; if (obj.resim1) { $("#urunResimListContainer img:eq(0)").parent().parent().show(); url = "images/urunler/" + obj.resim1; $(".lightbox:first").attr("href", url); $(".lightbox:first img") .attr( "src", url ) .attr("data-zoom-image", url); $("#urunResimListContainer img:first") .attr("src", "include/resize.php?path=" + url + "&width=300") .parent() .attr("data-zoom-image", url) .attr( "data-image", url ) .unbind("click"); } if (obj.resim2) { $("#urunResimListContainer img:eq(1)").parent().parent().show(); url = "images/urunler/" + obj.resim2; $("#urunResimListContainer img:eq(1)") .show() .attr("src", "include/resize.php?path=" + url + "&width=300") .parent() .attr("data-zoom-image", url) .attr( "data-image", url ) .unbind("click"); } else $("#urunResimListContainer img:eq(1)").parent().parent().hide(); if (obj.resim3) { $("#urunResimListContainer img:eq(2)").parent().parent().show(); url = "images/urunler/" + obj.resim3; $("#urunResimListContainer img:eq(2)") .show() .attr("src", "include/resize.php?path=" + url + "&width=300") .parent() .attr("data-zoom-image", url) .attr( "data-image", url ) .unbind("click"); } else $("#urunResimListContainer img:eq(2)").parent().parent().hide(); if (obj.resim4) { $("#urunResimListContainer img:eq(3)").parent().parent().show(); url = "images/urunler/" + obj.resim4; $("#urunResimListContainer img:eq(3)") .show() .attr("src", "include/resize.php?path=" + url + "&width=300") .parent() .attr("data-zoom-image", url) .attr( "data-image", url ) .unbind("click"); } else $("#urunResimListContainer img:eq(3)").parent().parent().hide(); if (obj.resim5) { $("#urunResimListContainer img:eq(4)").parent().parent().show(); url = "images/urunler/" + obj.resim5; $("#urunResimListContainer img:eq(4)") .show() .attr("src", "include/resize.php?path=" + url + "&width=300") .parent() .attr("data-zoom-image", url) .attr( "data-image", url ) .unbind("click"); } else $("#urunResimListContainer img:eq(4)").parent().parent().hide(); $("#urunResimListContainer img").bind("click", function (e) {}); galeri = []; var i = 0; $.each($("#urunResimListContainer a"), function () { galeri.push( $("#urunResimListContainer a").eq(i).attr("data-zoom-image") ), i++; }); galeri[0] = $(".lightbox a").eq(0).attr("href"); $(".zoomContainer").remove(); //if (!isMobile) { $(".lightbox img").unbind("click"); $(".lightbox img").removeData("elevateZoom"); $(".lightbox img").removeData("zoomImage"); $(".lightbox:first img").elevateZoom({ gallery: "urunResimListContainer", easing: true, }); $(".lightbox:first img").bind("click", function (e) { var ez = $(".lightbox:first img").data("elevateZoom"); $.fancybox(ez.getGalleryList()); return false; }); } }, }); }); } function updateAdetSecim(obj,urunID,adet) { $('.adetSecim li').removeClass('selected'); $(obj).addClass('selected'); $(".urunSepeteEkleAdet_" + urunID).val(adet); $(".urunSepeteEkleAdet").val(adet); ajaxFiyatGuncelle(urunID); } function sepeteOzellikEkleLink(urunID, obj) { for (var i = 1; i <= 10; i++) { if ($(".urunSecim_" + urunID + "_ozellik" + i + "detay").length) { var value = $( ".urunSecim_" + urunID + "_ozellik" + i + "detay li.selected" ).text(); if (!value) { return myalert(lang_secimiTamamlayin, "success"); } secimURL += "&ozellik" + i + "detay=" + encodeURIComponent(value); } } window.location.href = siteDizini + "page.php?act=sepet&op=ekle&adet=1" + secimURL + "&urunID=" + urunID; return false; } function listeIptal(str, url) { Swal.fire({ text: str, icon: "warning", showCancelButton: true, confirmButtonText: lang_evet, cancelButtonText: lang_hayir, showCloseButton: true, }).then(function (result) { if (result.value) { window.location.href = url; } }); return false; } function sepeteEklePrompt(str, urunID, obj, open, fname) { Swal.fire({ text: str, icon: "warning", showCancelButton: true, confirmButtonText: lang_evet, cancelButtonText: lang_hayir, showCloseButton: true, }).then(function (result) { if (result.value) { fname(urunID, obj, open); } }); return false; } function sepeteEkleLink(urunID, obj) { updateSecimAppendURL(urunID); if (sepetEkleKontrol()) { window.location.href = siteDizini + "page.php?act=sepet&op=ekle&adet=" + urunSepeteEkleAdet + secimURL + "&urunID=" + urunID; return false; } } function hemenAlLink(urunID, obj) { updateSecimAppendURL(urunID); if (sepetEkleKontrol()) { window.location.href = siteDizini + "page.php?act=sepet&op=ekle&adet=" + urunSepeteEkleAdet + secimURL + "&urunID=" + urunID + "&hemenal=true"; return false; } } function ajaxFiyatGuncelle(urunID) { updateSecimURL(); urunSepeteEkleAdet = $(".urunSepeteEkleAdet_" + urunID).val(); if (!urunSepeteEkleAdet) urunSepeteEkleAdet = $(".urunSepeteEkleAdet").val(); if (!urunSepeteEkleAdet) urunSepeteEkleAdet = 1; var url = "include/ajaxLib.php?ajax=1&act=sepetEkle&urunID=" + encodeURIComponent(urunID) + "&adet=" + encodeURIComponent(urunSepeteEkleAdet) + "&" + secimURL + "&showprice=true"; $.get(url, function (data) { var m = data.split("|"); m[0] = parseFloat(m[0]); m[1] = parseFloat(m[1]); if (!m[1]) return; if (isNaN(m[0])) return; if(shopPHPUrunFiyatYTL != moneyFormat(m[0])) $(".old-price,.discount").hide(); $("#shopPHPUrunFiyatOrg").text(moneyFormat(m[1])); $("#shopPHPUrunFiyatT").text(moneyFormat(m[1])); $("#shopPHPUrunFiyatOrg_KH").text(moneyFormat(m[1] / (1 + shopPHPUrunKDV))); $("#shopPHPUrunFiyatYTL").text(moneyFormat(m[0])); anaUrunFiyat = moneyFormat(m[0]); $.get( "include/ajaxLib.php?act=taksit&urunID=" + urunID + "&fiyat=" + m[0], function (data2) { $("#taksitGosterim").html(data2); } ); if (paytrURL) $("#paytr_taksit_guncelle").html( '
      ' ); $("#shopPHPUrunFiyatYTL_KH").text( moneyFormat((m[0] * 1) / (1 + shopPHPUrunKDV)) ); $("#shopPHPHavaleIndirim,.b-hi #shopPHPHavaleIndirim").text( moneyFormat(m[0] * 1 * (1 - shopPHPHavaleIndirim)) ); $("#shopPHPTekCekimOran").text( moneyFormat(m[0] * 1 * (1 - shopPHPTekCekimOran)) ); }); } var sepeteEkleSonUrunID = 0; function sepeteEkle(urunID, obj, hizliSepet) { if (typeof mySepeteEkle == "function") { return mySepeteEkle(urunID, obj); } sepetEkleKontrol(); updateSecimURL(urunID); urunSepeteEkleAdet = $(".urunSepeteEkleAdet_" + urunID).val(); if (!urunSepeteEkleAdet) urunSepeteEkleAdet = $(".urunSepeteEkleAdet").val(); if (!urunSepeteEkleAdet) urunSepeteEkleAdet = 1; if (sepetEkleKontrolValue) { var url = "include/ajaxLib.php?ajax=1&act=sepetEkle&urunID=" + encodeURIComponent(urunID) + "&adet=" + encodeURIComponent(urunSepeteEkleAdet) + "&" + secimURL; $.get(url, function (data) { /* if (data == "urun_link") window.location.href = siteDizini + "page.php?act=sepet&op=ekle&adet=" + urunSepeteEkleAdet + "&urunID=" + urunID; */ if (data == "urun_link") myalert(lang_urunVarSecim, "warning"); else if (data == "urun_var") myalert(lang_sepeteEklenmis, "warning"); else if (data == "urun_stok_yok") myalert(lang_stoktaOlmayanUrunuEkleyemezsiniz, "warning"); else { if (hizliSepet) { if ((sepeteEkleSonUrunID == urunID || !$(".drawer--is-visible").length) && $(".imgSepetGoster,#imgSepetGoster").length) document.querySelector(".imgSepetGoster,#imgSepetGoster").click(); else { window.top.document.querySelector(".imgSepetGoster,#imgSepetGoster").click(); } sepeteEkleSonUrunID = urunID; } else { Swal.fire({ text: lang_sepeteEklendi, type: "info", icon: "success", toast: true, button: lang_OK, showConfirmButton: true, showCancelButton: true, confirmButtonText: lang_alisveriseDevamEt, cancelButtonText: lang_sepetimeGit, }).then(function (result) { if (!result.value) { window.location.href = "ac/sepet"; } }); } sepetHTMLGuncelle(""); // document.querySelector(".imgSepetGoster,#imgSepetGoster").click(); $(".urunSecim li").removeClass("selected"); $( "#urunSecim_ozellik1detay,#urunSecim_ozellik2detay,#urunSecim_ozellik3detay" ).val(""); } secimURL = ""; $(".urunSepeteEkleAdet_" + urunID).val(1); $(".urunSepeteEkleAdet").val(1); urunSepeteEkleAdet = 1; }); } return false; } function updateSepetBilgi(selector, act) { if(!$(selector).length) return; var url = "include/ajaxLib.php?act=sepetBilgi&op=" + encodeURIComponent(act) + (act == "ModulFarkiIle" || act == "toplamKDVDahil" ? "&format=1" : ""); $.get(url, function (data) { $(selector).html(data); }); } function multiSepetEkle() { //$(obj).parent().html(lang_lutfenBekleyin); var url = "include/ajaxLib.php?act=sepetEkle&urunID=" + encodeURIComponent($("#relUrunID").val()) + "&adet=" + encodeURIComponent(urunSepeteEkleAdet) + "&ajax=1"; //window.open(url); $.get(url, function (data) { //alert(data); $("#sepetGoster").html(data); }); for (var i = 0; i <= 10; i++) { if ( $("#adet_" + i).val() && $("#adet_" + i).val() >= 1 && $("#adet_" + i).is(":checked") ) { var url = "include/ajaxLib.php?act=sepetEkle&urunID=" + encodeURIComponent($("#relUrunID").val()) + "&adet=" + $("#adet_" + i).val() + "&beraberUrunler=" + $("#adet_" + i).attr("urunID") + "&ekle_adet_" + $("#adet_" + i).attr("urunID") + "=" + $("#adet_" + i).val() + "&relUrunID=" + $("#relUrunID").val(); $.get(url, function (data) { //alert(url + ' : ' + data); $("#sepetGoster").html(data); }); } } setTimeout(function () { window.location.href = siteDizini + "page.php?act=sepet&x=1"; }, 2000); return false; } function ChangeUrl(url) { if (typeof (history.pushState) != "undefined") { var obj = { Url: url }; history.pushState(obj, obj.Title, obj.Url); history.replaceState(obj, obj.Title, obj.Url); } else { console.log("Browser does not support HTML5."); } } function changeSPSlide(obj, num, total) { num = Math.round(num % total); $(obj).find(".spSlide").hide("fast"); $(obj) .find(".spSlide:eq(" + num + ")") .fadeIn("slow"); setTimeout(function () { changeSPSlide(obj, num + 1, total); }, 5000); } function tckimlikkontorolu(KimlikNo) { KimlikNo = String(KimlikNo); if (!KimlikNo.match(/^[0-9]{11}$/)) return false; pr1 = parseInt(KimlikNo.substr(0, 1)); pr2 = parseInt(KimlikNo.substr(1, 1)); pr3 = parseInt(KimlikNo.substr(2, 1)); pr4 = parseInt(KimlikNo.substr(3, 1)); pr5 = parseInt(KimlikNo.substr(4, 1)); pr6 = parseInt(KimlikNo.substr(5, 1)); pr7 = parseInt(KimlikNo.substr(6, 1)); pr8 = parseInt(KimlikNo.substr(7, 1)); pr9 = parseInt(KimlikNo.substr(8, 1)); pr10 = parseInt(KimlikNo.substr(9, 1)); pr11 = parseInt(KimlikNo.substr(10, 1)); if ((pr1 + pr3 + pr5 + pr7 + pr9 + pr2 + pr4 + pr6 + pr8 + pr10) % 10 != pr11) return false; if ( ((pr1 + pr3 + pr5 + pr7 + pr9) * 7 + (pr2 + pr4 + pr6 + pr8) * 9) % 10 != pr10 ) return false; if (((pr1 + pr3 + pr5 + pr7 + pr9) * 8) % 10 != pr11) return false; return true; } function teklifFiyatGuncelle() { var ToplamKDVDahil = 0; var ToplamKDVHaric = 0; var KDVDahil = 0; var KDVHaric = 0; var KDV = 0; $("table.teklif tr.teklifSatir").each(function () { KDV = $(this).find(".kdv").text().replace(/\%/i, ""); KDVDahil = $(this).find(".adet").val() * $(this).find(".fiyat").val().replace(/,/i, ""); KDVHaric = KDVDahil / (1 + KDV / 100); ToplamKDVDahil += KDVDahil; ToplamKDVHaric += KDVHaric; $(this).find(".toplam").text(moneyFormat(KDVDahil)); }); $("#kdvdahil").html(moneyFormat(ToplamKDVDahil)); $("#kdvharic").html(moneyFormat(ToplamKDVHaric)); $("#toplamkdv").html(moneyFormat(ToplamKDVDahil - ToplamKDVHaric)); $("#toplamytl").html(moneyFormat(ToplamKDVDahil)); $("#dolar").html(moneyFormat(ToplamKDVDahil / dolar)); $("#euro").html(moneyFormat(ToplamKDVDahil / euro)); } function setSCity(city) { $.ajax({ url: "include/ajaxLib.php?act=setCitySession&city=" + city, type: "GET", success: function (data) { //alert(data); window.location.reload(); }, }); } function setSCountry(cnt) { $.ajax({ url: "include/ajaxLib.php?act=setCountrySession&cnt=" + cnt, type: "GET", success: function (data) { //alert(data); window.location.reload(); }, }); } function setFilterSession() { var seoURLAdd = ""; var queryFilter = ""; $("input.filterCheck:visible").each(function () { if ($(this).is(":checked")) { queryFilter += "queryFilter[]=" + $(this).attr("filterKey") + "::" + $(this).attr("filterValue") + "&"; if (seoURLAdd) seoURLAdd += "-"; seoURLAdd += $(this).attr("filterKey") + "_" + $(this).attr("filterValue"); } }); if ($("#fiyat_slider3").length) queryFilter += "queryFilter[]=" + $("#fiyat_slider3").attr("filterKey") + "::" + $("#fiyat_slider3").val().replace(";", " - ") + "&"; $.ajax({ url: "include/ajaxLib.php?act=setFilterSession", type: "POST", data: queryFilter, success: function (data) { //alert(data); data = decodeEntities(data); window.location.href = data; return; var url = window.location.href; url = url.replace(/page=[0-9]*/i, "page=1&"); url = url.replace(/-p.[0-9]*\-/i, "_filter__" + seoURLAdd + "-p1-"); // window.location.href = data; }, }); } function decodeEntities(html) { var txt = document.createElement("textarea"); txt.innerHTML = html; return txt.value; } var mouseX, mouseY; $(document) .mousemove(function (e) { mouseX = e.pageX; mouseY = e.pageY; }) .mouseover(); // call the handler immediately function bindCCFunctions() { $("input.cardno").bind("keydown", function (event) { if (event.keyCode == 32) { return false; } }); //$('input[name$="cardno"],input.cardno').keypad({keypadOnly:false}); $(".card-number").change(function () { if ($(this).hasClass("est-card-number")) return; if ($(this).val().length == 4) { $(this).next().focus(); } }); $(".card-number").keyup(function () { if ($(this).hasClass("est-card-number")) return; if ($(this).val().length == 4) { $(this).next().focus(); } }); $("span.button") .parents("form:first") .submit(function () { if (!stopSubmit) $(this).find("span.button").html(lang_lutfenBekleyin); }); } function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if (new Date().getTime() - start > milliseconds) { break; } } } function saveSiparisForm(formID, op) { if (!formID) return; $.ajax({ type: "POST", url: "page.php?isAjax=1&act=satinal&op=adres", data: $("#" + formID).serialize(), success: function (response) { $.ajax({ type: "GET", url: "page.php?act=onay&tp=" + op + "&viewPopup=1&r=" + Math.random(), success: function (response) { $(".fancybox-inner textarea").html( $(response).find("textarea").html() ); }, }); }, }); } function odemeSepetTasarimGuncelle(isFirst) { $('#basket-right-container input').css('opacity',1).css('pointer-events','auto'); $('#payment-loader-div').remove(); if(currentact != 'satinal') return; if (window.screen.width < 1000) return; if (isFirst) { $('.basket-wrap:first').addClass('basket-tek'); $('
      ').prependTo( $(".shopphp-payment-body").parent() ); $(".basket-right:first").appendTo($("#basket-right-container")); $("#gf_kargoFirmaID") .parent() .parent() .appendTo($("#basket-right-container .basket-right")); $("#gf_odemeTipi") .parent() .parent() .appendTo($("#basket-right-container .basket-right")); $(".formv2 .sf-neutral-button,.shopphp-payment-body .sf-neutral-button") .appendTo($("#basket-right-container")) .css({ width: "100%", }); $("#gf_acceptRulesCB_satinalKural") .parent() .parent() .parent() .appendTo($("#basket-right-container")); $( '' ).appendTo($(".shopphp-payment-body form:first")); $("#gf_kargoFirmaID").change(function () { $("#data_kargoFirmaID").val($(this).val()); }); $("#gf_odemeTipi").change(function () { $("#data_odemeTipi").val($(this).val()); }); } else { console.log("Sepet güncellendi."); $("#basket-right-container .basket-right ul:first").html( $(".basket-right:first").find("ul:first").html() ); $(".basket-wrap .basket-right").remove(); $(".basket-left:first").css("width", "100%"); } } function setPromotionCode() { var code = $('input.coupon-code').val(); if(!code) return; $('input.coupon-code').val(''); $.get('page.php?act=sepet&data_promotionCode=' + code + '&viewPopup=1&isAjax=1',function(data) { sepetHTMLGuncelle(data); }) return false; } function loadQuickSearch() { console.log('Here'); $("#search-container").remove(); $('
      ').appendTo( $(".detailSearchKey").parent() ); var position = $(".detailSearchKey").position(); $("#search-container").css("left", position.left); var swidth = ($(".detailSearchKey").width() + 50); if(swidth < 500) swidth = 500; if (isMobile) $("#search-container").css("width", "100%"); else $("#search-container").css("width", swidth + "px"); $("#search-container").css("top", 10 + $(".detailSearchKey").height() + "px"); $("#search-container").load( "include/mod_Search.php?s=" + encodeURIComponent($(".detailSearchKey").val()) ); } $(document).ready(function () { $("body").show(); $('#shopphp-login .menu_head').click(function () { window.location.href= $(this).find('a:first').attr('href'); }); $("div.sozlesme-items textarea").each(function () { $(this).height($(this)[0].scrollHeight + 50); }); if (window.screen.width < 1000) isMobile = true; $("#gf_email").keyup(function (e) { if (e.which === 32) return false; }); $("#gf_check_email").keyup(function (e) { if (e.which === 32) return false; }); $("#gf_ceptel,#gf_evtel,#gf_istel,.input-tel input,#q_gsm").mask( "(Z00) 000-0000", { translation: { Z: { pattern: /[1-8]/, optional: false, }, }, } ); $("#gf_ebulten,#ebultenSMS").val("1"); if ($(".basket-wrap").parent().width() < 1000) $(".basket-wrap").addClass("basket-tek"); $(".basket-wrap").css("visibility", "visible"); alerter = new Alerter(); $("input[name=odemeSelect]:checked").click(); $("#gf_odemeTipi").change(function () { sepetSecimGuncelle($(this).val(), 0); }); $(".karlastirma-liste-checkbox").click(function () { if ($(this).is(":checked")) karsilastirmaEkle($(this).attr("id").replace("k_", "")); else karsilastirmaKaldir($(this).attr("id").replace("k_", "")); }); $("#gf_ceptel_alanKodu,#gf_istel_alanKodu,#gf_evtel_alanKodu").keyup( function (e) { if ($(this).val().length == 4) $("#" + $(this).attr("id").replace("alanKodu", "tel")).focus(); } ); $('#gf_puan').barrating({ theme: 'css-stars' }); $(".register-tab label").click(function () { $(".register-tab label").removeClass("active"); $(this).addClass("active"); $(".bireysel,.kurumsal").hide(); var className = $(this).attr("id"); $("." + className).show().removeClass('d-none'); }); $("input[name=uye-tipi]:first").click(); $("#urunsirala input").click(function () { $("#urunsirala").submit(); }); $("a.viewStnOB").fancybox({ beforeLoad: function () { var formID = $("a.viewStnOB").parent().attr("formID"); saveSiparisForm(formID, "onsatis"); }, scrolling: "no", padding: 10, centerOnScroll: true, href: "page.php?act=onay&tp=onsatis&viewPopup=1&r=" + Math.random(), type: "ajax", onCleanup: function () { var myContent = this.href; $(myContent).unwrap(); }, }); $("a.uye-kural").click(function () { $.fancybox.open({ scrolling: "no", padding: 10, centerOnScroll: true, href: "page.php?act=onay&tp=uyekural&viewPopup=1&r=" + Math.random(), type: "ajax", }); }); $("a.uye-kvkk").click(function () { $.fancybox.open({ scrolling: "no", padding: 10, centerOnScroll: true, href: "page.php?act=onay&tp=kvkk&viewPopup=1&r=" + Math.random(), type: "ajax", }); }); $("a.viewStnKVKK").fancybox({ beforeLoad: function () { var formID = $("a.viewStnKVKK").parent().attr("formID"); saveSiparisForm(formID, "kvkk"); }, scrolling: "no", padding: 10, centerOnScroll: true, href: "page.php?act=onay&tp=kvkk&viewPopup=1&r=" + Math.random(), type: "ajax", onCleanup: function () { var myContent = this.href; $(myContent).unwrap(); }, }); $("a.viewStnSAK").fancybox({ beforeLoad: function () { var formID = $("a.viewStnSAK").parent().attr("formID"); saveSiparisForm(formID, "satinalma"); }, scrolling: "no", padding: 10, centerOnScroll: true, href: "page.php?act=onay&tp=satinalma&viewPopup=1&r=" + Math.random(), type: "ajax", onCleanup: function () { var myContent = this.href; $(myContent).unwrap(); }, }); $("#shopphp-payment-title-step1").click(function () { $("#shopphp-payment-body-step2,#shopphp-payment-body-step3").hide("fast"); if ($("#shopphp-payment-body-step1").find("input").length) { $("#shopphp-payment-body-step1").show("fast"); } else { $("#shopphp-payment-body-step1").show("fast").html(ajaxLoaderDiv()); $.get("include/ajaxLib.php?act=viewForm", function (data) { $("#shopphp-payment-body-step1").html(data); }); } }); $("#shopphp-payment-title-step2").click(function () { if ($("#shopphp-payment-body-step1").find(".sf-button").length) { $("#shopphp-payment-body-step1").find(".sf-button").click(); } else { $("#shopphp-payment-body-step2").show("fast").html(ajaxLoaderDiv()); $.get("include/ajaxLib.php?act=siparisOdemeSecim", function (data) { $("#shopphp-payment-body-step2").show("fast").html(data); if ($(data).find("input").length) $("#shopphp-payment-body-step1,#shopphp-payment-body-step3").hide( "fast" ); }); } }); $.fn.equalizeHeights = function(){ var set = Math.max.apply(this, $(this).map(function(i,e){ return $(e).height() }).get() ); if (set > 1) return this.height( set ) } $(".taksit-container").equalizeHeights(); $("select.urunSecim").change(function () { var varurl = ""; var url = ""; var selectName = $(this).attr("varID"); var urunID = $(this).attr("urunID"); var currentID = parseInt( selectName.replace("ozellik", "").replace("detay", "") ); for (i = 1; i <= 10; i++) { if ($("select[urunID="+urunID+"][varID=ozellik" + i + "detay]").length) varurl += "&var" + i + "=" + encodeURIComponent($("select[urunID="+urunID+"][varID=ozellik" + i + "detay]").val()); } if ($("select[urunID="+urunID+"][varID=ozellik" + (currentID + 1) + "detay]").length) { url = "include/ajaxLib.php?act=varSelectUpdate&seq=" + (currentID + 1) + "&urunID=" + encodeURIComponent(urunID) + varurl; $.get(url, function (data) { $("select[urunID="+urunID+"][varID=ozellik" + (currentID + 1) + "detay]").removeAttr( "disabled" ); if (data) $("select[urunID="+urunID+"][varID=ozellik" + (currentID + 1) + "detay]").html(data); }); } if(shopPHPUrunID == $(this).attr("urunID")) { url = "include/ajaxLib.php?act=varKodKontrol&urunID=" + urunID + varurl; $.get(url, function (data) { if (data) $("#spUrunKodu").text(data); }); updateVarResim( $(this).attr("urunID"), $(this).attr("varID"), $(this).val() ); ajaxFiyatGuncelle($(this).attr("urunID")); } }); $(".filterComboSelect").change(function () { var id = $(this).attr("formid"); $("#" + id).submit(); }); $('input[type="submit"]').click(function () { $(this).removeAttr("disabled"); }); $("div.button").click(function () { $(this).find("input").removeAttr("disabled").click(); }); $(".dec,.azalt").click(function () { var simdiAdet = parseFloat($(".urunSepeteEkleAdet").val()); if (simdiAdet > 1) simdiAdet--; $(".urunSepeteEkleAdet").val(simdiAdet); return false; }); $(".inc,.arttir").click(function () { var simdiAdet = parseFloat($(".urunSepeteEkleAdet").val()); simdiAdet++; $(".urunSepeteEkleAdet").val(simdiAdet); return false; }); $("#fatura").click(function () { if ($(this).is(":checked")) $(".fatura").show(); else $(".fatura").hide(); }); $('input[type="password"]').val(""); //$(".tooltip").tooltipster({ animation: "slide", speed: 100 }); $(".iconListe").parent().css({ position: "relative", }); $("#filterContainer input.filterCheck").change(function () { setFilterSession(); }); $("#gf_password").reviewPassword({ preventWeakSubmit: false, }); $("#gf_kargoFirmaID,#gf_city,#gf_semt").change(function () { formKargoChange(); }); $(".multiSepetCheckbox").each(function () { msc++; $(this).attr("id", "adet_" + msc); }); $(".multiSepetCheckbox").click(function () { $("#caprazToplamAdet").text($(".multiSepetCheckbox:checked").length); var toplam = 0; $(".multiSepetCheckbox:checked").each(function () { toplam += parseFloat($(this).attr("kazanc")); }); $("#caprazToplamKazanc").text(moneyFormat(toplam)); }); $("li[disabled=disabled]").css('pointer-events','none'); $("table.teklif input").keyup(teklifFiyatGuncelle); $("#arttir,#azalt").click(function () { var obj = this; $("table.teklif .fiyat").each(function () { if ($(obj).prop("id") == "arttir") $(this).val(moneyFormat($(this).val() * (1 + $("#oran").val() / 100))); else $(this).val(moneyFormat($(this).val() * (1 - $("#oran").val() / 100))); }); teklifFiyatGuncelle(); }); $(".MenuContainer").show(); $(".HarfListe .Harf:last").css({ borderRight: "none", }); $(".SubMenuItem a").each(function () { $(this).css({ marginLeft: $(this).prop("level") * 10 + "px", }); if ($(this).prop("level") == 1) $(this).css({ padding: "0", background: "none", }); }); $(".FilitreKategori").css({ width: $(".FilitreKategoriListe").width() / 3 - 40 + "px", }); $("body").css("overflowX", "hidden"); $(".spSlides").each(function () { var totalSlides = $(this).find(".spSlide").size(); changeSPSlide(this, 0, totalSlides); }); $('#detailSearchKey').addClass('detailSearchKey'); $(".detailSearchKey").attr('autocomplete', 'off').attr('x-webkit-speech',''); $(".detailSearchKey").keyup(loadQuickSearch); $(".detailSearchKey").focus(loadQuickSearch); $(".detailSearchKey").focusout(function() { setTimeout(function() { $('#search-container').css({'opacity':0,'zIndex':'-1'}); },200); }); /* $("#detailSearchKey,.detailSearchKey").autocomplete( "include/ajaxLib.php?act=arama", { minChars: 2, width: 300, multiple: false, matchContains: true, formatItem: formatItem, formatResult: formatResult, selectFirst: false, autpSubmit: true, } ); */ if (!isMobile) { $("a.fancybox-iframe").fancybox({ type: "iframe", autoSize: true, afterLoad: function () { $.extend(this, {}); }, afterClose: function () { sepetHTMLGuncelle(""); }, }); $(".lightbox:first").each(function () { $(this).find("img:first").attr("data-zoom-image", $(this).attr("href")); }); $(".lightbox:first img").elevateZoom({ gallery: "urunResimListContainer", easing: true, }); $(".lightbox:first img").bind("click", function (e) { var ez = $(".lightbox:first img").data("elevateZoom"); $.fancybox(ez.getGalleryList()); return false; }); if ($(".lightbox img").length == 0) $(".lightbox").fancybox({ openEffect: "elastic", closeEffect: "elastic", helpers: { title: { type: "inside", }, }, }); } else { $("#urunResimListContainer a").click(function () { $(".lightbox:first img").attr("src", $(this).attr("data-zoom-image")); }); $(".lightbox").removeAttr("href"); } $(".imgCaptchaRefresh").click(function () { $(this) .parent() .find(".imgCaptcha") .attr({ src: "include/create_captcha.php?u=1&" + Math.random(), }); }); $("#gf_country,#gf_country2").change(function () { formCountryChange(this); }); $("#gf_city,#gf_city2").change(function () { formCityChange(this); }); $("#gf_semt,#gf_semt2").change(function () { formTownChange(this); }); $("#gf_semt").change(function () { if (!$("#gf_semt2").html()) return; var errorID = $(this).prop("id").replace(/gf_/i, "error_"); $("#" + errorID).text(""); $(".generatedForm .button").show(); if ($(this).find("option:selected").attr("kargo") == 0) { $("#" + errorID).text(" " + lang_ilceGonderimYok); $(".generatedForm .button").hide(); } if ( $(this).find("option:selected").attr("fiyatfarki") != 0 && $(this).find("option:selected").attr("fiyatfarki") ) { var str = lang_ilceKargoFark; str = str.replace( /%fark%/i, $(this).find("option:selected").attr("fiyatfarki") ); $("#" + errorID).text(" " + str); } }); if ($("#gf_city").html()) formCityChange($("#gf_city")); if ($("#gf_country").html()) formCountryChange($("#gf_country")); $(".fillAddress").change(function () { var preFix = $(this).attr("addressPrefix"); var pars = "act=addressList&adresID=" + encodeURIComponent($(this).val()); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { var dataArray = data.split("||"); $("#gf_address" + preFix).val(dataArray[0]); $("#gf_mah" + preFix).val(dataArray[3]); $("#gf_country" + preFix).val(dataArray[4]); $("#gf_city" + preFix).val(dataArray[1]); if(parseInt(dataArray[4]) > 1) { $("#gf_semt" + preFix).parent().parent().hide(); $("#gf_mah" + preFix).parent().parent().hide(); } else { $("#gf_semt" + preFix).parent().parent().show(); $("#gf_mah" + preFix).parent().parent().show(); } var pars = "act=city&cID=" + parseInt(dataArray[4]); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { $("#gf_city" + preFix).html(data); $("#gf_city" + preFix).val(dataArray[1]); var pars = "act=town&cityID=" + parseInt(dataArray[1]); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { $("#gf_semt" + preFix).html(data); $("#gf_semt" + preFix).val(dataArray[2]); var pars = "act=town2&townID=" + parseInt(dataArray[2]); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { $("#gf_mah" + preFix).html(data); $("#gf_mah" + preFix).val(dataArray[3]); kargoListeGuncelle(); }, }); }, }); }, }); }, }); }); $(".sepeteEkleAdet").click(function () { $(this).val(""); }); $(".sepeteEkleAdet").keyup(function (e) { var key = e.charCode || e.keyCode || 0; var total = $(this).val(); urunSepeteEkleAdet = total; return; }); bindCCFunctions(); $(".urunSecimTable select").change(updateSecimURL); updateSecimURL(); if (pushAlert != null && pushAlert.length > 0) myalert(pushAlert, "success"); $('a[href="#"]').click(function () { return false; }); $(".piyasa-indirim").each(function () { if ($(this).text() == "%" || !$(this).text()) $(this).remove(); }); $(".fancybox").fancybox({ hideOnOverlayClick: false, hideOnContentClick: false, helpers: { overlay: { closeClick: false, }, }, afterLoad: function () { this.wrap.find(".fancybox-inner").css({ overflowY: "auto", overflowX: "hidden", }); }, }); }); function myalert(text, icon, toast = true) { if((typeof templateName !== 'undefined') && (templateName == 'elite' || templateName == 'flow') && text == lang_urunVarSecim) return; Swal.fire({ toast: toast, text: text, icon: icon, confirmButtonText: lang_tamam, customClass: { confirmButton: icon == "error" ? "" : "custom-class", }, }); } function adresSil(obj) { Swal.fire({ text: lang_adresSilOnay, icon: "warning", showCancelButton: true, confirmButtonText: lang_evet, cancelButtonText: lang_hayir, showCloseButton: true, }).then(function (result) { if (result.value) { $.ajax({ url: "include/mod_SiparisAdresSecim.php?deleteAjaxAddressID=" + $(obj).attr("addressID"), type: "GET", success: function (data) { window.location.reload(); }, }); } }); return false; } function adresKayit(obj, formID) { var checkFor = [ "name", "lastname", "country", "city", "semt", "address", "baslik", "ceptel", ]; for (i = 0; i < checkFor.length; i++) { if ( checkFor[i] == "semt" && $(formID).find("[name='country']").val() != "1" ) continue; if ( $(formID) .find("[name='" + checkFor[i] + "']") .length && !$(formID) .find("[name='" + checkFor[i] + "']") .val() && $(formID) .find("[name='" + checkFor[i] + "']") .parent() .find("label") .length && $(formID) .find("[name='" + checkFor[i] + "']") .parent() .find("label") .text() ) { myalert( lang_eksiksizDoldurun + " (" + $(formID) .find("[name='" + checkFor[i] + "']") .parent() .find("label") .text() + ")", "warning" ); $(formID) .find("[name='" + checkFor[i] + "']") .focus(); return false; } } if ($(formID).find("[name='ceptel']").val().length <= 13) { myalert(lang_eksiksizDoldurun + " (Cep Telefonu)", "warning"); $(formID).find("[name='ceptel']").focus(); return false; } $.ajax({ url: "include/mod_SiparisAdresSecim.php?setAjaxAddressID=" + $(obj).attr("addressID"), type: "POST", data: $(formID).serialize(), success: function (data) { window.location.reload(); }, }); return false; } function adresGuncelle(obj) { $.fancybox({ autoSize: true, hideOnOverlayClick: false, hideOnContentClick: false, helpers: { overlay: { closeClick: false, }, }, href: "include/mod_SiparisAdresSecim.php?getAjaxAddressID=" + $(obj).attr("addressID"), type: "ajax", }); return false; } function updateSecimAppendURL(urunID) { urunSepeteEkleAdet = $(".urunSepeteEkleAdet_" + urunID).val(); if (!urunSepeteEkleAdet) urunSepeteEkleAdet = $(".urunSepeteEkleAdet").val(); if (!urunSepeteEkleAdet) urunSepeteEkleAdet = $(".sepeteEkleAdet").val(); if (!urunSepeteEkleAdet) urunSepeteEkleAdet = 1; secimURLAppend = ""; for (i = 1; i <= 50; i++) { if ( $(".urunSecim.urunSecim_" + urunID + "_ozellik" + i + "detay li.selected") .length ) secimURLAppend += "&ozellik" + i + "detay=" + encodeURIComponent( $( ".urunSecim.urunSecim_" + urunID + "_ozellik" + i + "detay li.selected" ).attr("value") ); } } function updateSecimURL(urunID) { if ($(".urunSepeteEkleAdet").length > 0) urunSepeteEkleAdet = parseFloat($(".urunSepeteEkleAdet").val()); secimURL = ""; var ePrefix = '#urunSecim_ozellik'; if(typeof urunID == 'string' && $('#urunSecim_'+urunID+'_ozellik1detay').length) { ePrefix = '#urunSecim_'+urunID+'_ozellik'; } for (i = 1; i <= 50; i++) { if ($(ePrefix + i + "detay").val()) secimURL += "&ozellik" + i + "detay=" + encodeURIComponent($(ePrefix + i + "detay").val()); } if ($("#freeID").val()) secimURL += "&freeID=" + encodeURIComponent($("#freeID").val()); if ($("#combineID").val()) secimURL += "&combineID=" + encodeURIComponent($("#combineID").val()); if (secimURLAppend) secimURL += secimURLAppend; } function formCountryChange(obj) { if (!$(obj).val()) return; var cityID = $(obj) .attr("id") .replace(/country/i, "city"); $("#" + cityID).html(""); var semtID = $(obj) .attr("id") .replace(/country/i, "semt"); var mahID = $(obj) .attr("id") .replace(/country/i, "mah"); if ($(obj).val() != "1") { $("#" + semtID) .html("") .parent() .hide(); $("#" + mahID) .html("") .parent() .hide(); } else { $("#" + semtID) .parent() .show(); $("#" + semtID).html(""); $("#" + mahID) .parent() .show(); $("#" + mahID).html(""); } var pars = "act=city&cID=" + $(obj).val(); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { var selected = $("#" + cityID).attr("secili"); $("#" + cityID).html(data); $("#" + cityID + " option[value='" + selected + "']").attr( "selected", "selected" ); //if (isMobile) $("#" + cityID).selectmenu("refresh", true); }, }); var pars = "act=kargoArray&data_country=" + $(obj).val(); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { $("#gf_kargoFirmaID").html(data); $("#gf_info_kargoFirmaID").html(""); }, }); return true; } function formTownChange(obj) { if (!$(obj).val()) return; var semtID = $(obj).attr("id").replace(/semt/i, "mah"); $("#" + semtID).html(""); var pars = "act=town2&for=" + semtID + "&townID=" + $(obj).val(); if ($("#" + semtID).attr("filter") == "true") pars += "&valid=true"; $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { var selected = $("#" + semtID).attr("secili"); $("#" + semtID).html(data); $("#" + semtID + " option[value='" + selected + "']").attr( "selected", "selected" ); // if (isMobile) $("#" + semtID).selectmenu("refresh", true); }, }); return true; } function formKargoChange() { if (!$("#gf_kargoFirmaID").val()) return; $('#basket-right-container input').css('opacity',0.5).css('pointer-events','none'); // $('#siparis-submit-button').after('
      ' + ajaxLoaderDiv() + '
      '); $.get( "include/ajaxLib.php?act=siparisOdemeSecimArray&kargoFirmaID=" + $("#gf_kargoFirmaID").val(), function (data) { $("#gf_odemeTipi").html(data); } ); if ($("#gf_kargoFirmaID").val() != "") { $("#gf_info_kargoFirmaID").removeClass("sf-icon").html(''); $.ajax({ url: "include/ajaxLib.php?act=kargoTutar&kargoFirmaID=" + $("#gf_kargoFirmaID").val() + "&data_country=" + encodeURIComponent($("#gf_country").val()) + "&data_city=" + encodeURIComponent($("#gf_city").val()) + "&data_semt=" + encodeURIComponent($("#gf_semt").val()) + "&data_mah=" + encodeURIComponent($("#gf_mah").val()) + "&r=" + Math.random(), success: function (data) { $("#gf_info_kargoFirmaID").removeClass("sf-icon").html(data); sepetHTMLGuncelle(""); }, }); } } function formCityChange(obj) { if (!$(obj).val()) return; var semtID = $(obj).attr("id").replace(/city/i, "semt"); var mahID = $(obj).attr("id").replace(/city/i, "mah"); $("#" + mahID).html(""); $("#" + semtID).html(""); var pars = "act=town&for=" + semtID + "&cityID=" + $(obj).val(); if ($("#" + semtID).attr("filter") == "true") pars += "&valid=true"; $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { var selected = $("#" + semtID).attr("secili"); $("#" + semtID).html(data); $("#" + semtID + " option[value='" + selected + "']").attr( "selected", "selected" ); //if (isMobile) $("#" + semtID).selectmenu("refresh", true); formTownChange($("#" + semtID)); }, }); var pars = "act=kargoArray&data_city=" + $(obj).val(); $("#gf_info_kargoFirmaID").html(""); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { $("#gf_kargoFirmaID").html(data); // formKargoChange(); }, }); return true; } function kargoListeGuncelle() { if(!$("#gf_kargoFirmaID").length) return true; var pars = "act=kargoArray&data_city=" + $('#gf_city').val() + "&data_country=" + $('#gf_country').val(); $("#gf_info_kargoFirmaID").html(""); $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { $("#gf_kargoFirmaID").html(data); // formKargoChange(); }, }); return true; } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g, ""); } function checkSimpleCaptcha(formID) { return; var pars = "txtCaptcha=" + $("." + formID + "_txtCaptcha").val(); $.ajax({ url: "include/ajaxLib.php?act=simplecaptcha", type: "POST", data: pars, success: function (data) { data = trim(data); if (data == "false" || !data) { myalert("Güvenlik kodu hatalı.", "error"); } else { $(".formdeger").val(data); $("#" + formID).submit(); } }, }); } function checkCaptcha(formID) { if (grecaptcha && grecaptcha.getResponse().length > 0) { var pars = "recaptcha_challenge_field=" + $("#recaptcha_challenge_field").val() + "&recaptcha_response_field=" + $("#recaptcha_response_field").val(); $.ajax({ url: "include/ajaxLib.php?act=captcha", type: "POST", data: pars, success: function (data) { data = trim(data); if (data == "false" || !data) { myalert("Güvenlik kodu hatalı.", "error"); Recaptcha.reload(); } else { $(".formdeger").val(data); $("#" + formID).submit(); } }, }); } else { myalert(lang_guvenlikKodOnay, "warning"); return; } } var ArkadasimaGonderWidth = 450; var ArkadasimaGonderHeight = 440; function arkadasimaGonderPopup(urunID) { window.open( "popup.php?act=arkadasimaGonder&urunID=" + urunID, "_blank", "width=" + ArkadasimaGonderWidth + ",height=" + ArkadasimaGonderHeight ); return false; } function formatItem(row) { return ( ' ' + row[1] ); } function formatResult(row) { return row[1]; //return row[0].replace(/(<.+?>)/gi, ''); } function getHash( clientId, oid, amount, okUrl, failUrl, islemtipi, taksit, rnd, storekey ) { var hash = ""; var taksitstr = ""; if (taksit > 1) taksitstr = taksit; var pars = "act=getHash&clientId=" + clientId + "&oid=" + oid + "&amount=" + amount + "&okUrl=" + okUrl + "&failUrl=" + failUrl + "&islemtipi=" + islemtipi + "&taksit=" + taksitstr + "&rnd=" + rnd + "&storekey=" + storekey; $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { data = trim(data); $("#hash").val(data); }, }); return hash; } function getHashGaranti( strTerminalID, strOrderID, strAmount, strSuccessURL, strErrorURL, strType, taksit, strStoreKey, SecurityData ) { var hash = ""; var taksitstr = ""; if (taksit > 1) taksitstr = taksit; var pars = "act=getHashGaranti&strTerminalID=" + strTerminalID + "&strOrderID=" + strOrderID + "&strAmount=" + strAmount + "&strSuccessURL=" + strSuccessURL + "&strErrorURL=" + strErrorURL + "&strType=" + strType + "&taksit=" + taksitstr + "&strStoreKey=" + strStoreKey + "&SecurityData=" + SecurityData; $.ajax({ url: "include/ajaxLib.php?" + pars, success: function (data) { data = trim(data); $("#hash").val(data); }, }); return hash; } // Üst Kategori Listesi Fonksiyonları var topCatID = 0; var topMarkaID = 0; var urunCatInsert = ""; var urunMarkaInsert = ""; var userNameError = ""; var emailNameError = ""; function checkRegisterStatus() { $("#sp_registerForm span.button").html(lang_lutfenBekleyin); return true; } function checkAvail(value, type) { $.ajax({ url: "include/ajaxLib.php?act=checkAvail&str=" + encodeURIComponent(value) + "&type=" + encodeURIComponent(type), success: function (data) { data = trim(data); if (data != "OK") { if (type == "username") { userNameError = "true"; $("#sp_registerForm .gf_username").focus(); myalert(data, "warning"); } if (type == "email" && userNameError == "false") { emailNameError = "true"; $("#sp_registerForm .gf_email").focus(); myalert(data, "warning"); } } else { if (type == "username") { userNameError = "false"; } if (type == "email") { emailNameError = "false"; } } if (userNameError == "false" && emailNameError == "false") $("#sp_registerForm .generatedForm").submit(); }, }); } function updateSubCats(sID) { document.getElementById("opt2").options.length = 1; document.getElementById("opt2").options[0].text = lang_lutfenBekleyin; var url = "include/ajaxLib.php?act=topSubCategory&catID=" + sID; $.ajax({ url: url, success: function (data) { if (data != "" && data.length > 5 && !(lastFocusedId == "gf_" + type)) { upOptions("opt2", data); } }, }); updateSubMarka(sID); } function sistemTeklifeEkle() { var stop = false; var secilenUrunArray = new Array(); var secilenAdetArray = new Array(); for (var i = 1; i <= toplamkategori; i++) { catID = catNum[i]; var urunID = document.getElementById("urunSelected_" + catID).options[ document.getElementById("urunSelected_" + catID).selectedIndex ].value; var stok = urunStok[urunID]; if (stok <= 0) { myalert(lang_stoktaOlmayanUrunuEkleyemezsiniz, "error"); stop = true; } if (urunID > 0) { secilenUrunArray[secilenUrunArray.length] = urunID; secilenAdetArray[secilenAdetArray.length] = $("#adet_" + catID).val(); } } if (secilenUrunArray.length > 0 && stop == false) { document.getElementById("SistemSepeteEkleDiv").innerHTML = '
      ' + lang_lutfenBekleyin + "
      "; //alert(secilenUrunArray.length); for (var i = 0; i < secilenUrunArray.length; i++) { var url = "include/ajaxLib.php?act=teklifEkle&urunID=" + secilenUrunArray[i] + "&adet=" + secilenAdetArray[i]; //window.open(url); if (i < secilenUrunArray.length - 1) { $.get(url, function (data) {}); } else { $.get(url, function (data) { window.location = siteDizini + "page.php?act=tekliflerim"; }); } } window.location = siteDizini + "page.php?act=tekliflerim"; } } function hizliUrunGoster(urunID) { if (isMobile) return goUrun(urunID); $.fancybox({ type: "iframe", autoSize: true, href: "popup.php?act=urunDetay&urunID=" + urunID, afterClose: function () { sepetHTMLGuncelle(""); }, }); return false; } function quickLogin(name, password) { var url = "include/ajaxLib.php?act=quickCheckUser&username=" + encodeURIComponent(name) + "&password=" + encodeURIComponent(password); $.get(url, function (data) { if (data) { location.reload(true); } else myalert(lang_hataliKullaniciVeyaSifre, "error"); }); return false; } function quickRegister(name, lastname, email, password, gsm, bulletin, rule) { if (!name || !lastname || !email || !password || !gsm || !rule) { myalert(lang_eksiksizDoldurun, "warning"); return false; } var url = "include/ajaxLib.php?act=quickRegister&name=" + encodeURIComponent(name) + "&lastname=" + encodeURIComponent(lastname) + "&email=" + encodeURIComponent(email) + "&pass=" + encodeURIComponent(password) + "&gsm=" + encodeURIComponent(gsm) + "&bulletin=" + encodeURIComponent(bulletin); $.get(url, function (data) { console.log('Register Status : ' + data); if (data == "ue") myalert(lang_epostaDahaOnceAlinmis, "warning"); else if (data == "me") myalert(lang_cepKaydedilmis, "warning"); else if (data == "uo") { Swal.fire({ toast: true, icon: '', text: lang_uyeOnay, confirmButtonText: lang_tamam, customClass: { confirmButton: "custom-class", }, }).then((value) => { window.location.href = './'; }); } else quickLogin(email, password); }); return false; } function quickContact( name, nameValidate, email, emailValidate, tel, telValidate, msg, msgValidate ) { var stop = false; if (nameValidate && !name) stop = true; else if (emailValidate && !email) stop = true; else if (telValidate && !tel) stop = true; else if (msgValidate && !msg) stop = true; if (stop) myalert(lang_eksiksizDoldurun, "warning"); else if (emailValidate && !Validate_Email_Address(email)) myalert(lang_hataliEposta, "error"); else { $.ajax({ url: "include/ajaxLib.php?act=quickContact&urunID=0&namelastname=" + encodeURIComponent(name) + "&ceptel=" + encodeURIComponent($("#tel").val()) + "&email=" + encodeURIComponent($("#xemail").val()), success: function (data) { myalert(lang_iletisimOK, "success"); }, }); } return false; } function teklifSepetEkle() { $(".teklifInfoTable").html( '
      ' ); $(".teklifUrunID").each(function () { var url = "include/ajaxLib.php?act=sepetEkle&urunID=" + encodeURIComponent($(this).text()) + "&adet=" + $(this).parent().find(".adet").val(); $.get(url, function (data) {}); }); setTimeout(function () { window.location = siteDizini + "page.php?act=sepet"; }, 3000); } function sistemSepeteEkle() { var stop = false; var secilenUrunArray = new Array(); var secilenAdetArray = new Array(); for (var i = 1; i <= toplamkategori; i++) { catID = catNum[i]; var urunID = $("#urunSelected_" + catID).val(); var stok = urunStok[urunID]; if (stok <= 0) { myalert(lang_stoktaOlmayanUrunuEkleyemezsiniz, "error"); stop = true; } if (urunID > 0) { secilenUrunArray[secilenUrunArray.length] = urunID; secilenAdetArray[secilenAdetArray.length] = $("#adet_" + catID).val(); } } if (secilenUrunArray.length > 0 && stop == false) { document.getElementById("SistemSepeteEkleDiv").innerHTML = '
      ' + lang_lutfenBekleyin + "
      "; //alert(secilenUrunArray.length); for (var i = 0; i < secilenUrunArray.length; i++) { var url = "include/ajaxLib.php?act=sepetEkle&urunID=" + encodeURIComponent(secilenUrunArray[i]) + "&adet=" + encodeURIComponent(secilenAdetArray[i]); if (i < secilenUrunArray.length - 1) { $.get(url, function (data) {}); } else { $.get(url, function (data) { setTimeout(function () { window.location.href = siteDizini + "page.php?act=sepet"; }, 2000); }); } } // window.location = 'page.php?act=sepet'; } } function updateSubMarka(sID) { document.getElementById("opt3").options.length = 1; document.getElementById("opt3").options[0].text = lang_lutfenBekleyin; var pars = "act=topSubMarka&catID=" + sID; $.ajax({ url: "include/ajaxLib.php?act=topSubMarka&catID=" + sID, success: function (data) { upOptions("opt3", data); }, }); topCatID = document.getElementById("opt2").selectedIndex >= 0 ? document.getElementById("opt2").options[ document.getElementById("opt2").selectedIndex ].value : document.getElementById("opt1").options[ document.getElementById("opt1").selectedIndex ].value; } function upOptions(id, result) { document.getElementById(id).options.length = 0; var optsArray = result.split("||"); for (var i = 0; i < optsArray.length; i++) { var optDataArray = optsArray[i].split("$$"); optDataArray[1] = optDataArray[1].replace("'", "'"); document.getElementById(id).options[ document.getElementById(id).options.length ] = new Option(optDataArray[1], optDataArray[0]); } } // Üst Kategori Listesi Fonksiyonları var toplamkdvdahil = 0; var toplamkdvharic = 0; var toplamkdv = 0; var KDVHaricArray = new Array(); function updateToplam() { var is = document.getElementsByTagName("input"); toplamkdvdahil = 0; toplamkdvharic = 0; toplamkdv = 0; for (var i = 0; i < is.length; i++) { if (is[i].id.indexOf("fiyat_") == 0) { var realID = is[i].id.replace("fiyat_", ""); toplamkdvdahil += parseFloat(is[i].value.replace(',','')); if (KDVHaricArray[realID]) toplamkdvharic += parseFloat(KDVHaricArray[realID]); } } toplamkdv = toplamkdvdahil - toplamkdvharic; document.getElementById("kdvdahil").innerHTML = moneyFormat(toplamkdvdahil); //document.getElementById('kdvharic').innerHTML = moneyFormat(toplamkdvharic); document.getElementById("toplamytl").innerHTML = moneyFormat(toplamkdvdahil); //document.getElementById('toplamkdv').innerHTML = moneyFormat(toplamkdv); document.getElementById("dolar").innerHTML = moneyFormat( toplamkdvdahil / dolar ); document.getElementById("euro").innerHTML = moneyFormat( toplamkdvdahil / euro ); if (document.getElementById("havaleile")) document.getElementById("havaleile").innerHTML = moneyFormat( toplamkdvdahil - toplamkdvdahil * havaleindirim ); } function updateKategori(urunID) { var url = "include/ajaxLib.php"; var catID = 0; var data = ""; var myAjax = new Array(); for (var i = 2; i <= updatekategori; i++) { catID = catNum[i]; var pars = "act=updateKategori&urunID=" + urunID + "&catID=" + catID + "&randID=" + Math.floor(Math.random() * 1000000); var target = "catNum_" + i; if (urunID > 0) { pcTopLoading(i); $("#" + target).load("include/ajaxLib.php?" + pars); } up("adet_" + catID, 0); up("fiyat_" + catID, 0); document.getElementById("detail_href_" + catID).href = "#"; document.getElementById("detail_href_" + catID).target = "_self"; ch("stok_" + catID, "stok_def_" + catID); KDVHaricArray[catID] = 0; } updateToplam(); } function pcTopLoading(i) { document.getElementById("catNum_" + i).innerHTML = ' '; } function pcTopLoaded(response, i) { document.getElementById("catNum_" + i).innerHTML = response.responseText; } function updateFiyat(urunID, catID) { var fiyat = urunSFiyat[urunID]; var stok = urunStok[urunID]; console.log(urunID); console.log(fiyat); up("adet_" + catID, 1); if (fiyat > 0) up("fiyat_" + catID, moneyFormat(fiyat)); if (urunID > 0) { if (stok > 0) ch("stok_" + catID, "stok_var_" + catID); else { ch("stok_" + catID, "stok_yok_" + catID); up("adet_" + catID, 0); up("fiyat_" + catID, 0); } } else { ch("stok_" + catID, "stok_def_" + catID); up("adet_" + catID, 0); up("fiyat_" + catID, 0); } if (stok > 0) KDVHaricArray[catID] = urunKDVHaricFiyat[urunID]; document.getElementById("detail_href_" + catID).href = urunID > 0 ? "page.php?act=urunDetay&urunID=" + urunID : "#"; document.getElementById("detail_href_" + catID).target = urunID > 0 ? "_blank" : "_self"; updateToplam(); } function updateAdet(v, catID) { var xID = "#urunSelected_" + catID; var urunID = $(xID).val(); if (v == 0 || !v) KDVHaricArray[catID] = 0; else KDVHaricArray[catID] = urunKDVHaricFiyat[urunID] * v; var urunID = document.getElementById("urunSelected_" + catID).options[ document.getElementById("urunSelected_" + catID).selectedIndex ].value; var fiyat = urunSFiyat[urunID]; var stok = urunStok[urunID]; if (!isInt(v)) { myalert(lutfenSadeceRakkamKullanin, "warning"); v = urunID > 0 && stok > 0 ? 1 : 0; up("adet_" + catID, v); } else if (v > stok) { myalert(lang_stoktlarimizdaYok, "warning"); up("adet_" + catID, stok); v = stok; } if (urunID > 0) up("fiyat_" + catID, moneyFormat(fiyat * v)); updateToplam(); } function ShowDetailPic(catID) { var urunID = document.getElementById("urunSelected_" + catID).options[ document.getElementById("urunSelected_" + catID).selectedIndex ].value; document.getElementById("detail_div_" + catID).innerHTML = ''; if (urunResim[urunID]) document.getElementById("detail_div_" + catID).style.display = "block"; } // PC Toplama Fonksiyonları function moneyFormat(number) { var decimalplaces = 2; var decimalcharacter = "."; var thousandseparater = ","; number = parseFloat(number); var sign = number < 0 ? "-" : ""; var formatted = new String(number.toFixed(decimalplaces)); if (decimalcharacter.length && decimalcharacter != ".") { formatted = formatted.replace(/\./, decimalcharacter); } var integer = ""; var fraction = ""; var strnumber = new String(formatted); var dotpos = decimalcharacter.length ? strnumber.indexOf(decimalcharacter) : -1; if (dotpos > -1) { if (dotpos) { integer = strnumber.substr(0, dotpos); } fraction = strnumber.substr(dotpos + 1); } else { integer = strnumber; } if (integer) { integer = String(Math.abs(integer)); } while (fraction.length < decimalplaces) { fraction += "0"; } temparray = new Array(); while (integer.length > 3) { temparray.unshift(integer.substr(-3)); integer = integer.substr(0, integer.length - 3); } temparray.unshift(integer); integer = temparray.join(thousandseparater); var out = sign + integer + decimalcharacter + fraction; if (kurusgizle) out = out.replace(".00", ""); return out; } function moneyFormat2(V) { var intPart, decPart; ret = V * 100; ret = Math.round(ret); ret = V < 0.1 ? "0" + ret : ret; ret = V < 1 ? "0" + ret : "" + ret; intPart = ret.substring(0, ret.length - 2); decPart = ret.substring(ret.length - 2); ret = intPart + "." + decPart; if (ret.indexOf("-") >= 0) ret = ret.replace("00", ""); return ret; } function pause(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > exitTime) return; } } function isInt(x) { var y = parseInt(x); if (isNaN(y)) return false; return x == y && x.toString() == y.toString(); } function gv(id) { if (document.getElementById(id)) return document.getElementById(id).value; else alert("DEBUG gv : " + id + " -> NOID."); } function up(id, v) { if (document.getElementById(id)) document.getElementById(id).value = v; else alert("DEBUG up : " + id + " -> NOID."); } function ch(oldid, newid) { if (!document.getElementById(oldid)) alert("DEBUG ch : " + oldid + " -> NOID."); if (!document.getElementById(newid)) alert("DEBUG ch : " + newid + " -> NOID."); document.getElementById(oldid).innerHTML = document.getElementById(newid).innerHTML; } function openTab(id) { if ( $("#fancyTabContainer").html() != null && $("#fancyTabContainer").html() != "" ) { id++; $("#fancyTabContainer .tabs1 li:eq(" + id + ")").click(); return; } //if (lastTabID == id) return; var cont = false; { if (lastTabID) $("#tabData" + lastTabID).hide("fast"); $("#tabData" + id).show("fast"); $("#tabData" + id + " .imgCaptchaRefresh").click(); lastTabID = id; cont = true; } for (var i = 1; i <= 10; i++) { if (document.getElementById("option" + i)) { document.getElementById("option" + i).style.backgroundPosition = "0% 0px"; document .getElementById("option" + i) .getElementsByTagName("span")[0].style.backgroundPosition = "100% 0px"; } } if (cont && document.getElementById("option" + id) != null) { document.getElementById("option" + id).style.backgroundPosition = "0% -42px"; document .getElementById("option" + id) .getElementsByTagName("span")[0].style.backgroundPosition = "100% -42px"; } } function flash(w, h, u, t) { document.write( "" ); document.write(""); document.write( "" ); } function Validate_Email_Address(input) { //input.replace(/\s/g, ""); var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (input.match(validRegex)) { return true; } else { return false; } } /* function Validate_Email_Address(email) { //$("#gf_email").val($("#gf_email").val().replace(/ /g, "")); email.replace(/\s/g, ""); var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } */ function trFix(string) { //string = string.replace(/y/g,'ı'); //string = string.replace(/?/g,'ş'); //string = string.replace(/?/g,'ğ'); return string; } function sssOpen(ID) { if (lastSSSID) { $("#sss_cevap_" + lastSSSID).slideUp("fast"); $("#sss_image_" + lastSSSID).removeClass('fa-minus').addClass('fa-plus').css({'color':'#0bc15c'}); } if (lastSSSID != ID) { $("#sss_cevap_" + ID).slideDown("fast"); $("#sss_image_" + ID).removeClass('fa-plus').addClass('fa-minus').css({'color':'#aaa'});; lastSSSID = ID; } else lastSSSID = 0; } function fc(obj) { obj.innerHTML = obj.innerHTML + ''; document.getElementById("sb").click(); } function pencereAc(url, en, boy) { var y = window.top.outerHeight / 2 + window.top.screenY - boy / 2; var x = window.top.outerWidth / 2 + window.top.screenX - en / 2; window .open( url, "shopphp", "height=" + boy + ",width=" + en + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=1, top=" + y + ", left=" + x ) .focus(); } function is_int(input) { return typeof input == "number" && parseInt(input) == input; } function bookmark() { if (window.sidebar) { // Mozilla Firefox Bookmark window.sidebar.addPanel(location.href, document.title, ""); } else if (window.external) { // IE Favorite window.external.AddFavorite(location.href, document.title); } else if (window.opera && window.print) { // Opera Hotlist this.title = document.title; return true; } } function liftOff() { window.location.reload(); } function errorAlert(str) { Swal.fire({ title: "Hata!", text: str, icon: "error", button: lang_OK, }); } function ugFiyat(lineID) { Swal.fire({ input: "text", content: "input", text: lang_urunYeniFiyat, confirmButtonText: lang_guncelle, }).then((value) => { if(!value.value) return; $.get( "include/ajaxLib.php?act=userGroupFiyat&lineID=" + lineID + "&fiyat=" + value.value, function (data) { if (data == "err" || !data) { Swal.fire({ title: lang_hata, text: lang_fiyatGuncelleHata, icon: "error", button: lang_OK, }); } else { sepetHTMLGuncelle(data); Swal.fire({ title: "", text: lang_fiyatGuncelleOK, icon: "success", button: lang_OK, }); } } ); }); } /* Before document ready */ if ($(".shopphp-payment-body").length) { odemeSepetTasarimGuncelle(true); } $('button.sepet-goster').parent().css({'width':'100%','box-sizing':'border-box'});