(function(a){a.fn.extend({mainsearch:function(d,h){h=a.extend({},a.Mainsearch.defaults,{url:typeof d=="string"?d:null},h);h.formatAddToCart=typeof h.formatAddToCart=="function"?h.formatAddToCart:function(){return""};h.onFormSubmit=typeof h.onFormSubmit=="function"?h.onFormSubmit:function(){return false};h.makeResultsDiv=typeof h.makeResultsDiv=="function"?h.makeResultsDiv:function(){return false};h.modifyUrl=typeof h.modifyUrl=="function"?h.modifyUrl:function(w){return w};return this.each(function(){new a.Mainsearch(this,h)})},setOptionsMS:function(d){return this.trigger("setOptionsMS",[d])},unmainsearch:function(){return this.trigger("unmainsearch")}});a.Mainsearch=function(d,h){function w(){T.noResults()}function Y(i,e){if(a("#exo-results").length)a("#exo-results").empty();else try{h.makeResultsDiv()}catch(F){if(!a("#exo-results").length)return}e&&typeof e=="object"?T.display(e,i):w()}function W(i,e,F,z){if(typeof h.url=="string"&&h.url.length>0){z="";if(a.cookie)z=a.cookie("ecs-userId");var n={sv:"search",u:z,q:i.q.replace(/\$amp;/g,"&").replace(/\$eq;/g,"="),wt:"json"};a.each(h.extraParams,function(b,p){if(p)n[b]=typeof p=="function"?p():p});a.ajax({mode:"abort",port:"mainsearch"+d.name,dataType:"text",cache:h.httpCaching,url:h.url,data:a.extend(n,e),success:function(b){var p=b;p=h.parse&&h.parse(b)||eval("("+b+")");F(i,p)}})}else z()}var T=a.Mainsearch.Select(h,a("#exo-results")),x;a(d).bind("setOptionsMS",function(i,e){a.extend(h,e)});a("body").append("<a rel='ms-main-history' id='_mainsearch' href='#' style='opacity:0;font-size:1px;'>.</a>");a(d).parents("form").submit(function(){var i=encodeURI(a(d).val()).replace(/&/g,"$amp;").replace(/=/g,"$eq;");a("#_mainsearch").attr("href","#q="+i).click();a(d).blur();var e=false;try{e=h.onFormSubmit(i)}catch(F){}if(e!==true)e=false;return e});a.history.init(function(i){if(i==""&&a("#exo-results > div").length)a.browser.msie&&(a.browser.version<8||document.documentMode<8)||location.reload();if(typeof i=="string"&&i.search(".*q=.+")>=0){if(a.browser.msie)i=i.replace(/^.*#/,"");i=decodeURIComponent(i);i=i.split("&");var e={};a.each(i,function(l,S){var N=S.split("=");e[N[0]]=N[1]});if(e.q){if(!x||e.q!=x){x=e.q;a.Autocompleter.SubmitTrackingMsg&&a.Autocompleter.SubmitTrackingMsg(e.q.replace(/\$amp;/g,"&").replace(/\$eq;/g,"="),null,null,null,"fullsearch",h)}i=e.npp?parseInt(e.npp):h.rowsPerPage;var F=(e.p?e.p-1:0)*i,z=e.sort?e.sort:h.defaultSorting,n=e.catl?parseInt(e.catl):1;e.pmin&&parseInt(e.pmin);e.pmax&&parseInt(e.pmax);var b=e.plo?parseInt(e.plo):"*",p=e.phi?parseInt(e.phi):"*",t=[],v=e.cats?e.cats.split("|"):[];a.each(v,function(l){t.push("Category:"+v[l])});if(b!="*"||p!="*")t.push("Price:["+b+" TO "+p+"]");e.brand&&t.push("Brand:"+e.brand);i={rows:i,sort:z,facet_query:"Category:"+n,start:F};if(t.length>0)i.fq=t.join("+");if(h.sortBrandsByCount===false)i["f.Brand.facet_sort"]="index";if(h.sortCategoriesByCount===false)i["f.Category.facet_sort"]="index";W(e,i,Y,w)}else w()}},"");a("a[rel='ms-main-history']").click(function(){var i=this.href;i=i.replace(/^.*#/,"");a.history.load(i);return false})};a.Mainsearch.defaults={currencySymbol:"&euro;",currencySymbolAfterPrice:true,decimalPoint:",",noResultsMsg:"Es wurden keine Treffer gefunden.",of:"von",to:"bis",results:"Treffer",sortBy:"Sortieren nach",relevance:"Relevanz",lowestPrice:"Niedrigster Preis",highestPrice:"H&ouml;chster Preis",categories:"Kategorien",brands:"Hersteller",prices:"Preis einschr&auml;nken",brand:"Hersteller",more:"weitere",deselect:"Aufheben",httpCaching:true,formatAddToCart:function(){return""},onFormSubmit:function(){return false},makeResultsDiv:function(){return false},modifyUrl:function(d){return d},addToCart:false,sortCategoriesByCount:true,sortBrandsByCount:false,projectId:-1,extraParams:{},defaultSorting:"score",imageDir:"img",rowsPerPage:15};a.Mainsearch.Select=function(d){function h(){a("#exo-results").html("<div>"+d.noResultsMsg+"</div>")}function w(n){var b="#";a.each(n,function(p,t){if(t)b+=p+"="+urlencode(t)+"&"});return b.substr(0,b.length-1)}function Y(n,b){var p=document.compatMode=="BackCompat";e=b.npp?parseInt(b.npp):d.rowsPerPage;F=b.p?b.p-1:0;var t=F*e,v=b.sort?b.sort:d.defaultSorting,l=b.catl?parseInt(b.catl):1,S=b.pmin?parseInt(b.pmin):"*",N=b.pmax?parseInt(b.pmax):"*",C=b.plo?parseInt(b.plo):"*",D=b.phi?parseInt(b.phi):"*",m=b.cats?b.cats.split("|"):[],G=n.response.docs,r=n.facet_counts&&n.facet_counts.facet_fields.Brand,o=n.facet_counts&&n.facet_counts.facet_fields.Category,s=n.facet_counts&&n.facet_counts.facet_fields.Price,Z=n.response.numFound,$=G.length,H=t+1,X=t+$;if($<=0)h();else{var J=a("<div/>").attr("id","exo-facet-hdr").appendTo(a("#exo-results"));x=a("<div/>").attr("id","exo-facets").appendTo(a("#exo-results"));var c;if(v=="Brand"&&r&&r.length<4)v="score";if(o||m.length>0){a("<h3/>").html(d.categories).appendTo(J);var O=a("<div/>").addClass("exo-cats").appendTo(x),g=a("<ol/>").appendTo(O),P=g;if(!b.cats){b.cats="";b.catl=1}var I=b.cats;l=b.p=1;var q;if(m.length>0){b.cats="";b.catl=0;url=w(b);a("<li/>").html("<span class='exo-FName exo-wide-cat exo-bold'><a rel='ms-history' title='"+d.deselect+"' href='"+
url.replace(/\&/g,"&amp;")+"'>&lsaquo; "+decodeURIComponent(m[0].substr(1))+"</a></span>&nbsp;").appendTo(g);q=m[0];for(c=1;c<m.length;){b.cats=q;b.catl=++l;url=w(b);if(c>0){g=a("<li/>").appendTo(g);document.documentMode<8&&g.css("display","inline-block");g=a("<ol/>").addClass("exo-cats-list").appendTo(g)}a("<li/>").addClass("exo-li-height").html("<span class='exo-FName exo-wide-cat exo-bold'><a rel='ms-history' title='"+d.deselect+"' href='"+url.replace(/\&/g,"&amp;")+"'>&lsaquo; "+decodeURIComponent(m[c].substr(1))+"</a></span>&nbsp;").appendTo(g);c++;q+="|"+m[c-1]}g=a("<li/>").appendTo(g);document.documentMode<8&&g.css("display","inline-block");g=a("<ol/>").addClass("exo-cats-list").appendTo(g);l++}var k=a(g).outerHeight();m=k;var K;if(o&&l<=4){q=I?I+"|":"";var j;for(c=0;c<o.length;c+=2){k=a(P).outerHeight();j=a(O).outerHeight();if(k>m&&k>j){for(var u=k-m;m>j-i;)m-=u;a(P).css({height:m,overflow:"hidden",position:"relative"});a("<div/>").addClass("exo-more").html(d.more+"&hellip;").click(function(){a(P).removeAttr("style");a(O).addClass("exo-facet-border").css("overflow-y","auto");a(this).remove()}).appendTo(O)}K=m;m=k;b.cats=q+urlencode(o[c]);b.catl=l+1;url=w(b);lastNode=a("<li/>").addClass("exo-li-height").html("<span class='exo-FName exo-slim-cat'><a rel='ms-history' href='"+url.replace(/\&/g,"&amp;")+"' title='"+o[c].substr(1)+"'>"+o[c].substr(1)+"</a></span>&nbsp;<span class='exoFCount'>("+o[c+1]+")</span>").appendTo(g)}k=a(P).outerHeight();j=a(O).outerHeight();if(k>m&&k>j){for(u=k-m;m>j-i;)m-=u;a(P).css({height:m,overflow:"hidden",position:"relative"});a("<div/>").addClass("exo-more").html(d.more+"&hellip;").click(function(){a(P).removeAttr("style");a(O).addClass("exo-facet-border").css("overflow-y","auto");a(this).remove()}).appendTo(O)}b.p=F+1}p&&P.css("margin-left","0");b.cats=I;b.catl=l}if(r){a("<h3/>").html(d.brands).appendTo(J);var Q=a("<div/>").addClass("exo-brands").appendTo(x);l=a("<div/>").appendTo(Q);var A;j=0;o=[];if(b.brand)o=decodeURIComponent(b.brand).split("|");I=[];if(o.length){c=a("<form/>").appendTo(l);a(c).attr("action","");A=a("<ul/>").addClass("exo-brand-sel").appendTo(c)}for(j=0;j<o.length;j++){u=true;for(c=0;c<r.length;c+=2)if(r[c]==o[j])u=false;if(!u){k=a("<li/>").appendTo(A);k=a("<label/>").attr("for","exo-sel-brand"+j).addClass("selected").html("<input id='exo-sel-brand"+j+"' class='exo-cbox' value='"+urlencode(o[j])+"' type='checkbox' checked='yes' /><span class='exo-FName'>"+o[j]+"</span>").appendTo(k);I.push(urlencode(o[j]))}}q=0;if(A)q=a(A).outerHeight();var R=a("<form/>").appendTo(l);a(R).attr("action","");A=a("<ul/>").addClass("exo-brand-sel").appendTo(R);m=k=a(A).outerHeight();for(c=g=0;c<r.length;c+=2){k=a(A).outerHeight()+q;j=a(Q).outerHeight();if(!g&&k>q&&k>j){u=K-q;a(A).css({height:u,overflow:"hidden",position:"relative"});if(g=a(".exo-cats > ol[style*='height']")){g=a(g).outerHeight()-q;if(g>0&&u!=g)u=g}a(R).css({height:u});g=a("<div/>").addClass("exo-more").html(d.more+"&hellip;").click(function(){a(R).removeAttr("style");a(A).removeAttr("style");a(Q).addClass("exo-facet-border").css("overflow-y","auto");a(this).remove()}).appendTo(l)}u=false;for(j=0;j<o.length;j++)if(r[c]==o[j])u=true;if(!u){K=m;m=k;k=a("<li/>").appendTo(A);k=a("<label/>").attr("for","exo-brand"+c).html("<input id='exo-brand"+c+"' class='exo-cbox' value='"+urlencode(r[c])+"' type='checkbox' /><span class='exo-FName exo-slim-cat'>"+r[c]+"</span>&nbsp;<span class='exoFCount'>("+r[c+1]+")</span>").appendTo(k)}}k=a(A).outerHeight()+q;j=a(Q).outerHeight();if(!g&&k>q&&k>j){u=K-q;a(A).css({height:u,overflow:"hidden",position:"relative"});if(g=a(".exo-cats > ol[style*='height']")){g=a(g).outerHeight()-q;if(g>0&&u!=g)u=g}a(R).css({height:u});g=a("<div/>").addClass("exo-more").html(d.more+"&hellip;").click(function(){a(R).removeAttr("style");a(A).removeAttr("style");a(Q).addClass("exo-facet-border").css("overflow-y","auto");a(this).remove()}).appendTo(l)}if(q>0&&j!=q)if(g){if(a(l).outerHeight()>j){a(R).removeAttr("style");a(A).removeAttr("style");a(Q).addClass("exo-facet-border").css("overflow-y","auto");a(g).remove()}}else q>j&&a(Q).addClass("exo-facet-border").css("overflow-y","auto");b.brand=I.join("|");a("input.exo-cbox").click(function(){var f=a(this).attr("checked");a(this).closest("label").toggleClass("selected",f);var y=[];a("label.selected > input.exo-cbox").each(function(){y.push(a(this).val())});b.brand=y.length?y.join("|"):"";b.p=1;f=w(b);f=f.replace(/^.*#/,"");a.history.load(f)})}if(p){var L=a("div.exo-cats").width()*0.8;a("div.exo-cats .exo-slim-cat").each(function(){a(this).width()>L&&a(this).width(L)});L=a("div.exo-cats").width()-5;a("div.exo-cats .exo-wide-cat").each(function(){a(this).width()>L&&a(this).width(L)});L=a("div.exo-brands").width()*0.8;a("div.exo-brands .exo-slim-cat").each(function(){a(this).width()>L&&a(this).width(L)});a(".exo-brand-sel li").hover(function(){a(this).toggleClass("exo-brand-hover")})}a("<h3/>").html(d.prices).appendTo(J);J=a("<div/>").addClass("exo-price").appendTo(x);if(s&&s.length>=2){o=s.length;s[o]=s[o-2]+1;s[o+1]=0;o+=2;K=parseInt(s[0]);m=parseInt(s[o-2]);var E=[],U=false;q=I=false;if(C==="*"||C===K)C=K;else I=U=true;if(D==="*"||D===m)D=m;else q=U=true;J.html("<table id='exo-price-hdr'><tr><td><input type='text' id='exo-pmin' value='"+C+"'/></td><td class='exo-center exo-bold'><label for='exo-pmax'>"+d.to+"</label></td><td class='exo-right'><input type='text' id='exo-pmax' value='"+D+"'/>&nbsp;<span class='exo-bold'>"+d.currencySymbol.split(" ")[0]+"</span></td></tr></table><div id='exo-price-slider'></div>");k=0;l=g=o/2-1;j=0;var B={};if(U){for(c=0;c<o;c+=2){j+=s[c+1];E[c]=s[c];E[c+1]=j;if(I&&k===0&&C<=E[c])k=c/2;if(q&&l===g&&D<=E[c])l=c/2}B.pmax=0;B.pmin=0;B.phi=0;B.plo=0;B.p=0;url="#";a.each(b,function(f,y){if(y&&B[f]!=0)url+=f+"="+urlencode(y)+"&"});url=url.substr(0,url.length-1);c=0;if(k>0)c=E[k*2-1];c=E[l*2+1]-c;a("<div id='exo-price-count'><span id='exo-price-clr'><a rel='ms-history' class='exo-x' href='"+url.replace(/\&/g,"&amp;")+"'><img src='"+d.imageDir+"/theX.png' alt='x' title='"+d.deselect+"'/></a></span>&nbsp;"+d.results+":&nbsp;<span id='exo-price-cnt' class='exoFCount'>"+c+"</span></div>").appendTo(J)}else{for(c=0;c<s.length;c+=2){j+=s[c+1];E[c]=s[c];E[c+1]=j}a("<div id='exo-price-count'><span id='exo-price-clr' class='exo-x exo-x-gray'><img src='"+d.imageDir+"/theX-gray.png' alt='x'/></span>&nbsp;"+d.results+":&nbsp;<span class='exoFCount'>"+j+"</span></div>").appendTo(J)}if(S==="*")S=K;if(N==="*")N=m;a("#exo-price-slider").slider({range:true,min:0,max:g,values:[k,l],slide:function(f,y){var M=y.values[0]*2,V=y.values[1]*2,ba=E[M],ca=E[V],aa=0;if(M>0)aa=E[M-1];M=E[V+1]-aa;a("#exo-pmin").val(ba);a("#exo-pmax").val(ca);a("#exo-price-count > span.exoFCount").html(M)},change:function(){C=parseInt(a("#exo-pmin").val());D=parseInt(a("#exo-pmax").val());b.pmax=N;b.pmin=S;b.p=0;var f=false;if(D!==N&&b.phi===undefined||b.phi>0&&b.phi!=D){b.phi=D;f=true}if(C!==S&&b.plo===undefined||b.plo>0&&b.plo!=C){b.plo=C;f=true}if(f){f=w(b);f=f.replace(/^.*#/,"");a.history.load(f)}}});a("#exo-pmin").blur(function(){if(parseInt(a(this).val())<0){a(this).val(C);return false}var f=a("#exo-price-slider").slider("values",0);a("#exo-price-slider").slider("values",0,f)}).keydown(function(f){if(f.keyCode==13){if(parseInt(a(this).val())<0){a(this).val(C);return false}f=a("#exo-price-slider").slider("values",0);a("#exo-price-slider").slider("values",0,f)}});a("#exo-pmax").blur(function(){if(parseInt(a(this).val())<0){a(this).val(D);return false}var f=a("#exo-price-slider").slider("values",1);a("#exo-price-slider").slider("values",1,f)}).keydown(function(f){if(f.keyCode==13){if(parseInt(a(this).val())<0){a(this).val(D);return false}f=a("#exo-price-slider").slider("values",1);a("#exo-price-slider").slider("values",1,f)}})}else{if(C!="*"||D!="*")U=true;B={};if(U){B.pmax=0;B.pmin=0;B.phi=0;B.plo=0;B.p=0;url="#";a.each(b,function(f,y){if(y&&B[f]!=0)url+=f+"="+urlencode(y)+"&"});url=url.substr(0,url.length-1);a('<span id="exo-price-clr"><a rel="ms-history" href="'+url.replace(/\&/g,"&amp;")+'">Aufheben</a></span> ').appendTo(J)}}x=a("<div/>").attr("id","exo-header").appendTo(a("#exo-results"));s=a("<div/>").addClass("exo-headerLine").appendTo(x);s.addClass("first");W(s,Z,F,b);s=a("<div/>").addClass("exo-headerLine").appendTo(x);s.append("<span id='exo-numRes'>"+H+" &ndash; "+X+" "+d.of+" "+Z+" "+d.results+"</span>");H=a("<span/>").attr("id","exo-numPerPage").appendTo(s);for(c=d.rowsPerPage;c<=d.rowsPerPage*4;c*=2)if(c==e)a('<span class="current">'+c+"</span> ").appendTo(H);else{b.p=1;b.npp=c;url=w(b);a('<span class="exo-npp"><a rel="ms-history" href="'+url.replace(/\&/g,"&amp;")+'">'+c+"</a></span> ").appendTo(H)}b.npp=e;c=a("<span/>").addClass("exo-sorting").appendTo(s);c.text(d.sortBy+" ");c=a("<select/>").appendTo(c).change(function(){b.sort=a(this).val();b.p=0;var f=w(b);f=f.replace(/^.*#/,"");a.history.load(f)});H="";if(r&&r.length>=4)H='<option value="Brand">'+d.brand+"</option>";c.html('<option value="score">'+d.relevance+"</option>"+H+'<option value="Price">'+d.lowestPrice+'</option><option value="Price desc">'+d.highestPrice+"</option>").val(v);x=a("<div/>").attr("id","exo-result-list").addClass("listview").appendTo(a("#exo-results"));a("<div/>").addClass("exo-result-sep").appendTo(x);for(c=0;c<$;c++){v=t+c+1;r=G[c].SN_name.replace(/\'/g,"&rsquo;");H="";X=d.modifyUrl(G[c].URL).replace(/\&/g,"&amp;");if(G[c].Image)H="<a class='exo-prod-url' rel='"+v+"' href='"+X+"' title='"+r+"'><img alt='' src='"+G[c].Image+"' title='"+r+"' /></a>";v="<div class='exo-img'><div>"+H+"</div></div><div class='exo-desc'><div class='exo-prodName'><a class='exo-prod-url' rel='"+v+"' href='"+X+"' title='"+r+"'>"+G[c].SN_name+"</a></div>";v+="<div class='exo-prodDesc'>"+G[c].Description+"</div>";r=d.formatAddToCart(G[c]);if(typeof r=="string"&&r.length>0)v+="<div class='exo-addToCart'>"+r+"</div>";v+="<div class='exo-prodPrice'>";v+=d.currencySymbolAfterPrice?G[c].Price.replace(".",d.decimalPoint)+" "+d.currencySymbol:d.currencySymbol+G[c].Price.replace(".",d.decimalPoint);v+="</div></div>";a("<div/>").addClass("exo-result").html(v).appendTo(x);a("<div/>").addClass("exo-result-sep").appendTo(x)}p&&a("div.exo-img img").load(function(){var f=a(this).height(),y=a(this).width(),M=a(this).parents("div").height(),V=a(this).parents("div").width();if(f>=y&&f>M)a(this).height(M);else f<y&&y>V&&a(this).width(V)});W(x,Z,F,b);a("a[rel='ms-history']").click(function(){var f=this.href;f=f.replace(/^.*#/,"");a.history.load(f);return false});a("a.exo-prod-url").bind("mousedown.exo",function(){a.Autocompleter.SubmitTrackingMsg(b.q,a(this).attr("title"),null,a(this).attr("rel"),"lp_click",d)})}}function W(n,b,p,t){b=Math.ceil(b/e);var v=Math.min(b,p+4),l=Math.max(0,p-3);if(b>1){n=a("<span/>").addClass("exo-pager").appendTo(n);if(l>0){t.p=1;url=w(t);a('<span class="exo-page-number"><a rel="ms-history" href="'+
url+'">&laquo;</a></span> ').appendTo(n);a('<span class="exo-page-number">&hellip;</span> ').appendTo(n)}for(;l<v;l++)if(l==p)a('<span class="exo-page-number exo-actual-page">'+(l+1)+"</span> ").appendTo(n);else{t.p=l+1;url=w(t);a('<span class="exo-page-number"><a rel="ms-history" href="'+url+'">'+(l+1)+"</a></span> ").appendTo(n)}if(l<b){a('<span class="exo-page-number">&hellip;</span> ').appendTo(n);t.p=b;url=w(t);a('<span class="exo-page-number"><a rel="ms-history" href="'+url+'">&raquo;</a></span> ').appendTo(n)}}}
var T=true,x,i,e,F,z;return{display:function(n,b){if(T){z=document.createElement("div");document.body.appendChild(z);a(z).css({position:"absolute",left:-1000,top:-1000,display:"none"});var p=div=a("<div/>").addClass("exo-more").html(d.more+"&hellip;");a(z).empty();p.appendTo(z);i={height:a(z).outerHeight(),width:a(z).outerWidth()}.height;T=false}Y(n,b)},noResults:function(){h()}}}})(jQuery);;jQuery.noConflict();var shop_dir="";var exoProjectId=304;var searchFieldId="exo-suggest1";var categoryDelimiter=">";var exoProxyUrl="/"+shop_dir+"exorbyte-search/suggest.php";var searchFieldPath="#"+searchFieldId;var exo_form_id="search_mini_form";var exo_search_result="/"+shop_dir+"exo-search-result/";var exo_selector_form="#"+exo_form_id;var imgDir="/"+shop_dir+"exorbyte-search/img";jQuery(document).ready(function(){if(!jQuery.browser.msie||jQuery.browser.version.substring(0,1)>"6"){jQuery(searchFieldPath).result(redirect);jQuery(searchFieldPath).autocomplete(exoProxyUrl,{max:25,extraParams:{Bias:100,SN_limit:"display=type"},projectId:exoProjectId,leftOffset:-278,topOffset:9,width:958,formatHeader:null,formatItem:secondColNone}).focus();if(jQuery("#exo-results").size()===1){jQuery(searchFieldPath).mainsearch(exoProxyUrl,{imageDir:imgDir,projectId:exoProjectId,sortBrandsByCount:false,sortCategoriesByCount:true,formatAddToCart:true,rowsPerPage:15,currencySymbolAfterPrice:true,currencySymbol:"&euro;",decimalPoint:",",noResultsMsg:"Es wurden keine Treffer gefunden.",of:"von",to:"bis",results:"Treffer",sortBy:"Sortieren nach",relevance:"Relevanz",lowestPrice:"Niedrigster Preis",highestPrice:"H&ouml;chster Preis",categories:"Kategorien",brands:"Hersteller",prices:"Preis einschr&auml;nken",brand:"Hersteller",more:"weitere",deselect:"Aufheben"});var searchParams=decodeURIComponent(location.search.substr(1));if(!location.hash.match(".*#q=.+")){searchParams=searchParams.split("&");var i;var parts;var queryStr="";for(i=0;i<searchParams.length;i++){parts=searchParams[i].split("=");if(parts[0]=="q"&&parts.length==2){queryStr=parts[1];jQuery(searchFieldPath).val(queryStr);jQuery(exo_selector_form).submit();}}}}}});;GrimmTopMenu=function(menuCount,menuPrefix,buttonPrefix)
{this.menuPrefix=menuPrefix;this.buttonPrefix=buttonPrefix;this.displayMask=0;this.lastMask=0;this.menuCount=menuCount;};GrimmTopMenu.prototype.initialize=function()
{for(var i=1;i<=this.menuCount;i++){var t=$(this.menuPrefix+i);var button=$(this.buttonPrefix+i);if(!button){continue;}
button.store('topMenuItem',i);button.observe('mouseover',function(event){this.enterButton(event.findElement("a").retrieve('topMenuItem'));}.bind(this));button.observe('mouseout',function(event){this.leaveButton(event.findElement("a").retrieve('topMenuItem'));}.bind(this));var menu=$(this.menuPrefix+i);if(!menu){continue;}
menu.store('topMenuItem',i);menu.observe('mouseover',function(event){this.enterMenu(event.findElement("div.mega-menu").retrieve('topMenuItem'));}.bind(this));menu.observe('mouseout',function(event){this.leaveMenu(event.findElement("div.mega-menu").retrieve('topMenuItem'));}.bind(this));var topValue=Math.floor((menu.getHeight()-246)/2);var selector=new Selector(".mega-menu-column-separator");var seps=selector.findElements(menu);seps.each(function(element){element.setStyle({top:topValue+"px"});});}};GrimmTopMenu.prototype.enterButton=function(i)
{this.displayMask=1<<((i-1)*3);this.updateMenuDisplay();};GrimmTopMenu.prototype.leaveButton=function(i)
{this.displayMask|=4<<((i-1)*3);this.displayMask&=~(1<<((i-1)*3));window.setTimeout(function(){this.displayMask&=~(4<<((i-1)*3));this.updateMenuDisplay();}.bind(this),50);};GrimmTopMenu.prototype.enterMenu=function(i)
{this.displayMask=2<<((i-1)*3);this.updateMenuDisplay();};GrimmTopMenu.prototype.leaveMenu=function(i)
{this.displayMask|=4<<((i-1)*3);this.displayMask&=~(2<<((i-1)*3));window.setTimeout(function(){this.displayMask&=~(4<<((i-1)*3));this.updateMenuDisplay();}.bind(this),50);};GrimmTopMenu.prototype.updateMenuDisplay=function()
{if(this.displayMask==this.lastMask){return;}
if(this.lastMask==0){$('header-navigation').addClassName('active');}
for(var i=0;i<this.menuCount;i++){var flags=this.displayMask&7<<(i*3);if(flags>0){this.showMenu(i);}else{this.hideMenu(i);}}
this.lastMask=this.displayMask;if(this.displayMask==0){$('header-navigation').removeClassName('active');}};GrimmTopMenu.prototype.showMenu=function(i)
{var button=$(this.buttonPrefix+(i+1));if(!button){return;}
button.addClassName("active");if(i>0){var leftBtn=$(this.buttonPrefix+i);if(leftBtn){leftBtn.addClassName("right-active");}}
var menu=$(this.menuPrefix+(i+1));if(!menu){return;}
if(this.lastMask==0){window.setTimeout(function(){var obj=this[0];var menu=this[1];var i=this[2];var flags=obj.displayMask&7<<(i*3);if(flags>0){menu.show();}}.bind([this,menu,i]),200);}else{menu.show();}};GrimmTopMenu.prototype.hideMenu=function(i)
{var button=$(this.buttonPrefix+(i+1));if(!button){return;}
button.removeClassName("active");if(i>0){var leftBtn=$(this.buttonPrefix+i);if(leftBtn){leftBtn.removeClassName("right-active");}}
var menu=$(this.menuPrefix+(i+1));if(!menu){return;}
menu.hide();};;document.observe('dom:loaded',function(){var shopUrl=BLANK_IMG.substr(0,BLANK_IMG.length-13);var labels=$$('#product-attribute-specs-table .label');labels.each(function(label){if(label.innerHTML.match('Weight')!==null){label.update('<a href="'+shopUrl+'lieferung/">'+label.innerHTML+'</a>');throw $break;}
else if(label.innerHTML.match('Gewicht')!==null){label.update('<a href="'+shopUrl+'lieferung/">'+label.innerHTML+'</a>');throw $break;}});});;if(typeof Effect=='undefined')
throw("You must have the script.aculo.us library to use this accordion");var Accordion=Class.create({initialize:function(id,defaultExpandedCount){if(!$(id))throw("Attempted to initalize accordion with id: "+id+" which was not found.");this.accordion=$(id);this.options={toggleClass:"nav_button",toggleActive:"nav_button_active",contentClass:"nav_content"}
this.contents=this.accordion.select('div.'+this.options.contentClass);this.isAnimating=false;this.maxHeight=0;this.current=defaultExpandedCount?this.contents[defaultExpandedCount-1]:this.contents[0];this.toExpand=null;this.checkMaxHeight();this.initialHide();this.attachInitialMaxHeight();var clickHandler=this.clickHandler.bindAsEventListener(this);this.accordion.observe('click',clickHandler);},expand:function(el){this.toExpand=el.next('div.'+this.options.contentClass);if(this.current!=this.toExpand){this.toExpand.show();this.animate();}},checkMaxHeight:function(){for(var i=0;i<this.contents.length;i++){if(this.contents[i].getHeight()>this.maxHeight){this.maxHeight=this.contents[i].getHeight();}}},attachInitialMaxHeight:function(){this.current.previous('div.'+this.options.toggleClass).addClassName(this.options.toggleActive);if(this.current.getHeight()!=this.maxHeight)this.current.setStyle({height:this.maxHeight+"px"});},clickHandler:function(e){var el=e.element();if(el.hasClassName(this.options.toggleClass)&&!this.isAnimating){this.expand(el);}},initialHide:function(){for(var i=0;i<this.contents.length;i++){if(this.contents[i]!=this.current){this.contents[i].hide();this.contents[i].setStyle({height:0});}}},animate:function(){var effects=new Array();var options={sync:true,scaleFrom:0,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleMode:{originalHeight:this.maxHeight,originalWidth:this.accordion.getWidth()},scaleX:false,scaleY:true};effects.push(new Effect.Scale(this.toExpand,100,options));options={sync:true,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleX:false,scaleY:true};effects.push(new Effect.Scale(this.current,0,options));var myDuration=0.6;new Effect.Parallel(effects,{duration:myDuration,fps:35,queue:{position:'end',scope:'accordion'},beforeStart:function(){this.isAnimating=true;this.current.previous('div.'+this.options.toggleClass).removeClassName(this.options.toggleActive);this.toExpand.previous('div.'+this.options.toggleClass).addClassName(this.options.toggleActive);}.bind(this),afterFinish:function(){this.current.hide();this.toExpand.setStyle({height:this.maxHeight+"px"});this.current=this.toExpand;this.isAnimating=false;}.bind(this)});}});
