function getProduct(jsonData) { currentProduct = jsonData.ResultSet.Result[0]; jQuery(".prodImage").attr("src",currentProduct.Thumbnail); jQuery(".prodName").html(currentProduct.Name); jQuery(".prodVenues").html(currentProduct.Venue); jQuery(".prodButton").attr("href", currentProduct.DeepLink); if ( jQuery(".prodVenues").height() > 250 ) { jQuery(".prodVenues").css("background", "url(http://demandware.edgesuite.net/aaab_prd/on/demandware.static/Sites-ShopCH-Site/-/default/v1329947189591/images/newlayout/product/karte.gif) no-repeat 200px 0"); } else { jQuery(".prodVenues").css("background", ""); } searchIsBusy = false; bObj.removeScriptTag(); } function openVenues( pid ) { try { jQuery(".venuesHolder").css("display", "block"); jQuery(".venuesHolder").css("z-index", "110"); /* mobile Safari on iPad */ if(window.navigator.platform == "iPad") { jQuery("#venuesHolder").css("top", window.pageYOffset + "px"); }; /*make extra-wurst for ie6...*/ if(jQuery.browser.msie && jQuery.browser.version.substr(0,1)=="6") { var top = document.documentElement.scrollTop + "px"; jQuery(".venuesHolder").css("position", "absolute"); jQuery(".venuesHolder").css("top", top); jQuery(".venuesHolder .head").removeClass("head").addClass("headie6"); jQuery(".venuesHolder .body").removeClass("body").addClass("bodyie6"); jQuery(".venuesHolder .footer").removeClass("footer").addClass("footerie6"); jQuery(".venuesHolder .close").css("margin", "0"); } else { jQuery(".venuesHolder").css("position", "fixed"); } jsonTarget = 'http://www.jochen-schweizer.ch/on/demandware.store/Sites-ShopCH-Site/default/Product-Json?pid=' + pid; bObj = new JSONscriptRequest( jsonTarget ); bObj.buildScriptTag(); bObj.addScriptTag(); }catch (err) { alert(err.description); } } function closeVenues() { jQuery(".venuesHolder").css("display","none"); } /* search -----------------------------------------------------------------------------------------------------*/ var firstFocus = true; function completeSearch() { if( firstFocus ) { jQuery.post("http://www.jochen-schweizer.ch/on/demandware.store/Sites-ShopCH-Site/default/API-AllProducts", function(data){ suggestions = data.split('|'); }); firstFocus = false; } } function checkSearchInput() { var query = jQuery("#searchquery")[0].value; if( query == "Erlebnisse / Orte / Stichworte" || query == "Hier Suchbegriff eingeben" || query == "") { jQuery("#searchquery")[0].value = "Hier Suchbegriff eingeben"; jQuery("#searchquery")[0].style.color="#f00"; } else { if (firstFocus) { location.href = "http://www.jochen-schweizer.ch/on/demandware.store/Sites-ShopCH-Site/default/Giftfinder-Show?emptysearch=true"; } else { submitFormButton('SimpleSearchForm','null'); } } } /* * Set price range according to selected price refinement option */ function setPriceRange() { var options = jQuery("#priceRange").children(); for(var i = 0; i < options.length; i++) { if(options[i].selected) { var option = options[i]; //console.info(option); range = option.getAttribute("value"); break; } } if(range != null) { pricelimit = range.split(':'); jQuery("input[name='pmin']").attr("value", pricelimit[0]); jQuery("input[name='pmax']").attr("value", pricelimit[1]); } } function openFolderFAQ(id) { var iconID = "#" + "faqhead"+id; var bodyID = "#" + "faqbody"+id; if(jQuery(iconID).hasClass("plus")) { jQuery(iconID).removeClass("plus").addClass("minus"); jQuery(bodyID).slideDown(); } else { jQuery(iconID).removeClass("minus").addClass("plus"); jQuery(bodyID).slideUp(); } } function openFolderAlphaTab(id) { jQuery("div:not(.folded) .alphaTabBody").slideUp(); jQuery(".folder.minus").removeClass("minus").addClass("plus"); jQuery("#iconAlpha"+id).removeClass("plus").addClass("minus"); jQuery("#productList"+id).slideDown(); jQuery("#productList"+id).addClass("folded"); } function toggleContainer(ID) { var container = document.getElementById(ID); if(container.className == "containerMore") { container.className = "containerLess"; } else { container.className = "containerMore"; } } function addQuantity(productID, inputfieldName, inputfieldValue, minOrder, pUUID, optionValue) { jQuery("#pid").attr("value", productID); jQuery("#optionfield").attr("name", inputfieldName); jQuery("#optionfield").attr("value", inputfieldValue); jQuery("#Quantity").attr("value", minOrder); jQuery("#pUUID").attr("value", pUUID); jQuery("#" + "dwopt_" + productID + "boxOption").attr("value", optionValue); } function selectCreditCard(value) { if(value) { jQuery("#creditCardButton1").css("visibility","visible"); jQuery("#creditCardButton2").css("visibility","visible"); jQuery("#creditCardButton1").show(); jQuery("#creditCardButton2").show(); jQuery("#nextButton1").hide(); jQuery("#nextButton2").hide(); } else { jQuery("#creditCardButton1").hide(); jQuery("#creditCardButton2").hide(); jQuery("#nextButton1").css("visibility","visible"); jQuery("#nextButton2").css("visibility","visible"); jQuery("#nextButton1").show(); jQuery("#nextButton2").show(); } } jQuery.extend(jQuery.expr[':'],{ textboxEmpty: function(el){ return jQuery(el).val() == ""; } }); jQuery(document).ready(function(){ initCoCompact(); /* scroll to first warning */ if(jQuery("label span.warning:visible").size() > 0) { var firstTop = jQuery("label span.warning:visible:first").offset().top-120; /*jQuery("html,body").animate({scrollTop: firstTop}, 1000);*/ } jQuery(".hintRestorable").focusout(function() { if(jQuery(this).val() == "") { var hintText = jQuery(this).attr("title"); jQuery(this).removeClass("enabled"); jQuery(this).val(hintText); } }); }) ; function initCoCompact() { initializeShippingAddresses(); eval("initPaymentDivs(" + "'dwfrm_checkout_selectedpm'" + ")"); jQuery("#couponInput").keypress(function(event) { if (event.which == '13') { event.preventDefault(); submitFormButton('updateForm','dwfrm_cart_addCoupon'); } }); jQuery("#couponInput").focus(function() { jQuery("#couponInputButton").removeClass("gray"); jQuery("#couponInputButton").addClass("red"); jQuery(this).val("").addClass("enabled"); }); jQuery("#giftCertificateInput").focus(function() { jQuery("#giftCertificateInputButton").removeClass("gray"); jQuery("#giftCertificateInputButton").addClass("red"); jQuery(this).val("").addClass("enabled"); }); jQuery("#giftCertificateInput").keypress(function(event) { if (event.which == '13') { event.preventDefault(); submitFormButton("updateForm","dwfrm_cart_addGiftCertificate"); } }); jQuery("#cco_login_login").focus(function() { jQuery("#loginInputButton").removeClass("gray").addClass("red"); jQuery(this).val("").addClass("enabled"); selectLogin(); }); jQuery("#cco_login_password").keypress(function(event) { if (event.which == '13') { event.preventDefault(); submitFormButton("updateForm", "dwfrm_cart_login"); } }); jQuery("#cco_login_password").focus(function() { jQuery("#loginInputButton").removeClass("gray").addClass("red"); jQuery(this).val("").addClass("enabled"); jQuery(this).addClass("enabled"); selectLogin(); }); jQuery("#chooseCheckoutLogin1").change(function() { jQuery("#loginInputButton").removeClass("red").addClass("gray"); }); jQuery("#chooseCheckoutLogin2").change(function() { jQuery("#loginInputButton").removeClass("gray").addClass("red"); }); showErrors(); } function selectDownload() { jQuery("input.nogiftbox").attr("checked", "checked"); jQuery("#shippingMethodHidden").val("download"); jQuery("#WithoutALA").click(); ajaxUpdateForm(); } function selectShipping() { //boxed? var boxed = jQuery("input.giftbox:checked").size() > 0; var express = jQuery("#expressCheckbox").is(":checked"); jQuery("#shippingRadio").attr("checked", "checked"); var method = express ? "expressShipping" : "standard"; if(boxed) { method = "box_" + method; } jQuery("#shippingMethodHidden").val(method); ajaxUpdateForm(); } function selectExpress(shipping) { jQuery("#shippingRadio").attr("checked", "checked"); jQuery("#shippingMethodHidden").val("expressShipping"); ajaxUpdateForm(); } function openOptionBox(pliUUID) { /*jQuery(".optionBox:not("+"#optionBox_" + pliUUID+")").slideUp();*/ jQuery("#optionBox_" + pliUUID).slideToggle(); } /* This function causes problems on the filialfinder page function ajaxUpdateForm() { var postUrl = jQuery("#updateForm").attr("action") + " #updateForm"; var data = jQuery("#updateForm").serializeArray(); setLightbox(jQuery("
")); jQuery("#updateFormHolder").load ( postUrl, data, initCoCompact); return false; } */ function setLightbox(element) { jQuery(".cartLightBox").remove(); var lb = jQuery("
"); jQuery("#updateFormHolder").prepend(lb); jQuery(element).addClass("lightboxContent").hide().insertAfter(jQuery(".cartLightBox")); jQuery(element).fadeIn(400); jQuery(".cartLightBox").css({opacity : 0.0}); jQuery(".cartLightBox").fadeTo(200, 0.5); positionLB(); } function positionLB() { var wheight = jQuery(window).height(); var bwidth = jQuery("#updateFormHolder").innerWidth(); var bheight = jQuery("#updateFormHolder").innerHeight(); var lcwidth = jQuery(".lightboxContent").innerWidth(); var top = jQuery("#updateFormHolder").offset().top; var left = jQuery("#updateFormHolder").offset().left; jQuery(".cartLightBox").css("width", bwidth + "px"); jQuery(".cartLightBox").css("height", (bheight-top) + "px"); jQuery(".cartLightBox").css("top", top + "px"); jQuery(".cartLightBox").css("left", jQuery("#updateFormHolder").offset().left + "px"); jQuery(".lightboxContent").css("left", (bwidth / 2) + left - (lcwidth / 2) + "px"); jQuery(".lightboxContent").css("top", jQuery(window).scrollTop() + 300 + "px"); } function zip_size(zip, land) { switch ( land ) { case "AT" : case "CH" : case "BE" : case "L" : case "LI" : if ( zip.value.length != 4 || zip.value.match('[0-9]{4}') == null ) { alert ( "Das Format der PLZ muss lauten - 9999" ); zip.value = ''; } break; case "DE" : case "IT" : case "F" : case "E" : if ( zip.value.length != 5 || zip.value.match('[0-9]{5}') == null ) { alert ( "Das Format der PLZ muss lauten - 99999" ); zip.value = ''; } break; case "RUS" : if ( zip.value.length != 6 || zip.value.match('[0-9]{6}') == null ) { alert ( "Das Format der PLZ muss lauten - 999999" ); zip.value = ''; } break; case "NL" : if ( zip.value.length != 7 || zip.value.match('[0-9]{4} [A-Z]{2}') == null ) { alert ( "Das Format der PLZ muss lauten - 9999 XX" ); zip.value = ''; } } } function submitCCO() { jQuery("#submitButton").attr("href",""); jQuery("#submitButton").click(function(){}); if(!isDifferentShippingEnabled()) { copyBillingToShipping(); } submitFormButton('updateForm','dwfrm_cart_compactCheckout'); } function selectLogin() { jQuery("#chooseCheckoutLogin1").removeAttr("checked"); jQuery("#chooseCheckoutLogin2").attr("checked", "checked"); } function deSelectLogin() { jQuery("#chooseCheckoutLogin1").attr("checked", "checked"); jQuery("#chooseCheckoutLogin2").removeAttr("checked"); } function initializeShippingAddresses() { var dse = isDifferentShippingEnabled(); if(dse) { jQuery("#shippingAddressForm").show(); jQuery("#billingAddressTitle").show(); jQuery("#combinedAddressTitle").hide(); } else { jQuery("#shippingAddressForm").hide(); jQuery("#billingAddressTitle").hide(); jQuery("#combinedAddressTitle").show(); } } function alaSwitch() { var ala = isDifferentShippingEnabled(); if(ala) { jQuery("#shippingAddressForm").slideDown(); jQuery("#billingAddressTitle").show(); jQuery("#combinedAddressTitle").hide(); clearShipping(); } else { jQuery("#shippingAddressForm").slideUp(); jQuery("#billingAddressTitle").hide(); jQuery("#combinedAddressTitle").show(); copyBillingToShipping(); } } function isDifferentShippingEnabled() { return jQuery("#WithALA:checked").size() > 0; } function copyBillingToShipping() { var bPrefix = "dwfrm_checkout_addresses_billingaddress_"; var sPrefix = "dwfrm_checkout_addresses_shippingaddress_"; var title = jQuery("input[name='" + bPrefix + "title']:checked").val(); jQuery("input[name='" + sPrefix + "title'][value='" + title + "']").attr("checked", "checked"); jQuery("#" + sPrefix + "firstname:textboxEmpty").val(jQuery("#" + bPrefix + "firstname").val()); jQuery("#" + sPrefix + "lastname:textboxEmpty").val(jQuery("#" + bPrefix + "lastname").val()); jQuery("#" + sPrefix + "city:textboxEmpty").val(jQuery("#" + bPrefix + "city").val()); jQuery("#" + sPrefix + "address1:textboxEmpty").val(jQuery("#" + bPrefix + "address1").val()); jQuery("#" + sPrefix + "address2:textboxEmpty").val(jQuery("#" + bPrefix + "address2").val()); jQuery("#" + sPrefix + "zip:textboxEmpty").val(jQuery("#" + bPrefix + "zip").val()); if(jQuery("#" + sPrefix + "country").val()=='') { jQuery("#" + sPrefix + "country").val(jQuery("#" + bPrefix + "country").val()); } } function clearShipping() { var sPrefix = "dwfrm_checkout_addresses_shippingaddress_"; jQuery("input[name='" + sPrefix + "title']").removeAttr("checked"); jQuery("#" + sPrefix + "firstname").val(""); jQuery("#" + sPrefix + "lastname").val(""); jQuery("#" + sPrefix + "city").val(""); jQuery("#" + sPrefix + "address1").val(""); jQuery("#" + sPrefix + "address2").val(""); jQuery("#" + sPrefix + "zip").val(""); jQuery("#" + sPrefix + "country").val(""); } function initPaymentDivs(idPrefix) { if(jQuery("#" + idPrefix + '_Computop:checked').size() >0) { showPaymentDiv("creditcard"); } if(jQuery("#" + idPrefix + '_Cash:checked').size() >0) { showPaymentDiv("kasse"); } if(jQuery("#" + idPrefix + '_PayPal:checked').size() >0) { showPaymentDiv("paypal"); } if(jQuery("#" + idPrefix + '_CASH_ON_DELIVERY:checked').size() >0) { showPaymentDiv("nachnahme"); } if(jQuery("#lastschriftRadio:checked").size() >0) { showPaymentDiv("lastschrift"); } if(jQuery("#" + idPrefix + '_Sofort:checked').size() >0) { showPaymentDiv("sofort"); } if(jQuery(".paymentMethod .radio_wrapper input.radio:checked").size()==0) { jQuery(".paymentMethod .radio_wrapper input.radio").first().click(); } } function showPaymentDiv(divid) { jQuery("div.paymentMethod").hide(); jQuery("#" + divid).show(); } function showErrors() { if(jQuery(".ccoHiddenError").size() > 0) { var alerter; if(jQuery(".ccoAlert").size()==0) { alerter = jQuery("

"); jQuery(alerter).children("h2").html("Bitte überprüfen Sie Ihre Eingabe:"); } else { alerter = jQuery(".ccoAlert"); } /*debugOut("found " + jQuery(".ccoHiddenError") + " error-elements");*/ jQuery(".ccoHiddenError").each(function(idx,obj) { jQuery("
  • ").html(jQuery(obj).text()).appendTo(jQuery(alerter).children("ul")); }); setLightbox(alerter); } } function closeAlert() { jQuery(".ccoAlert").remove(); jQuery(".cartLightBox").remove(); } function placeFakeFormField(formularID, formFieldName) { if(formFieldName != "null") { jQuery("#" + "submit_fake_" + formFieldName).attr("name", formFieldName ); } } function debugOut(text) { jQuery("
    ").html(text).appendTo(jQuery("body")); } var epoq_host = 'http://rs1.epoq.de/inbound-servletapi/'; var epoq_secureHost = 'https://rs1.epoq.de/inbound-servletapi/'; if (window.location.protocol == "https:"){epoq_host = epoq_secureHost; epoq_secure=1}; var epoq_functionParams = ''; var epoq_itemParams = ''; var epoq_cs=''; var epoq_productIds = new Array(); var epoq_quantities = new Array(); var epoq_unitPrices = new Array(); var epoq_filter = new Array(); var epoq_insertElements = new Array(); var epoq_insertElementsMarker = new Array(); var epoq_attributes = new Object(); var epoq_restParameter = new Object(); function epoq_executeFunction() { if (window.location.protocol == "https:"){epoq_host = epoq_secureHost; epoq_secure=1}; var head = document.getElementsByTagName('head')[0]; script = document.createElement('script'); script.id = 'epoq_ExecutorScript'; script.type = 'text/javascript'; script.src = epoq_host + epoq_function + '?' + epoq_functionParams; head.appendChild(script); //script.parentNode.removeChild(script) } function epoq_executeFunctionInPlace() { document.write("" + "" + ""); } function epoq_readAllParams() { epoq_functionParams = ''; if (typeof(epoq_tenantId) != "undefined")epoq_functionParams += "tenantId=" + escape(epoq_tenantId) + "&"; if (typeof(epoq_password) != "undefined")epoq_functionParams += "password=" + escape(epoq_password) + "&"; if (typeof(epoq_customerId) != "undefined")epoq_functionParams += "customerId=" + escape(epoq_customerId) + "&"; if (typeof(epoq_sessionId) != "undefined")epoq_functionParams += "sessionId=" + escape(epoq_sessionId) + "&"; if (typeof(epoq_demo) != "undefined")epoq_functionParams += "demo=" + escape(epoq_demo) + "&"; if (typeof(epoq_rating) != "undefined")epoq_functionParams += "rating=" + escape(epoq_rating) + "&"; if (typeof(epoq_query) != "undefined")epoq_functionParams += "query=" + escape(epoq_search) + "&"; //item if (typeof(epoq_productId) != "undefined")epoq_functionParams += "productId=" + escape(epoq_productId) + "&"; if (typeof(epoq_quantity) != "undefined")epoq_functionParams += "quantity=" + escape(epoq_quantity) + "&"; if (typeof(epoq_unitPrice) != "undefined")epoq_functionParams += "unitPrice=" + escape(epoq_unitPrice) + "&"; //if (typeof(epoq_title) != "undefined")epoq_functionParams += "title=" + escape(epoq_title) + "&"; if (typeof(epoq_params) != "undefined")epoq_functionParams += "params=" + escape(epoq_params) + "&"; //items for ( var i=0, len=epoq_productIds.length; i maxH) { f=1-((h - maxH) / h); pix.width=w * f; pix.height=h * f; } } function epoq_imageLoaded(img, maxheight) { epoq_fixImgs(img, maxheight); if(document.getElementById(img.id) != null) { document.getElementById(img.id).height = img.width; document.getElementById(img.id).height = img.height; document.getElementById(img.id).src = img.src; } } (function() { var table = "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D"; /* Number */ epoq_c = function( /* String */ str, /* Number */ crc ) { if( crc == window.undefined ) crc = 0; var n = 0; //a number between 0 and 255 var x = 0; //an hex number crc = crc ^ (-1); for( var i = 0, iTop = str.length; i < iTop; i++ ) { n = ( crc ^ str.charCodeAt( i ) ) & 0xFF; x = "0x" + table.substr( n * 9, 8 ); crc = ( crc >>> 8 ) ^ x; } return crc ^ (-1); }; })(); function epoq_preLoadImages(image_url, maxheight) { var imageCache = new Array(); var i = 0; for(i=0; i /* Opens a new window with the provided url and dimension @param url the url to open @param width the window width @param height the window height */ function openPopup(url, width, height) { if (url != null) { if (width != null && height != null) { window.open(url, "", "width=" + width +", height=" + height +", scrollbars=yes, resizable=no"); } else { window.open(url, "", "scrollbars=yes, resizable=yes"); } } } /* * Called on product details site * Proceed to next image and keep track of current image index * Function uses variables declared in productdetails.isml */ function nextImage() { if(index < images.length - 1) index++; else index = 0; var url = images[index]; jQuery("#" + "gallery_image").css("display","inline"); hideFlashDivs(); jQuery("#" + "gallery_image").attr("src", url); } /* * Called on product details site * Proceed to previous image and keep track of current image index * Function uses variables declared in productdetails.isml */ function prevImage() { if(index > 0) index--; else index = images.length - 1; var url = images[index]; jQuery("#" + "gallery_image").css("display","inline"); hideFlashDivs(); jQuery("#" + "gallery_image").attr("src", url); } /* * Called on product details site * Swaps an image to the given image url * Function uses variables declared in productdetails.isml */ var swapActive = 1; function galleryImage(imageUrl, newIndex) { jQuery("#" + "gallery_image").css("display", "inline"); hideFlashDivs(); jQuery("#" + "gallery_image").attr("src", imageUrl); index = newIndex; } function hideFlashDivs() { for (i=1; i<5; i++) { if(document.getElementById('flashdiv_' + i)) { document.getElementById('flashdiv_' + i).style.display = "none"; } } } /* Flash Videos */ var flashOn = false; function showVideo(number, param) { hideFlashDivs(); if (param == "flashOff") { jQuery("#" + "gallery_image").css("display","inline"); stopFlashMovie(); flashOn=false; return true; } jQuery("#" + "gallery_image").css("display","none"); jQuery("#" + "flashdiv_" + number).css("display", "block"); flashOn=true; playFlashMovie(); } function checkFlash(number) { if (flashOn) { flashOn=false; document.getElementById('imgdiv').style.display = "inline"; document.getElementById('flashdiv_' + number).style.display = "none"; stopFlashMovie(); } } function getFlashMovieObject() { if (navigator.appName.indexOf("Microsoft Internet")!=-1) { return window.flash; } else { return window.document.flash; } } function stopFlashMovie() { getFlashMovieObject().stop(); } function playFlashMovie() { var flashMovie=getFlashMovieObject(); } function body_loaded() { // Try to load more early: (disabled in lighbox so. //initLightbox(); } /* * formular - id if the form formFieldName - name of the hidden formfield that is used instead of the submit button */ function submitFormButton(formularID, formFieldName) { if(formFieldName != "null") { jQuery("#" + "submit_fake_" + formFieldName).attr("name", formFieldName ); } jQuery("#" + formularID).submit(); } /* Toogle tabs */ function toggleToDetails() { document.getElementById("detailsTab").className = 'active'; document.getElementById("moreTab").className = 'dummy'; document.getElementById("ratingsTab").className = 'dummy'; document.getElementById("details").className = 'show'; document.getElementById("more").className = 'hide'; document.getElementById("ratings").className = 'hide'; } function toggleToDetailsPartner() { document.getElementById("detailsTab").className = 'active'; document.getElementById("moreTab").className = 'dummy'; document.getElementById("details").className = 'show'; document.getElementById("more").className = 'hide'; } function toggleToMore() { document.getElementById("detailsTab").className = 'dummy'; document.getElementById("moreTab").className = 'active'; document.getElementById("ratingsTab").className = 'dummy'; loadTracker('eventdetailsreiter'); document.getElementById("details").className = 'hide'; document.getElementById("more").className = 'show'; document.getElementById("ratings").className = 'hide'; } function toggleToMore2() { document.getElementById("detailsTab").className = 'dummy'; document.getElementById("moreTab").className = 'active'; document.getElementById("details").className = 'hide'; document.getElementById("more").className = 'show'; } function toggleToRatings() { document.getElementById("detailsTab").className = 'dummy'; document.getElementById("moreTab").className = 'dummy'; document.getElementById("ratingsTab").className = 'active'; loadTracker('erlebnisberichtereiter'); document.getElementById("details").className = 'hide'; document.getElementById("more").className = 'hide'; document.getElementById("ratings").className = 'show'; } function toggleToDetails2() { document.getElementById("detailsTab").className = 'active'; document.getElementById("ratingsTab").className = 'dummy'; document.getElementById("details").className = 'show'; document.getElementById("ratings").className = 'hide'; } function toggleToRatings2() { document.getElementById("detailsTab").className = 'dummy'; document.getElementById("ratingsTab").className = 'active'; loadTracker('erlebnisberichtereiter'); document.getElementById("details").className = 'hide'; document.getElementById("ratings").className = 'show'; } function loadTracker(desc) { var myurl = et_trackerPage; var myvars = "et_cid=24&et_lid=35&et_sub="+desc; // iframe for tracking: sendeHTTPRequest('POST',myurl,myvars); } function sendeHTTPRequest(method, url, variables) { jQuery.ajax({ type: method, url: url, data: variables }); } function toggleSubNav ( toggleID , imageID) { var selector = "#" + toggleID; if(jQuery(selector).prev().hasClass("selected")) { jQuery(selector).prev().removeClass("selected"); jQuery(selector).hide(); } else { jQuery(selector).prev().addClass("selected"); jQuery(selector).show(); } } // Show hint to enlarge image with mouseover: function mag_over(id) { document.getElementById(id).style.display = "inline"; } function mag_out(id) { document.getElementById(id).style.display = "none"; } function nav1_over(el) { el.style.fontWeight="bold"; var image = document.getElementById("img:" + el.id); image.src="/on/demandware.static/Sites-JSShop-Site/-/default/images/newlayout/navi_haupt_active.png"; } function nav1_out(el) { el.style.fontWeight="normal"; var image = document.getElementById("img:" + el.id); image.src="/on/demandware.static/Sites-JSShop-Site/-/default/images/newlayout/navi_haupt.png"; } function nav2_over(el) { el.style.fontWeight="bold"; var image = document.getElementById("img:" + el.id); image.src="/on/demandware.static/Sites-JSShop-Site/-/default/images/newlayout/navi_sub_active.png"; } function nav2_out(el) { el.style.fontWeight="normal"; var image = document.getElementById("img:" + el.id); image.src="/on/demandware.static/Sites-JSShop-Site/-/default/images/newlayout/navi_sub.png"; } // Giftfinder functions #################################################################################### var giftFinder_searchURL = "/on/demandware.store/Sites-ShopCH-Site/default/Giftfinder-Products"; function GiftfinderLoad(sessionVars) { if (document.GiftfinderForm != undefined){ if ( sessionVars["state"] != '' ) { document.GiftfinderForm.GiftfinderForm_State.value = sessionVars["state"]; } if ( sessionVars["target"] != '' ) { document.GiftfinderForm.GiftfinderForm_Target.value = sessionVars["target"] } if ( sessionVars["price"] != '' ) { document.GiftfinderForm.GiftfinderForm_Price.value = sessionVars["price"] } if ( sessionVars["category"] != '' ) { document.GiftfinderForm.GiftfinderForm_Category.value = sessionVars["category"] } else { document.GiftfinderForm.GiftfinderForm_Category.value = 'leer'; } Giftfinder_Selection (); } } function Giftfinder_Selection() { if ( document.GiftfinderForm.GiftfinderForm_Target ) { document.GiftfinderForm.GiftfinderForm_Target.style.color = document.GiftfinderForm.GiftfinderForm_Target.value == 'leer' ? "#"+"A3A3A3" : "#"+"E2001A"; } if ( document.GiftfinderForm.GiftfinderForm_Price ) { document.GiftfinderForm.GiftfinderForm_Price.style.color = document.GiftfinderForm.GiftfinderForm_Price.value == 'leer' ? "#"+"A3A3A3" : "#"+"E2001A"; } if ( document.GiftfinderForm.GiftfinderForm_Category ) { document.GiftfinderForm.GiftfinderForm_Category.style.color = document.GiftfinderForm.GiftfinderForm_Category.value == 'leer' ? "#"+"A3A3A3" : "#"+"E2001A"; } if ( document.GiftfinderForm.GiftfinderForm_State ) { document.GiftfinderForm.GiftfinderForm_State.style.color = document.GiftfinderForm.GiftfinderForm_State.value == 'leer' ? "#"+"A3A3A3" : "#"+"E2001A"; } var params = new Array(); if (document.GiftfinderForm.GiftfinderForm_State) { params.push('GiftfinderForm_State=' + encodeURIComponent(document.GiftfinderForm.GiftfinderForm_State.value)); } if (document.GiftfinderForm.GiftfinderForm_Price) { params.push('GiftfinderForm_Price=' + document.GiftfinderForm.GiftfinderForm_Price.value); } if (document.GiftfinderForm.GiftfinderForm_Target) { params.push('GiftfinderForm_Target=' + document.GiftfinderForm.GiftfinderForm_Target.value); } if (document.GiftfinderForm.GiftfinderForm_Category) { params.push('GiftfinderForm_Category=' + document.GiftfinderForm.GiftfinderForm_Category.value); } jQuery.ajax({ url: "/on/demandware.store/Sites-ShopCH-Site/default/Giftfinder-Go" + "?" + params.join("&"), success: function(data){Giftfinder_showResults(data);}, dataType: "xml" }); } function Giftfinder_showResults(data) { var results = jQuery(data).find("Products").text(); jQuery("#" + "GiftfinderResults").html(results); } function Giftfinder_submitForm() { jQuery("#" + "GiftfinderForm").submit(); return false; } function checkFilial( zipCity ) { if (zipCity.value == "" ) { zipCity.style.color="#" + "959599"; zipCity.value = "Ort oder PLZ"; } else { if (zipCity.value == "Ort oder PLZ" ) { zipCity.value = ""; zipCity.style.color="#" + "000"; } } } jQuery(document).ready(function() { fixIE(); initializeUIComponents(); }); function fixIE() { if(jQuery.browser.msie){ if(jQuery.browser.version.substr(0,1)=="6"){ jQuery(".content1 .pad8").css("padding-bottom", "0px"); jQuery(".content1 .price").css("height", "10px"); jQuery(".content1 .price").css("padding-top", "3px"); jQuery(".infobox .price").css("height", "10px"); jQuery(".infobox .price").css("padding-top", "3px"); /* fix missing attribute selector [href] in ie6 */ jQuery(".breadcrumbLink[href]").css("text-decoration", "underline"); /* fix buttons with orange background */ jQuery(".button.small.red.bgorange .left").css("background-position", "-360px -86px"); jQuery(".button.small.red.bgorange .right").css("background-position", "-365px -86px"); } /* images inside an a element are not clickable, fix all IE versions */ jQuery("a span img").click(function() { document.location.href = jQuery(this).parent().parent().attr("href"); } ); /*jQuery(".boxContent.eventBoxPadding").css("padding-top", "8px");*/ } } function initializeUIComponents(){ jQuery(".tab").each(function(){ if(!jQuery(this).hasClass("tabselected")){ jQuery(this).hover( function(){jQuery(this).addClass("tabselected");}, function(){jQuery(this).removeClass("tabselected");}); } }); } function submitenter( formID, fieldID, e ) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { submitFormButton( formID, fieldID ); return false; } else return true; } var fadeTimeoutInterval = 7000; jQuery(document).ready(function() { if (typeof(timeout)!="undefined") { fadeTimeoutInterval = timeout; } if (jQuery("#currentLink").length) { if (jQuery("#currentLink").attr("href") == "#") { document.getElementById("currentLink").style.cursor = 'default'; } else { document.getElementById("currentLink").style.cursor = 'pointer'; } } jQuery("#currentLink img").css("visibility", "visible"); setTimeout(fade, fadeTimeoutInterval); }); function fade() { if(jQuery("#currentLink").children().length > 1) { jQuery("#currentLink img:last").animate({"opacity" : 0}, 1600, afterFade); } } function afterFade() { var lastImg = jQuery("#currentLink img:last"); var src = lastImg.attr("src"); var href = lastImg.attr("id"); var title = lastImg.attr("title"); lastImg.remove(); jQuery("").attr("src", src).attr("id", href).attr("title", title).prependTo("#currentLink"); jQuery("#currentLink img:first").css("visibility", "visible"); jQuery("#currentLink img:first").css("opacity", 1); jQuery("#currentLink").attr("href", jQuery("#currentLink img:last").attr("id")); jQuery("#currentLink").attr("name", jQuery("#currentLink img:last").attr("name")); if (jQuery("#currentLink").attr("href") == "#") { document.getElementById("currentLink").style.cursor = 'default'; } else { document.getElementById("currentLink").style.cursor = 'pointer'; } setTimeout(fade, fadeTimeoutInterval); } function isEmail ( email ) { if (email.indexOf ( "@" ) != "-1" && email.indexOf(".") != "-1" ) { return true ; } else { return false; } } function isFilled ( text ) { if (text == "" || text == null ) { return false; } else { return true ; } } function toggleWishlist( status ) { if ( status == false ) { document.getElementById('message').style.display = 'block'; document.getElementById('others').style.display = 'block'; document.getElementById('preview').style.display = 'block'; } else { document.getElementById('message').style.display = 'none'; document.getElementById('others').style.display = 'none'; document.getElementById('preview').style.display = 'none'; } } function sendForm () { var myform = document.forms['sendwishlist']; document.getElementById("myname").style.border="1px solid #989898"; document.getElementById("myemail").style.border="1px solid #989898"; document.getElementById("yourname").style.border="1px solid #989898"; document.getElementById("youremail").style.border="1px solid #989898"; if (!isFilled(myform.elements['myname'].value)) { document.getElementById("myname").style.border="1px solid red"; myform.elements['myname'].focus(); return false; } if (!isEmail(myform.elements['myemail'].value)) { document.getElementById("myemail").style.border="1px solid red"; myform.elements['myemail'].focus(); return false; } if ( myform.elements['justtome'].checked ) { document.sendwishlist.submit(); } if (!isFilled(myform.elements['yourname'].value)) { document.getElementById("yourname").style.border="1px solid red"; myform.elements['yourname'].focus(); return false; } if (!isEmail(myform.elements['youremail'].value)) { document.getElementById("youremail").style.border="1px solid red"; myform.elements['youremail'].focus(); return false; } document.sendwishlist.submit(); } function preview () { var hoch=screen.height; var breit=screen.width; var url = 'http://www.jochen-schweizer.ch/on/demandware.store/Sites-ShopCH-Site/default/Wishlist-Preview' + '?myname=' + document.getElementById("myname").value + '&myemail=' + document.getElementById("myemail").value + '&yourname=' + document.getElementById("yourname").value + '&youremail=' + document.getElementById("youremail").value + '&usermessage=' + document.getElementById("usermessage").value ; settings='width=500,height=405,scrollbars=no,location=no, dependent=yes,directories=no,status=no,menubar=no, toolbar=no,resizable=no'; win = window.open(url,'userrequestwin',settings); win.focus(); if (window.focus) {win.focus()} win.moveTo(100,100); } function giftbox_closeAllBut ( id ) { for (var country in countryMaps) { var toggle = (id == country) ? 'on' : 'off'; openFolderGiftbox (country , toggle ); } } function giftbox_setMapImage(id) { giftbox_closeAllBut ( id ); for (var country in countryMaps) { if(id == country) { jQuery("#klickmap").attr("src", "http://demandware.edgesuite.net/aaab_prd/on/demandware.static/Sites-ShopCH-Site/-/default/v1329947189591/images/" + countryMaps[country]); } } } function openFolderGiftbox(id, on) { if (! jQuery("fihead"+id) ) { return; } if( on == 'on') { jQuery("#fihead" + id).removeClass("plus"); if(jQuery("#fihead" + id).hasClass("minus")) { openFolderGiftbox(id, "off"); return; } else { jQuery("#fihead" + id).addClass("minus"); } jQuery("#fibody" + id).slideDown(); } if( on == 'off') { if(jQuery("#fihead" + id).hasClass("plus")) { return; } else{ jQuery("#fihead" + id).addClass("plus"); jQuery("#fihead" + id).removeClass("minus"); } jQuery("#fibody" + id).slideUp(); } }