var __NS = (navigator.appName.indexOf("Netscape") != -1) || window.opera; var mouseX = 0; var mouseY = 0; jQuery(document).ready( function() { $("#MiddleLayouts").click( function(e) { mouseX = e.pageX; mouseY = e.pageY; }); }) /* * function changeImage(form,img,pathURL) { var infoText = "Favori Listesin"; * var onImg = "images/main/ico_favori01.gif"; var offImg = * "images/main/ico_favori02.gif"; var divId = "favoriText"; * * if (img.id == 'comparisonImg'){ infoText = "Karşılaştırma Listesin"; onImg = * "images/main/ico_karsilastir2.gif"; offImg = * "images/main/ico_karsilastir1.gif"; divId = "comparisonText"; } * * with(form){ img.src=pathURL; setTimeout('',3000); if (img.name==1) { * //alert(infoText + " eklenmiştir !!!"); * document.getElementById(divId).innerHTML = infoText+"den Çıkart "; * img.src=onImg; img.name=0; } else { //alert(infoText + " çıkarılmıştır !!!"); * document.getElementById(divId).innerHTML = infoText+"e Ekle"; img.src=offImg; * img.name=1; } } * * updateFrame('productSuggestions'); } */ /* AJAX */ function compareMe(psi, c, sc, img) { img.src = "images/main/working.gif"; if (img.name == 0) { remComp(psi, c, img); img.name = 1; } else { addComp(psi, c, sc, img); img.name = 0; } } function addComp(psi, c, sc, img) { comparison.addToComparison(psi, c, sc); img.src = "images/main/ico_karsilastir2.gif"; $('#comparisonText').html("Karşılaştırma Listesinden Çıkar"); } function remComp(psi, c, img) { comparison.removeFromComparison(psi, c); img.src = "images/main/ico_karsilastir1.gif"; $('comparisonText').html("Karşılaştırma Listesine Ekle"); } function kangurumCompareMe(psi, c, sc, img) { img.src = "images/main/working.gif"; if (img.name == 0) { kangurumRemComp(psi, c, img); img.name = 1; } else { kangurumAddComp(psi, c, sc, img); img.name = 0; } } function kangurumRemComp(psi, c, img) { comparison.removeFromComparison(psi, c); img.src = "images/main/karsilastir.gif"; img.alt = "Karşılaştırma Listesine Ekle"; } function kangurumAddComp(psi, c, sc, img) { comparison.addToComparison(psi, c, sc); img.src = "images/main/karsilastir_eksi.gif"; img.alt = "Karşılaştırma Listesinden Çıkar"; } function kangurumFavoriteMe(psi, img) { img.src = "images/main/working.gif"; favorites.addToFavorites(psi); if (img.name == 0) { img.name = 1; img.src = "images/main/favori.gif"; img.alt = "Favorilerime Ekle"; } else { img.name = 0; img.src = "images/main/favori_eksi.gif"; img.alt = "Favorilerimden Çıkar"; } } function favoriteMe(psi, img) { img.src = "images/main/working.gif"; favorites.addToFavorites(psi); if (img.name == 0) { img.name = 1; img.src = "images/main/ico_favori02.gif"; $('favoriText').html("Favorilerime Ekle"); } else { img.name = 0; img.src = "images/main/ico_favori01.gif"; $('favoriText').html("Favorilerimden Çıkar"); } } function changeFav(psi, img) { img.src = "images/main/working.gif"; favorites.addToFavorites(psi); if (img.name == 1) { img.name = 0; img.src = "images/main/ico_favori01.gif"; img.alt = "Favorilerimden Çıkar"; } else { img.name = 1; img.src = "images/main/ico_favori02.gif"; img.alt = "Favorilerime Ekle"; } } function changeFavSmall(psi, img) { img.src = "images/main/working.gif"; favorites.addToFavorites(psi); if (img.name == 1) { img.name = 0; img.src = "images/main/icon_favori_on.gif"; img.alt = "Favorilerimden Çıkar"; } else { img.name = 1; img.src = "images/main/icon_favori_off.gif"; img.alt = "Favorilerime Ekle"; } } /* //AJAX */ // ADDTOCART function checkAmounts(form) { var hasAmountSet = 0; var i = 1; var amountTxt = document.forms[form.name].elements["amounts_" + i]; while (amountTxt != null) { if (amountTxt.value != "" && amountTxt.value != "0.00" && amountTxt.value != "0") { hasAmountSet = 1; break; } i++; amountTxt = document.forms[form.name].elements["amounts_" + i]; } return hasAmountSet; } function checkStockAmounts(form, counter) { var isAmountInStock = 1; var i = 1; if(counter != null) i = counter; var amountTxt = document.forms[form.name].elements["amounts_" + i]; var stockAmount = document.forms[form.name].elements["stockAmount_" + i]; var isOnStock = document.forms[form.name].elements["isOnStock_" + i]; while (stockAmount != null && amountTxt != null && isOnStock != null) { if (amountTxt.value != "" && amountTxt.value != "0.00" && amountTxt.value != "0") { if (isOnStock.value == "false") { isAmountInStock = -1; break; } var intAmount = parseInt(amountTxt.value); var intStock = parseInt(stockAmount.value); if (isOnStock.value == "true" && intStock > 0 && intAmount > intStock) { isAmountInStock = 0; break } } i++; stockAmount = document.forms[form.name].elements["stockAmount_" + i]; amountTxt = document.forms[form.name].elements["amounts_" + i]; isOnStock = document.forms[form.name].elements["isOnStock_" + i]; } return isAmountInStock; } function checkMaxAmount(form, counter) { var hasAmountSet = 1; var i = 1; if(counter != null) i = counter; var amountTxt = document.forms[form.name].elements["amounts_" + i]; while (amountTxt != null) { var intAmount = parseInt(amountTxt.value); if (amountTxt.value != "" && amountTxt.value != "0.00" && amountTxt.value != "0" && intAmount > 99) { hasAmountSet = 0; break; } i++; amountTxt = document.forms[form.name].elements["amounts_" + i]; } return hasAmountSet; } function addToBasketMultipleSubmit(form,destUrl) { if (checkAmounts(form) == 0) { alert("Sepete ekleyebilmek için ürün miktarı girmelisiniz."); return true; } if (checkMaxAmount(form, null) == 0) { alert("Sepete aynı üründen en fazla 99 adet ekleyebilirsiniz."); return true; } if (checkStockAmounts(form, null) == -1) { alert("Eklemek istediğiniz ürün(ler) stokta bulunmamaktadır."); return true; } if (checkStockAmounts(form, null) == 0) { alert("Eklemek istediğiniz miktarda ürün stoklarımızda mevcut değildir."); return true; } document.forms[form.name].action = destUrl; document.forms[form.name].submit(); } function addToBasketMultiple(form, destUrl, productModelId) { if (checkAmounts(form) == 0) { alert("Sepete ekleyebilmek için ürün miktarı girmelisiniz."); return true; } if (checkMaxAmount(form, null) == 0) { alert("Sepete aynı üründen en fazla 99 adet ekleyebilirsiniz."); return true; } if (checkStockAmounts(form, null) == -1) { alert("Eklemek istediğiniz ürün(ler) stokta bulunmamaktadır."); return true; } if (checkStockAmounts(form, null) == 0) { alert("Eklemek istediğiniz miktarda ürün stoklarımızda mevcut değildir."); return true; } refreshBasket(form, destUrl, null, productModelId); return true; } function addToBasketMultipleGo(form, destUrl, attrUri, productModelId) { if (checkAmounts(form) != 0) { document.getElementById('returnuri').value = attrUri; refreshBasket(form, destUrl, attrUri, productModelId); } document.location = attrUri; } function addToBasketMultipleTabGo(form, destUrl, attrUri, productModelId, targetTab, activeTab) { if(checkAmounts(form) == 0) { document.getElementById('returnuri').value = attrUri; tabChangeDynamic(targetTab, activeTab, attrUri); return true; } if (checkMaxAmount(form, null) == 0) { alert("Sepete aynı üründen en fazla 99 adet ekleyebilirsiniz."); return true; } if (checkStockAmounts(form, null) == -1) { alert("Eklemek istediğiniz ürün(ler) stokta bulunmamaktadır."); return true; } if (checkStockAmounts(form, null) == 0) { alert("Eklemek istediğiniz miktarda ürün stoklarımızda mevcut değildir."); return true; } refreshBasket(form, destUrl, null, productModelId); tabChangeDynamic(targetTab, activeTab, attrUri); return true; } function addToBasket(form, destUrl, productModelId) { var hasAmountSet = 0; var isAmountInStock = 1; var amountTxt = document.forms[form.name].elements["amount"]; if (amountTxt != null) { if (amountTxt.value != "" && amountTxt.value != "0.00" && amountTxt.value != "0") { hasAmountSet = 1; } } if (hasAmountSet == 0) { alert("Sepete ekleyebilmek için ürün miktarı girmelisiniz."); return true; } if (checkMaxAmount(form, null) == 0) { alert("Sepete aynı üründen en fazla 99 adet ekleyebilirsiniz."); return true; } var stockAmount = document.forms[form.name].elements["stockAmount"]; var isOnStock = document.forms[form.name].elements["isOnStock"]; if (stockAmount != null && amountTxt != null && isOnStock != null) if (amountTxt.value != "" && amountTxt.value != "0.00" && amountTxt.value != "0") { if (isOnStock.value == "false") { alert("Eklemek istediğiniz ürün(ler) stokta bulunmamaktadır."); return true; } var intAmount = parseInt(amountTxt.value); var intStock = parseInt(stockAmount.value); if (intAmount > 99) { alert("Sepete aynı üründen en fazla 99 adet ekleyebilirsiniz."); return true; } if (isOnStock.value == "true" && intStock > 0 && intAmount > intStock) { alert("Eklemek istediğiniz miktarda ürün stoklarımızda mevcut değildir."); return true; } } refreshBasket(form, destUrl, null, productModelId); return true; } function addToBasketForIconSepetOnProductListing(form, destUrl, counter,productModelId) { var hasAmountSet = 0; var amountTxt = document.forms[form.name].elements["amounts_" + counter]; if (amountTxt != null) { if (amountTxt.value != "" && amountTxt.value != "0.00" && amountTxt.value != "0") { hasAmountSet = 1; } } if (hasAmountSet == 0) { alert("Sepete ekleyebilmek için ürün miktarı girmelisiniz."); return true; } if (checkMaxAmount(form, counter) == 0) { alert("Sepete aynı üründen en fazla 99 adet ekleyebilirsiniz."); return true; } var checkStockAmount = checkStockAmounts(form, counter); if (checkStockAmount == -1) { alert("Eklemek istediğiniz ürün(ler) stokta bulunmamaktadır."); return true; } if (checkStockAmount == 0) { alert("Eklemek istediğiniz miktarda ürün stoklarımızda mevcut değildir."); return true; } destUrl = destUrl + "&amount=" + amountTxt.value; refreshBasket(form, destUrl, null, productModelId); return true; } function addToBasketUrl(destUrl, productModelId) { refreshBasket(null, destUrl, null, productModelId); } // BASKET PROCESS function basketChangeDynamic(targetlink) { var basketContentObj = document.getElementById('MPL_Basket_Content'); var basketWorkingObj = document.getElementById('KNG_Basket_Working'); if (basketContentObj != null) { basketContentObj.style.display = "none"; basketWorkingObj.style.display = ""; } if (targetlink != "null") dwrUtils.forwardPage(targetlink, basketContent); } function refreshBasket(form, destUrl, attrUri, productModelId) { var queryString = ""; if (form != null) queryString = $(form).serialize(); if (productModelId != null) { $( "
Sepetinize Ekleniyor
") .prependTo(productModelId); var position = $(productModelId).position(); var width = $(productModelId).width(); var tmpWidth = 45; var positionLeft = (width / 2) - tmpWidth; $(".t-layoutmask").css( { 'left' :position.left, 'top' :position.top, 'width' :$(productModelId).width(), 'height' :$(productModelId).height(), 'padding-left' :$(productModelId).css('padding-left'), 'padding-right' :$(productModelId).css('padding-right'), 'padding-top' :$(productModelId).css('padding-top'), 'padding-bottom' :$(productModelId).css('padding-bottom'), 'margin-left' :$(productModelId).css('margin-left'), 'margin-right' :$(productModelId).css('margin-right'), 'margin-bottom' :$(productModelId).css('margin-bottom'), 'margin-top' :$(productModelId).css('margin-top') }); $(".t-lm-msg").css( { 'left' :positionLeft }); } else { if (mouseY == 0) { $("#MiddleLayouts").trigger('click'); } var winW = $(document).width(); $( "
Sepetinize Ekleniyor
") .prependTo('body'); $("#t-gen-1201").css('top', mouseY); $("#t-gen-1201").css('left', winW / 2 - $("#t-gen-1201").width() / 2); $("#t-gen-1201").fadeIn(2000); } $.ajax( { url :destUrl, data :queryString, type :"POST", cache :false, success : function() { $(".basketDiv").css( { 'display' :'' }); basketChangeDynamic('/dwrUpdateBasket.do'); } }); } function basketContent(data) { var basketContentObj = document.getElementById('MPL_Basket_Content'); var basketWorkingObj = document.getElementById('KNG_Basket_Working'); if (basketContentObj != null) { basketWorkingObj.style.display = "none"; basketContentObj.style.display = ""; basketContentObj.innerHTML = data; } $(".t-layoutmask").remove(); } function submitSort(form, destUrl) { form.action = destUrl; form.submit(); } function openWindowNoEvent(destUrl, winName, winProps) { var win = window.open(destUrl, winName, winProps); win.focus(); return false; } function updateFrame(frameName) { if (frameName != '') { // check if this is a framed page if ((top != self)) { // decide which frame to update if (frameName == 'content') { parent.content.location.reload(); } else if (frameName == 'rightInformation') { parent.rightInformation.location.reload(); } else if (frameName == 'shoppingCarts') { parent.shoppingCarts.location.reload(); } else if (frameName == 'productSuggestions') { parent.productSuggestions.location.reload(); } } else { // do nothing } } } function getCheckedRadio(theRadioGroup) { var val = null; for ( var i = 0; i < theRadioGroup.length; i++) { if (theRadioGroup[i].checked) { val = theRadioGroup[i].value; break; } // if checked } // for i return val; } // ------------------------------------------------------------------- function iecompattest() { // Döküman tipine göre IE test // ------------------------------------------------------------------- return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body // ------------------------------------------------------------------- } // function iecompattest(){ // ------------------------------------------------------------------- // ------------------------------------------------------------------- function getScrollY() { // Scroll Y uzaklığı // ------------------------------------------------------------------- var x = __NS ? pageYOffset : iecompattest().scrollTop; return (x); // ------------------------------------------------------------------- } // function getScrollY(){ // ------------------------------------------------------------------- // ------------------------------------------------------------------- function getScrollX() { // Scroll X uzaklığı // ------------------------------------------------------------------- var x = __NS ? pageXOffset : iecompattest().scrollLeft; return (x); // ------------------------------------------------------------------- } // function getScrollX(){ // ------------------------------------------------------------------- // ------------------------------------------------------------------- function getClientW() { // Browser ic genislik // ------------------------------------------------------------------- var x = __NS ? innerHeight : iecompattest().clientHeight; return (x) // ------------------------------------------------------------------- } // function getClientW(){ // ------------------------------------------------------------------- // ------------------------------------------------------------------- function getClientH() { // Browser ic yukseklik // ------------------------------------------------------------------- var x = __NS ? innerWidth : iecompattest().clientWidth; return (x); // ------------------------------------------------------------------- } // function getClientH(){ // ------------------------------------------------------------------- // ------------------------------------------------------------------- function getElementPos(paramElement, paramDir) { // elementin sayfadaki yeri // - paramDir 'x' / 'y' // ------------------------------------------------------------------- (paramDir == "x") ? pos = paramElement.offsetLeft : pos = paramElement.offsetTop; tempElement = paramElement.offsetParent; while (tempElement != null) { pos += (paramDir == "x") ? tempElement.offsetLeft : tempElement.offsetTop; tempElement = tempElement.offsetParent; } return (pos); // ------------------------------------------------------------------- } // function getElementPos(paramElement,paramDir){ // ------------------------------------------------------------------- var _pTitleYemek = new Image(); _pTitleYemek.src = 'images/main/TR/icon_title_yemek01.gif'; var _pCloseYemek = new Image(); _pCloseYemek.src = 'images/main/icon_y_pop_close01.gif'; var _pTitleOneri = new Image(); _pTitleOneri.src = 'images/main/TR/icon_title_oneriurun01.gif'; function yemekTarifPopUpShow(paramObj, tasteDetailPath, tasteImgPath, tasteName, productDetailPath, message01, message02) { var _main = document.getElementById('main'); var _x = getElementPos(paramObj, 'x'); var _mainX = getElementPos(_main, 'x'); var _y = getElementPos(paramObj, 'y'); var _tempDiv = document.getElementById('kangTempXY'); var _pCont = ''; _pCont = '
'; _pCont += '
\' width="176" height="40" />
'; _pCont += '
'; _pCont += '
'; _pCont += '
'; _pCont += '
'; _pCont += message01; _pCont += '

