
	var imgpath;
	var csspath;
	var inames = ["lieferbar.gif", "lieferzeitanfrage.gif", "warenkorb1.gif", "vergleichen1.gif", "warenkorb0.gif", "vergleichen0.gif"];            
	var p = csspath+"../../images/ico/icons_1/";
    inames.each( function(item) {
    	var n=new Image();
		n.src = p+item;
		var n1=new Image();
		n1.src = imgpath+item;
    });

    var pricer = Class.create();
    pricer.prototype = {
        initialize: function() {
			this.mode = 0;
			this.font = "prices";
			this.szFont	= "1";
			this.setFont("prices");
			this.setSize("1");
   			this.checkers = 0;
   			this.currency= 'EUR';
   			this.currencyString = '<img src="' + this.ipath+'euro.gif">';
			for(i=0;i<3;i++)
				this.loadFont(i+1);
            this.ready = 0;
        },
		setSize : function(sz){
			if(!sz || sz=="")
				sz="1";
			this.szFont=sz;
			this.ipath = imgpath+""+this.font+"/size"+this.szFont+"/";
		},
		setFont : function(font){
			if(!font || font=="")
				font="prices";
			if(font=="prozente")
				this.mode|=0x80;
				
			this.font=font
			this.ipath = imgpath+""+this.font+"/size"+this.szFont+"/";
		},
		setCurrency : function(currency){
		  this.currency = currency;
				
		},
		setCurrencyByString : function(currency){
		  var curr="";
		  var inside=0;
		  for(var i=0;i<currency.length;i++){
		     var ch = currency.substr(i,1);
		     
	  		  if(inside)
 			      curr+=ch;
	  		  if(ch == ' ')
	      	      inside = 1;
		  }

		  if(curr!="")
		     this.currency = curr;
    				
		},		
		loadFont :function(sz){
			var ipath;
			if(!sz || sz=="")
				ipath = imgpath+""+this.font+"/size"+this.szFont+"/";
			else
				ipath = imgpath+""+this.font+"/size"+sz+"/";
	
            $A($R(0,9)).each(function(item){
                var n=new Image();
                n.src = ipath+"0"+item+".gif";
                }
            );
            var inames = ["euro.gif", "komma.gif", "punkt.gif"];            
            inames.each( function(item) {
                var n=new Image();
                n.src = ipath+item;
            });
		},     
        out: function(price){
			
            var s;
			if(this.mode&0x7f)
				s = this.format(price);
			else
				s= price;
            var ergebnis = "";
            for (var i=0; i < s.length; i++){
                var c = s.charAt(i);
                if(c=='.')
                    c='punkt';
                else if(c==',')
                    c='komma';
				else
					c='0'+c;
                ergebnis += '<img src="' + this.ipath + c + '.gif" align="top">';
            }
			
			if(!(this.mode & 0x80))
		 	//ergebnis += '<img src="' + this.ipath+'euro.gif">';
				ergebnis += this.getCurrency();
			else
			    ergebnis += '<img src="' + this.ipath+'prozent.gif">';
            return ergebnis;        
        },
		getCurrency : function(){
		    if(this.currency == 'EUR')
 				 this.currencyString = '<img src="' + this.ipath+'euro.gif">';
	        else{
	        	 this.currencyString = '<img src="' + this.ipath;
	        	 this.currencyString += this.currency.toLowerCase()+'.gif">';
  			}
  			return this.currencyString;
	 
		},
        
        format: function(zahl){
            wert = parseFloat(zahl);
            r = wert % 1000;
            t = parseInt(wert / 1000);
            erg = "";
            if(t)
                erg =t+".";
            r = r.toFixed(2);
            r = r.replace(/\./,",");
            erg+=r;
            return erg;
        },
		print: function(price){
			document.write(this.out(price));
		}
		
        
    }
