var xmlhttp=null;function updateArticleData(c,d){var e=function(){if(xmlhttp.req.readyState==4){var a=xmlhttp.req.responseXML;if(!a){return}if(a.getElementsByTagName("invalid").length==0){hideImpossibleMsg(d);hideNotAvailableMsg(d);fadeInAllPriceInformation(d);fadeInArticleNumber(d);fadeInCompleteStockInfo(d);if(a.getElementsByTagName("price").length>0)updateArticlePrice(d,a.getElementsByTagName("price")[0].firstChild.nodeValue);if(a.getElementsByTagName("supplierAid").length>0)updateSupplierAid(d,a.getElementsByTagName("supplierAid")[0].firstChild.nodeValue);if(a.getElementsByTagName("basePrice").length>0)updateBaseprice(d,a.getElementsByTagName("basePrice")[0].firstChild.nodeValue);if(a.getElementsByTagName("deliveryCost").length>0)updateDeliveryCost(d,a.getElementsByTagName("deliveryCost")[0].firstChild.nodeValue);var b=a.getElementsByTagName("stockInfo")[0];if(b){updateAvailability(d,parseInt(b.getAttribute("onStock")),parseInt(b.getAttribute("onStockMin")),b.getAttribute("reOrderType"))}else{updateAvailability(d,2,1,"")}if(a.getElementsByTagName("scaledPrice").length>0)updateScaleprice(d,a.getElementsByTagName("scaledPrice")[0].childNodes);if(a.getElementsByTagName("isOrderable").length==false)setArticleNotOrderable(d)}else{showImpossibleMsg(d);hideAllPriceInformation(d);hideArticleNumber(d);hideNotAvailableMsg(d);hideCompleteStockInfo(d)}}};var f=getPostBody();if(xmlhttp){xmlhttp.abort()}xmlhttp=new ajaxRequest(c,e,"POST",f,["Content-Type","application/x-www-form-urlencoded"]);xmlhttp.doRequest()}function updateBundleArticleData(c,d,e){var f=function(){if(xmlhttp.req.readyState==4){var a=xmlhttp.req.responseXML;if(!a){return}if(a.getElementsByTagName("invalid").length==0){hideImpossibleMsg(d);hideNotAvailableMsg(d);fadeInAllPriceInformation(d);fadeInBundleArticleNumbers();fadeInArticleNumber(d);fadeInCompleteStockInfo(d);if(a.getElementsByTagName("supplierAid").length>0)updateBundleArticleSupplierAid(a.getElementsByTagName("supplierAid")[0].firstChild.nodeValue,e);var b=a.getElementsByTagName("stockInfo")[0];if(b){updateAvailability(d,parseInt(b.getAttribute("onStock")),parseInt(b.getAttribute("onStockMin")),b.getAttribute("reOrderType"))}else{updateAvailability(d,2,1,"")}}else{showImpossibleMsg(d);hideAllPriceInformation(d);hideBundleArticleNumbers();hideArticleNumber(d);hideNotAvailableMsg(d);hideCompleteStockInfo(d)}}};var g=getPostBody(e);if(xmlhttp){xmlhttp.abort()}xmlhttp=new ajaxRequest(c,f,"POST",g,["Content-Type","application/x-www-form-urlencoded"]);xmlhttp.doRequest()}function getPostBody(a){var b="";var c=getElementsByTagAndAttribValue("select","name","_shop_article_");selects_loop:for(var i=0;i<c.length;i++){if(b!="")b+="&";var d=c[i].childNodes;for(var j=0;j<d.length;j++){if(d[j].nodeType==1){if(d[j].selected){b+=escape(c[i].getAttribute("name"))+"="+escape(d[j].getAttribute("value"));continue selects_loop}}}}var e=document.getElementsByName("sessid")[0];if(e.getAttribute("value")){b+="&sessid="+escape(e.getAttribute("value"))}if(a){b+="&changedBundlePart="+a}return b}function updateSupplierAid(a,b){if(document.getElementById("shop_article_id_"+a))document.getElementById("shop_article_id_"+a).firstChild.data=b}function updateBundleArticleSupplierAid(a,b){if(document.getElementById("shop_article_bundle_"+b+"_article_id"))document.getElementById("shop_article_bundle_"+b+"_article_id").firstChild.data=a}function updateArticlePrice(a,b){if(document.getElementById("shop_article_price_"+a).getElementsByTagName("span")[1])document.getElementById("shop_article_price_"+a).getElementsByTagName("span")[1].firstChild.data=b}function updateBaseprice(a,b){if(document.getElementById("shop_baseprice_"+a)&&document.getElementById("shop_baseprice_"+a).getElementsByTagName("span")[1])document.getElementById("shop_baseprice_"+a).getElementsByTagName("span")[1].firstChild.data=b}function updateDeliveryCost(a,b){if(document.getElementById("shop_shipping_cost_"+a)&&document.getElementById("shop_shipping_cost_"+a).getElementsByTagName("span")[1])document.getElementById("shop_shipping_cost_"+a).getElementsByTagName("span")[1].firstChild.data=b}function fadeInAllPriceInformation(a){if(document.getElementById(a+"_shop_articledetail_price_frame"))document.getElementById(a+"_shop_articledetail_price_frame").style.display="";if(document.getElementById("shop_baseprice_"+a))document.getElementById("shop_baseprice_"+a).style.display="";if(document.getElementById("shop_article_order_allowed_"+a))document.getElementById("shop_article_order_allowed_"+a).style.display="";if(document.getElementById("shop_article_order_not_allowed_"+a))document.getElementById("shop_article_order_not_allowed_"+a).style.display="none";if(document.getElementById("shop_article_order_never_allowed_"+a))document.getElementById("shop_article_order_never_allowed_"+a).style.display="none";if(document.getElementById(a+"_shop_article_scaledprices_table"))document.getElementById(a+"_shop_article_scaledprices_table").style.display=""}function hideAllPriceInformation(a){if(document.getElementById(a+"_shop_articledetail_price_frame"))document.getElementById(a+"_shop_articledetail_price_frame").style.display="none";if(document.getElementById("shop_baseprice_"+a))document.getElementById("shop_baseprice_"+a).style.display="none";if(document.getElementById("shop_article_order_allowed_"+a))document.getElementById("shop_article_order_allowed_"+a).style.display="none";if(document.getElementById("shop_article_order_not_allowed_"+a))document.getElementById("shop_article_order_not_allowed_"+a).style.display="none";if(document.getElementById("shop_article_order_never_allowed_"+a))document.getElementById("shop_article_order_never_allowed_"+a).style.display="";if(document.getElementById(a+"_shop_article_scaledprices_table"))document.getElementById(a+"_shop_article_scaledprices_table").style.display="none"}function setArticleNotOrderable(a){if(document.getElementById("shop_article_order_allowed_"+a))document.getElementById("shop_article_order_allowed_"+a).style.display="none";if(document.getElementById("shop_article_order_not_allowed_"+a))document.getElementById("shop_article_order_not_allowed_"+a).style.display="";if(document.getElementById("shop_article_order_never_allowed_"+a))document.getElementById("shop_article_order_never_allowed_"+a).style.display="none"}function fadeInArticleNumber(a){if(document.getElementById(a+"_shop_articledetail_info"))document.getElementById(a+"_shop_articledetail_info").style.display=""}function hideArticleNumber(a){if(document.getElementById(a+"_shop_articledetail_info"))document.getElementById(a+"_shop_articledetail_info").style.display="none"}function fadeInBundleArticleNumbers(){var a=getElementsByTagAndAttribValue("span","class","shop_article_bundle_article_id_frame");for(var i=0;i<a.length;i++){a[i].style.display=""}}function hideBundleArticleNumbers(){var a=getElementsByTagAndAttribValue("span","class","shop_article_bundle_article_id_frame");for(var i=0;i<a.length;i++){a[i].style.display="none"}}function showImpossibleMsg(a){if(document.getElementById("shop_article_variant_impossible_"+a))document.getElementById("shop_article_variant_impossible_"+a).style.display=""}function hideImpossibleMsg(a){if(document.getElementById("shop_article_variant_impossible_"+a))document.getElementById("shop_article_variant_impossible_"+a).style.display="none"}function hideNotAvailableMsg(a){if(document.getElementById("shop_article_variant_not_available_"+a))document.getElementById("shop_article_variant_not_available_"+a).style.display="none"}function fadeInCompleteStockInfo(a){if(document.getElementById(a+"_shop_articledetail_stock_info_frame"))document.getElementById(a+"_shop_articledetail_stock_info_frame").style.display=""}function hideCompleteStockInfo(a){if(document.getElementById(a+"_shop_articledetail_stock_info_frame"))document.getElementById(a+"_shop_articledetail_stock_info_frame").style.display="none"}function updateScaleprice(a,b){var c=getElementsByTagAndAttribValue("td","class",a+"_shop_article_scaledprices_data_row");for(var i=0,j=0;i<b.length;i++){if((b[i].nodeType==1)&&(j<=c.length)){c[j].getElementsByTagName("span")[1].firstChild.data=b[i].getAttribute("value");j++}}}function updateAvailability(a,b,c,d){var e=false,fewArticleInStock=false;if(b>0){e=true;if(c>b){fewArticleInStock=true}}var f=null;f=getElementsByTagAndAttribValue("div","class","shop_text_article_available");f=f[0];if(f!=null){if(e==true){f.style.display=""}else{f.style.display="none"}}f=null;f=getElementsByTagAndAttribValue("div","class","shop_text_few_article_available")[0];if(f!=null){if(fewArticleInStock==true){f.style.display=""}else{f.style.display="none"}}f=null;f=getElementsByTagAndAttribValue("div","class","shop_text_article_not_available");var g="";switch(d){case"short_duration":g="reorder_short";break;case"medium_duration":g="reorder_medium";break;case"long_duration":g="reorder_long";break;case"unknown_duration":g="reorder_unknown";break;case"not_orderable":g="out_of_stock";break}for(var i=0;i<f.length;i++){if(f!=null){var h=f[i].getAttribute("class")||f[i].getAttribute("className");if((e==false)&&(h.indexOf(g)!=-1)){f[i].style.display=""}else{f[i].style.display="none"}}}if((e<=0)&&(d=="not_orderable")){if(document.getElementById("shop_article_variant_not_available_"+a))document.getElementById("shop_article_variant_not_available_"+a).style.display="";if(document.getElementById("shop_article_order_allowed_"+a))document.getElementById("shop_article_order_allowed_"+a).style.display="none";if(document.getElementById("shop_article_order_not_allowed_"+a))document.getElementById("shop_article_order_not_allowed_"+a).style.display=""}else{if(document.getElementById("shop_article_order_allowed_"+a))document.getElementById("shop_article_order_allowed_"+a).style.display="";if(document.getElementById("shop_article_order_not_allowed_"+a))document.getElementById("shop_article_order_not_allowed_"+a).style.display="none"}}function getElementsByTagAndAttribValue(a,b,c){var d=new Array();var e=document.getElementsByTagName(a);for(var i=0;i<e.length;i++){var f=e[i].getAttribute(b)||e[i].getAttribute(b+"Name");if(f!=null){if(c!=""){var g=f.split(" ");for(var j=0;j<g.length;j++){if(g[j].indexOf(c)!=-1){d[d.length]=e[i]}}}else{d[d.length]=e[i]}}}return d}var ajaxRequest=function(a,b,c,d,e,f){this.url=a;this.wState=b;this.method=c||"GET";this.body=d||null;this.headers=e||false;this.sync=f||true;this.abortReq=false;this.req=(window.XMLHttpRequest)?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):false);this.doRequest=function(){this.req.open(this.method,this.url,this.sync);if(this.headers){for(var i=0;i<this.headers.length;i+=2){this.req.setRequestHeader(this.headers[i],this.headers[i+1])}}this.req.onreadystatechange=this.wState;(!this.abortReq)?this.req.send(this.body):this.req.abort()};this.abort=function(){if(this.req&&this.req.readyState!=4)this.req.abort()}}
