<!-- basket Basket functions  -->
<!-- (c) Copyright 2004 GS Software -->
<!-- 27jan2004 -->
function showItemsneu(){
  var tablerowcolor = '#F0F0F0';
  var aPrices = new Array();
  var aFromQuants = new Array();
  var aToQuants = new Array();
  var basketText="";
  top.GesamtWarenwert=0;
  totprice = 0;
  totvat = 0;
  basketText="<!-- Begin Form updateform from permbasket.js -->";
  basketText=basketText +'<FORM NAME="updateform">';
  if (top.theBasket.length>1) {
    // document.writeln('<DIV align="left">');
    basketText=basketText +"<center><TABLE class='minibasket' WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING=0>";
    basketText=basketText +"<TR><td colspan=3 class='tablecolor1'>Warenkorb</td></tr>";
    basketText=basketText +"<TR BGCOLOR='#C0C0C0'><TD class='minibasket'><b>"+top.Loc_Quantity+"</b></TD><TD width=50% >&nbsp;&nbsp;<b>"+top.Loc_Article+"</b></TD><TD class='minibasket' align='center' width=50%>&nbsp;</TD></TR>";
  } else {
  }

  if (top.theBasket.length>1) {
    for (var i = 1; i < top.theBasket.length; i++) {
      with(top.theBasket[i]) {
        theitem=Item;
        itemtotal = 0;
        thequantity = Quantity;
        iNumberPrices=parseInt(NumberPrices);
        aPrices = Prices.split(":");
        aFromQuants = FromQuants.split(":");
        aToQuants = ToQuants.split(":");
        for (var j=1;j<iNumberPrices;j++) {
          if (( parseInt(Quantity) < parseInt(aToQuants[j-1])) && (parseInt(Quantity) >= parseInt(aFromQuants[j-1]))) {
            theprice=aPrices[j-1];
          }
        }
        if (parseInt(Quantity) >= parseInt(aToQuants[iNumberPrices-1])) {
          theprice=aPrices[iNumberPrices-1];
        }
        itemtotal = (eval(theprice*thequantity));
        temptotal = itemtotal * 100;
        totprice = totprice + itemtotal;
        thisvat = (parseFloat(itemtotal*productvatrate)) / (parseFloat(productvatrate)+parseFloat(100));
        thisvat = parseFloat(top.alterError(thisvat));
        totvat = totvat + thisvat;

        if(Attribut1=='') A1=''; else A1=', '+Attribut1;
        if(Attribut2=='') A2=''; else A2=', '+Attribut2;
        if(Attribut3=='') A3=''; else A3=', '+Attribut3;

        itemlist=i;
        hilf="";
        if (Textin != "") hilf="<br> "+Textin;
//        basketText=basketText +"<tr valign='top'><td><INPUT TYPE=TEXT readonly NAME='Posten"+itemlist+"' VALUE='"+thequantity+"' SIZE=1 style='border-style:solid; border-width:1px;'></td>";
        basketText=basketText +"<tr valign='top'><td class='minibasket' valign='top' align='left' width='70'><b>"+thequantity+"</b></td>";
        basketText=basketText +"<td class='minibasket' valign='top' colspan='2'>"+theitem+A1+A2+A3+hilf+"</td></tr>";
        basketText=basketText +"<tr><TD class='minibasket' align='left'colspan='2'><b>"+top.Loc_PriceEach+"</b></TD><td class='minibasket' align='right'><b>"+top.Loc_PriceTotal+"</b></TD></tr>";
        basketText=basketText +"<tr><td class='minibasket' valign='top' align='right'>&#8364; "+top.alterError(theprice)+"</td><td class='minibasket' valign='top' align='right' colspan='2'>&#8364; "+top.alterError(itemtotal)+"</td></tr>";
        if (tablerowcolor == '#F0F0F0')
          tablerowcolor = "#F8F8F8";
        else
          tablerowcolor = "#F0F0F0";
      }
    }
//        basketText=basketText +'<TR><TD class="minibasket" colspan=2><HR></TD></TR>';
    basketText=basketText +"<tr BGCOLOR='#C0C0C0'><td class='minibasket' colspan='2'><a href='basket.htm' target='Hauptframe' onFocus='if(this.blur)this.blur()'><img class='noneborder' src='/images/buttons/question.gif' border='0' align='absmiddle' alt='Warenkorb anzeigen' valign='middle'></a><b>"+top.Loc_Total+"</b></td><td class='minibasket' align=right><b>&#8364; "+top.alterError(totprice)+"</b></td></tr>";
    basketText=basketText +"</TABLE><cr>";
//     basketText=basketText +'</div>');
  }
  basketText=basketText +"</FORM>";
  basketText=basketText +"<!-- End Form updateform from permbasket.js -->";
  top.GesamtWarenwert=totprice;
  top.SetMiniBasket(escape(basketText));
}