'; _pCont += ''; _pCont += ' '; _pCont += ' '; _pCont += ' '; _pCont += ' '; _pCont += '
 '; _pCont += tasteName; _pCont += '

'; _pCont += '
'; _pCont += message02; _pCont += '
'; _pCont += '
'; _pCont += '
'; // alert('x:' + _x + '\ny:' + _y); _tempDiv.innerHTML = ''; _tempDiv.style.display = 'block'; _tempDiv.style.marginTop = _y + 'px'; _tempDiv.style.marginLeft = _x - _mainX + 'px'; _tempDiv.style.width = 230 + 'px'; _tempDiv.innerHTML = _pCont; } function yildizliPopUpShow(paramObj, productAdviceDetailPath, productAdviceImgPath, productAdviceName, productPrice, productPriceSymbol, productDetailPath, message01) { var _main = document.getElementById('main'); var _x = getElementPos(paramObj, 'x'); var _mainX = getElementPos(_main, 'x'); var _y = getElementPos(paramObj, 'y'); var _tempDiv = document.getElementById('kangTempXY'); var _pCont = ''; _pCont = '
'; _pCont += '
\' width="176" height="40" />
'; _pCont += '
'; _pCont += '
'; _pCont += '
'; _pCont += ''; _pCont += ' '; _pCont += ' '; _pCont += ''; _pCont += ' '; _pCont += '
  '; _pCont += productAdviceName; _pCont += '
 '; _pCont += productPrice; _pCont += ' '; _pCont += productPriceSymbol _pCont += ''; _pCont += '
'; _pCont += '
'; _pCont += message01; _pCont += '
'; _pCont += '
'; _pCont += '
'; // alert('x:' + _x + '\ny:' + _y); _tempDiv.innerHTML = ''; _tempDiv.style.display = 'block'; _tempDiv.style.marginTop = _y + 'px'; _tempDiv.style.marginLeft = _x - _mainX + 'px'; _tempDiv.style.width = 230 + 'px'; _tempDiv.innerHTML = _pCont; } function yemekTarifPopUpHide() { var _tempDiv = document.getElementById('kangTempXY'); _tempDiv.innerHTML = ''; _tempDiv.style.display = 'none'; }