var COLORBOX={STYLE:{TITLE:"colorbox-product_catalog"}};var URL_PRODUCT_REQUEST="/cgi/api/contact/product_request.cgi";var URL_CONTINUE_INQUIRY="/kontakt/anfrage.shtml?";$(document).ready(function(){function c(){$.colorbox.style(COLORBOX.STYLE["TITLE"]);var d=$("div#colorbox");$("div#product_catalog div#product div#details div.image a.image").colorbox({transition:"elastic",speed:350,opacity:0.85,maxHeight:"98.5%",maxWidth:"98.5%",scalePhotos:true,overlayClose:true,open:true,title:function(){return $("div#product_catalog div#product div#details div.image a.image").attr("title").replace(/» /g,"")},onOpen:function(){d.addClass("product_catalog zoom")},onClosed:function(){d.removeClass("product_catalog zoom")}},function(){})}$("div#product_catalog div#product div#details div.image a.image").click(function(){c();return false});$("div#product_catalog div#product div#details div.image a.magnifier").click(function(){c();return false});var a=new OrderCatalog({target:"div#product_catalog div#product div#details div.links a.order_catalog",country:country,checkboxSettings:CHECKBOX_SETTINGS,mask:mask});function b(d){if(d=="first"){$("div#product_catalog div#product div#technical_data div.cards div.first_card").show();$("div#product_catalog div#product div#technical_data div.cards div.second_card").hide();$("div#product_catalog div#product div#technical_data div.tabs span.first_tab").css("background-image",'url("/images/product_catalog/product/technical_data/tabs/tab/left/active.gif")');$("div#product_catalog div#product div#technical_data div.tabs span.second_tab").css("background-image",'url("/images/product_catalog/product/technical_data/tabs/tab/right/inactive.gif")')}else{$("div#product_catalog div#product div#technical_data div.cards div.first_card").hide();$("div#product_catalog div#product div#technical_data div.cards div.second_card").show();$("div#product_catalog div#product div#technical_data div.tabs span.first_tab").css("background-image",'url("/images/product_catalog/product/technical_data/tabs/tab/left/inactive.gif")');$("div#product_catalog div#product div#technical_data div.tabs span.second_tab").css("background-image",'url("/images/product_catalog/product/technical_data/tabs/tab/right/active.gif")')}}$("div#product_catalog div#product div#technical_data div.tabs span.first_tab a").click(function(){b("first");return false});$("div#product_catalog div#product div#technical_data div.tabs span.second_tab a").click(function(){b("second");return false});$('div#product_catalog div#product div#images a[rel="gallery"]').click(function(){$.colorbox.style(COLORBOX.STYLE["TITLE"]);var e=$("div#colorbox");var d=$("div#product_catalog div#product div#images div.image").index($(this).parents("div.image"));$('div#product_catalog div#product div#images a[rel="gallery"]').colorbox({transition:"elastic",speed:350,opacity:0.85,maxHeight:"98.5%",maxWidth:"98.5%",scalePhotos:true,overlayClose:true,current:"Bild {current} von {total}",previous:"Zurück",next:"Weiter",close:"Schliessen",rel:"gallery",slideshow:true,slideshowAuto:false,slideshowSpeed:5000,slideshowStart:"Slideshow starten",slideshowStop:"Slideshow beenden",open:true,title:function(){return $(this).attr("title").replace(/» /g,"")},onOpen:function(){e.addClass("product_catalog gallery");$.colorbox.next(null,d)},onClosed:function(){e.find("div#cboxWrapper div#cboxContent div#cboxSecondPrevious").remove();e.find("div#cboxWrapper div#cboxContent div#cboxSecondNext").remove();e.removeClass("product_catalog gallery")}},function(){e.find("div#cboxWrapper div#cboxContent div#cboxPrevious").attr("title","Zurück").clone(true).appendTo(e.find("div#cboxWrapper div#cboxContent")).attr("id","cboxSecondPrevious").html("");e.find("div#cboxWrapper div#cboxContent div#cboxNext").attr("title","Weiter").clone(true).appendTo(e.find("div#cboxWrapper div#cboxContent")).attr("id","cboxSecondNext").html("")});return false});$("div#product_catalog div#product div#request form input#zip_code").mask(mask,{placeholder:""});$("div#product_catalog div#product div#request form a.continue_inquiry").click(function(){var d=$("div#product_catalog div#product div#request form");var h=URL_CONTINUE_INQUIRY;var l=d.find("input#product_id").val();if(l){h=h+"product="+l+"&"}var j=d.find("input#person").val();if(j){h=h+"person="+j+"&"}var k=d.find("input#email").val();if(k){h=h+"email="+k+"&"}var g=d.find("input#telephone").val();if(g){h=h+"telephone="+g+"&"}var f=d.find("input#street").val();if(f){h=h+"address="+f+"&"}var e=d.find("input#zip_code").val();if(e){h=h+"&zip_code="+e+"&"}var i=d.find("input#city").val();if(i){h=h+"&city="+i+"&"}h=h.replace(/&$/,"");document.location.href=h;return false});$.validator.addMethod("zip_code_and_city_missing",function(e,d){return false});$("div#product_catalog div#product div#request form").validate({submitHandler:function(e){var e=$(e);var g=e.parent().find("h1");var f=e.find("div.elements");var h=e.find("div.loading");var d=e.find("div.messages");f.fadeTo("normal",0.5);h.show();$.ajax({url:URL_PRODUCT_REQUEST,data:{product_id:e.find("input#product_id").val(),person:e.find("input#person").val(),email:e.find("input#email").val(),telephone:e.find("input#telephone").val(),street:e.find("input#street").val(),zip_code:e.find("input#zip_code").val(),city:e.find("input#city").val()},type:"get",dataType:"json",success:function(i){h.hide();f.fadeTo("normal",0,function(){$(this).css("visibility","hidden");if(i){if(i.errors||!i.success){g.text("Die Anfrage konnte leider nicht verschickt werden.");d.html('<p class="error">'+i.errors.join("<br />")+"</p>")}else{g.text("Anfrage wurde erfolgreich verschickt.");d.html("<p>"+i.success+"</p>").fadeIn("normal")}}else{g.text("Die Anfrage konnte leider nicht verschickt werden.")}})}})},errorClass:"error",errorElement:"span",errorPlacement:function(d,e){d.insertAfter(e).hide().css("height","auto").slideDown()},rules:{plz:{required:"input#city:filled",zip_code_and_city_missing:{depends:function(d){return $("input#zip_code:blank").length&&$("input#city:blank").length}}},city:{required:"input#zip_code:filled",zip_code_and_city_missing:{depends:function(d){return $("input#zip_code:blank").length&&$("input#city:blank").length}}}},messages:{person:"Bitte geben Sie Ihren Namen ein.",email:{required:"Bitte geben Sie Ihre E-Mail-Adresse ein.",email:"Bitte geben Sie eine gültige E-Mail-Adresse ein."},street:"Bitte geben Sie Ihre Anschrift ein.",zip_code:{required:"Bitte geben Sie Ihre Postleitzahl ein.",zip_code_and_city_missing:"Bitte geben Sie Ihren Wohnort und die Postleitzahl ein."},city:{required:"Bitte geben Sie Ihren Wohnort ein.",zip_code_and_city_missing:""}}});$("div#product_catalog div#product div#request form a.submit").click(function(){$("div#product_catalog div#product div#request form").submit();return false})});
