// Mondo Shop 2 2.7.0.23 201001191209
function ShopTexts(){this.entries=new Array();this.add=add;this.getText=getText;function add(n,f){this.entries[n]=f;}function getText(n){var f=this.entries[n];if(f)return f();else return'';}function hasText(n){var f=this.entries[n];return f!=null;}}function traverseNode(cat,lNode,design){if(cat.hideInNavigation)return;var link=new Link();var curDesign=design;link.name='0'+str2hex(cat.catNo);link.catName=str2hex(cat.catNo);link.text=cat.description;link.title=cat.description;link.cat=cat;if(cat.linkDesign)curDesign=shop.linkDesigns.getByName(cat.linkDesign);link.design=curDesign;link.URL='\''+cat.catNo+'\'';if(cat.artCount > 0)link.type=16;else{if(cat.hasData||cat.catTemplateFileName)link.type=26;else link.type=20;}var node=new TreeNode();node.parentNode=lNode;node.init();node.nodeLink=link;for(var i=0;i < cat.getSubCatCount();i++){traverseNode(cat.getSubCat(i),node,design);}}function CList_addIdent(obj){obj.ident=this.entries.length;this.entries[this.entries.length]=obj;
}function CList_add(obj){this.entries[this.entries.length]=obj;}function CList_addNamed(name,obj){obj.name=name;this.entries[this.entries.length]=obj;}function CList_count(){return this.entries.length;}function CList_getByNo(n){return this.entries[n];}function CList_getByName(name){for(var i=0;i<this.entries.length;i++)if(this.entries[i].name==name)return this.entries[i];return null;}function CList_getByMC(MC){for(var i=0;i<this.entries.length;i++)if(this.entries[i].MC==MC)return this.entries[i];return null;}function CList_getByIdent(ident){for(var i=0;i<this.entries.length;i++)if(this.entries[i].ident==ident)return this.entries[i];return null;}function CList_clear(){this.entries.length=0;}function CList_addByID(a){this.entries[a.id]=a;}function CList_getByID(id){return this.entries[id];}function NList_add(name,obj){obj.name=name;this.entries[name]=obj;}function NList_getByName(name){return this.entries[name];}function TreeNode(){this.name=null;this.appendChild=appendChild;
this.changeState=changeState;this.childItems=new Array();this.getFirstChild=getFirstChild;this.getNextChild=getNextChild;this.getNextID=getNextID;this.getRoot=getRoot;this.nodeLink=null;this.catTreeDesign=null;this.nodeID=null;this.parentNode=null;this.open=false;this.writeNode=writeNode;this.writeTree=writeTree;this.init=init;this.treeDesign=null;this.autoReload=autoReload;function autoReload(){return this.treeDesign.autoReload;}function init(){if(this.parentNode==null){this.subItemCount=0;}else{this.parentNode.appendChild(this);}this.nodeID=this.getNextID();}function writeTree(){var erg=this.writeNode('');erg[0]=erg[0].join('');erg[1]=erg[1].join('');return erg;}function getRoot(){if(this.parentNode==null)return this;else return this.parentNode.getRoot();}function getFirstChild(){if(this.childItems.length>0)return this.childItems[0];else return null;}function getNextChild(node){for(i=0;i<this.childItems.length;i++)if(this.childItems[i]==node){i++;
if(i<this.childItems.length)return this.childItems[i];}return null;}function getNextID(){if(this.parentNode==null){this.subItemCount++;return this.subItemCount;}else{return this.parentNode.getNextID();}}function changeState(id){if(this.nodeID==id){if((this.childItems.length>0)||(this.nodeLink.cat&&this.nodeLink.cat.hasSubCats)){this.open=!this.open;if(this.open)shop.clickNode=this;return 1;}else{return 2;}}else{var erg=0;for(var i=0;i<this.childItems.length;i++){var erg=erg|this.childItems[i].changeState(id);}if(!((erg&1)||(erg&2))){if(this.getRoot().treeDesign.closeOther){if(this.open){this.open=false;erg|=4;}}}return erg;}}function appendChild(node){this.childItems[this.childItems.length]=node;}function writeNode(leftText){var erg=new Array(2);erg[0]=new Array();erg[1]=new Array();var i=0;if(this.parentNode==null){for(i=0;i<this.childItems.length;i++){var ret=this.childItems[i].writeNode(leftText);erg[0]=erg[0].concat(ret[0]);erg[1]=erg[1].concat(ret[1]);}}else{this.nodeLink.state=0;
if(this.open&&this.nodeLink.cat&&(this.childItems.length==0)&&(this.nodeLink.cat.subCats.length>0)){var design=this.getRoot().catTreeDesign;for(i=0;i<this.nodeLink.cat.subCats.length;i++)traverseNode(this.nodeLink.cat.subCats[i],this,design);}if(this.open)this.nodeLink.state=2;else if((this.nodeLink.cat&&this.nodeLink.cat.hasSubCats)||(this.childItems.length>0))this.nodeLink.state=1;else this.nodeLink.state=0;var nextItem=this.parentNode.getNextChild(this);var navIconText="";var treeDesign=this.getRoot().treeDesign;if(treeDesign!=null){if(this.nodeLink.state==0){if(nextItem!=null)img=treeDesign.navIconN;else img=treeDesign.navIconLN;navIconText+="<td><img src=\""+img+"\" border=0 width="+treeDesign.navIconWidth+" height="+treeDesign.navIconHeight+"><\/td>";}else{if(this.open){if(nextItem!=null)img=treeDesign.navIconS;else img=treeDesign.navIconLS;}else{if(nextItem!=null)img=treeDesign.navIconW;else img=treeDesign.navIconLW;}navIconText+="<td>";if(treeDesign.useNavIcons)
navIconText+='<a href="javascript:clickTree(\''+this.getRoot().name+'\', '+this.nodeID+',window);">';navIconText+="<img src=\""+img+"\" border=0 width="+treeDesign.navIconWidth+" height="+treeDesign.navIconHeight+">";if(treeDesign.useNavIcons)navIconText+="<\/a>";navIconText+="<\/td>";}}this.nodeLink.clickTree='clickTree(\''+this.getRoot().name+'\', '+this.nodeID+',window);';erg[0][erg[0].length]=this.nodeLink.writeLinkImages();erg[1][erg[1].length]=this.nodeLink.writeLink(leftText+navIconText);this.nodeLink.clickTree=null;if(this.open){if(nextItem!=null)img=treeDesign.navIconVL;else img=treeDesign.navIconE;leftText+="<td><img src=\""+img+"\" border=0 width="+treeDesign.navIconWidth+" height="+treeDesign.navIconHeight+"><\/td>";for(i=0;i<this.childItems.length;i++){var ret=this.childItems[i].writeNode(leftText);erg[0]=erg[0].concat(ret[0]);erg[1]=erg[1].concat(ret[1]);}}}return erg;}}function LinkList(){this.name=null;this.entries=new Array();
this.add=CList_add;this.getByNo=CList_getByNo;this.count=CList_count;this.getByName=CList_getByName;}function LinkListList(){this.entries=new Array();this.add=NList_add;this.getByName=NList_getByName;}function LinkTreeList(){this.entries=new Array();this.add=NList_add;this.getByName=NList_getByName;}function ShopFunction(shopFunction,frameName,templateFile){this.shopFunction=shopFunction;this.frameName=frameName;this.templateFile=templateFile;this.call=call;function call(){if(eval('window.'+this.frameName+'!=null;')&&(this.templateFile!=null))eval('window.'+this.frameName+'.location.href=\''+this.templateFile+'\';');}}function StartPage(frameName,templateFile,autoReload,size){this.frameName=frameName;this.templateFile=templateFile;this.autoReload=autoReload;this.size=size;}function FrameSetupList(){this.functions=new Array();this.startPages=new Array();this.addFunction=addFunction;this.addStartPage=addStartPage;this.getFunctionByName=getFunctionByName;this.getStartPageByName=getStartPageByName;
function addFunction(shopFunction,frameName,templateFile){this.functions[this.functions.length]=new ShopFunction(shopFunction,frameName,templateFile);}function addStartPage(frameName,templateFile,autoReload,size){this.startPages[this.startPages.length]=new StartPage(frameName,templateFile,autoReload,size);}function getFunctionByName(name){for(var i=0;i<this.functions.length;i++){if(name==this.functions[i].shopFunction)return this.functions[i];}return null;}function getStartPageByName(name){var page=null;for(var i=0;i<this.startPages.length;i++)if(name==this.startPages[i].frameName){page=this.startPages[i];break;}if(page!=null){if((name==shop.config.readString('StdFrame'))&&(shop.search['page']!=null)){return new StartPage(name,shop.search['page'],page.autoReload,page.size);}else{var cat=null;if(shop.search['cat'])cat=shop.catList.getByName(shop.search['cat']);if(cat){if(shop.search['art']!=null){var fn=this.getFunctionByName('SN_Article');if(page.frameName!=fn.frameName)
return page;var template='';if(cat.artTemplateFileName)template=cat.artTemplateFileName;else template=fn.templateFile;return new StartPage(name,template+'?cat='+mmescape(shop.search['cat'])+'&art='+mmescape(shop.search['art']),page.autoReload,page.size);}else{var fn=null;if(cat.artCount>0)fn=this.getFunctionByName('SN_ArticleList');else fn=this.getFunctionByName('SN_Catalog');if(page.frameName!=fn.frameName)return page;var template='';if(cat.artTemplateFileName)template=cat.artTemplateFileName;else template=fn.templateFile;return new StartPage(name,template+'?cat='+mmescape(shop.search['cat']),page.autoReload,page.size);}}}}return page;}}function Config(){this.data=new Array();this.readString=readString;this.writeString=writeString;this.readBool=readBool;this.writeBool=writeBool;this.readInt=readInt;this.writeInt=writeInt;this.readFloat=readFloat;this.writeFloat=writeFloat;this.clear=clear;function clear(){this.data=new Array();}function readString(name){var v;v=this.data[name];
return v ? v:"";}function writeString(name,val){this.data[name]=val;}function readBool(name){var v;v=this.data[name];return v ? v:false;}function writeBool(name,val){this.data[name]=val;}function readInt(name){var v;v=this.data[name];return v ? v:0;}function writeInt(name,val){this.data[name]=val;}function readFloat(name){var v;v=this.data[name];return v ? v:0.0;}function writeFloat(name,val){this.data[name]=val;}}function ObjectFactory(){this.c=c;function c(name){return eval('new '+name+';');}}function AttributeDefList(){this.attributes=new Array();this.getCount=getCount;this.add=add;this.getAttributeDef=getAttributeDef;function getCount(){return this.attributes.length;}function add(i){if(i)i.no=this.attributes.length;this.attributes[this.attributes.length]=i;}function getAttributeDef(no){return this.attributes[no];}}var atString=1;function AttributeDef(){this.description='';this.type=atString;this.defaultValue='';this.caption='';
this.editWidth=0;this.editHeight=0;this.required=0;this.no=0;this.getDescription=getDescription;this.getType=getType;this.getDefaultValue=getDefaultValue;this.getNo=getNo;this.getInputName=getInputName;function getDescription(){return this.description;}function getType(){return this.type;}function getDefaultValue(){return this.defaultValue;}function getNo(){return this.no;}function getInputName(){return'customItemAttr'+this.no;}}function AttributeValueList(){this.attributes=new Array();this.getCount=getCount;this.add=add;this.addID=addID;this.getAttributeValue=getAttributeValue;this.getByNo=getByNo;this.assign=assign;function getCount(){return this.attributes.length;}function add(i){this.attributes[this.attributes.length]=i;}function addID(i){i.no=this.attributes.length;this.attributes[this.attributes.length]=i;}function getAttributeValue(no){return this.attributes[no];}function getByNo(no){for(var i=0;i<this.attributes.length;i++)if(this.attributes[i].no==no)
return this.attributes[i];return null;}function assign(v){for(var i=0;i<v.getCount();i++){var av=new AttributeValue();av.assign(v.attributes[i]);this.attributes[this.attributes.length]=av;}}}function AttributeValue(){this.value='';this.no=0;this.getValue=getValue;this.getNo=getNo;this.setValue=setValue;this.assign=assign;function getValue(){return this.value;}function setValue(v){this.value=v;}function getNo(){return this.no;}function assign(v){this.value=v.value;this.no=v.no;}}function SelAttrList(){this.attributes=new Array();this.add=add;this.getByNo=getByNo;function add(attr){attr.groupID=this.attributes.length;this.attributes[this.attributes.length]=attr;}function getByNo(no){return this.attributes[no];}}function SelAttr(){this.text='';this.caption='';this.groupID=0;this.values=new SelAttrValueList();this.add=add;this.getValueByID=getValueByID;this.getInputName=getInputName;function add(val){this.values.add(val);}function getValueByID(id){return this.values.values[id];
}function getInputName(){return'selAttr'+this.groupID;}}function SelAttrValueList(){this.values=new Array();this.add=add;function add(val){val.ident=this.values.length;this.values[this.values.length]=val;}}function SelAttrValue(){this.text='';this.ident=0;}function PriceList_calcPrice(quantity){return this.findPrice(quantity).price*quantity;}function PriceList_add(minQuantity,price){var p=new Price();p.list=this;p.price=price;p.minQuantity=minQuantity;this.listEntries[this.listEntries.length]=p;}function PriceList_findPrice(quantity){var ret=null;for(var i=0;i < this.listEntries.length;i++){if(this.listEntries[i].minQuantity <=quantity){ret=this.listEntries[i];}}return ret;}function PriceList_findBestPrice(){var ret=null;for(var i=0;i < this.listEntries.length;i++){if((ret==null)||this.listEntries[i].price<ret.price){ret=this.listEntries[i];}}return ret;}function PriceList_count(){return this.listEntries.length;}function PriceList_getItem(No){return this.listEntries[No];
}function PriceList(){this.listEntries=new Array();this.VATType=0;this.add=PriceList_add;this.count=PriceList_count;this.getItem=PriceList_getItem;this.findPrice=PriceList_findPrice;this.findBestPrice=PriceList_findBestPrice;this.calcPrice=PriceList_calcPrice;this.getVATPercent=getVATPercent;this.getVATType=getVATType;function getVATPercent(){return shop.VATList.getVATPercent(this.VATType);}function getVATType(){return this.VATType;}}function Price_getPrice(){return this.price;}function Price_getMinQuantity(){return this.minQuantity;}function Price(){this.list=null;this.minQuantity=null;this.price=null;this.getMinQuantity=Price_getMinQuantity;this.getPrice=Price_getPrice;}function SolePrice(){this.priceNet=null;this.priceGross=null;this.VATPercent=null;this.VATType=-1;this.minQuantity=null;this.discount=0;this.baseFactor=1;this.getMinQuantity=getMinQuantity;this.getPrice=getPrice;this.getPriceNet=getPriceNet;this.getPriceGross=getPriceGross;
this.getPriceRaw=getPriceRaw;this.getPriceVAT=getPriceVAT;this.setPrice=setPrice;this.setPriceView=setPriceView;this.getVATPercent=getVATPercent;this.applyDiscount=applyDiscount;this.hasDiscount=hasDiscount;this.getDiscPercent=getDiscPercent;this.isNull=isNull;function isNull(){return!isNotNull(this.getPriceGross());}function hasDiscount(){return(this.discount!=0);}function getDiscPercent(){return this.discount;}function applyDiscount(p,t){if(this.discount!=0){if(t==1)return MondoRound(p);if(t==0)return MondoRound(p-this.applyDiscount(p,2));if(t==2)return MondoRound(p*this.discount/100);}else{if(t==2)return 0;else return p;}}function getPrice(t){if(shop.showNetPrices())return this.getPriceNet(t);else return this.getPriceGross(t);}function setPrice(price){if(shop.config.readBool('PricesAreNet'))this.priceNet=price;else this.priceGross=price;}function setPriceView(price){if(shop.showNetPrices())this.priceNet=price;else this.priceGross=price;}function getPriceNet(t){
if((this.priceNet!=null)&&(this.priceGross!=null))return this.priceNet;var e;if(shop.showNetPrices()){if(this.priceNet!=null){e=this.applyDiscount(this.priceNet,t);}else{e=this.applyDiscount(MakeNet(this.priceGross,this.getVATPercent()/100),t);}}else{if(this.priceGross!=null){e=this.applyDiscount(this.priceGross,t);}else{e=this.applyDiscount(MakeGross(this.priceNet,this.getVATPercent()/100),t);}e=MakeNet(e,this.getVATPercent()/100);}return MondoRound(e/this.baseFactor);}function getPriceGross(t){if((this.priceNet!=null)&&(this.priceGross!=null))return this.priceGross;var e;if(shop.showNetPrices()){if(this.priceNet!=null){e=this.applyDiscount(this.priceNet,t);}else{e=this.applyDiscount(MakeNet(this.priceGross,this.getVATPercent()/100),t);}e=MakeGross(e,this.getVATPercent()/100);}else{if(this.priceGross!=null){e=this.applyDiscount(this.priceGross,t);}else{e=this.applyDiscount(MakeGross(this.priceNet,this.getVATPercent()/100),t);}}return MondoRound(e/this.baseFactor);}function getPriceRaw(t){
if(shop.config.readBool('PricesAreNet'))return this.getPriceNet(t);else return this.getPriceGross(t);}function getPriceVAT(t){return this.getPriceGross(t)-this.getPriceNet(t);}function getMinQuantity(){return this.minQuantity;}function getVATPercent(){if(this.VATType>=0)return MondoRound(shop.VATList.getVATPercent(this.VATType)*100);else if((this.priceNet!=null)&&(this.priceGross!=null))return MondoRound((this.priceGross/this.priceNet-1)*100);else return MondoRound(this.VATPercent*100);}}function ImageList(){this.entries=new Array();this.getByName=CList_getByName;this.getByNo=CList_getByNo;this.getByMC=CList_getByMC;this.add=CList_addNamed;this.addImg=CList_add;this.count=CList_count;}function Image_getHTML(src,width,height,hint,style){var s='<img src="'+src+'"'+' height="'+height+'"'+' width="'+width+'"'+' border="0"';if(hint){s+=' alt="'+hint+'"'+' title="'+hint+'"';}if(style){s+='style="'+style+'"';}s+='\>';return s;}function Image_HTMLTag(){
return this.getHTML(this.getSrc(),this.width,this.height,this.hint,this.cssStyle);}function Image_HTMLTagThumb(){return this.getHTML(this.getThumbSrc(),this.getThumbWidth(),this.getThumbHeight(),this.hint,this.thumbCssStyle);}function _Image(){this.name='';this.fileName='';this.width=0;this.height=0;this.thumbFileName='';this.thumbWidth=0;this.thumbHeight=0;this.hint='';this.MC='';this.cssStyle='';this.thumbCssStyle='';this.HTMLTag=Image_HTMLTag;this.HTMLTagThumb=Image_HTMLTagThumb;this.getSrc=getSrc;this.getThumbSrc=getThumbSrc;this.getThumbWidth=getThumbWidth;this.getThumbHeight=getThumbHeight;this.getHint=getHint;this.getHTML=Image_getHTML;this.thumbFile=thumbFile;function getSrc(){return this.fileName;}function thumbFile(s){var w=shop.config.readInt('ArtListImagesWidth');var h=shop.config.readInt('ArtListImagesHeight');var i,j,p,f,e;i=s.lastIndexOf('.');j=s.lastIndexOf('\/')+1;p=s.substring(0,j);f=s.substring(j,i);e=s.substring(i,s.length);return p+'Thumbnails/'+f+'x'+w+'x'+h+e;
}function getThumbSrc(){if(this.thumbFileName)return this.thumbFileName;else if(this.fileName)return(shop.config.readBool('ArtListImagesActive')&&shop.config.readBool('UseThumbNails'))?this.thumbFile(this.fileName):this.fileName;else return'';}function getThumbWidth(){if(this.thumbWidth)return this.thumbWidth;else return this.width;}function getThumbHeight(){if(this.thumbHeight)return this.thumbHeight;else return this.height;}function getHint(){return this.hint;}}function QuantityUnit_hasBaseUnit(){return(this.baseUnit!=null);}function QuantityUnit_calcBasePrice(price){return price*this.baseFactor;}function QuantityUnit(){this.id=null;this.shortName=null;this.name=null;this.baseUnit=null;this.baseFactor=null;this.hasBaseUnit=QuantityUnit_hasBaseUnit;this.calcBasePrice=QuantityUnit_calcBasePrice;}function QuantityUnitList(){this.entries=new Array();this.add=add;this.count=CList_count;this.getQuantityUnit=getQuantityUnit;this.getQuantityUnitByID=getQuantityUnitByID;
function add(id,shortName,name,baseUnit,baseFactor){var t=new QuantityUnit();t.id=id;t.shortName=shortName;t.name=name;t.baseUnit=baseUnit;t.baseFactor=baseFactor;this.entries[this.entries.length]=t;}function getQuantityUnit(no){return this.entries[no];}function getQuantityUnitByID(id){for(var i=0;i < this.entries.length;i++){if(this.entries[i].id==id){return this.entries[i];}}return null;}}function CurrencyUnit(){this.ISOCode="";this.type=0;this.description="";this.symbol="";this.factor1=1.0;this.factor2=1.0;this.decimals=2;this.formatCurr=formatCurr;function formatCurr(val,sign,NoCurr){var s='';if(sign&&(val>=-0.0000001))s+='+';s+=formatNumber(val,this.decimals,shop.decSep,shop.thSep);if(!NoCurr)s+=' '+this.symbol;return s;}}function CurrencyUnitList(){this.entries=new Array();this.getCurrByID=NList_getByName;this.add=add;this.getCurrencyUnit=getCurrencyUnit;this.formatCurr=formatCurr;this.convertCurr=convertCurr;function getCurrByID(id){
return this.entries[id];}function add(id,type,desc,symbol,f1,f2,dec){var t=new CurrencyUnit();t.ISOCode=id;t.type=type;t.description=desc;t.symbol=symbol;t.factor1=f1;t.factor2=f2;t.decimals=dec;this.entries[id]=t;}function getCurrencyUnit(no){return this.entries[no];}function formatCurr(val,c,sign,NoCurr){var curr=this.getCurrByID(c);return curr.formatCurr(this.convertCurr(val,c),sign,NoCurr);}function convertCurr(val,c){var base=shop.baseCurrUnit;var target=this.getCurrByID(c);if(base.ISOCode==target.ISOCode){return val;}if(target.factor1!=0)val/=target.factor1;return val*target.factor2;}}function VATList(){this.entries=new Array();this.add=add;this.getVATPercent=getVATPercent;this.count=CList_count;this.getByNo=CList_getByNo;function add(type,p){var t=new VATType();t.percent=p;t.type=type;this.entries[type]=t;}function getVATPercent(type){return this.entries[type].percent;}}function VATType(){this.type=null;this.percent=null;this.shortname=null;
}function Zone(){this.id=null;this.paymentMethod=null;this.deliveryMethod=null;this.deliveryMethods=new Array();this.paymentMethods=new Array();this.getDMByNo=getDMByNo;this.getPMByNo=getPMByNo;this.dmCount=dmCount;this.pmCount=pmCount;this.hasDeliveryMethod=hasDeliveryMethod;this.hasPaymentMethod=hasPaymentMethod;this.getDefaultDeliveryMethod=getDefaultDeliveryMethod;this.getDefaultPaymentMethod=getDefaultPaymentMethod;this.countries=new Array();this.hasCountry=hasCountry;this.pmCheckPrice=-1;this.dmCheckPrice=-1;this.pmActiveCount=0;this.dmActiveCount=0;function getDefaultDeliveryMethod(){if(this.deliveryMethod>=0){var dm=shop.deliveryMethods?shop.deliveryMethods.getByIdent(this.deliveryMethod):null;if(dm&&dm.isAvailable())return dm;}return this.getDMByNo(0);}function getDefaultPaymentMethod(){if(this.paymentMethod>=0){var pm=shop.paymentMethods?shop.paymentMethods.getByIdent(this.paymentMethod):null;if(pm&&pm.isAvailable())return pm;}return this.getPMByNo(0);}function hasDeliveryMethod(m){
if(!m)return false;var p=shop.voucher.getTotalPrice(6).getPrice();for(var i=0;i<this.deliveryMethods.length;i++)if((m.ident==this.deliveryMethods[i])&&m.isAvailable(p)) return true;return false;}function hasPaymentMethod(m){if(!m)return false;var p=shop.voucher.getTotalPrice(8).getPrice();for(var i=0;i<this.paymentMethods.length;i++)if((m.ident==this.paymentMethods[i])&&m.isAvailable(p)) return true;return false;}function dmCount(){var p=shop.voucher.getTotalPrice(6).getPrice();if(p==this.dmCheckPrice)return this.dmActiveCount;this.dmActiveCount=0;for(var i=0;i<this.deliveryMethods.length;i++){var dm=shop.deliveryMethods.getByIdent(this.deliveryMethods[i]);if(dm.isAvailable(p))this.dmActiveCount++;}this.dmCheckPrice=p;return this.dmActiveCount;}function pmCount(){var p=shop.voucher.getTotalPrice(8).getPrice();if(p==this.pmCheckPrice)return this.pmActiveCount;this.pmActiveCount=0;for(var i=0;i<this.paymentMethods.length;i++){var pm=shop.paymentMethods.getByIdent(this.paymentMethods[i]);
if(pm.isAvailable(p))this.pmActiveCount++;}this.pmCheckPrice=p;return this.pmActiveCount;}function hasCountry(code){for(var i=0;i<this.countries.length;i++)if(this.countries[i]==code)return true;return false;}function getDMByNo(no){var index=-1;var i=0;var p=shop.voucher.getTotalPrice(6).getPrice();var dm=null;if(shop.deliveryMethods){do{dm=shop.deliveryMethods.getByIdent(this.deliveryMethods[i]);if(dm&&dm.isAvailable(p))index++;i++;}while((index<no)&&(i<this.deliveryMethods.length));}return dm;}function getPMByNo(no){var index=-1;var i=0;var p=shop.voucher.getTotalPrice(8).getPrice();var pm=null;if(shop.paymentMethods){do{pm=shop.paymentMethods.getByIdent(this.paymentMethods[i]);if(pm&&pm.isAvailable(p))index++;i++;}while((index<no)&&(i<this.paymentMethods.length));}return pm;}}function ZoneList(){this.entries=new Array();this.add=CList_add;this.count=CList_count;this.pcountry=null;this.dcountry=null;this.pzone=null;this.dzone=null;this.getPaymentZone=getPaymentZone;this.getDeliveryZone=getDeliveryZone;
this.getZone=getZone;function getZone(code){for(var i=0;i<this.entries.length;i++)if(this.entries[i].hasCountry(code))return this.entries[i];return null;}function getPaymentZone(){var country=shop.paymentAddress.readInt('SN_Country');if(this.pcountry==country)return this.pzone;else{this.pzone=this.getZone(country);this.pcountry=country;return this.pzone;}}function getDeliveryZone(){var country=shop.differingDeliveryAddress?shop.deliveryAddress.readInt('SN_Country'):shop.paymentAddress.readInt('SN_Country');if(country==this.dcountry)return this.dzone;else{if(country==this.pcountry){this.dzone=this.pzone;this.dcountry=country;return this.dzone;}this.dzone=this.getZone(country);this.dcountry=country;return this.dzone;}}}function Country(){this.id=0;this.iso2='';this.iso3='';this.description='';this.vatFree=0;this.vatFreeWithID=0;}function CountryList(){this.entries=new Array();this.idMap=new Array();this.stdCountry=0;this.add=add;this.count=CList_count;this.getByNo=CList_getByNo;this.getById=getById;
this.getISO2=getISO2;this.getISO3=getISO3;this.getText=getText;function getById(id){return this.idMap[id];}function getText(id){var c=this.getById(id);return c?c.description:'';}function getISO2(id){var c=this.getById(id);return c?c.iso2:'';}function getISO3(id){var c=this.getById(id);return c?c.iso3:'';}function add(obj){this.entries[this.entries.length]=obj;this.idMap[obj.id]=obj;}}function DynPMList(){this.refresh=refresh;this.count=count;function count(){return this.refresh().length;}function refresh(){var entries=new Array();var zone=shop.zones.getPaymentZone();var p=shop.voucher.getTotalPrice(8).getPrice();for(var i=0;i<zone.paymentMethods.length;i++){var pm=shop.paymentMethods.getByIdent(zone.paymentMethods[i]);if(pm.isAvailable(p))entries[entries.length]=pm;}shop.payment.paymentMethod=shop.payment.getPaymentMethod();return entries;}}function DynDMList(){this.refresh=refresh;this.count=count;function count(){return this.refresh().length;}function refresh(){var entries=new Array();
var zone=shop.zones.getDeliveryZone();var p=shop.voucher.getTotalPrice(6).getPrice();for(var i=0;i<zone.deliveryMethods.length;i++){var dm=shop.deliveryMethods.getByIdent(zone.deliveryMethods[i]);if(dm.isAvailable(p))entries[entries.length]=dm;}shop.delivery.deliveryMethod=shop.delivery.getDeliveryMethod();return entries;}}function CPAConfig(){this.dataType=0;this.defaultValue=null;this.values=new Array();this.getDefaultValue=getDefaultValue;function getDefaultValue(){return this.defaultValue!=null?this.defaultValue:'';}}function PaymentMethod(){this.ident=null;this.image=null;this.infoURL='';this.minAmount=0;this.maxAmount=0;this.HasInfos=false;this.infoText='';this.pi1='';this.pi2='';this.pi3='';this.pi4='';this.name='';this.type=0;this.surcharge=0;this.bankAccount='';this.bankCode='';this.bankName='';this.bankAccountOwner='';this.CCNo='';this.CCValDate='';this.CCOwner='';this.CCType='';this.getPaymentSurcharge=getPaymentSurcharge;this.getName=getName;this.getType=getType;this.isAvailable=isAvailable;
function isAvailable(p){if(p==null)p=shop.voucher.getTotalPrice(8).getPrice();if((this.minAmount>0)&&(p<this.minAmount))return false;if((this.maxAmount>0)&&(p>this.maxAmount))return false;return true;}function getName(){return this.name;}function getPaymentSurchargePrice(){var p=shop.voucher.getTotalPrice(8);var total=this.getPaymentSurcharge(p.avrg);return MakeSurchargePrice(total,p.avrg);}function getPaymentSurcharge(VAT){return adjust(this.surcharge,VAT);}function getType(){return this.type;}}function Payment(){this.paymentMethod=null;this.transactionType=0;this.transactionNo='';this.authorized=false;this.authorizeNo='';this.applyVAT=true;this.VATID='';this.minSurchargeLimit=null;this.minSurcharge=null;this.getPaymentMethod=getPaymentMethod;this.getMinSurchargeLimitPrice=getMinSurchargeLimitPrice;this.getMinAmountSurchargePrice=getMinAmountSurchargePrice;this.getPaymentSurcharge=getPaymentSurcharge;function getPaymentSurcharge(vat){if(this.paymentMethod)return this.paymentMethod.getPaymentSurcharge(vat);
else return 0;}function getMinAmountSurchargePrice(total,VAT){if((this.minSurchargeLimit!=null)&&(adjust(this.minSurchargeLimit,VAT)>=total))return MakeSurchargePrice(adjust(this.minSurcharge,VAT),VAT);else return MakeSurchargePrice(0,VAT);}function getMinSurchargeLimitPrice(){var p=shop.basket.getPricesByVAT();if(this.minSurchargeLimit!=null)return MakeSurchargePrice(adjust(this.minSurchargeLimit,p.avrg),p.avrg);else return MakeSurchargePrice(0,p.avrg);}function getPaymentMethod(){var zone=shop.zones.getPaymentZone();if(!zone.hasPaymentMethod(this.paymentMethod))this.paymentMethod=zone.getDefaultPaymentMethod();return this.paymentMethod;}}function DeliveryMethod(){this.ident=null;this.name='';this.fixedSurcharge=0;this.proportionalSurcharge=0;this.weightSurcharge=0;this.staggerPrices=new Array();this.minAmount=0;this.maxAmount=0;this.surchargeLimit=0;this.calcType=0;this.infoText='';this.image=null;this.HasInfos=false;this.infoURL='';this.getName=getName;this.getDeliveryCost=getDeliveryCost;
this.getDeliveryCostPrice=getDeliveryCostPrice;this.getProportionalFactor=getProportionalFactor;this.getWeightSurchargeBase=getWeightSurchargeBase;this.isAvailable=isAvailable;function isAvailable(p){if(p==null)p=shop.voucher.getTotalPrice(6).getPrice();if((this.minAmount>0)&&(p<this.minAmount))return false;if((this.maxAmount>0)&&(p>this.maxAmount))return false;return true;}function getDeliveryCostPrice(type){var pbv=shop.basket.getPricesByVAT();pbv.calcQuots();var p=shop.voucher.getTotalDeliveryPrice();return MakeSurchargePrice(this.getDeliveryCost(p.getPrice(),pbv.avrg,type),pbv.avrg);}function getProportionalFactor(){return this.proportionalSurcharge;}function getWeightSurchargeBase(){var pbv=shop.basket.getPricesByVAT();pbv.calcQuots();return MakeSurchargePrice(adjust(this.weightSurcharge,pbv.avrg),pbv.avrg);}function getDeliveryCost(total,VAT,type){if(shop.user.loggedOn&&!shop.user.calcShippingCosts)return 0;if(shop.basket.isNoDeliveryCost())return 0;var limit=adjust(this.surchargeLimit,VAT);
if((limit>0)&&(total>=limit))return 0;var fixed=0;var prop=0;var weight=0;var deliveryWeight=shop.basket.getTotalWeight();switch(this.calcType){case 0:break;case 1:{fixed=adjust(this.fixedSurcharge,VAT);prop=MondoRound(total*this.proportionalSurcharge/100);weight=MondoRound(adjust(this.weightSurcharge,VAT)*deliveryWeight);}break;case 2:{for(var i=this.staggerPrices.length-2;i>=0;i-=2){var p=adjust(this.staggerPrices[i],VAT);if(p<=total){prop=adjust(this.staggerPrices[i+1],VAT);break;}}}break;case 3:{for(var i=this.staggerPrices.length-2;i>=0;i-=2){var w=this.staggerPrices[i];if(w<=deliveryWeight){weight=adjust(this.staggerPrices[i+1],VAT);break;}}}break;}switch(type){case 0:return prop;break;case 1:return weight;break;case 2:return fixed;break;case 3:return MondoRound(fixed+prop+weight);break;default:return 0;}}function getName(){return this.name;}}function Delivery(){this.deliveryMethod=null;this.costLimit=0;this.getCostLimit=getCostLimit;this.getCostLimitPrice=getCostLimitPrice;
this.getDeliveryCost=getDeliveryCost;this.getDeliveryMethod=getDeliveryMethod;function getDeliveryMethod(){var zone=shop.zones.getDeliveryZone();if(!zone.hasDeliveryMethod(this.deliveryMethod))this.deliveryMethod=zone.getDefaultDeliveryMethod();return this.deliveryMethod;}function getDeliveryCost(total,VAT,type){var dm=this.getDeliveryMethod();if(dm)return dm.getDeliveryCost(total,VAT,type);else return 0;}function getCostLimitPrice(){var p=shop.basket.getPricesByVAT();p.calcQuots();return MakeSurchargePrice(adjust(this.costLimit,p.avrg),p.avrg);}function getCostLimit(){return this.costLimit;}}function Stack(){this.stack=new Array();this.count=0;this.push=stack_push;this.pop=stack_pop;this.peek=stack_peek;function stack_push(obj){this.stack[this.count]=obj;this.count++;}function stack_pop(){if(this.count>0){this.count--;return this.stack[this.count];}else return null;}function stack_peek(){if(this.count>0){return this.stack[this.count-1];}else return null;}}function DeliveryMethodList(){
this.entries=new Array();this.idMap=new Array();this.cladd=CList_add;this.add=add;this.getByName=CList_getByName;this.getByIdent=getByIdent;this.count=CList_count;this.getByNo=CList_getByNo;function add(obj){this.idMap[obj.ident]=obj;this.cladd(obj);}function getByIdent(id){return this.idMap[id];}}function PaymentMethodList(){this.entries=new Array();this.idMap=new Array();this.add=add;this.cladd=CList_add;this.getByName=CList_getByName;this.getByIdent=getByIdent;this.count=CList_count;this.getByNo=CList_getByNo;function add(obj){this.idMap[obj.ident]=obj;this.cladd(obj);}function getByIdent(id){return this.idMap[id];}}function ChannelList(){this.entries=new Array();this.add=CList_add;this.count=CList_count;this.getByNo=CList_getByNo;this.getByIdent=CList_getByIdent;}function Channel(){this.ident=null;this.description=null;}function Link(){this.name=null;this.text=null;this.type=null;this.title=null;this.URL=null;this.target=null;this.design=null;this.scriptCall=null;
this.state=0;this.clickTree=null;this.catName=null;this.cat=null;this.writeLink=writeLink;this.writeLinkImages=writeLinkImages;this.writePageLink=writePageLink;this.writePageLinkImages=writePageLinkImages;this.generateName=generateName;this.getURL=getURL;this.getTitle=getTitle;this.getText=getText;this.getCSSClass=getCSSClass;function getCSSClass(){var hasDsgn=false;var dsgn=null;if(this.design!=null){switch(this.state){case 0: var dsgn=this.design.designN;break;case 1: var dsgn=this.design.designW;break;case 2: var dsgn=this.design.designS;break;}if(dsgn==null)dsgn=this.design.designN;hasDsgn=(dsgn!=null);}if(hasDsgn)return dsgn.getCSSClassTag();else return'';}function getTitle(){return this.title!=null?this.title:'';}function getText(){return this.text!=null?this.text:'';}function getURL(){var url='';var target=null;if((this.target=='_self')||(this.target==null))target='window';else if(this.target=='_parent')target='parent';else if(this.target=='_top')target='top';
else if(this.target=='_blank')target=null;else target='parent.'+this.target;url='javascript:';if(this.clickTree!=null)url+=this.clickTree;switch(this.type){case 0:{if(target)url+='var erg='+target+'.location.href=\''+this.URL+'\';';else url+='var erg=window.open(\''+this.URL+'\',\'\');';break;}case 1:{if(target)url+='var erg='+target+'.location.href=\'PublishedFiles/'+this.URL+'\';';else url+='var erg=window.open(\'PublishedFiles/'+this.URL+'\',\'\');';break;}case 2:url+='shop.goHome();';break;case 3:url+='window.history.back();';break;case 4:url+='shop.basket.applyInput(window);checkOut(window);';break;case 5:url+=shop.article.getAddArticleCode();break;case 6:url+='shop.showFunction(\'SN_ShowBasket\');';break;case 7:url+='shop.basket.clear();shop.showFunction(\'SN_ShowBasket\');';break;case 8:url+='shop.basket.remove('+shop.article.getPositionNo()+');'+'shop.notifyBasketChange();reloadFrame(window);';break;case 9:url+='shop.showFunction(\'SN_BasketPrint\');';break;
case 10:url+=';';break;case 11:url+='shop.showFunction(\'SN_ShowContactForm\');';break;case 12:url+='shop.sendNormalMail();';break;case 13:url+='shop.showFunction(\'SN_Help\');';break;case 14:url+='shop.applySearchInput(window);shop.doSearch();';break;case 15:url+='applyLoginInput(window);shop.showFunction(\'SN_LoginCheck\');';break;case 16:url+='shop.showArticleList('+this.URL+');';break;case 17:url+='checkOutNextStep(window);';break;case 18:url+='checkOutPrevStep(window);';break;case 19:url+='reloadFrame(window);';break;case 20:url+='var erg=reloadFrame(window);';break;case 21:url+='shop.showArticle('+this.URL+');';break;case 22:{if(target)url+='var erg='+target+'.location.href=\''+this.URL+'\';';else url+='var erg=window.open(\''+this.URL+'\',\'\');';break;}case 23:url=shop.article.getApplyLink()+'reloadFrame(window);';break;case 24:url+='shop.basket.applyInput(window); reloadFrame(window);';break;case 25:url=shop.article.getApplyLink()+'shop.showArticle(\''+shop.article.def.catalog.catNo+'\',\''
+shop.article.def.articleNo+'\');';break;case 26:url+='shop.showCatalogPage('+this.URL+');';break;case 27:url+='applyOrderSummaryInput(window);reloadFrame(window);';break;case 28:url+='sendContactForm(window);';break;case 29:url+='if(shop.searchEngine)shop.searchEngine.next(window);';break;case 30:url=shop.searchItem.url;break;case 31:url+='checkOutKnownCustomer(window);';break;case 32:url+='checkOutNewCustomer(window);';break;case 33:url+='checkOutChangeAddress(window);';break;case 34:url+='checkOutNoChange(window);';break;case 35:url+='shop.logout();';break;case 36:url+='checkOutOfferInquiry(window);';break;case 37:url=shop.article.getAddVariantLink();break;case 38:url+='submitContactForm(window);';break;case 39:url+='checkOutChooseCountry(window);';break;case 40:url+='shop.tellAFriend(\''+shop.article.def.catalog.catNo+'\',\''+shop.article.def.articleNo+'\');';break;case 41:url+='shop.requestForArticleInfo\''+shop.article.def.catalog.catNo+'\',\''+shop.article.def.articleNo+'\');';break;
case 42:url+='top.close();';break;default:url+=';';break;}return url;}function generateName(){var ret='';switch(this.type){case 5:case 8:case 23:case 25:ret=this.name+shop.article.getInputName();break;case 37:ret=this.name+shop.article.getInputName()+shop.article.getVariantIndex();break;default:ret=this.name;break;}return ret;}function writePageLink(prefix){this.scriptCall="";this.state=0;if(prefix==null)prefix='';return this.writeLink(prefix);}function writePageLinkImages(){this.scriptCall="";this.state=0;return this.writeLinkImages();}function writeLink(prefix){var hasDsgn=false;var s="";var dsgn=null;if(this.design!=null){switch(this.state){case 0: var dsgn=this.design.designN;break;case 1: var dsgn=this.design.designW;break;case 2: var dsgn=this.design.designS;break;}if(dsgn==null)dsgn=this.design.designN;hasDsgn=(dsgn!=null);}if(hasDsgn||(prefix!=null)){s+='<div><table border="0" cellpadding="0" cellspacing="0" style="display:inline"><tr valign="middle">';
s+=prefix;}var url=this.getURL();var lname=this.generateName();var link='<a name="lblLink'+lname+'" href="'+url+'"';if(this.title!=null)link+=' title="'+this.title+'"';if(hasDsgn){link+=dsgn.getMouseOver(lname);link+=dsgn.getCSSClassTag();}link+='>';if(hasDsgn){if(dsgn.hasIcon)s+='<td>'+link+dsgn.getIcon('lblIcon'+lname)+'<\/a><\/td>';}if(this.text!=null&&(!hasDsgn||dsgn.hasText)){if(hasDsgn)s+=dsgn.getTextCellBegin();else s+='<td>';s+=link;if(hasDsgn)s+=dsgn.getFontBegin();s+="<nobr>"+this.text+"<\/nobr>";if(hasDsgn)s+=dsgn.getFontEnd();s+='<\/a><\/td>';}if(hasDsgn){if(dsgn.hasImage)s+='<td>'+link+dsgn.getImage('lblImage'+lname,this,false)+'<\/a><\/td>';}if(hasDsgn||(prefix!=null)){s+='<\/tr><\/table></div>\n';}return s;}function writeLinkImages(){var dsgn=null;var lname=this.generateName();if(this.design!=null){switch(this.state){case 0: var dsgn=this.design.designN;break;case 1: var dsgn=this.design.designW;break;
case 2: var dsgn=this.design.designS;break;}if(dsgn==null)dsgn=this.design.designN;}var s='';if(dsgn!=null){if(dsgn.hasIcon&&dsgn.icon.srcOn){s+='var LinkIconOn'+lname+'= new Image(); LinkIconOn'+lname+'.src="'+dsgn.icon.srcOn+'";\n'+'var LinkIcon'+lname+'= new Image(); LinkIcon'+lname+'.src="'+dsgn.icon.src+'";\n';}if(dsgn.hasImage&&dsgn.image.srcOn){s+='var LinkImageOn'+lname+'= new Image(); LinkImageOn'+lname+'.src="'+dsgn.getImgSrc(this,true)+'";\n'+'var LinkImage'+lname+'= new Image(); LinkImage'+lname+'.src="'+dsgn.getImgSrc(this,false)+'";\n';}if(s!='')s='<script language="JavaScript">\n<!--\n'+s+'//-->\n<\/script>';}return s;}}function CatalogList(){this.entries=new Array();this.getByName=NList_getByName;this.add=NList_add;this.getCat=getCat;function getCat(cat){var erg=this.getByName(cat);if(erg==null)erg=new Catalog();erg.catNo=cat;this.add(cat,erg);return erg;}}function ShopMail(){this.online=false;this.recipient='';
this.sender='';this.cc1='';this.cc2='';this.bcc1='';this.bcc2='';this.subject='';this.contentType='';this.charset='';this.encryption='';this.body='';this.showBankData=false;this.showCCData=false;this.showShortText=false;this.showLongText=false;}function DiscClass(){this.id=null;this.name=null;this.description=null;}function DiscClassList(){this.entries=new Array();this.count=CList_count;this.addByID=CList_addByID;this.getByID=CList_getByID;}function DiscClassRel(){this.personClass=null;this.articleClass=null;this.discount=null;}function DiscClassRelList(){this.entries=new Array();this.count=CList_count;this.add=add;this.getByIDs=getByIDs;function add(rel){this.entries[rel.articleClass+'_'+rel.personClass]=rel;}function getByIDs(a,p){return this.entries[a+'_'+p];}}function FixedArtDisc(){this.id=null;this.name=null;this.description=null;this.discount=null;}function FixedArtDiscList(){this.entries=new Array();this.count=CList_count;this.addByID=CList_addByID;this.getByID=CList_getByID;
}function StaggerClassList(){this.entries=new Array();this.count=CList_count;this.addByID=CList_addByID;this.getByID=CList_getByID;}function StaggerClass(){this.entries=new Array();this.id=null;this.count=CList_count;this.add=add;this.getByNo=CList_getByNo;this.init=init;this.getDiscount=getDiscount;function getDiscount(q){for(var i=this.entries.length-1;i>=0;i--){if(this.entries[i].minAmount<=q)return this.entries[i].discount;}return 0;}function init(a){if(a.length>2){this.id=a[0];for(var i=1;i<a.length;i+=2){this.add(a[i],a[i+1]);}}}function add(min,disc){var e=new StaggerEntry();e.minAmount=min;e.discount=disc;this.entries[this.entries.length]=e;}}function StaggerEntry(){this.minAmount=null;this.discount=null;}function OnlineDiscount(){this.type=0;this.value=0;}function LanguageList(){this.entries=new Array();this.getByName=CList_getByName;this.getByNo=CList_getByNo;this.add=CList_addNamed;this.count=CList_count;}function Language(){this.name=null;this.description=null;this.image=null;
this.getSetURL=getSetURL;function getSetURL(){return'javascript:shop.setLanguage(window,\''+this.name+'\');';}}function CPAValueList(){this.getByNo=getByNo;this.count=count;function count(){return 10;}function getByNo(no){if((shop.user.customValues[no]==null)||(shop.cpaConfig[no]==null))return null;var value=new CPAValue();value.no=no+1;value.value=shop.user.customValues[no];value.dataType=shop.cpaConfig[no].dataType;return value;}}function CPAValue(){this.no=0;this.value=null;this.text='';this.dataType=0;this.description='';this.isListValue=isListValue;function isListValue(){return(this.dataType==5);}}function ExtWindow(){this.Name=null;this.Width=0;this.Height=0;this.Left=0;this.Top=0;this.ResizAble=false;this.ScrollBars=false;this.Location=false;this.MenuBar=false;this.Status=false;this.ToolBar=false;this.window=null;this.addBaseWindowDef=addBaseWindowDef;this.paramStr=paramStr;function addBaseWindowDef(aName,aWidth,aHeight,aLeft,aTop,aResizAble,aScrollBars,aLocation,aMenuBar,aStatus,aToolBar){
this.Name = aName;this.Width = aWidth;this.Height = aHeight;this.Left = aLeft;this.Top = aTop;this.ResizAble = aResizAble;this.ScrollBars = aScrollBars;this.Location = aLocation;this.MenuBar = aMenuBar;this.Status = aStatus;this.ToolBar = aToolBar;}function paramStr() {str =  'width='+this.Width+', height='+this.Height+', left='+this.Left+', top='+this.Top+', scrollbars='+this.ScrollBars+', resizable='+this.ResizAble+', location='+this.Location+', menubar='+this.MenuBar+', status='+this.Status+', toolbar='+this.ToolBar;return str;}}
jsl=true;
