var el; var objAjax; var intNewValue; var divLoader; var intOldValue; el = null; objAjax = null; intNewValue = 0; intOldValue = 0; divLoader = null; function doLoader(){ if(divLoader == null){ divLoader = document.getElementById('loader'); } if(el == null){ divLoader.style.visibility = 'visible'; }else{ divLoader.style.visibility = 'hidden'; } } function doShopCartDel(elName){ if(el == null){ doLoader(); el = document.getElementById(elName); intProductId = getProductID(elName); var url = "http://www.nomadoutlet.com/shop.asp?action=del&productId=" + intProductId; objAjax = new Ajax(url, { method: "get"}); objAjax.options.onComplete = doShopCartDelCallBack; objAjax.request(); } } function doShopCartDelCallBack(result){ if(result == "oke"){ price = document.getElementById('price-' + getProductID(el.id)); price = price.value.toInt(); elSubtotaal = document.getElementById('subtotaal'); elSubtotaalBasis = document.getElementById('subtotaalbasis'); elSubtotaalBasis.value = elSubtotaalBasis.value.toInt() - price; elSubtotaal.innerHTML = doShopFormatPrice(elSubtotaalBasis.value); elTotaal = document.getElementById('totaal'); elTotaalBasis = document.getElementById('totaalbasis'); elTotaalBasis.value = elTotaalBasis.value.toInt() - price; elTotaal.innerHTML = doShopFormatPrice(elTotaalBasis.value); el.parentNode.removeChild(el); } doLoader(); el = null; } function doShopCartChange(elName, strType){ //productId if(el == null){ doLoader(); el = document.getElementById(elName); intProductId = getProductID(elName); intOldValue = (el.innerHTML).toInt(); intNewValue = intOldValue; if(strType == '+'){ intNewValue++; } if(strType == '-'){ intNewValue--; } if(intNewValue > 0){ var url = "http://www.nomadoutlet.com/shop.asp?action=update&productId=" + intProductId + "&count=" + intNewValue; objAjax = new Ajax(url, { method: "get"}); objAjax.options.onComplete = doShopCartChangeCallBack; objAjax.request(); }else{ doLoader(); el = null; } } } function getProductID(strName){ return strName.split('-')[1]; } function doShopCartChangeCallBack(result){ if(result == "oke"){ el.innerHTML = intNewValue; price = document.getElementById('price-' + getProductID(el.id)); price = price.value.toInt(); var elTotal = document.getElementById('total-' + getProductID(el.id)); elTotal.innerHTML = doShopFormatPrice(intNewValue * price); elSubtotaal = document.getElementById('subtotaal'); elSubtotaalBasis = document.getElementById('subtotaalbasis'); elTotaal = document.getElementById('totaal'); elTotaalBasis = document.getElementById('totaalbasis'); if(intNewValue > intOldValue){ elSubtotaalBasis.value = elSubtotaalBasis.value.toInt() + price; elTotaalBasis.value = elTotaalBasis.value.toInt() + price; }else{ elSubtotaalBasis.value = elSubtotaalBasis.value.toInt() - price; elTotaalBasis.value = elTotaalBasis.value.toInt() - price; } elSubtotaal.innerHTML = doShopFormatPrice(elSubtotaalBasis.value); elTotaal.innerHTML = doShopFormatPrice(elTotaalBasis.value); } doLoader(); el = null; } function doChangeAfleverAdres(strDo){ document.getElementById('aflveradres').style.display = strDo; } function doChangeFromStep3(strUrl){ document.frmConfirm.action = strUrl; document.frmConfirm.submit(); } function doShopCheckConfirmForm(){ var frm = document.frmConfirm; var blnError; blnError = false; //algvrw if(!frm.algvrw.checked){ alert('Sie müssen die AGBs akzeptieren'); blnError = true; } if(!blnError){ frm.submit(); } } function doShopCheckDataForm(){ var frm = document.frmData; var blnError; blnError = false; var aRequired = ['strShopperFirstName', 'strShopperLastName', 'strShopperEmail', 'strAdres', 'strAdresPostal', 'strAdresCity', 'strAdresCountry']; var aMessage = ['Vorname ist ein Pflichtveld', 'Nachname ist ein Pflichtveld', 'Email Adresse ist ein Pflichtveld', 'Strasse ist ein Pflichtveld', 'PLZ ist ein Pflichtveld', 'Ort ist ein Pflichtfeld', 'Land ist ein Pflichtveld']; var aRequired2 = ['strDeliveryAdres', 'strDeliveryAdresPostal', 'strDeliveryAdresCity', 'strDeliveryAdresCountry']; var aMessage2 = ['Strasse (Ablieferungsadresse) ist ein Pflichtveld', 'PLZ (Ablieferungsadresse) ist ein Pflichtveld', 'Ort (ablieferadresse) ist ein Pflichtfeld', 'Land (Ablieferungsadresse) ist ein Pflichtveld']; for(i = 0; i < aRequired.length && !blnError; i++){ var val = eval('frm.' + aRequired[i] + '.value'); if (val == ''){ alert(aMessage[i]); eval('frm.' + aRequired[i] + '.focus()'); blnError = true; } } if(frm.afleveradres[1].checked){ for(j = 0; j < aRequired2.length && !blnError; j++){ var val = eval('frm.' + aRequired2[j] + '.value'); if (val == ''){ alert(aMessage2[j] + ' is required'); eval('frm.' + aRequired2[j] + '.focus()'); blnError = true; } } } if(!blnError){ frm.submit(); } } function doShopSubmitLogin(){ var frm = document.frmlogin; var blnError; blnError = false; if(frm.email.value == "" && !blnError){ alert('E-Mail Adresse ist ein Pflichtveld'); frm.email.focus(); blnError = true; } if(frm.pass.value == "" && !blnError){ alert('Passwort ist ein Pflichtveld'); frm.pass.focus(); blnError = true; } if(!blnError){ frm.submit(); } } function doGetPassword(){ var frm = document.frmlogin; var blnError; blnError = false; if(frm.email.value == "" && !blnError){ alert('E-Mail Adresse ist ein Pflichtveld'); frm.email.focus(); blnError = true; } if(!blnError){ frm.action = 'http://www.nomadoutlet.com/default.asp?page=shop&subpage=step1&action=sendpass'; frm.submit(); } } function doShowVoorwaarden(){ doPopup('http://www.nomadoutlet.com/voorwaarden.asp', 400, 400, 'yes'); } function doShopFormatPrice(strIn){ var strTempLeft; var strTempRight; strIn = "" + strIn; if(strIn.length > 2){ strTempLeft = strIn.substring(0, (strIn.length - 2)); //Left(strNumber, (strIn.length - 2)) if( strIn.substring((strIn.length - 2), strIn.length).toInt() == 0 ){ strTempRight = "-"; }else{ strTempRight = strIn.substring((strIn.length - 2), strIn.length); } if('' == "GBP" ){ return "£ " + strTempLeft + "." + strTempRight; }else{ if('' == "USD"){ return "$ " + strTempLeft + "." + strTempRight; }else{ return "€ " + strTempLeft + "," + strTempRight; } } }else{ if('' == "GBP" ){ return "£ 0.00"; }else{ if('' == "USD"){ return "$ 0,00"; }else{ return "€ 0,00"; } } } } var elChoosenVariant; var productImageURL; var productImage; elChoosenVariant = null; productImageURL = null; productImage = null; //doShopCartVariant('productImageID-" & adoRSImage("ProductImageID") &"', 'variant-" & adoRS("ProductId") &"', 'productImageURL" & adoRS("ProductId") & "','productImage" & adoRS("ProductId") & "'); function doShopCartVariant(strImageID, strVariant, strProductImageURL, strProductImage){ if(el == null){ doLoader(); var nummer; nummer = getProductID(strVariant); el = document.getElementById(strImageID); productImageURL = document.getElementById(strProductImageURL); productImage = document.getElementById(strProductImage); elChoosenVariant = document.getElementById(strVariant); var url = "http://www.nomadoutlet.com/shop.asp?action=variant&productId=" + nummer + "&strImage=" + escape(el.src); objAjax = new Ajax(url, { method: "get"}); objAjax.options.onComplete = doShopCartVariantCallBack; objAjax.request(); } } function doShopCartVariantCallBack(result){ if(result == "oke"){ elChoosenVariant.src = el.src; productImage.src = el.src.replace('/mini_', '/index_'); //alert(productImage.src) productImageURL.href = el.src.replace('/mini_', '/product_'); //productImage.src = el.src; //index_ } doLoader(); el = null; elChoosenVariant = null; productImageURL = null; productImage = null; }