if(typeof DEBUG==="undefined"){DEBUG=false}window.addEvent("domready",function(){if($("container_check_minibar")){DEBUG&&DEBUG&&console.log("new mini bar check function....");var b=$("countMiniBarCheckContainer").value;DEBUG&&DEBUG&&console.log("new mini bar check function....max container: "+b);for(var c=1;c<=b;c++){DEBUG&&DEBUG&&console.log("Runde: "+c);DEBUG&&DEBUG&&console.log("von: "+b);var a=new MiniBarCheck();a.cloneContainer(c);if(c>1){a.removeContainer(c)}}}});var MiniBarCheck=new Class({cloneContainer:function(a){var b="add_product_container_"+(a*1);DEBUG&&console.log("Clone Container: "+a+" "+b+" get container: "+$(b));$("add_product_container_"+a).addEvent("click",function(c){DEBUG&&console.log("container_counter: "+a);var d=$("product_container_1").clone();d.getElements("input");d.getElements("input").each(function(f,e){f.value=""}.bind(this));d.getFirst("select").selectedIndex=0;$("countMiniBarCheckContainer").value=($("countMiniBarCheckContainer").value*1)+1;d.setProperty("id","product_container_"+$("countMiniBarCheckContainer").value*1);d.getFirst("div").setProperty("id","add_product_container_"+$("countMiniBarCheckContainer").value*1);d.getLast("div").setProperty("id","remove_product_container_"+$("countMiniBarCheckContainer").value*1);d.getLast("select").setProperty("id","sel_checkMiniBar_product"+$("countMiniBarCheckContainer").value*1);d.getLast("select").setProperty("id","sel_checkMiniBar_productcount"+$("countMiniBarCheckContainer").value*1);d.inject($("container_check_minibar").getLast("div"),"after");this.cloneContainer($("countMiniBarCheckContainer").value*1);this.removeContainer($("countMiniBarCheckContainer").value*1)}.bind(this));DEBUG&&console.log("assigned counter: "+a);if(a==1){DEBUG&&console.log("First Container: "+a);$("remove_product_container_"+a).setStyle("display","none")}else{$("remove_product_container_"+a).setStyle("display","block")}return a},removeContainer:function(a){DEBUG&&console.log("remove container");$("remove_product_container_"+a).addEvent("click",function(b){$("product_container_"+a).destroy();$("countMiniBarCheckContainer").value=($("countMiniBarCheckContainer").value*1)-1}.bind(this))}});