	// define buildUp Methods for StandAloneElements
	function createLine(){
		myLine = new clsObject("OrderBody")
			myLine.LinePos						=	xmlOHeader.childNodes.length;
			myLine.ProductNo					=	"";
			myLine.Name							=	"";
			myLine.Description					=	"";
			myLine.PriceUserEntry				=	"";
			myLine.PriceUnit					=	"1";
			myLine.MinOrder						=	"1";
			myLine.QuantityUnit					=	"";
			myLine.QuantityAmount				=	"1";
			myLine.TaxClass						=	"0";
			myLine.TaxRate						=	"0";
			myLine.TaxAmountLineTotalLC			=	"0";
			myLine.TaxAmountLineTotalSC			=	"0";
			myLine.DiscountRate					=	"0";
			myLine.DiscountNetSingleUnitLC		=	"0";
			myLine.DiscountGrossSingleUnitLC	=	"0";
			myLine.DiscountNetLineTotalLC		=	"0";
			myLine.DiscountGrossLineTotalLC		=	"0";
			myLine.DiscountNetSingleUnitSC		=	"0";
			myLine.DiscountGrossSingleUnitSC	=	"0";
			myLine.DiscountNetLineTotalSC		=	"0";
			myLine.DiscountGrossLineTotalSC		=	"0";
			myLine.PriceNetSingleUnitLC			=	"0";
			myLine.PriceGrossSingleUnitLC		=	"0";
			myLine.PriceNetLineTotalLC			=	"0";
			myLine.PriceGrossLineTotalLC		=	"0";
			myLine.PriceNetSingleUnitSC			=	"0";
			myLine.PriceGrossSingleUnitSC		=	"0";
			myLine.PriceNetLineTotalSC			=	"0";
			myLine.PriceGrossLineTotalSC		=	"0";
			myLine.WeightUnit					=	"";
			myLine.WeightAmountSingleUnit		=	"0";
			myLine.WeightAmountLineTotal		=	"0";
			// remove
			myLine.addNode("Internal");
	// return Line-Object to Caller
	return myLine;
	};
// 
	function addToBag(anElement,Amount){
		with(this){
			var taxamount = taxarea[parseInt(xmlConfig.taxarea)][parseInt(anElement.Tax) + 1];
			var update = -1;
			myLines = xmlOHeader.childNodes
			for(var i=0;i<myLines.length;i++){
				if(myLines[i].ProductNo==anElement.Prod_nr){
					update = i;
					break;
					};
				};
			// product already in shoppingcard
			if(update>-1){
				// detect position of prod_nr in shoppingcart
				myLines[i].QuantityAmount = Amount;
				if(boolPriceTaxIncl){
					myLines[i].PriceNetLineTotalLC = anElement.Price * Amount * ( 1 - taxamount/( 100 + taxamount ));
					myLines[i].PriceGrossLineTotalLC = anElement.Price * Amount;
					}
				else{
					myLines[i].PriceNetLineTotalLC = anElement.Price * Amount;
					myLines[i].PriceGrossLineTotalLC = anElement.Price * Amount * ( 1 + taxamount/100 );
					};
				}
			// add product to shoppingcart
			else{
				myLine = createLine();
// *** ANPASS			myLine.ProductNo = anElement.Prod_nr;
                                var Buffer = anElement.Prod_nr.split(" ");
                                myLine.ProductNo = Buffer[0];
				myLine.Name = anElement.Title;
				myLine.Description = anElement.Subtitle;
				myLine.QuantityAmount = Amount;
				myLine.QuantityUnit = anElement.Unitdesc;
				myInternal = myLine.getFirstItem("Internal")
					myInternal.price = anElement.Price;
					myInternal.address = anElement.LnkAdress;
					myInternal.navIndex = anElement.NavIndex;
					myInternal.discount = anElement.Discount;
					myInternal.minOrder = anElement.Minorder;
					myInternal.variants = anElement.Variants;
					myInternal.catDiscount = anElement.catDiscount;
				
				myLine.WeightAmountSingleUnit = parseFloat(anElement.Weight);
				myLine.WeightAmountLineTotal = parseFloat(anElement.Weight) * parseInt(Amount);
				
				myLine.TaxClass = anElement.Tax;
				myLine.TaxRate = taxamount;
				
				myLine.PriceUnit = anElement.PriceUnit;
				
				if(boolPriceTaxIncl){
					myLine.PriceNetSingleUnitLC = parseFloat(anElement.Price) * ( 1 - taxamount/( 100 + taxamount ) );
					myLine.PriceNetLineTotalLC = parseFloat(anElement.Price) * parseInt(Amount) * ( 1 - taxamount/( 100 + taxamount ) );
					myLine.PriceGrossSingleUnitLC = parseFloat(anElement.Price);
					myLine.PriceGrossLineTotalLC = parseFloat(anElement.Price) * parseInt(Amount);
					}
				else{
					myLine.PriceNetSingleUnitLC = parseFloat(anElement.Price);
					myLine.PriceNetLineTotalLC = parseFloat(anElement.Price) * parseInt(Amount);
					myLine.PriceGrossSingleUnitLC = parseFloat(anElement.Price) * ( 1 + taxamount/100 );
					myLine.PriceGrossLineTotalLC = parseFloat(anElement.Price) * parseInt(Amount) * ( 1 + taxamount/100 );
					};
				myLines[myLines.length] = myLine;
				};
			safeData();
			var dummyQueryString = "";
			if(Element){
                              dummyQueryString += "productId=" + anElement.Prod_No + "&quantity=" + Amount;
                           			
				};
			location.href="orderform.htm?" + dummyQueryString;
			};
		};
	function TElementPrint(){
	};
		
	// ** 1106
	function Element(Index,Image,Width,Height,Prod_nr,Title,Subtitle,Manufac,Price,Weight,Tax,PriceUnit,Unitdesc,NavIndex,Options,LnkAdress,Discount,Minorder,Category,catDiscount,displMode){
		this.Index = Index;
		this.Image = Image;this.Width = Width;
		this.Height = Height;this.Prod_nr = Prod_nr;
		this.Title = Title;this.Subtitle = Subtitle;
		this.Manufac = Manufac;this.Price = Price;
		this.Weight = Weight;this.Tax = Tax;
		this.PriceUnit = PriceUnit;this.Unitdesc = Unitdesc;
		this.NavIndex = NavIndex;
		this.Print = TElementPrint;this.Variants = Options;
		this.LnkAdress = LnkAdress;this.Discount = Discount;
		this.Minorder = Minorder;this.Category = Category;
		this.catDiscount = catDiscount;
		this.displMode = displMode;
	};
	
