Fleurop._Product=function(){var h=document.getElementById("tbTotal");var f={};f._previousCustomPrice=0;f.SetTotal=k;f.AddPriceQuantity=o;f.AddPriceQuantityUsingClientID=i;f.AddSpecialCard=n;f.FormatTotal=e;f.TotalLoad=j;f.OnLoadPage=a;f.constructorProduct=r;f.SetCustomPriceChange=v;f.FormatCustomPrice=s;f.ShowAddonTotalLine=g;f.HideWrongAddonTotalLines=q;f.AddZeros=p;f.SimpleCustomPriceFormat=t;f.CheckDigitCount=x;f.onSuccessGetProductVariantCourierServiceCharges=l;f.onFailGetProductVariantCourierServiceCharges=d;this.Protected=f;this.PriceQuantity=function(A){w(A)};this.CheckForNull=function(A){u(A)};this.TotalLoad=function(){f.SimpleCustomPriceFormat();f.TotalLoad()};this.OnLoadPage=function(){f.OnLoadPage()};this.onSuccessGetProductVariantCourierServiceCharges=function(A){l(A)};this.onFailGetProductVariantCourierServiceCharges=function(A){d(A)};this.constructorProduct=function(){r()};this.SetCurrentProductVariantID=function(A){z(A)};this.ShowAddonTotalLine=function(B,D,C,A,E){g(B,D,C,A,E)};this.HideWrongAddonTotalLines=function(A){q(A)};function w(A){if(A.value>maximumQuantityPerProductItem){A.value=maximumQuantityPerProductItem}if(/\D/.test(A.value)){A.value=A.defaultValue}else{A.defaultValue=A.value}c(A.value);Fleurop.Product.OnLoadPage()}function u(A){if(A.value==""||A.value=="0"){A.value="1"}A.defaultValue=A.value;c(A.value);Fleurop.Product.TotalLoad()}function c(F){var A=0;while(A<1000){var E=document.getElementById(A+"_trAddonProduct");if(!E){break}var D=0;var C=E.getElementsByTagName("input");for(var B=0;B<C.length;B++){if(C[B].getAttributeNode("id")&&C[B].getAttributeNode("id").value.indexOf("tbAddonQuantity")>=0){C[B].value=F}}A++}}function o(B){var A=document.getElementById("tbPriceQuantity");if(A!=null){B=B*parseInt(A.value)}return B}function i(B){var A=document.getElementById(productQuantityClientID);if(A!=null){B=B*parseInt(A.value)}return B}function n(B){var A=document.getElementById("tdSpecialCardTotal");if(A!=null&&A.innerHTML!=""){tempValue=A.innerHTML;if(IsDecimalSeparatorDefined){tempValue=tempValue.toString().replace(rExpFormLocale,".")}B+=parseFloat(tempValue)}return B}function k(G){var I;var H;var A;var F=document.getElementById("spanTotal");if(F!=null){if(IsDecimalSeparatorDefined){G=G.toString().replace(rExpFormLocale,".")}I=parseFloat(G);var J=document.getElementById("spanProductPrice");if(J!=null){J.innerHTML=f.FormatTotal(G)}I=f.AddPriceQuantity(I);I=f.AddPriceQuantityUsingClientID(I);var C=0;while(C<1000){var N=document.getElementById(C+"_trAddonProduct");if(!N){break}var E=0;var B=0;var M=N.getElementsByTagName("td");for(var D=0;D<M.length;D++){if(M[D].getAttributeNode("id")&&M[D].getAttributeNode("id").value.indexOf("tdAddonTotal")>=0&&M[D].innerHTML!=""){E=M[D].innerHTML;if(IsDecimalSeparatorDefined){E=E.toString().replace(rExpFormLocale,".")}E=parseFloat(E)}}var K=N.getElementsByTagName("input");for(var D=0;D<K.length;D++){if(K[D].getAttributeNode("id")&&K[D].getAttributeNode("id").value.indexOf("tbAddonQuantity")>=0){B=K[D].value;I+=E*parseInt(B)}}C++}var L=document.getElementById("tdServiceChargeTotal");if(L!=null){A=L.innerHTML;if(IsDecimalSeparatorDefined){A=A.toString().replace(rExpFormLocale,".")}I+=parseFloat(A)}I+=b("tdCourierSvcChgPeakPeriod");I+=b("tdCourierSvcChgFedExSaturday");I+=b("tdCourierSvcChgFedExDelivery");I=f.AddSpecialCard(I);F.innerHTML=f.FormatTotal(I)}}function b(B){var A=document.getElementById(B);tempValue=0;if(A!=null){tempValue=A.innerHTML;if(IsDecimalSeparatorDefined){tempValue=tempValue.toString().replace(rExpFormLocale,".")}tempValue=parseFloat(tempValue);tempValue=f.AddPriceQuantity(tempValue);tempValue=f.AddPriceQuantityUsingClientID(tempValue)}return tempValue}function e(A){A=String(A);if(IsDecimalSeparatorDefined){A=A.toString().replace(rExpFormLocale,".")}A=parseFloat(A);A=Math.round(A*100)/100;A=String(A);A=f.AddZeros(A);if(IsDecimalSeparatorDefined){A=A.toString().replace(rExpToLocale,DecimalSeparator)}return A}function v(B){var C=document.getElementById(initialCustomPriceClientID);var A=document.getElementById(customPriceChangedClientID);C.value=B.value;A.value="1";if(B.value==f._previousCustomPrice){A.value="0";C.value=previousHiddenValue}}function s(B,A){if(IsDecimalSeparatorDefined){A=A.toString().replace(rExpFormLocale,".")}var C=B.value;if(IsDecimalSeparatorDefined){C=C.toString().replace(rExpFormLocale,".")}if(isNaN(parseFloat(C))||parseFloat(A)>parseFloat(C)){C=A}C=f.AddZeros(C);if(IsDecimalSeparatorDefined){C=C.toString().replace(rExpToLocale,DecimalSeparator)}B.value=C}function t(){if(typeof(textCustomPriceClientID)!="undefined"&&textCustomPriceClientID!=null){var A=document.getElementById(textCustomPriceClientID);if(IsDecimalSeparatorDefined&&A){A.value=A.value.toString().replace(rExpFormLocale,".");var B=parseFloat(A.value);if(!isNaN(B)){var C=p(B.toString());A.value=C;if(IsDecimalSeparatorDefined){A.value=A.value.toString().replace(rExpToLocale,DecimalSeparator)}}}}}function p(B){var A=B.indexOf(".");if(decimalsInPice){if(A!=-1){switch(B.length-1-A){case 1:B=B+"0";break;case 2:break}}else{B=B+".00"}}return B}function x(A){var B=A.value;if(IsDecimalSeparatorDefined){B=B.toString().replace(rExpFormLocale,".")}if(decimalsInPice){if(B.indexOf(".")>=0){var C=B.split(".");if(C.length>=2){if(C[1].length>2){C[1]=C[1].substr(0,2)}B=C[0]+"."+C[1]}}}else{var D=parseInt(B);if(!isNaN(D)){B=D}else{B=""}}if(IsDecimalSeparatorDefined){B=B.toString().replace(rExpToLocale,DecimalSeparator)}if(A.value!=B){A.value=B}}function z(A){if(typeof(currentProductVariantClientID)!="undefined"){var B=document.getElementById(currentProductVariantClientID);if(B!=null){B.value=A}}}function j(){}function a(){}function r(){var A=document.getElementById("tbTotal");var C=0;if(A){for(var B=0;B<A.rows.length;B++){if(A.rows[B].style.cssText.toLowerCase().replace(" ","").indexOf("display:none")<0){A.rows[B].className=C&1?"rowprice":"";C++}}}if(typeof(textCustomPriceClientID)!="undefined"){var D=document.getElementById(textCustomPriceClientID);if(D){f._previousCustomPrice=document.getElementById(textCustomPriceClientID).value}}}function l(O){var I=document.getElementById("ihCourierSvcChgPeakPeriodRow");var L=document.getElementById(I.value);var N=document.getElementById("tdCourierSvcChgPeakPeriod");var A=document.getElementById("ihCourierSvcChgFedExSaturdayRow");var B=document.getElementById(A.value);var F=document.getElementById("tdCourierSvcChgFedExSaturday");var E=document.getElementById("ihCourierSvcChgFedExDeliveryRow");var J=document.getElementById(E.value);var M=document.getElementById("tdCourierSvcChgFedExDelivery");L.style.cssText="display: none";B.style.cssText="display: none";J.style.cssText="display: none";N.innerHTML=parseFloat("0");F.innerHTML=parseFloat("0");M.innerHTML=parseFloat("0");if(O!=null&&O!=""){var K=O.split("_");for(var C=0;C<K.length;C++){var H=K[C].split(" ");var D=H[0];var G=H[1];switch(D){case"5":L.style.cssText="display: table-row";N.innerHTML=G;break;case"6":B.style.cssText="display: table-row";F.innerHTML=G;break;case"7":J.style.cssText="display: table-row";M.innerHTML=G;break;default:}}}Fleurop.Product.TotalLoad();Fleurop.Product.constructorProduct()}function d(A){var G=document.getElementById("ihCourierSvcChgPeakPeriodRow");var F=document.getElementById(G.value);var C=document.getElementById("ihCourierSvcChgFedExSaturdayRow");var E=document.getElementById(C.value);var D=document.getElementById("ihCourierSvcChgFedExDeliveryRow");var B=document.getElementById(D.value);F.style.cssText="display: none";E.style.cssText="display: none";B.style.cssText="display: none";Fleurop.Product.TotalLoad();Fleurop.Product.constructorProduct()}function m(F,C,I,G){var K=document.getElementById("productPrice");var E=K.cloneNode(true);E.setAttribute("id",I+"_trAddonProduct");E.setAttribute("var",F);var N=E.getElementsByTagName("td");var O=E.getElementsByTagName("input");var P;P=N[0];P.setAttribute("style","padding: 3px 3px 0pt 0pt");var R;var M;for(var L=0;L<O.length;L++){if(O[L].getAttributeNode("id")&&O[L].getAttributeNode("id").value.indexOf("tbPriceQuantity")>=0){R=O[L];M=O[L].value}}R.setAttribute("id","tbAddonQuantity");R.setAttribute("class","FormList");R.setAttribute("value",M);R.setAttribute("disabled","disabled");R.setAttribute("maxlength","9");R.setAttribute("onblur","Fleurop.Product.CheckForNull ( this );");R.setAttribute("onkeyup","Fleurop.Product.PriceQuantity(this);");R.setAttribute("onblur","Fleurop.Product.CheckForNull ( this );");R.setAttribute("onblur","Fleurop.Product.CheckForNull ( this );");var Q=N[1];Q.setAttribute("style","padding: 3px;");Q.setAttribute("colspan","4");Q.setAttribute("id","tdAddonName");var H=N[2];H.setAttribute("style","padding: 3px;");H.setAttribute("align","right");var A=H.getElementsByTagName("table")[0];var B=A.getElementsByTagName("tr")[0];var D=A.getElementsByTagName("td")[0];D.innerHTML=G+"&nbsp";var J=A.getElementsByTagName("td")[1];J.setAttribute("id","tdAddonTotal");K.parentNode.insertBefore(E,K.nextSibling);return E}function y(D,F,B){var A=0;var G;while(A<1000){G=document.getElementById(A+"_trAddonProduct");if(!G){break}var C=G.getAttributeNode("var");if(D==C.value){break}A++}var E;if(A>0&&!G){A--;E=document.getElementById(A+"_trAddonProduct");A++;var G=m(D,F,A,B);E.parentNode.insertBefore(G,E.nextSibling)}return G}function g(F,G,D,E,A){var H=y(F,G,E);if(!H){H=m(F,G,0,E)}if(H){var B=H.getAttributeNode("var");if(F==B.value){H.style.cssText="display: table-row";var I=H.getElementsByTagName("td");for(var C=0;C<I.length;C++){if(I[C].getAttributeNode("id")&&I[C].getAttributeNode("id").value.indexOf("tdAddonTotal")>=0){I[C].innerHTML=Fleurop.Product.FormatTotal(parseFloat(D.replace(",",".")))}else{if(I[C].getAttributeNode("id")&&I[C].getAttributeNode("id").value.indexOf("tdAddonName")>=0){I[C].innerHTML=A+'"'+G+'"'}}}}}}function q(A){var B=0;while(B<1000){var F=document.getElementById(B+"_trAddonProduct");if(!F){break}var D=F.getAttributeNode("var");if(A.value.indexOf(D.value)<0){F.style.cssText="display: none";var E=F.getElementsByTagName("td");for(var C=0;C<E.length;C++){if(E[C].getAttributeNode("id")&&E[C].getAttributeNode("id").value.indexOf("tdAddonTotal")>=0){E[C].innerHTML=Fleurop.Product.FormatTotal(parseFloat(0))}}}B++}}window.onload=Fleurop.EventManager.AddHandler(window.onload,r)};