function amendItem(itemno, newquant){
  if (!( (parseFloat(newquant) == parseInt(newquant) )&&( parseInt(newquant) > 0) ))
    alert(top.Loc_Integer);
  else {
    if (parseInt(newquant) > 9999) {
      alert("Die maximale Bestellmenge ist 9999!");
      newquant = '9999';
    }
    top.theBasket[parseInt(itemno)].Quantity=newquant;
 }
 document.location.reload();
 top.basketframe.location = "permbasket.htm";
// Hauptframe.location.reload();
 showItemsneu();
}


function removeItem(itemno){
  top.theBasket=top.theBasket.slice(0,itemno).concat(top.theBasket.slice(itemno+1,top.theBasket.length));
  document.location.reload();
  top.basketframe.location = "permbasket.htm";
//  Hauptframe.location.reload();
  showItemsneu();
}

function clearBasket(){
  if (confirm(top.Loc_RemoveConfirm))
    top.theBasket=top.theBasket.slice(0,1);
  document.location.reload();
  top.basketframe.location = "permbasket.htm";
//  Hauptframe.location.reload();
  showItemsneu();
}

function xminiBasketneu(){
  var tablerowcolor = '#F0F0F0';
  totprice = 0;
  var aPrices = new Array();
  var aFromQuants = new Array();
  var aToQuants = new Array();
  if (top.theBasket.length>1) {
    for (var i = 1; i < top.theBasket.length; i++){
      with(top.theBasket[i]){
        theitem=Item;
        thequantity = Quantity; //fulllist.substring(itemstart, itemend);
        itemtotal = 0;
        iNumberPrices=parseInt(NumberPrices);
        aPrices = Prices.split(":");
        aFromQuants = FromQuants.split(":");
        aToQuants = ToQuants.split(":");
        for (var j=1;j<iNumberPrices;j++){
          if (( parseInt(Quantity) < parseInt(aToQuants[j-1])) && (parseInt(Quantity) >= parseInt(aFromQuants[j-1]))){
            theprice=aPrices[j-1];
          }
        }
        if (parseInt(Quantity) >= parseInt(aToQuants[iNumberPrices-1])){
          theprice=aPrices[iNumberPrices-1];
        }
        itemtotal = (eval(theprice*thequantity));
        temptotal = itemtotal * 100;
        totprice = totprice + itemtotal;
        if(Attribut1=='') A1=''; else A1=', '+Attribut1;
        if(Attribut2=='') A2=''; else A2=', '+Attribut2;
        if(Attribut3=='') A3=''; else A3=', '+Attribut3;

        itemlist=i;
        hilf="";
        if (Textin != "") hilf="<br> "+Textin;
      }
    }
    document.writeln('</tr>');
    document.writeln('</table>');
  } else {
  }
}
function resetShoppingBasket(){
  theBasket=theBasket.slice(0,1);
  GesamtWarenwert=0;
}