// ** Definitionen	
	
var spmax = 4; 
var Entry = new Array(Anz);
var start = 0;
var ende = 0;
var Treffer = 0;
var Perrow = 0;
var such = "";
var firstrow = "<table class='TOPPRPARENT' border='0' cellpadding='2' cellspacing='0' width='100%'><tr>";
var lastrow = "</tr></table>";
var newrow = "</tr><tr>";
var tab = firstrow;
var su1 = getParameterFromURL("Word"); 
var err = "<b class=welcome style=color:blue>Kein Treffer gefunden zu<i style=color:red> " + su1 + "</i></b> ";
var found1 = "<b class=welcome style=color:blue>";
var found2 = " Treffer gefunden zu <i style=color:green>" + su1 + "</i></b> ";
// ** Suchartikel

       	
 	if(getParameterFromURL("Word") > "")
 	{	
 		
  		for(var i=0; i<Anz;i++)
  		{	
  			var Artikel = Art[i][0].substr(1,15);
  			var Artikelfull = Art[i][0].toLowerCase();
  			var Bez = Art[i][1].toLowerCase();
  			var Wort = getParameterFromURL("Word").toLowerCase();  			
  			var z = Wort.length;
  			var Anzeigen = 0;
  			for(var x=0; x<Bez.length;x++)
  			{	
  		           if (Bez.substr(x,z)==Wort || Artikelfull.substr(x,z)==Wort)
  			   {
  			   	var Anzeigen = 1;
  			   }
  			}
  			
  			 			
  			if (Anzeigen > 0)
  			{
  			
  			Treffer++;
  			err  = found1 + Treffer + found2;
  			Perrow++;
	        	such += "<td bgcolor=aliceblue>";
			such += "<img src='sm/" + Artikel + ".jpg' onclick=popup('" + Artikel + "')><br>"; 
			such += Art[i][0] + "<b style=color:red>  " + Art[i][2] + " Eur</b>";
			such += "<br>";
			such += Art[i][1];
			such += "<br>";
		
			such += "<a href='JavaScript:addToBag(Entry[" + i + "],1)'><img src='assets/images/add.gif' border=0></a>";
			such += "</td>";
			Buff = Art[i][2].replace(/,/,".");
			Bestellkommentarv = Bestellkommentar;
			Taxv = "1";
		        if(Art[i][0].substr(1,2) == "HA" && Art[i][0].substr(3,1) == "-") {Taxv = "2"};
		        if(Art[i][0].substr(1,2) == "MY" && Art[i][0].substr(3,1) == "-") {Taxv = "2"};
		        if(Art[i][0].substr(1,1) == "N" && Art[i][0].substr(3,1) == "-") {Taxv = "2"};
		        if(Art[i][0].substr(0,1) == "*") {Bestellkommentarv = "sofort lieferbar"};		
			Entry[i] = new Element(
			0, " ",
			0, 0,
			Art[i][0], Art[i][1],
			Bestellkommentarv, " ",
			Buff, "0",
			Taxv, 1,
			"Stück", "18",
			"", " ",
			"", 1,
			"0000", "0",
			 0)
			 if (Perrow==spmax)
			 	{
			 		such += newrow;
			 		Perrow=0;
			 	}
			 }
		};
		if (Perrow<spmax && Perrow>0)
		{
		     Perrow = spmax - Perrow; 
		     such += "<td bgcolor=aliceblue colspan=" + Perrow + ">&nbsp</td>";
		     such += newrow;
		}
		tab  += such;
		tab  += err;
		
 	}

