/* Extension for cSMDiscounts class */
cSMDiscounts.prototype.renderHTML = function(){
var $t = this, $x = $t.xml, $go = false, $h = $n = "", $vl = $md = $o = $op = 0, $a = $v = $vd = $id = $tB = $hd = null;
	// get amounts, values, discounted values and textBuffer
	$op = $t.parent.getOriginalPrice();
	$md = $x.getAttribute(_SMAMode).split(";");
	$vl = $x.getAttribute(_SMAValue).split(";");
	$a = $x.getAttribute(_SMAAmount).split(";");
	$vd = $x.getAttribute(_SMAValueDiscount).split(";");
	$id = $x.getAttribute(_SMAItemDiscount).split(";");
	$tB = $x.getAttribute(_SMATextBuffer).split(";");
	$hd = $x.getAttribute(_SMAHidden).split(";");
	$qu = $x.parentNode.getAttribute(_SMAOQtyUnit);
	$qt = $x.getAttribute(_SMAMode).split(";");
	$h += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"discounts-list\">";
	$h += "<thead><tr><td colspan=\"4\" class=\"discounts-headline\">Mengenrabatte</td></tr>";
	$h += "<tr>";
	$h += "<th class=\"discounts-name\">&nbsp;</th>";
	$h += "<th class=\"discounts-from-amount\">Ab " + $qu + "</th>";
	$h += "<th class=\"discounts-value\">Preis:/" + $qu + "</th>";
	$h += "<th class=\"discounts-saving\">Ersparnis pro ME:</th>";
	$h += "</tr></thead><tbody>";
	for(var i=0; i<$a.length; i++){
		if($hd[i]!="1"){
			$go = true;
			$n = $x.text.substring($o, $o + parseInt($tB[i]));
			$o += parseInt($tB[i]);
			$h += "<tr valign=\"top\">";
			$h += "<td class=\"discounts-name\">" + $n + "&nbsp;</td>";
			$h += "<td class=\"discounts-from-amount\">" + $a[i] + "</td>";
			if(cint($qt[i]) != 2){
				$h += "<td class=\"discounts-value\">" + cprimary.format(fnSMPFt($vd[i]), SM_CGROUP + SM_CSYMBOL) + "</td>";
			} else {
				$h += "<td class=\"discounts-value\">+" + $id[i] + " " + $qu + " kostenlos</td>";
			};
			$h += "<td class=\"discounts-value\">";
			if(cint($qt[i]) != 2){
				$h += (($md[i]==1) ? $vl[i] + "% = " : "") + cprimary.format($op - fnSMPFt($vd[i]), SM_CGROUP + SM_CSYMBOL);
			} else {
				$h += cprimary.format($id[i] * $op, SM_CGROUP + SM_CSYMBOL);
			};
			$h += "</td>";
			$h += "</tr>";
			};
		};
	$h += "</tbody></table>";
	if(!$go) $h = "";
	return($h);
	};