function fastpris()
{
	this.vareid=0;
	this.tilbudsindex=100;
	this.rabat_stk = 0;
	this.rabat_percent = 0;
	this.price = 0;
	
	this.calc_price = function(antal) {
		var rabat = 0;
		if(this.tilbudsindex > 0) {
			var new_price = this.price - ((this.tilbudsindex / 100) * this.price);
			rabat = rabat + (this.tilbudsindex);
		} else {
			var new_price = this.price;
		}
		if(this.rabat_stk > 0 && antal >= this.rabat_stk) {
			rabat = rabat+ this.rabat_percent;
			new_price = new_price - ((this.rabat_percent / 100) * new_price);
		}
		new_price = new_price * antal;
		document.getElementById('rabat_'+this.vareid).value=rabat;
		document.getElementById('pris_'+this.vareid).value="DKK "+this.CurrencyFormatted(new_price);
		//alert(CurrencyFormatted(new_price));
	}
	this.CurrencyFormatted = function(amount)
	{
		var i = parseFloat(amount);
		if(isNaN(i)) { i = 0.00; }
		var minus = '';
		if(i < 0) { minus = '-'; }
		i = Math.abs(i);
		i = parseInt((i + .005) * 100);
		i = i / 100;
		s = new String(i);
		if(s.indexOf('.') < 0) { s += '.00'; }
		if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
		s = minus + s;
		s=s.replace(".", ",");
		return s;
	}
	this.vareprove_submit = function() {
		document.getElementById('vareprove_'+this.vareid).value='1';
		document.getElementById('pris_'+this.vareid).value="DKK 10,00";
		document.getElementById('antal_'+this.vareid).value="1";
		document.getElementById('formen_'+this.vareid).submit();
	}
}