// ** Seitensteuerung	
      
      if(isNaN(getParameterFromURL("Seite")) == false)
 	{
  		start+=getParameterFromURL("Seite"); 
  		start*=40;
 	}
      ende+=start;
      ende+=40;
      aktuell=ende;
      aktuell/=40;
      buffer = "<br><B style='COLOR: red'>* Seite " + aktuell + " *       </B>";
            
      if (ende<Anz)
        {
     	 buffer += "<A href='javascript:Page(" + aktuell + ")'> nächste</A>"; 
	}
	if (ende>Anz)
        {
  		ende=Anz;
 	}
 	buffer += " Seite - "; 
      for (var i=0; i < Anz; i+=40)
        {
        rech = i;
        rech/=40;
        disp=rech;
        disp++;
        
        buffer += "<A href='javascript:Page(" + rech + ")'>" + disp + "</A> - " 
       	}
   	buffer += "<br><br>"
      
       document.write(buffer);
	
		
// ** Ausgabe Seite	
		

j=0;
for(var i=start; i<ende;i++){
	        var Artikel = Art[i][0].substr(1,15);

		tab += "<td width=25%>";
		tab += "<img src='sm/" + Artikel + ".jpg' onclick=popup('" + Artikel + "')><br>"; 
		tab += Art[i][0] + "<b style=color:red>  " + Art[i][2] + " Eur</b>";
		tab += "<br>";
		tab += Art[i][1];
		tab += "<br>";
		
		tab += "<a href='JavaScript:addToBag(Entry[" + i + "],1)'><img src='assets/images/add.gif' border=0></a>";
		tab += "</td>";
		j++;
		if(j==spmax)	{
				tab += newrow;
				j=0;
				}
			
		Buff = Art[i][2].replace(/,/,".");
		Bestellkommentarv = Bestellkommentar;
		Taxv = "1";
		if(Art[i][0].substr(1,2) == "HA" && Art[i][0].substr(3,1) == "-") {Taxv = "2"};
		if(Art[i][0].substr(1,2) == "MY" && Art[i][0].substr(3,1) == "-") {Taxv = "2"};
		if(Art[i][0].substr(1,1) == "N" && Art[i][0].substr(3,1) == "-") {Taxv = "2"};
		if(Art[i][0].substr(0,1) == "*") {Bestellkommentarv = "sofort lieferbar"};	
		Entry[i] = new Element(
		0, " ",
		0, 0,
		Art[i][0], Art[i][1],
		Bestellkommentarv, " ",
		Buff, "0",
		Taxv, 1,
		"Stück", "18",
		"", " ",
		"", 1,
		"0000", "0",
		 0)
		};
		
var tab = tab + lastrow;
document.write(tab);
document.write(buffer);
document.abfrage.Word.value=su1;




// Popup-Window
function popup(loc){
HTML="<html><head><meta http-equiv=\"imagetoolbar\" content=\"no\"><style>body{margin:0px 0px 0px 0px}</style></head><body onBlur='top.close()'><a href=\"javascript:window.close()\"><img src='http://www.stickvorlagen-shop.de/bg/"+loc+".jpg' border=0 alt=\"Fenster schliessen\"name=li onLoad='window.resizeTo(document.li.width+10,document.li.height+29)'></a></body></html>";
if(window.screen) var myleft=(screen.width-450)/2,mytop=(screen.height-350)/2;
popupImage=window.open('about:blank','_blank','toolbar=no,scrollbars=no,width=450,height=250,left='+myleft+',top='+mytop);
popupImage.document.open();
popupImage.document.write(HTML);
popupImage.document.close();
}

function Page(Seite) 
	{
		var Ziel = window.location.pathname + "?Seite=" + Seite;
 		window.location.href = Ziel;
		
	}
// Popup-Window

function suchbez()
        {       
        	Word = document.abfrage.Word.value;
        	Word = Word.replace("#","");
        	Wordt = Word.split(" ");
        	Word = Wordt[0];
	
        	var Ziel = window.location.pathname + "?Word=" + Word + "&Seite=" + getParameterFromURL("Seite");
 		window.location.href = Ziel;
	}


     