/*-----------------------------------------------------------------------*/
/*-- COPYRIGHT NOTICE                                                   -*/
/*-- (c) Copyright MK Internet-Service GmbH. All Rights Reserved.       -*/
/*-- Selling or reusing this code even in parts is expressly forbidden.	-*/
/*-----------------------------------------------------------------------*/

 var Eintrag    = new Array();
 var katalogstruktur    = new Array();

 var aktDate = new Date();
 var whitespace = " \t\n\r";
 var Suchstring = ""; 
 var trennzeichen = "#";
 var trennzeichenVarianten1 = ": ";
 var trennzeichenVarianten2 = "<br>"; // ; Semikolon nicht erlaubt
 var Eingabefenster  = self; // parent.frames['preload']; 
 var Ausgabefenster = self; //parent.frames['main']; 
 var aIndex = '<p><a name="[Index]">- [Index] -</a></p>';
 var aIndexBuf = "##start##";
 var aIndexBack = '<p><a href="#Anfang"><font face="Arial" size="1">Zurück zum Anfang</font></a></p>';
 var Spezifikation = "";
 var posStartseite = location.href.toUpperCase().indexOf("SG_STARTSEITE");
 var aktKatalogseite = self.location.href.substring(self.location.href.lastIndexOf("sg_"),self.location.href.length);
 var aktSeite = aktKatalogseite.substring(0,aktKatalogseite.indexOf(".htm")) + ".htm";
 var txtFlags = "<br>";
 var txtFlagsGP = "";
 var txtFlagsGE = "";
 var txtFlagsVK = "";
 var txtFlagsUVP = "";
 var txtFlagsME = "";
 
  // Zusatzfelder Bezeichner
 var Zusatzfeld1Bezeichner = "";
var Zusatzfeld2Bezeichner = "";
var Zusatzfeld3Bezeichner = "";
var Zusatzfeld4Bezeichner = "";
var Zusatzfeld5Bezeichner = "";
var Zusatzfeld6Bezeichner = "";
var Zusatzfeld7Bezeichner = "";
var Zusatzfeld8Bezeichner = "";
var Zusatzfeld9Bezeichner = "";
var Zusatzfeld10Bezeichner = "";

 
 // Vorlage zerlegen
 var Ausdruck = ""; // /(.+)\[template](.+)\[\/template](.+)/;
 // Ausdruck.exec(v_produkte);
 var constStaticTop = ""; //RegExp.$1;
 var constDynamicMiddle = ""; //RegExp.$2;
 var constStaticBottom = ""; //RegExp.$3;
 
 var aktKategorie = "";
  
 var Bildpfad = "images/";
  
 // Konfiguration Kategoriebild
 var KategoriebildWidth = '';
 if (KategoriebildWidth != '')
 {
 	KategoriebildWidth = ' width="' + KategoriebildWidth + '"';
 }
 
 var KategoriebildHeight = '';
 if (KategoriebildHeight != '')
 {
 	KategoriebildHeight = ' height="' + KategoriebildHeight + '"';
 }
 
 var KategoriebildBorder = '';
 if (KategoriebildBorder != '')
 {
  	KategoriebildBorder = ' border="' + KategoriebildBorder + '"';
 }
  
 var KategoriebildBorderColor = '';
 if (KategoriebildBorderColor != '')
 {
  	KategoriebildBorderColor = '  style="border-color:' + KategoriebildBorderColor + '"';
 }
   
// Konfiguration Produktbild
var ProduktbildWidth = "120";
var ProduktbildHeight = "";
var ProduktbildBorder = "";
var ProduktbildBorderColor = "";
var ProduktbildAlignment = "";


if (ProduktbildWidth != '')
{
ProduktbildWidth = ' width="' + ProduktbildWidth + '"';
}

if (ProduktbildHeight != '')
{
ProduktbildHeight = ' height="' + ProduktbildHeight + '"';
}

if (ProduktbildBorder != '0' && ProduktbildBorder != '')
{
	ProduktbildBorder = ' border="' + ProduktbildBorder + '"';
}
else
{
	ProduktbildBorder = ' border="0"';
}

if (ProduktbildBorderColor != '' && (parseInt(navigator.appVersion) >= 5 || navigator.appName.indexOf("Microsoft") >= 0) && ProduktbildBorder)
{
	ProduktbildBorderColor = '  style="border-color:' + ProduktbildBorderColor + '"';
}

if (ProduktbildAlignment != '')
{
	ProduktbildAlignment = ' align="' + ProduktbildAlignment + '" vspace="5" hspace="10"';
} 
 
 var max_pagesize = 30;
 var maxSpaltenzahl = 1;

 var suche_pagesize = 10000;
 var position = 1;
 var parameter= "";
 var maxPos = 0;
 var maxPage = 0;
 var absolutePage = 0;
 var linkData = "";
 var Suchstring;
 var output = "";
 
 parameter = window.location.search.split("&");
 
 if (parameter.length > 1)
 {
 	position = parameter[1].split("pos=")[1] * 1;
 }
 else
 {
 	position = 0;
 }
 
 function setFocus (anObject)
 {
 	eval("parent.main.document.forms[1]." + anObject + ".focus()");
 	eval("parent.main.document.forms[1]." + anObject + ".select()");
 }
 
 
 function getQuantity (anObject)
 {
 	return eval("parent.main.document.forms[1]." + anObject)?eval("parent.main.document.forms[1]." + anObject + ".value"):"1";
 }
 
function getSpezifikation (anObject)
{
	txtSpezifikation = "";
	anObjectName = "";
	if (eval("parent.main.document.forms[1]." + anObject))
	{
		anObjectName = eval("parent.main.document.forms[1]." + anObject + ".name");
		
		for(var i=0;i<parent.main.document.forms[1].length;++i)
		{
			txtSpezifikationZusatzfeld = "";

			// if (parent.main.document.forms[1].elements[i].name.indexOf(anObjectName) > -1 && parent.main.document.forms[1].elements[i].name != anObjectName)
			if (parent.main.document.forms[1].elements[i].name.indexOf(anObjectName) > -1)
			{
				// alert(eval("parent.main.document.forms[1]." + parent.main.document.forms[1].elements[i].name + "_h"));
				if (eval("parent.main.document.forms[1]." + parent.main.document.forms[1].elements[i].name + "_h"))
				{
					txtSpezifikationZusatzfeld = eval("parent.main.document.forms[1]." + parent.main.document.forms[1].elements[i].name + "_h.value");
				}

				switch(parent.main.document.forms[1].elements[i].type) 
				{
				 case "text":
						txtSpezifikation = txtSpezifikation + "<br>" + txtSpezifikationZusatzfeld + parent.main.document.forms[1].elements[i].value;
				 break;
				 case "radio":
						if (parent.main.document.forms[1].elements[i].checked)
						{
							txtSpezifikation = txtSpezifikation + "<br>" + txtSpezifikationZusatzfeld + parent.main.document.forms[1].elements[i].value;
						}
				 break;
				 case "checkbox":
						if (parent.main.document.forms[1].elements[i].checked)
						{
							txtSpezifikation = txtSpezifikation + "<br>" + txtSpezifikationZusatzfeld + parent.main.document.forms[1].elements[i].value;
						}
				 break;
				 case "select-one":
						txtSpezifikation = txtSpezifikation + "<br>" + txtSpezifikationZusatzfeld + parent.main.document.forms[1].elements[i].value;
				 break;
				 case "textarea":
						txtSpezifikation = txtSpezifikation + "<br>" + txtSpezifikationZusatzfeld + "<br>" + parent.main.document.forms[1].elements[i].value;
				 break;
				 case "file":
						txtSpezifikation = txtSpezifikation + "<br>" + txtSpezifikationZusatzfeld + parent.main.document.forms[1].elements[i].value;
				 break;
				 case "hidden":

				 break;
				 default:
					// alert(parent.main.document.forms[1].elements[i].type);
				 break;
				}

			}
		}
	}

	txtSpezifikation = txtSpezifikation.replace(/"/g, "´´");
	txtSpezifikation = txtSpezifikation.replace(/'/g, "´");
	return txtSpezifikation;
}

function checkSpezifikationenOK (strID)
{
	matchStrID = "_" + strID + "_";
	var pattern = eval("/_" + strID + "$/");

	for(var i=0;i<parent.main.document.forms[1].length;++i)
	{
		if (parent.main.document.forms[1].elements[i].name.indexOf(matchStrID) > -1 || pattern.test(parent.main.document.forms[1].elements[i].name))	
		{
			switch(parent.main.document.forms[1].elements[i].type) 
			{
			 case "text":
			 break;
			 case "radio":
			 break;
			 case "checkbox":
			 break;
			 case "select-one":
				if (parent.main.document.forms[1].elements[i].selectedIndex == 0 && parent.main.document.forms[1].elements[i].options.length > 1)
				{
					wert = parent.main.document.forms[1].elements[i].options[parent.main.document.forms[1].elements[i].selectedIndex].value;
					if (wert.toUpperCase().indexOf("WÄHLEN") > -1 || wert.toUpperCase().indexOf("CHOOSE") > -1 || wert.toUpperCase().indexOf("SELECTION") > -1)
					{
						alert(wert);
						parent.main.document.forms[1].elements[i].focus();
						return false;
					}
				}
			 break;
			 case "textarea":
			 break;
			 case "file":
			 break;
			 case "hidden":
			 break;
			 default:
			 break;
			}
		}
	}

	return true;

}
 
 
 function getSelectionXS (anObject)
 {
 	{
 		return eval("parent.main.document.forms[1]." + anObject)?eval("parent.main.document.forms[1]." + anObject + ".options[parent.main.document.forms[1]." + anObject + ".selectedIndex].value"):"";
 	}
 }
 
  
 function getPrice (anObject, price)
 {
 	// Variante bestimmt Preis
 	QualityPriceObject = eval("parent.main.document.forms[1]." + anObject.replace(/Preis/g, "Holzqualitt"));
 	if(QualityPriceObject)
 	{
  	arrQualityPrice = price.split("#")[1];
  	price = arrQualityPrice.split("|")[QualityPriceObject.selectedIndex];
  }
 	aSelectedPrice = eval("parent.main.document.forms[1]." + anObject)?eval("parent.main.document.forms[1]." + anObject + ".options[parent.main.document.forms[1]." + anObject + ".selectedIndex].value"):"";
 	if (aSelectedPrice)
 	{
 		aSelectedPriceSplit = aSelectedPrice.split(top.cart.sepVarOrderno);
 		if (aSelectedPriceSplit.length > 2)
 		{
 			// mit Bestellnummer
 			return aSelectedPriceSplit[2].split(top.cart.sepVarPrice)[0].replace(/\,/g, ".");
 		}
 		else
 		{
 			// ohne Bestellnummer
 			return aSelectedPriceSplit[1].split(top.cart.sepVarPrice)[0].replace(/\,/g, ".");
 		}
 	}
 	else
 	{
 		if (price.indexOf("|") == -1) // für PV als Tabelle
 			if (price.indexOf(trennzeichen) > -1) // für PV als Tabelle
 				price = price.split(trennzeichen)[1];
 		return price.replace(/\,/g, ".");
 	}
 } 
 
 function getPrice_sic (anObject, price)
 {
 	aSelectedPrice = eval("parent.main.document.forms[1]." + anObject)?eval("parent.main.document.forms[1]." + anObject + ".options[parent.main.document.forms[1]." + anObject + ".selectedIndex].value"):"";
 	if (aSelectedPrice)
 	{
 		aSelectedPriceSplit = aSelectedPrice.split(top.cart.sepVarOrderno);
 		if (aSelectedPriceSplit.length > 2)
 		{
 			// mit Bestellnummer
 			return aSelectedPriceSplit[2].split(top.cart.sepVarPrice)[0].replace(/\,/g, ".");
 		}
 		else
 		{
 			// ohne Bestellnummer
 			return aSelectedPriceSplit[1].split(top.cart.sepVarPrice)[0].replace(/\,/g, ".");
 		}
 	}
 	else
 	{
 		if (price.indexOf("|") == -1) // für PV als Tabelle
 			if (price.indexOf(trennzeichen) > -1) // für PV als Tabelle
 				price = price.split(trennzeichen)[1];
 			
 		return price.replace(/\,/g, ".");
 	}
 } 
 
 function getOrderno (anObject, orderno)
 {
  	aSelectedOrderno = eval("parent.main.document.forms[1]." + anObject)?eval("parent.main.document.forms[1]." + anObject + ".options[parent.main.document.forms[1]." + anObject + ".selectedIndex].value"):"";
  	if (aSelectedOrderno)
  	{
  		aSelectedOrdernoSplit = aSelectedOrderno.split(top.cart.sepVarOrderno);
  		if (aSelectedOrdernoSplit.length > 2)
  		{
  			// mit Bestellnummer
  			return aSelectedOrdernoSplit[0];
  		}
  		else
  		{
  			// ohne Bestellnummer
  			return orderno;
  		}
  	}
  	return orderno;
 }
 
 function getPriceVar (anObject)
 {
  	aSelectedPriceVar = eval("parent.main.document.forms[1]." + anObject)?eval("parent.main.document.forms[1]." + anObject + ".options[parent.main.document.forms[1]." + anObject + ".selectedIndex].value"):"";
  	if (aSelectedPriceVar)
  	{
  		aSelectedPriceVarSplit = aSelectedPriceVar.split(top.cart.sepVarOrderno);
  		if (aSelectedPriceVarSplit.length > 2)
  		{
  			// mit Bestellnummer
  			return aSelectedPriceVarSplit[1];
  		}
  		else
  		{
  			// ohne Bestellnummer
  			return aSelectedPriceVarSplit[0];
  		}
  	}
  	return "";
 }
 
 function Trefferliste (anzTreffer, suchtyp, keyword, referrer, Kategoriebild)
 {
 	Ausgabefenster  = parent.frames['main'];
 	txt_Detail = "";
	var TxtTotalPage = "";
	 
	output = "";
	searchfield = 0;

	if (posStartseite > - 1)
	{
		max_pagesize = suche_pagesize;
		txt_Detail = top.cart.txt_Detail.replace(/\<br>/g, "");
	}
	else
	{
		txt_Detail = top.cart.txt_Detail;
	}

	 pagesize = max_pagesize;
	 maxPos = anzTreffer + pagesize;
	 zeile = 0;
	 treffer = 0;

	 if (maxPos > Eintrag.length)
	 {
		maxPos = Eintrag.length;
	 }

	 if (maxPos > -1)
	 {
		switch (suchtyp)
		{
			case "VolltextBestellnummer":
				if (!Pruefen(keyword))
				{
					return;
				}			
				searchfield = 2;
				Suchstring = keyword;
				aktKategorie = keyword;
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_produkte);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;
				constStaticTop = constStaticTop.replace(/\[Kategoriebezeichnung]/g, top.cart.textTrefferliste + "[Kategoriebezeichnung]");
				break;			
			case "VolltextBezeichner":
				if (!Pruefen(keyword))
				{
					return;
				}			
				searchfield = 3;
				Suchstring = keyword;
				aktKategorie = keyword;
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_produkte);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;
				constStaticTop = constStaticTop.replace(/\[Kategoriebezeichnung]/g, top.cart.textTrefferliste + "[Kategoriebezeichnung]");
				break;
			case "VolltextBezeichnerIndex":
				searchfield = 3;
				Suchstring = keyword;
				aktKategorie = keyword;
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_index);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;
				constStaticTop = constStaticTop.replace(/\[Index]/g, "-" + keyword + "-");
				constStaticTop = constStaticTop.replace(/\[Kategoriebezeichnung]/g, "");
				break;						
			case "VolltextBezeichnerSuche":
				maxSpaltenzahl = 1;
				searchfield = 3;
				Suchstring = keyword;
				aktKategorie = keyword;
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_suchergebnis);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;
				constStaticTop = constStaticTop.replace(/\[Index]/g, keyword);
				constStaticTop = constStaticTop.replace(/\[Kategoriebezeichnung]/g, top.cart.textTrefferliste);
				vorlage = "v_suchergebnis.txt";
				break;	
			case "Kategorie":
				searchfield = 1;
				Suchstring = keyword;
				aktKategorie = keyword;
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_produkte);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;				
				break;				
			case "Produkt":
				searchfield = 0;
				Suchstring = keyword;
				keyword = self.location.pathname.substring(self.location.pathname.lastIndexOf("sg_")+3,self.location.pathname.lastIndexOf("."));
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_einzelseite);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;		
				break;
			case "Produktindex":
				searchfield = 0;
				Suchstring = keyword;
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_index);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;	
				break;				
			default:
				if (suchtyp == "Sonderangebote")
					searchfield = 12;
				else
					searchfield = 13;
				Suchstring = keyword;
				aktKategorie = keyword;
				 // Vorlage zerlegen
				Ausdruck = /(.+)\[template](.+)\[\/template](.+)/;
				Ausdruck.exec(v_produkte);
				constStaticTop = RegExp.$1;
				constDynamicMiddle = RegExp.$2;
				constStaticBottom = RegExp.$3;				
				break;				
		}	 
		
		// letzte Bestellseite merken, wenn nicht Einzelseite
		if (suchtyp != "Produkt")
		{
			top.cart.lastKategorie = self.location.href.substring(self.location.href.lastIndexOf("/")+1,self.location.href.length);
		}
	
	 	staticTop = constStaticTop;
	 	
	 	dynamicMiddle = constDynamicMiddle;
	 	staticBottom = constStaticBottom;
	 	
	 	if (suchtyp == "Produktindex" || suchtyp == "VolltextBezeichnerIndex")
	 	{
	 		for (var i=0;i<Eintrag.length;i++)
	 		{
	 			aSplit = Eintrag[i].split(";");
	 			aSplit[26] = aSplit[0];
	 			aSplit[0] = aSplit[3];
	 			Eintrag[i] = aSplit.join(";");
	 		}
	 		Eintrag.sort();
			for (var i=0;i<Eintrag.length;i++)
			{
				aSplit = Eintrag[i].split(";");
				aSplit[0] = aSplit[26];
				aSplit[26] = "";
				Eintrag[i] = aSplit.join(";");
	 		}
	 	}	 	
	 	
		// Zusatzfelder ersetzen
		if (top.cart.srnr.toUpperCase().charAt(17) != "Z")
			dynamicMiddle = dynamicMiddle.replace(/\[Zusatzfelder\].*\[\/Zusatzfelder\]/ig, "");
		if (top.cart.srnr.toUpperCase().charAt(25) == "Z")
		{
			dynamicMiddle = dynamicMiddle.replace(/\<tr>\s*\<th[^\<]*>\[Zusatzfeld[0-9]*Bezeichner\]\<\/th>\s*\<th[^\<]*>\[Zusatzfeld[0-9]*\]\<\/th>\s*\<\/tr>/ig, "");
			dynamicMiddle = dynamicMiddle.replace(/\<tr>\s*\<td[^\<]*>\[Zusatzfeld[0-9]*Bezeichner\]\<\/td>\s*\<td[^\<]*>\[Zusatzfeld[0-9]*\]\<\/td>\s*\<\/tr>/ig, "");
		}
					
		if (posStartseite > - 1)
		{
			if (suchtyp == "Produkt")
			{
				staticTop = staticTop.replace(/\[Kategoriebezeichnung]/g, "");
				staticTop = staticTop.replace(/\[Kategoriebeschreibung]/g, "");
				staticTop = staticTop.replace(/\[Kategoriebild]/g, "");
				staticTop = staticTop.replace(/\[Kategoriebild]<br>/g, "");
			}
			maxSpaltenzahl = maxSpaltenzahlStartseite;
		}


		TextbausteinOben = top.cart.txt_Kopfzeile.replace(/_az_/g, "\"");
		TextbausteinOben = TextbausteinOben.replace(/_ez_/g, "'");
		TextbausteinOben = TextbausteinOben.replace(/_nbsp_/g, "\&nbsp;");
		TextbausteinOben = TextbausteinOben.replace(/_vbCrLf_/g, "");
		TextbausteinOben = TextbausteinOben.replace(/_sk_/g, ";");		
		
		TextbausteinUnten = top.cart.txt_Fusszeile.replace(/_az_/g, "\"");
		TextbausteinUnten = TextbausteinUnten.replace(/_ez_/g, "'");
		TextbausteinUnten = TextbausteinUnten.replace(/_nbsp_/g, "\&nbsp;");
		TextbausteinUnten = TextbausteinUnten.replace(/_vbCrLf_/g, "");
		TextbausteinUnten = TextbausteinUnten.replace(/_sk_/g, ";");		
					
		if (top.cart.txt_Kopfzeile != "")
			staticTop = staticTop.replace(/\[TextbausteinOben]/g, "<br>" + TextbausteinOben);
		else
			staticTop = staticTop.replace(/\[TextbausteinOben]/g, "");
			
		if (top.cart.txt_Fusszeile != "")
			staticBottom = staticBottom.replace(/\[TextbausteinUnten]/g, "<br><br>" + TextbausteinUnten);
		else
			staticBottom = staticBottom.replace(/\[TextbausteinUnten]/g, "");
	 	
		for (i=0;i<Eintrag.length;i++)
		{
			// Arrays für Varianten
			someValues1 = new Array; 
			someValues2 = new Array; 
			someValues3 = new Array;
			someValues4 = new Array;
			someValues5 = new Array;
			someValuesPreis = new Array;
			
			var Var1NameInput = "undefined";
			var Var2NameInput = "undefined";
			var Var3NameInput = "undefined";
			var Var4NameInput = "undefined";
			var Var5NameInput = "undefined";
			
			// Flags
			var MM = 0;
			var GP = "";
			var GE = "";
			var VK = 0.00;
			var UVP = "";
			var PD = ""; // Preisdarstellung
			var LZ = "";
			var ME = ""; //top.cart.quantityText;
			var aTxtFlags = "";
			var Beschreibung = "";
			var Kurzbeschreibung = "";
			var bildverweise = "";
			
			Spezifikation = "";
			
		    if (Eintrag[i].toUpperCase().indexOf(Suchstring.toUpperCase()) > -1 || (Suchstring == "*"))
		    {
		    // Fire
		    einEintrag=Eintrag[i].replace(/\r/g, "");
		    einEintrag=einEintrag.replace(/\n/g, "");
		    einEintrag=einEintrag.split(";")
				// einEintrag=Eintrag[i].split(";")

				// Leerzeilen ausfiltern IE = 1, FireFox = 0
				if (einEintrag.length <= 1)
				{
					continue;
				}

				if (einEintrag[searchfield].toUpperCase().indexOf(Suchstring.toUpperCase()) > -1  || suchtyp == "VolltextBezeichnerSuche" || (Suchstring == "*"))
				{
					if ((suchtyp == "VolltextBestellnummer") && einEintrag[searchfield].indexOf(Suchstring.toUpperCase()) > 0)
					{
						continue;
					}					
					if ((suchtyp == "VolltextBezeichnerIndex") && einEintrag[searchfield].toUpperCase().indexOf(Suchstring.toUpperCase()) > 0)
					{
						continue;
					}										
					if ((suchtyp == "Kategorie") && einEintrag[searchfield].indexOf(Suchstring.toUpperCase()) > 0 && (Suchstring != "*"))
					{
						continue;
					}					
					if ((suchtyp == "Produkt") && einEintrag[searchfield] != Suchstring)
					{
						continue;
					}
					if ((suchtyp == "Sonderangebote" || suchtyp == "Neuheiten") && einEintrag[searchfield] == "")
					{
						continue;
					}
					if (Eintrag[i].indexOf("#HI#") > -1)
					{
						continue;
					}
					
					Beschreibung = einEintrag[9].replace(/_az_/g, "\"");
					Beschreibung = Beschreibung.replace(/_ez_/g, "'");
					Beschreibung = Beschreibung.replace(/_nbsp_/g, "\&nbsp;");
					Beschreibung = Beschreibung.replace(/_vbCrLf_/g, "");
					Beschreibung = Beschreibung.replace(/_sk_/g, ";");
					einEintrag[9] = Beschreibung;
					
					Kurzbeschreibung = einEintrag[8].replace(/_az_/g, "\"");
					Kurzbeschreibung = Kurzbeschreibung.replace(/_ez_/g, "'");
					Kurzbeschreibung = Kurzbeschreibung.replace(/_nbsp_/g, "\&nbsp;");
					Kurzbeschreibung = Kurzbeschreibung.replace(/_vbCrLf_/g, "");
					Kurzbeschreibung = Kurzbeschreibung.replace(/_sk_/g, ";");
					einEintrag[8] = Kurzbeschreibung;


					if (einEintrag[3] == "Promotiontext")
					{
						staticTop = staticTop.replace(/\[Kategoriebeschreibung]/g, einEintrag[9]);
						staticTop = staticTop.replace(/\[Kurzbeschreibung]/g, einEintrag[8]);
						if (einEintrag[6])
							staticTop = staticTop.replace(/\[Bild1]/g, '<img src="' + Bildpfad + einEintrag[6] + '">');
						else
						{
							staticTop = staticTop.replace(/\[Bild1]<br>/g, '');
							staticTop = staticTop.replace(/\<br>\[Bild1]/g, '');
							staticTop = staticTop.replace(/\[Bild1]/g, '');
						}
						if (einEintrag[7])
							staticTop = staticTop.replace(/\[Bild2]/g, '<img src="' + Bildpfad + einEintrag[7] + '">');
						else
						{
							staticTop = staticTop.replace(/\[Bild2]<br>/g, '');
							staticTop = staticTop.replace(/\<br>\[Bild2]/g, '');
							staticTop = staticTop.replace(/\[Bild2]/g, '');
						}
						continue;
					}
					
					if (einEintrag[3] == "Kategorietext")
					{
							staticTop = staticTop.replace(/\[Kategoriebeschreibung]/g, einEintrag[8] + '<br>' + einEintrag[9] + '<br><br>');
							if (einEintrag[6])
								staticTop = staticTop.replace(/\[Kategoriebild]/g, '<img src="' + Bildpfad + einEintrag[6] + '"><br>');

							continue;
					}
					
					treffer++;
					if (zeile < pagesize && treffer > anzTreffer || suchtyp == "Produktindex" || suchtyp == "VolltextBezeichnerIndex")
					{
						aProduktOuput = "";
						aProduktOuput = dynamicMiddle;
						if (!top.cart.Bestellen)
						{
							aProduktOuput = aProduktOuput.replace(/\[Bestellen]/, '');
						}
						
						// Sonderdarstellung: ohne Preis, ohne Bestellnummer
						if (einEintrag[4] == "999999,99" || einEintrag[4] == "999999.99")
						{
							aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]/g, "");
							aProduktOuput = aProduktOuput.replace(/\[Bestellen]/g, "");
							aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "");
							aProduktOuput = aProduktOuput.replace(/\[Weiterempfehlen]/g, "");
							aProduktOuput = aProduktOuput.replace(/\[Mailinfo]/g, "");
							aProduktOuput = aProduktOuput.replace(/ class="sg"/g, "");
							aProduktOuput = aProduktOuput.replace(/ class="td_xs"/g, "");
							aProduktOuput = aProduktOuput.replace(/ class="th_xs"/g, "");
							aProduktOuput = aProduktOuput.replace(/\[Beschreibung]\s*<br>/g, "[Beschreibung]");
							aProduktOuput = aProduktOuput.replace(/\[\/Zusatzfelder]\s*<br>/g, "[/Zusatzfelder]");
						}
						
						if (einEintrag[4] == "9999999,99" || einEintrag[4] == "9999999.99")
						{
							aProduktOuput = aProduktOuput.replace(/\[Bestellen]/g, "");
							aProduktOuput = aProduktOuput.replace(/\[Preis]/g, top.cart.textPreisAufAnfrage);
						}
						
						// Sonderdarstellung Bildformate
						if ((einEintrag[6].indexOf("_bf.") > -1 && einEintrag[8] == "" && vorlage == "v_produkte.txt") || (einEintrag[6].indexOf("_bf.") > -1 && vorlage == "v_einzelseite.txt"))
						{
							aProduktOuput = aProduktOuput.replace(/\[Bild]/g, "");
							aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, "<center>[Bild]</center><br>[Beschreibung]");
						}

						if (eval("einEintrag[29]"))
						{
							if (einEintrag[29].indexOf("#MM") > -1)
							{
								aMatch = einEintrag[29].match(/MM[0-9]*\#/i);
								MM = aMatch[0].replace(/[^0-9]/g, "");
								if (aTxtFlags == "")
									aTxtFlags = txtFlags;
								aTxtFlags += top.cart.txtFlagsMM.replace(/\[MM]/g, MM);
							}
							if (einEintrag[29].indexOf("#VK") > -1)
							{
								aMatch = einEintrag[29].match(/VK[0-9.,\-]*\#/i);
								VK = aMatch[0].replace(/[^0-9.,\-]/g, "");
								if (aTxtFlags == "")
									aTxtFlags = txtFlags;
									
								if (VK.indexOf("-") == -1)
								{
									if (top.cart.euroOn)
									{
										txtFlagsVK = top.cart.txtFlagsVK1 + top.cart.currencySymbol + ' ( [Euro] ' + top.cart.currencySymbolEuro + ' )' + "<br>";
										aTxtFlags += txtFlagsVK.replace(/\[VK]/g, VK);
										aTxtFlags = aTxtFlags.replace(/\[Euro]/, top.cart.roundOff(VK.replace(/\,/g, ".") / top.cart.exchangeEuro,2).replace(/\./g, ","));
									}
									else
									{
										txtFlagsVK = top.cart.txtFlagsVK1 + top.cart.currencySymbol + "<br>";
										aTxtFlags += txtFlagsVK.replace(/\[VK]/g, VK);
									}
								}
							}
							
							if (einEintrag[29].indexOf("#UVP") > -1)
							{
								aMatch = einEintrag[29].match(/UVP[0-9.,\-]*\#/i);
								UVP = aMatch[0].replace(/[^0-9.,\-]/g, "");
							}
							
							if (einEintrag[29].indexOf("#GP") > -1)
							{
								aMatch = einEintrag[29].match(/\#GP[^#]*/i);
								GP = "&nbsp;&nbsp;" + aMatch[0].replace(/\#GP/g, "");
							}
							if (einEintrag[29].indexOf("#GE") > -1)
							{
								aMatch = einEintrag[29].match(/#GE[^#]*/i);
								GE = aMatch[0].replace(/\#GE/g, "");
							}
							if (einEintrag[29].indexOf("#LZ") > -1)
							{
								aMatch = einEintrag[29].match(/#LZ[^#]*/i);
								LZ = aMatch[0].replace(/\#LZ/g, "");
								if (aTxtFlags == "")
									aTxtFlags = txtFlags;
								aTxtFlags += top.cart.txtFlagsLZ.replace(/\[LZ]/g, LZ);
							}
							if (einEintrag[29].indexOf("#ME") > -1)
							{
								aMatch = einEintrag[29].match(/#ME[^#]*/i);
								ME = aMatch[0].replace(/\#ME/g, "");
							}
							aTxtFlags += "<br>";
						}
						
						// Staffelpreise, Preisvarianten
						if (eval("einEintrag[29]") && (einEintrag[29].indexOf("#SP#") > -1  || einEintrag[29].indexOf("#PV#") > -1))
						{
							if ((top.cart.konfAbPreis == 0 || vorlage == "v_einzelseite.txt") )
							{
								if (einEintrag[29].indexOf("#PV#") > -1 && top.cart.showPriceAsSelect) // Preisvarianten
								{
									aProduktOuput = aProduktOuput.replace(/\[Bestellen]/g, '<table border="0" cellspacing="0" cellpadding="0"><tr><td><input name="[Menge]" value="1" size="3" onBlur="if (!top.cart.checkNumber(this.value,0)) {this.focus(); this.select();}"></td><td valign="bottom">' + '&nbsp;' + ME + '&nbsp;&nbsp;' + '[Bestellen]</td></tr></table>');
								}
								else // Staffelpreise
								{
									if (GP)
										GP = "<br>" + GP;
									aProduktOuput = aProduktOuput.replace(/\[Preis]/g, '<input name="[Menge]" value="1" size="3" onBlur="if (!top.cart.checkNumber(this.value,0)) {this.focus(); this.select();}">' + '&nbsp;' + ME + GP + '<br>[Preis]');
								}
							}

							if (einEintrag[29].indexOf("#SP#") > -1 || !top.cart.showPriceAsSelect)
								aProduktOuput = aProduktOuput.replace(/\[Bestellen]/g, "");
						}
						else // Normalpreis
						{
							// if ((top.cart.konfAbPreis == 0 || vorlage == "v_einzelseite.txt") )
								aProduktOuput = aProduktOuput.replace(/\[Bestellen]/g, '<table border="0" cellspacing="0"><tr><td><input name="[Menge]" value="1" size="3" onBlur="if (!top.cart.checkNumber(this.value,0)) {this.focus(); this.select();}"></td><td valign="bottom">' + ME + '&nbsp;&nbsp;' + '[Bestellen]</td></tr></table>');
						}
							
						if (navigator.appName.indexOf("Microsoft") < 0) // Netscape
							aProduktOuput = aProduktOuput.replace(/onBlur/g, "onChange");
							
						aProduktOuput = aProduktOuput.replace(/\[Menge]/g, "Menge_" + einEintrag[0]);
						aProduktOuput = aProduktOuput.replace(/\[Kurzbeschreibung]/g, einEintrag[8]);
						
						if (einEintrag[6])
							aProduktOuput = aProduktOuput.replace(/\[Bild1]/g, '<img src="' + Bildpfad + einEintrag[6] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '>');
						if (einEintrag[7])
							aProduktOuput = aProduktOuput.replace(/\[Bild2]/g, '<img src="' + Bildpfad + einEintrag[7] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '>');
							
						aProduktOuput = aProduktOuput.replace(/\[URL]/g, einEintrag[10]);
						
						if (searchfield == 1)
						{
							deeplink = "" + self.location.href.substring(0,self.location.href.lastIndexOf("/"));
							filename = Suchstring.replace(/#/g, "_");
							filename = filename.replace(/[^a-zA-Z0-9_]/g, "");
							filename = "sg_" + filename + ".htm";
							filename = filename + "?ID=" + einEintrag[0];
							deeplink = deeplink + "/" + filename;
						}
						else
						{
							if (vorlage == "v_einzelseite.txt")
							{
								deeplink = self.location.href;
							}
							else
							{
								deeplink = self.location.href.substring(0,self.location.href.lastIndexOf("&"));
							}
						}
						aProduktOuput = aProduktOuput.replace(/\[Deeplink]/g, deeplink);
						aProduktOuput = aProduktOuput.replace(/\[aktKategorie]/g, aktKategorie.replace(/\#/g, " - "));
						
						// Zusatzfelder ersetzen
						if (einEintrag[19] && aProduktOuput.indexOf("[Zusatzfeld1]") > -1)
							if (einEintrag[19].split(trennzeichen).length > 1)
							{
								if (top.cart.crosselling)
								{
									// Zubehör
									txt_crosselling = showCrosselling(einEintrag[19], einEintrag[0]);
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld1]/g, txt_crosselling);
								}
								else
								{
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld1]/g, einEintrag[19].split(trennzeichen)[1]);
								}
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld1Bezeichner]/g, einEintrag[19].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld1]/g, einEintrag[19]);
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld1Bezeichner]/g, Zusatzfeld1Bezeichner);
							}
						if (einEintrag[20])
							if (top.cart.Bestellspezi)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld2]/g, top.cart.Bestellspezifikation.replace(/\[Feldname]/g, "Spezifikation_" + einEintrag[0]).replace(/\<br>/ig, "\n"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld2Bezeichner]/g, einEintrag[20]);
								Spezifikation = "<br>" + einEintrag[20];
							}
							else
							{
								if (einEintrag[20].split(trennzeichen).length > 1)
								{
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld2]/g, einEintrag[20].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld2Bezeichner]/g, einEintrag[20].split(trennzeichen)[0]);
								}
								else
								{
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld2]/g, einEintrag[20].replace(/\_az_/ig, "'"));
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld2Bezeichner]/g, Zusatzfeld2Bezeichner);
								}
							}
						if (einEintrag[21])
							if (einEintrag[21].split(trennzeichen).length > 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld3]/g, einEintrag[21].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld3Bezeichner]/g, einEintrag[21].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld3]/g, einEintrag[21].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld3Bezeichner]/g, Zusatzfeld3Bezeichner);
							}
						if (einEintrag[22])
							if (einEintrag[22].split(trennzeichen).length > 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld4]/g, einEintrag[22].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld4Bezeichner]/g, einEintrag[22].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld4]/g, einEintrag[22].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld4Bezeichner]/g, Zusatzfeld4Bezeichner);
							}
						if (einEintrag[23])
							if (einEintrag[23].split(trennzeichen).length > 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld5]/g, einEintrag[23].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld5Bezeichner]/g, einEintrag[23].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld5]/g, einEintrag[23].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld5Bezeichner]/g, Zusatzfeld5Bezeichner);
							}
						if (einEintrag[24])
							if (einEintrag[24].split(trennzeichen).length > 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld6]/g, einEintrag[24].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld6Bezeichner]/g, einEintrag[24].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld6]/g, einEintrag[24].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld6Bezeichner]/g, Zusatzfeld6Bezeichner);
							}
						if (einEintrag[25])
							if (einEintrag[25].split(trennzeichen).length > 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld7]/g, einEintrag[25].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld7Bezeichner]/g, einEintrag[25].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld7]/g, einEintrag[25].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld7Bezeichner]/g, Zusatzfeld7Bezeichner);
							}
						if (einEintrag[26])
							if (einEintrag[26].split(trennzeichen).length > 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld8]/g, einEintrag[26].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld8Bezeichner]/g, einEintrag[26].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld8]/g, einEintrag[26].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld8Bezeichner]/g, Zusatzfeld8Bezeichner);
							}
						if (einEintrag[27])
							if (einEintrag[27].indexOf("#") == -1 || (einEintrag[27].toUpperCase().indexOf(".GIF") == -1 && einEintrag[27].toUpperCase().indexOf(".JPG") == -1 && einEintrag[27].toUpperCase().indexOf(".JPEG") == -1))
							{
								if (einEintrag[27].split(trennzeichen).length > 1)
								{
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld9]/g, einEintrag[27].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld9Bezeichner]/g, einEintrag[27].split(trennzeichen)[0]);
								}
								else
								{
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld9]/g, einEintrag[27].replace(/\_az_/ig, "'"));
									aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld9Bezeichner]/g, Zusatzfeld9Bezeichner);
								}
							}
							else
							{
								bilder = einEintrag[27].split(trennzeichen);
								bildverweise = '<table cellpadding="0" cellspacing="5">';
								for (a=1;a<bilder.length;a++)
								{
									bildverweise += '<td><table class="th_xs" align="center" cellpadding="2" cellspacing="1"><tr><td class="td_xs" align="center"><a href="javascript:top.cart.PopupPic(\'' + Bildpfad + bilder[a] + '\')"><small>' + a + '<small></a></td></tr></table></td>';
								}
								bildverweise += '</tr></table>';
								aProduktOuput = aProduktOuput.replace(/\[Bild]/g, "[Bild]<br><br><small>" + bilder[0] + "</small><br>" + bildverweise);
							}
						if (einEintrag[28])
							if (einEintrag[28].split(trennzeichen).length > 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10]/g, einEintrag[28].split(trennzeichen)[1].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10Bezeichner]/g, einEintrag[28].split(trennzeichen)[0]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10]/g, einEintrag[28].replace(/\_az_/ig, "'"));
								aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10Bezeichner]/g, Zusatzfeld10Bezeichner);
							}
							
						// restliche Platzhalter Zusatzfelder löschen
						if (!einEintrag[19] && !einEintrag[20] && !einEintrag[21] && !einEintrag[22] && !einEintrag[23] && !einEintrag[24] && !einEintrag[25] && !einEintrag[26] && !einEintrag[27] && !einEintrag[28])
							aProduktOuput = aProduktOuput.replace(/\[Zusatzfelder\].*\[\/Zusatzfelder\]/ig, "");
						aProduktOuput = aProduktOuput.replace(/\<tr>\s*\<th[^\<]*>\[Zusatzfeld[0-9]*Bezeichner\]\<\/th>\s*\<th[^\<]*>\[Zusatzfeld[0-9]*\]\<\/th>\s*\<\/tr>/ig, "");
						aProduktOuput = aProduktOuput.replace(/\<tr>\s*\<td[^\<]*>\[Zusatzfeld[0-9]*Bezeichner\]\<\/td>\s*\<td[^\<]*>\[Zusatzfeld[0-9]*\]\<\/td>\s*\<\/tr>/ig, "");
						aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld[^\[]*\]<br>/ig, "");
						aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld[^\[]*\]/ig, "");
						
						// restliche Platzhalter Varianten löschen
						if (!einEintrag[14] && !einEintrag[15] && !einEintrag[16] && !einEintrag[17] && !einEintrag[18])
							aProduktOuput = aProduktOuput.replace(/\[Varianten\].*\[\/Varianten\]/ig, "");
						
						if (suchtyp == "Produktindex" || suchtyp == "VolltextBezeichnerIndex")
						{
							aIndexBuf = aIndex.replace(/\[Index]/g, einEintrag[3].charAt(0));
							if (output.indexOf (aIndexBuf) > - 1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Index]/g, "");
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Index]/g, aIndexBack + aIndexBuf);
							}
						}
						
						// Artikel nie als Link darstellen
						if (suchtyp != "VolltextBezeichnerSuche")
						{
							aProduktOuput = aProduktOuput.replace(/\[Artikel]/, einEintrag[3]);
						}
						
						if (einEintrag[7] != "" && ID == "")
						{
							if (einEintrag[8] != "" && (suchtyp == "Kategorie" || suchtyp == "Produktindex" || suchtyp.indexOf("Volltext") > -1)  || suchtyp == "VolltextBezeichnerIndex")
							{
								if (einEintrag[10] == "" || true)
								{
									filename = Suchstring.replace(/#/g, "_");
									filename = filename.replace(/[^a-zA-Z0-9_]/g, "");
									filename = "sg_" + filename + ".htm";
									aProduktOuput = aProduktOuput.replace(/\[Bild]/g, '<a href=\"' + filename + '?ID=' + einEintrag[0] + '&ref=' + aktKatalogseite + '\" target="main"><img ' + ProduktbildAlignment + ' src="' + Bildpfad + einEintrag[7] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '></a>');
								}
								else
								{
									aProduktOuput = aProduktOuput.replace(/\[Bild]/g, '<a href=\"' + einEintrag[10] + '\" target="main"><img ' + ProduktbildAlignment + ' src="' + Bildpfad + einEintrag[7] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '></a>');
								}
							}
							else
							{
								showPicture = '<img ' + ProduktbildAlignment + ' src="' + Bildpfad + einEintrag[7] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '>';
								if (einEintrag[6] != "" && ID == "")
								{
									// showPicture = '<a href="JavaScript:void(window.open(\'' + Bildpfad + einEintrag[6] + '\',\'displayWindow\',\'menubar=yes,width=400,height=300,scrollbars=yes,resizable=yes\'))">' + showPicture + '</a>';
									showPicture = '<a href="javascript:top.cart.PopupPic(\'' + Bildpfad + einEintrag[6] + '\')">' + showPicture + '</a>';
								}
								aProduktOuput = aProduktOuput.replace(/\[Bild]/g, showPicture);
							}
						}
						else
						{
							if (einEintrag[6] != "")
							{
								if (einEintrag[8] != "" && ID == "" && (suchtyp == "Kategorie" || suchtyp == "Produktindex" || suchtyp.indexOf("Volltext") > -1)  || suchtyp == "VolltextBezeichnerIndex")
								{
									if (einEintrag[10] == "" || true)
									{
										filename = Suchstring.replace(/#/g, "_");
										filename = filename.replace(/[^a-zA-Z0-9_]/g, "");
										filename = "sg_" + filename + ".htm";
										aProduktOuput = aProduktOuput.replace(/\[Bild]/g, '<a href=\"' + filename + '?ID=' + einEintrag[0] + '&ref=' + aktKatalogseite + '\" target="main"><img ' + ProduktbildAlignment + ' src="' + Bildpfad + einEintrag[6] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '></a>');
									}
									else
									{
										aProduktOuput = aProduktOuput.replace(/\[Bild]/g, '<a href=\"' + einEintrag[10] + '\" target="main"><img ' + ProduktbildAlignment + ' src="' + Bildpfad + einEintrag[6] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '></a>');
									}
								}
								else
								{
									if (einEintrag[6] != "" && ID == "" && (ProduktbildWidth != '' || ProduktbildHeight != ''))
									{
										showPicture = '<img ' + ProduktbildAlignment + ' src="' + Bildpfad + einEintrag[6] + '" ' + ProduktbildBorder + ProduktbildBorderColor + ProduktbildWidth + ProduktbildHeight + '>';
										// showPicture = '<a href="JavaScript:void(window.open(\'' + Bildpfad + einEintrag[6] + '\',\'displayWindow\',\'menubar=yes,width=400,height=300,scrollbars=yes,resizable=yes\'))">' + showPicture + '</a>';
										showPicture = '<a href="javascript:top.cart.PopupPic(\'' + Bildpfad + einEintrag[6] + '\')">' + showPicture + '</a>';
										
										aProduktOuput = aProduktOuput.replace(/\[Bild]/g, showPicture);
									}
									else
									{
										aProduktOuput = aProduktOuput.replace(/\[Bild]/g, '<img ' + ProduktbildAlignment + ' src="' + Bildpfad + einEintrag[6] + '" ' + ProduktbildBorder + ProduktbildBorderColor + '>');
									}
								}
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Bild]<br>/g, "");
								aProduktOuput = aProduktOuput.replace(/\[Bild]/g, "");
							}
						}
						
						aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, "[Beschreibung]");
						aProduktOuput = aProduktOuput.replace(/\[Flags]/g, aTxtFlags);
						
						if (einEintrag[8] != "" && (suchtyp == "Produktindex" || suchtyp == "VolltextBezeichnerIndex"))
						{
							aProduktOuput = aProduktOuput.replace(/\[Artikel]/, einEintrag[3]);
						}						
						
						// Mailinfo
						if (top.cart.txt_Mailinfo != "" && aProduktOuput.indexOf("[Mailinfo]") == -1 && posStartseite == - 1 && (einEintrag[4] != "999999,99" && einEintrag[4] != "999999.99"))
						{
							aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, "[Beschreibung][Mailinfo]");
						}
						// Weitermpfehlen
						if (top.cart.txt_weiterempfehlen != "" && aProduktOuput.indexOf("[Weiterempfehlen]") == -1 && posStartseite == - 1 && (einEintrag[4] != "999999,99" && einEintrag[4] != "999999.99"))
						{
							if (staticTop.indexOf('"Tabelle') == -1)
								aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, "[Beschreibung][Weiterempfehlen]");
							else
								aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, "[Beschreibung]<br>[Weiterempfehlen]");
						}
						if (einEintrag[8] == "" && einEintrag[9] == "")
						{
							aProduktOuput = aProduktOuput.replace(/\[Mailinfo]/g, "<a href='" + top.cart.txt_MailinfoURL + "'>" + top.cart.txt_Mailinfo.replace(/\<br>/g, "&nbsp;") + "</a>");
							aProduktOuput = aProduktOuput.replace(/\[Weiterempfehlen]/g, "<a href='" + top.cart.txt_weiterempfehlenURL + "'>" + top.cart.txt_weiterempfehlen.replace(/\<br>/g, "&nbsp;") + "</a>");
						}
						else
						{
							aProduktOuput = aProduktOuput.replace(/\[Mailinfo]/g, "<a href='" + top.cart.txt_MailinfoURL + "'>" + top.cart.txt_Mailinfo + "</a>");
							aProduktOuput = aProduktOuput.replace(/\[Weiterempfehlen]/g, "<a href='" + top.cart.txt_weiterempfehlenURL + "'>" + top.cart.txt_weiterempfehlen + "</a>");
						}
						aProduktOuput = aProduktOuput.replace(/\[Deeplink]/g, deeplink);
						
						
				 // if (einEintrag[8] != ""  && (suchtyp == "Kategorie" || suchtyp == "Produktindex" || suchtyp.indexOf("Volltext") > -1)  || suchtyp == "VolltextBezeichnerIndex")
						if (einEintrag[8] != ""  && suchtyp == "Kategorie")
						{
							if (txt_Detail != "" && aProduktOuput.indexOf("[Details]") == -1)
							{
								if (staticTop.indexOf('"Tabelle') == -1)
									aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, einEintrag[8] + "[Details]");
								else
									aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, "[Details]");
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, einEintrag[8]);
							}

							if (einEintrag[10] == "" || true)
							{
								filename = Suchstring.replace(/#/g, "_");
								filename = filename.replace(/[^a-zA-Z0-9_]/g, "");
								filename = "sg_" + filename + ".htm";
								aProduktOuput = aProduktOuput.replace(/\[Artikel]/g, "<a href=\"" + filename + "?ID=" + einEintrag[0] + "&ref=" + aktKatalogseite + "\" target='main'>" + einEintrag[3] + "</a>");
								aProduktOuput = aProduktOuput.replace(/\[Details]/g, "<a href=\"" + filename + "?ID=" + einEintrag[0] + "&ref=" + aktKatalogseite + "\" target='main'>" + txt_Detail + "</a>");
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Artikel]/g, "<a href=\"" + einEintrag[10] + "\" target='main'>" + einEintrag[3] + "</a>");
								aProduktOuput = aProduktOuput.replace(/\[Details]/g, "<a href=\"" + einEintrag[10] + "\" target='main'>" + txt_Detail + "</a>");
							}
						}
						else
						{
							if (suchtyp == "VolltextBezeichnerSuche")
							{
								pagesize = suche_pagesize;
								aProduktOuput = aProduktOuput.replace(/\[Zeile]/g, treffer);
								filename = top.suche.katalogstruktur[einEintrag[1] - 1].split(";")[1] + "#" + top.suche.katalogstruktur[einEintrag[1] - 1].split(";")[2];
								filename = filename.replace(/Kategorien#/g, "");
								filename = filename.replace(/#/g, "_");
								filename = filename.replace(/[^a-zA-Z0-9_]/g, "");
								filename = "sg_" + filename + ".htm";
								aProduktOuput = aProduktOuput.replace(/\[Artikel]/g, "<a href=\"" + filename + "?ID=" + einEintrag[0] + "&ref=" + referrer + "\" target='main'>" + einEintrag[3] + "</a>");
								aProduktOuput = aProduktOuput.replace(/\[Bezeichnung]/, einEintrag[3]);
								aProduktOuput = aProduktOuput.replace(/\[Kurztext]/, einEintrag[8]);
								aProduktOuput = aProduktOuput.replace(/\[Langtext]/, einEintrag[9]);
							}
							else
							{
								if (txt_Detail != "" && aProduktOuput.indexOf("[Details]") == -1)
								{
									aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, einEintrag[9] + "[Details]");
								}
								else
								{
									aProduktOuput = aProduktOuput.replace(/\[Beschreibung]/g, einEintrag[9]);
								}
								
								// Zusatzfeld 10 in Beschreibungstext
								if (einEintrag[28])
									if (einEintrag[28].split(trennzeichen).length > 1)
									{
										aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10]/g, einEintrag[28].split(trennzeichen)[1]);
										aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10Bezeichner]/g, einEintrag[28].split(trennzeichen)[0]);
									}
									else
									{
										aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10]/g, einEintrag[28]);
										aProduktOuput = aProduktOuput.replace(/\[Zusatzfeld10Bezeichner]/g, Zusatzfeld10Bezeichner);
									}
									
								
								Preisdif = ((1.0 * (UVP.replace(/\,/g, "."))) - (1.0 * (einEintrag[4].replace(/\,/g, ".")) ));
								Preisdif = (top.cart.roundOff(Preisdif,2).replace(/\./g, ","));

								
								aProduktOuput = aProduktOuput.replace(/\[UVP]/g, UVP);
								aProduktOuput = aProduktOuput.replace(/\[Preisdif]/g, Preisdif);
								aProduktOuput = aProduktOuput.replace(/\[Waehrung]/g, top.cart.currencySymbol);
								
								if (einEintrag[10] == "")
								{
									aProduktOuput = aProduktOuput.replace(/\[Artikel]/g, einEintrag[3]);
								}
								else
								{
									aProduktOuput = aProduktOuput.replace(/\[Artikel]/g, "<a href=\"" + einEintrag[10] + "\" target='main'>" + einEintrag[3] + "</a>");
									aProduktOuput = aProduktOuput.replace(/\[Details]/g, "<a href=\"" + einEintrag[10] + "\" target='main'>" + txt_Detail + "</a>");
								}
							}
						}
						aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]/g, "[Bestellnummer]");
						
						// Preis als Drop-Down
						someValuesPreis = einEintrag[4].split(trennzeichen);
						if (someValuesPreis.length > 1 || someValuesPreis[0].indexOf(top.cart.sepVarOrderno) > -1)
						{
							spaltePrice = someValuesPreis.length - 1;
							if (someValuesPreis[0] != "" && top.cart.showPriceAsSelect && einEintrag[29].indexOf("#SP#") == -1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]<br>/g, "");
								aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]/g, "");
								aSelect = '<select name="Preis_' + einEintrag[0] + '">\n';
								if (someValuesPreis.length > 0)
								{
									aHeaderSplit = someValuesPreis[0].split(top.cart.sepVarOrderno);
									VarBezeichner = "<br>" + aHeaderSplit[1].substring(0,aHeaderSplit[1].indexOf("|"));
									for (k=1;k<someValuesPreis.length;k++)
									{
											aSelectedPriceSplit = someValuesPreis[k].split(top.cart.sepVarOrderno);
											anzSpalten = aSelectedPriceSplit.length - 1;
											varPrice = aSelectedPriceSplit[anzSpalten].substring(0,aSelectedPriceSplit[anzSpalten].indexOf("|"));
											varValue = aSelectedPriceSplit[anzSpalten - 1].substring(0,aSelectedPriceSplit[anzSpalten - 1].indexOf("|"));
											if (aSelectedPriceSplit[0] != "" && someValuesPreis.length > 2)
												varOrderno = aSelectedPriceSplit[0] + top.cart.sepVarOrderno;
											else
												varOrderno = "";
												
											if (top.cart.euroOn)
											{
												aSelect += '<OPTION value="' + varOrderno + VarBezeichner + ": " + varValue + top.cart.sepVarOrderno + varPrice + '">' + varOrderno + varValue + top.cart.sepVarOrderno + varPrice + '&nbsp;' + top.cart.currencySymbol + ' ( [Euro] ' + top.cart.currencySymbolEuro + ' )</OPTION>';
												aSelect = aSelect.replace(/\[Euro]/, top.cart.roundOff(varPrice.replace(/\,/g, ".") / top.cart.exchangeEuro,2).replace(/\./g, ","));
											}
											else
											{
												aSelect += '<OPTION value="' + varOrderno + VarBezeichner + ": " + varValue + top.cart.sepVarOrderno + varPrice + '">' + varOrderno + varValue + top.cart.sepVarOrderno + varPrice + '&nbsp;' + top.cart.currencySymbol + '</OPTION>';
											}
										}
									}
									aSelect += '</select>';
									if (staticTop.indexOf('"Tabelle') == -1)
										aProduktOuput = aProduktOuput.replace(/\[Preis]/g, GP + "<br>" + "<strong>" + top.cart.priceText + top.cart.TxtZusatztextPreis + "</strong> " + aSelect);
									else
										aProduktOuput = aProduktOuput.replace(/\[Preis]/g, aSelect + " " + top.cart.TxtZusatztextPreis + "<br>" + GP);
							}							
						}

						// Variante1 
						if (einEintrag[14] && einEintrag[14].indexOf("#") > -1)
						{
							aSelect = '';
							someValues1 = einEintrag[14].split(trennzeichen)
							if (someValues1 != "")
							{
								if (someValues1[0] != "") 
									Var1NameInput = someValues1[0].replace(/[äÄöÖüÜß -]/g, '') + '_' + einEintrag[0];
								else
									Var1NameInput = "var1" + '_' + einEintrag[0];
								aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner1]/g, someValues1[0]);							
								aSelect = '<select name="' + Var1NameInput + '">\n';
								if (someValues1.length > 0)
								{
									for (k=1;k<someValues1.length;k++)
									{
										aSelect += '<OPTION value="' + someValues1[k] + '">' + someValues1[k] + '</OPTION>';
									}
								}
								aSelect += '</select>';
							}							
							
							aProduktOuput = aProduktOuput.replace(/\[Variante1]/g, aSelect);
						}
						else
						{
							aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner1]/g, "");
						}		
						// Variante2
						if (einEintrag[15] && einEintrag[15].indexOf("#") > -1)
						{
							aSelect = '';
							someValues2 = einEintrag[15].split(trennzeichen)
							if (someValues2 != "")
							{
								if (someValues2[0] != "") 
									Var2NameInput = someValues2[0].replace(/[äÄöÖüÜß ]/g, '') + '_' + einEintrag[0];
								else
									Var2NameInput = "var2" + '_' + einEintrag[0];
								aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner2]/g, someValues2[0]);							
								aSelect = '<select name="' + Var2NameInput + '">\n';
								if (someValues2.length > 0)
								{
									for (k=1;k<someValues2.length;k++)
									{
										aSelect += '<OPTION value="' + someValues2[k] + '">' + someValues2[k] + '</OPTION>';
									}
								}
								aSelect += '</select>';
							}							
							
							aProduktOuput = aProduktOuput.replace(/\[Variante2]/g, aSelect);
						}
						else
						{
							aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner2]/g, "");
						}		
						// Variante3
						if (einEintrag[16] && einEintrag[16].indexOf("#") > -1)
						{
							aSelect = '';
							someValues3 = einEintrag[16].split(trennzeichen)
							if (someValues3 != "")
							{
								if (someValues3[0] != "") 
									Var3NameInput = someValues3[0].replace(/[äÄöÖüÜß ]/g, '') + '_' + einEintrag[0];
								else
									Var3NameInput = "var3" + '_' + einEintrag[0];
								aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner3]/g, someValues3[0]);							
								aSelect = '<select name="' + Var3NameInput + '">\n';
								if (someValues3.length > 0)
								{
									for (k=1;k<someValues3.length;k++)
									{
										aSelect += '<OPTION value="' + someValues3[k] + '">' + someValues3[k] + '</OPTION>';
									}
								}
								aSelect += '</select>';
							}							
							
							aProduktOuput = aProduktOuput.replace(/\[Variante3]/g, aSelect);
						}
						else
						{
							aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner3]/g, "");
						}
						// Variante4
						if (einEintrag[17] && einEintrag[17].indexOf("#") > -1)
						{
							aSelect = '';
							someValues4 = einEintrag[17].split(trennzeichen)
							if (someValues4 != "")
							{
								if (someValues4[0] != "") 
									Var4NameInput = someValues4[0].replace(/[äÄöÖüÜß ]/g, '') + '_' + einEintrag[0];
								else
									Var4NameInput = "var4" + '_' + einEintrag[0];
								aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner4]/g, someValues4[0]);							
								aSelect = '<select name="' + Var4NameInput + '">\n';
								if (someValues4.length > 0)
								{
									for (k=1;k<someValues4.length;k++)
									{
										aSelect += '<OPTION value="' + someValues4[k] + '">' + someValues4[k] + '</OPTION>';
									}
								}
								aSelect += '</select>';
							}							
							
							aProduktOuput = aProduktOuput.replace(/\[Variante4]/g, aSelect);
						}
						else
						{
							aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner4]/g, "");
						}			
						// Variante5
						if (einEintrag[18] && einEintrag[18].indexOf("#") > -1)
						{
							aSelect = '';
							someValues5 = einEintrag[18].split(trennzeichen)
							if (someValues5 != "")
							{
								if (someValues5[0] != "") 
									Var5NameInput = someValues5[0].replace(/[äÄöÖüÜß ]/g, '') + '_' + einEintrag[0];
								else
									Var5NameInput = "var5" + '_' + einEintrag[0];
								aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner5]/g, someValues5[0]);							
								aSelect = '<select name="' + Var5NameInput + '">\n';
								if (someValues5.length > 0)
								{
									for (k=1;k<someValues5.length;k++)
									{
										aSelect += '<OPTION value="' + someValues5[k] + '">' + someValues5[k] + '</OPTION>';
									}
								}
								aSelect += '</select>';
							}							
							
							aProduktOuput = aProduktOuput.replace(/\[Variante5]/g, aSelect);
						}
						else
						{
							aProduktOuput = aProduktOuput.replace(/\[Variantenbezeichner5]/g, "");
						}	
						
						// nicht benötigte Platzhalter Varianten löschen
						aProduktOuput = aProduktOuput.replace(/\[Variante[^\[]*\]<br>/g, "");
						aProduktOuput = aProduktOuput.replace(/\[Variante[^\[]*\]/g, "");
						
						// Variantenbezeichner
						if (someValues1.length > 0)
						{
							Var1Bezeichnung = trennzeichenVarianten2 + someValues1[0] + trennzeichenVarianten1;
						}
						else
						{
							Var1Bezeichnung = "";
						}
						if (someValues2.length > 0)
						{
							Var2Bezeichnung = "<BR>" + someValues2[0] + trennzeichenVarianten1;
						}
						else
						{
							Var2Bezeichnung = "";
						}
						if (someValues3.length > 0)
						{
							Var3Bezeichnung = "<BR>" + someValues3[0] + trennzeichenVarianten1;
						}
						else
						{
							Var3Bezeichnung = "";
						}
						if (someValues4.length > 0)
						{
							Var4Bezeichnung = "<BR>" + someValues4[0] + trennzeichenVarianten1;
						}
						else
						{
							Var4Bezeichnung = "";
						}
						if (someValues5.length > 0)
						{
							Var5Bezeichnung = "<BR>" + someValues5[0] + trennzeichenVarianten1;
						}
						else
						{
							Var5Bezeichnung = "";
						}

						// Preisvarinaten als Liste
						var colsValues = 0;
						var colsPrice = 1;
						var htmlHead = "";
						var mengenstaffel = "";
						var rowspan = "2";
						
						if (suchtyp != "VolltextBezeichnerSuche" && eval("einEintrag[29]") && (einEintrag[29].indexOf("#SP#") > -1 || einEintrag[29].indexOf("#PV#") > -1))
						{
							AbPreis = "";
							if (einEintrag[29].indexOf("#PV#") > -1)
								rowspan = "1";
							splitPreise = einEintrag[4].split("#");
							headMatrix = splitPreise[0];
							headMatrixCols = splitPreise[0].split(top.cart.sepVarOrderno);
							headBestnr = headMatrixCols[0];
							headWerte = headMatrixCols[1];
							headStaffel = headMatrixCols[2] + " "; // Fire
							
							htmlMatrix = "<table border='1' cellspacing='0' cellpadding='2' class='sg' align=''>";
							htmlHead = "<tr>";
							if (headBestnr != "")
							{
								aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]<br>/g, "");
								aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]/g, "");
								htmlHead += "<th class='th_xs' valign='top' rowspan='" + rowspan + "'>" + headBestnr + "</th>";
								colsValues++;
							}
							splitHeadWerte = headWerte.split("|");
							for (kk=0;kk<splitHeadWerte.length;kk++)
							{
								if (splitHeadWerte[kk] != ("Spalte " + (kk + 1)))
								{
									htmlHead += "<th class='th_xs' valign='top' rowspan='" + rowspan + "'>" + splitHeadWerte[kk] + "</th>";
									colsValues++;
								}
							}
							waehrung = top.cart.currencySymbol;
							if (top.cart.euroOn != "")
								waehrung += " (" + top.cart.currencySymbolEuro + ")";
							htmlHead += "<th class='th_xs' valign='top' colspan='[colsPrice]'>" + top.cart.priceText + "&nbsp;" + waehrung + "&nbsp;[textStaffelpreise]" + top.cart.TxtZusatztextPreis + "</th></tr>"
							

							splitHeadStaffel = headStaffel.split("|");
							textStaffelpreise = splitHeadStaffel[splitHeadStaffel.length - 1];
							if (einEintrag[29].indexOf("#PV#") == -1)
							{
								htmlHead += "<tr>";
								for (kk=0;kk<10;kk++)
								{
									if (splitHeadStaffel[kk] != ("Preis " + (kk + 1))) 
									{
										if (kk > 0)
											mengenstaffel += "|";
										mengenstaffel += splitHeadStaffel[kk];

										htmlHead += "<th class='th_xs' valign='top'>" + splitHeadStaffel[kk] + "</th>";
										colsPrice++;
									}
								}
								htmlHead += "<th class='th_xs' valign='top'>&nbsp;</th>";
								htmlHead += "</tr>";
							}
							else
							{
								colsPrice = 2;
							}
							
							htmlHead = htmlHead.replace(/\[colsPrice]/g, colsPrice);
							htmlHead = htmlHead.replace(/\[textStaffelpreise]/g, textStaffelpreise);
							htmlMatrix += htmlHead;
							

							minAbPreis = 1000000.00;
							for (var ll=1;ll<splitPreise.length;ll++)
							{
								matrixCols = splitPreise[ll].split(top.cart.sepVarOrderno);
								bestnr = matrixCols[0];
								werte = matrixCols[1];
								bezeichnung = einEintrag[3] + "<br>";
								staffel = matrixCols[2];
								aPrice = mengenstaffel + "#";
								htmlMatrix += "<tr>";
								
								if (headBestnr != "")
								{
									htmlMatrix += "<td class='td_xs' valign='top'>" + bestnr + "&nbsp;</td>";
								}
								
								splitWerte = werte.split("|");
								for (n=0;n<splitHeadWerte.length;n++)
								{
									if (splitHeadWerte[n] != ("Spalte " + (n + 1)))
									{
										htmlMatrix += "<td class='td_xs' valign='top'>" + splitWerte[n] + "&nbsp;</td>";
										bezeichnung += splitHeadWerte[n] + ": " + splitWerte[n] + "&nbsp;&nbsp;";
									}
								}
								
								splitStaffel = staffel.split("|");
								zweitwaehrung = "";
								for (m=0;m<10;m++)
								{
									if (splitHeadStaffel[m] != ("Preis " + (m + 1)))
									{

										if (top.cart.euroOn != "")
											zweitwaehrung = " <br>(" + top.cart.roundOff(splitStaffel[m].replace(/\,/g, ".") / top.cart.exchangeEuro,2).replace(/\./g, ",") + ")";
										
										htmlMatrix += "<td class='td_xs' valign='top' align='right'>" + splitStaffel[m] + zweitwaehrung + "</td>";
										if (m > 0)
											aPrice += "|";
										aPrice += splitStaffel[m];
										
										if (minAbPreis >= (1.0 * splitStaffel[m].replace(/\,/g, ".")))
										{
											minAbPreis = 1.0 * splitStaffel[m].replace(/\,/g, ".");
											
											if (top.cart.currencyPos == "before")
												if (top.cart.euroOn != "")
													AbPreis = top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.txtAbPreis + top.cart.currencySymbol + " " + top.cart.roundOff(splitStaffel[m].replace(/\,/g, "."),2).replace(/\./g, ",") + " " + top.cart.currencySymbol + " ( " + top.cart.currencySymbolEuro + " [Euro]" + " )";
												else
													AbPreis = top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.txtAbPreis + top.cart.currencySymbol + " " + top.cart.roundOff(splitStaffel[m].replace(/\,/g, "."), 2).replace(/\./g, ",");
											else
												if (top.cart.euroOn != "")
													AbPreis = top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.txtAbPreis + top.cart.roundOff(splitStaffel[m].replace(/\,/g, "."),2).replace(/\./g, ",") + " " + top.cart.currencySymbol + " ( [Euro] " + top.cart.currencySymbolEuro + " )";
												else
													AbPreis = top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.txtAbPreis + top.cart.roundOff(splitStaffel[m].replace(/\,/g, "."), 2).replace(/\./g, ",") + " " + top.cart.currencySymbol;
											AbPreis = AbPreis.replace(/\[Euro]/, top.cart.roundOff(splitStaffel[m].replace(/\,/g, ".") / top.cart.exchangeEuro,2).replace(/\./g, ","));
										}
										
									}
								}
								if (top.cart.Bestellen)
								{
									if (bestnr == "")
									{
										bestnr = einEintrag[2];
									}
									htmlMatrix += "<td class='td_xs' valign='top' align='right'>" + '<a href="JavaScript:if (!top.cart.checkNumber(  getQuantity(\'Menge_' + einEintrag[0] + '\')  ,' + MM + ')) {setFocus(\'Menge_' + einEintrag[0] + '\');} else {if(checkSpezifikationenOK(\'' + einEintrag[0] + '\')) top.cart.addToBasket(' + "getQuantity('Menge_" + einEintrag[0] + "'),'" + bezeichnung + ' ' + "' + getPriceVar('Preis_" + einEintrag[0] + "') + ' " + Var1Bezeichnung + "' + getSelectionXS('" + Var1NameInput + "') + ' " + Var2Bezeichnung + "' + getSelectionXS('" + Var2NameInput + "') + ' " + Var3Bezeichnung + "' + getSelectionXS('" + Var3NameInput + "') + ' " + Var4Bezeichnung + "' + getSelectionXS('" + Var4NameInput + "') + ' " + Var5Bezeichnung + "' + getSelectionXS('" + Var5NameInput + "') + '" + Spezifikation + "' +  getSpezifikation('Spezifikation_" + einEintrag[0] + "') ,getOrderno('Preis_" + einEintrag[0] + "', '" + bestnr + "'), getPrice('Preis_" + einEintrag[0] + "', '" + aPrice + "'),'" + einEintrag[29] + "','" + einEintrag[6] + "','" + einEintrag[2] + ".htm','" + einEintrag[5].replace(/\,/g, ".") + "','" + einEintrag[0] + "','" + "sg_" + keyword.replace(/#/g, "_").replace(/-/g, "") + ".htm" + "'" + ')}">' + top.cart.imageOrder + '</a>' + "</td>";
								}
								htmlMatrix += "</tr>";
							};
							htmlMatrix += "</table>";
							if ((AbPreis != "" && vorlage == "v_startseite.txt") || (top.cart.konfAbPreis && einEintrag[8] != "" && vorlage == "v_produkte.txt"))
							{
								aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + AbPreis + "</strong>");
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Preis]/g, htmlMatrix);
							}
						}
						else
						{
							{
								if (top.cart.currencyPos == "before")
								{
									if (top.cart.euroOn)
									{
										if (staticTop.indexOf('"Tabelle') == -1)
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.currencySymbol + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + " ( " + top.cart.currencySymbolEuro + " [Euro] )" + "</strong><br>" + GP);
										else
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.TxtZusatztextPreis  + " " + top.cart.currencySymbol + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + " ( " + top.cart.currencySymbolEuro + " [Euro] )" + "</strong><br>" + GP);
										aProduktOuput = aProduktOuput.replace(/\[Euro]/g, top.cart.roundOff(einEintrag[4].replace(/\,/g, ".") / top.cart.exchangeEuro,2).replace(/\./g, ","));
									}
									else
									{
										if (staticTop.indexOf('"Tabelle') == -1)
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.currencySymbol + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + "</strong><br>" + GP);
										else
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.TxtZusatztextPreis  + " " + top.cart.currencySymbol + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + "</strong><br>" + GP);
									}
								}
								else
								{
									if (top.cart.euroOn)
									{
										if (staticTop.indexOf('"Tabelle') == -1)
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + " " + top.cart.currencySymbol + " ( [Euro] " + top.cart.currencySymbolEuro + " )" + "</strong><br>" + GP);
										else
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.TxtZusatztextPreis  + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + " " + top.cart.currencySymbol + " ( [Euro] " + top.cart.currencySymbolEuro + " )" + "</strong><br>" + GP);
										aProduktOuput = aProduktOuput.replace(/\[Euro]/g, top.cart.roundOff(einEintrag[4].replace(/\,/g, ".") / top.cart.exchangeEuro,2).replace(/\./g, ","));
									}
									else
									{	
										if (staticTop.indexOf('"Tabelle') == -1)
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.priceText + top.cart.TxtZusatztextPreis  + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + " " + top.cart.currencySymbol + "</strong>" + "<br>" + GP);
										else
											aProduktOuput = aProduktOuput.replace(/\[Preis]/g, "<strong>" + top.cart.TxtZusatztextPreis  + " " + top.cart.roundOff(einEintrag[4].replace(/\,/g, "."),2).replace(/\./g, ",") + " " + top.cart.currencySymbol + "</strong><br>" + GP);
									}
								}
							}
						}

						
						if (einEintrag[2])
						{
							if (staticTop.indexOf('"Tabelle') == -1)
							{
								aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]/g, top.cart.ordernoText + ": " + einEintrag[2]);
							}
							else
							{
								aProduktOuput = aProduktOuput.replace(/\[Bestellnummer]/g, einEintrag[2]);
							}
						}
						
						// Preis als Dropdown-Menue
						if (einEintrag[29].indexOf("#PV#") > -1 && top.cart.showPriceAsSelect == "1")
							aProduktOuput = aProduktOuput.replace(/\[Bestellen]/, '<a href="JavaScript:if (!top.cart.checkNumber(  getQuantity(\'Menge_' + einEintrag[0] + '\')  ,' + MM + ')) {setFocus(\'Menge_' + einEintrag[0] + '\');} else if(checkSpezifikationenOK(\'' + einEintrag[0] + '\')) top.cart.addToBasket(' + "getQuantity('Menge_" + einEintrag[0] + "'),'" + einEintrag[3] + ' ' + "' + getPriceVar('Preis_" + einEintrag[0] + "') + ' " + Var1Bezeichnung + "' + getSelectionXS('" + Var1NameInput + "') + ' " + Var2Bezeichnung + "' + getSelectionXS('" + Var2NameInput + "') + ' " + Var3Bezeichnung + "' + getSelectionXS('" + Var3NameInput + "') + ' " + Var4Bezeichnung + "' + getSelectionXS('" + Var4NameInput + "') + ' " + Var5Bezeichnung + "' + getSelectionXS('" + Var5NameInput + "') + '" + Spezifikation + "' + getSpezifikation('Spezifikation_" + einEintrag[0] + "') ,getOrderno('Preis_" + einEintrag[0] + "', '" + einEintrag[2] + "'), getPrice('Preis_" + einEintrag[0] + "', '" + "" + "'),'" + einEintrag[29] + "','" + einEintrag[6] + "','" + einEintrag[2] + ".htm','" + einEintrag[5].replace(/\,/g, ".") + "','" + einEintrag[0] + "','" + "sg_" + keyword.replace(/#/g, "_").replace(/-/g, "") + ".htm" + "'" + ')">' + top.cart.imageOrder + '</a>');
						else
							aProduktOuput = aProduktOuput.replace(/\[Bestellen]/, '<a href="JavaScript:if (!top.cart.checkNumber(  getQuantity(\'Menge_' + einEintrag[0] + '\')  ,' + MM + ')) {setFocus(\'Menge_' + einEintrag[0] + '\');} else if(checkSpezifikationenOK(\'' + einEintrag[0] + '\')) top.cart.addToBasket(' + "getQuantity('Menge_" + einEintrag[0] + "'),'" + einEintrag[3] + ' ' + "' + getPriceVar('Preis_" + einEintrag[0] + "') + ' " + Var1Bezeichnung + "' + getSelectionXS('" + Var1NameInput + "') + ' " + Var2Bezeichnung + "' + getSelectionXS('" + Var2NameInput + "') + ' " + Var3Bezeichnung + "' + getSelectionXS('" + Var3NameInput + "') + ' " + Var4Bezeichnung + "' + getSelectionXS('" + Var4NameInput + "') + ' " + Var5Bezeichnung + "' + getSelectionXS('" + Var5NameInput + "') + getSpezifikation('Spezifikation_" + einEintrag[0] + "', '" + Spezifikation + "') ,getOrderno('Preis_" + einEintrag[0] + "', '" + einEintrag[2] + "'), getPrice('Preis_" + einEintrag[0] + "', '" + einEintrag[4] + "'),'" + einEintrag[29] + "','" + einEintrag[6] + "','" + einEintrag[2] + ".htm','" + einEintrag[5].replace(/\,/g, ".") + "','" + einEintrag[0] + "','" + "sg_" + keyword.replace(/#/g, "_").replace(/-/g, "") + ".htm" + "'" + ')">' + top.cart.imageOrder + '</a>');
							//aProduktOuput = aProduktOuput.replace(/\[Bestellen]/, '<a href="JavaScript:if (!top.cart.checkNumber(  getQuantity(\'Menge_' + einEintrag[0] + '\')  ,' + MM + ')) {setFocus(\'Menge_' + einEintrag[0] + '\');} else top.cart.addToBasket(' + "getQuantity('Menge_" + einEintrag[0] + "'),'" + einEintrag[3] + ' ' + "' + getPriceVar('Preis_" + einEintrag[0] + "') + ' " + Var1Bezeichnung + "' + getSelectionXS('" + Var1NameInput + "') + ' " + Var2Bezeichnung + "' + getSelectionXS('" + Var2NameInput + "') + ' " + Var3Bezeichnung + "' + getSelectionXS('" + Var3NameInput + "') + ' " + Var4Bezeichnung + "' + getSelectionXS('" + Var4NameInput + "') + ' " + Var5Bezeichnung + "' + getSelectionXS('" + Var5NameInput + "') + '" + Spezifikation + "' + getSpezifikation('Spezifikation_" + einEintrag[0] + "') ,getOrderno('Preis_" + einEintrag[0] + "', '" + einEintrag[2] + "'), getPrice('Preis_" + einEintrag[0] + "', '" + einEintrag[4] + "'),'" + einEintrag[29] + "','" + einEintrag[6] + "','" + einEintrag[2] + ".htm','" + einEintrag[5].replace(/\,/g, ".") + "','" + einEintrag[0] + "','" + "sg_" + keyword.replace(/#/g, "_").replace(/-/g, "") + ".htm" + "'" + ')">' + top.cart.imageOrder + '</a>');
		
						
						// Mehrspaltig
						if (maxSpaltenzahl > 1)
						{
							valModulo = (treffer - position - 1) % maxSpaltenzahl;
							if (valModulo == 0)
							{
								aProduktOuput = aProduktOuput.substring(0, aProduktOuput.lastIndexOf("</tr>")) ;
							}
							if (valModulo > 0 && valModulo < (maxSpaltenzahl - 1))
							{
								aProduktOuput = aProduktOuput.replace(/\<tr[^\<]*\>/, "");
								aProduktOuput = aProduktOuput.substring(0, aProduktOuput.lastIndexOf("</tr>")) ;
							}
							if (valModulo == (maxSpaltenzahl - 1))
							{
								aProduktOuput = aProduktOuput.replace(/\<tr[^\<]*\>/, "");
							}
						}
						
						if (i % 2 && staticTop.indexOf("td2th") > -1)
						{
							aProduktOuput = aProduktOuput.replace(/\<td/g, "<th");
							aProduktOuput = aProduktOuput.replace(/\<\/td>/g, "</th>");
						}
						
						// Sonderangebot und Neuheit
						if (einEintrag[12] && einEintrag[12] != "")
							aProduktOuput = aProduktOuput.replace(/\[Sonderangebot]/g, top.cart.saleText);
						// if (einEintrag[13] && einEintrag[13] != "")
						//	aProduktOuput = aProduktOuput.replace(/\[Neu]/g, top.cart.newText);

						aProduktOuput = aProduktOuput.replace(/\[Bezeichnung]/g, einEintrag[3]);
						aProduktOuput = aProduktOuput.replace(/\[ID]/g, einEintrag[0]);

						// restliche Platzhalter löschen
						aProduktOuput = aProduktOuput.replace(/\[\[/g, "&#91;");
						aProduktOuput = aProduktOuput.replace(/\]\]/g, "&#93;");
						aProduktOuput = aProduktOuput.replace(/\[[^\[]*\]/g, "");
						output = output + aProduktOuput + "\n";
						zeile++;
					}
				}
			}
		}
		maxPage = Math.ceil(treffer/pagesize);
 	}
	maxPage = Math.ceil(treffer/pagesize);
	absolutePage = Math.ceil((anzTreffer * 1 + 1)/pagesize);
	absolutePage>0?absolutePage:1;
	
	staticTop = staticTop.replace(/Seite \[/g, top.cart.Seite_txt + " [");
	staticTop = staticTop.replace(/\] von \[/g, "] " + top.cart.Von_txt + " [");
	staticTop = staticTop.replace(/\[aktuelle_Seite]/g, maxPage>0?absolutePage:0 + " ");
	staticTop = staticTop.replace(/\[max_Seite]/g, maxPage);
	staticTop = staticTop.replace(/\[HEAD_Beschreibung]/g, top.cart.Katalog_txt_1);
	staticTop = staticTop.replace(/\[HEAD_Bild]/g, top.cart.Katalog_txt_2);
	staticTop = staticTop.replace(/\[HEAD_URL]/g, top.cart.Katalog_txt_3);
	
	if (keyword != "")
	{
		staticTop = staticTop.replace(/\[Suchbegriff]/g, '"' + keyword + '"');
	}

	staticTop = staticTop.replace(/\[Treffer]/g, treffer);
	staticTop = staticTop.replace(/\[Spaltenzahl]/g, maxSpaltenzahl);
	staticBottom = staticBottom.replace(/\[Spaltenzahl]/g, maxSpaltenzahl);
	
	
	if (kategoriebild == "")
	{
		staticTop = staticTop.replace(/\[Kategoriebild]<br>/g, "");
		staticTop = staticTop.replace(/\[Kategoriebild]/g, "");
		if (keyword == "sonderangebote" || keyword == "neuheiten")
		{
			staticTop = staticTop.replace(/\[Kategoriebezeichnung]/g, kategorietitel);
		}
		else
		{
			staticTop = staticTop.replace(/\[Kategoriebezeichnung]/g, kategorietitel);
		}
	}
	else
	{
		staticTop = staticTop.replace(/\[Kategoriebild]/g, '<img src="' + Bildpfad + kategoriebild + '"' + KategoriebildBorder + KategoriebildBorderColor + KategoriebildWidth + KategoriebildHeight + '>');
		if (kategoriebild.indexOf("h_") != 0)
		{
			staticTop = staticTop.replace(/\[Kategoriebezeichnung]/g, aktKategorie.substring(aktKategorie.lastIndexOf('#') + 1,aktKategorie.length));
		}
	}
	
	// überschüssige Zeilenumbrüche entfernen
	staticTop = staticTop.replace(/\<br>\<br>/ig, "");
	staticTop = staticTop.replace(/\<br>[ ]*\<p>/ig, "<p>");
	// restliche Platzhalter löschen
	staticTop = staticTop.replace(/\[[^\[]*\]/g, "");
	
	
	// Datum ersetzen
	staticTop = staticTop.replace(/\[Datum]/g, aktDate.getDate() + "." + (aktDate.getMonth()*1 + 1) + "." + aktDate.getYear());
	staticBottom = staticBottom.replace(/\[Datum]/g, aktDate.getDate() + "." + (aktDate.getMonth()*1 + 1) + "." + aktDate.getYear());		
	// Ausgabe starten; Achtung die aktuelle Naviagtion incl. Skripte wird gelöscht
	// Ausgabefenster.document.open();
	// alert(staticTop);
	// Ausgabefenster.document.write(staticTop);
	
	// alert(staticTop.substring(staticTop.indexOf("<form"), staticTop.length));
	TxtTotalPage = staticTop.substring(staticTop.indexOf("<body"), staticTop.length)
	// TxtTotalPage = staticTop;
	
	if (suchtyp == "Produktindex" || suchtyp == "VolltextBezeichnerIndex")
	{
		arr_produkte = output.split("<!-- sort ");
		arr_produkte.sort();
		Ausgabefenster.document.write(arr_produkte.join(" "));
	}
	else
	{
		// Ausgabefenster.document.writeln(output);
		TxtTotalPage += output;

	}	
	

	if (referrer && referrer != self.location)
	{
		staticBottom = staticBottom.replace(/\[zurueck]/g, "<a href='" + referrer + "'>" + top.cart.txt_zurueck + "</a>");
		staticBottom = staticBottom.replace(/\[txt_zurueck]/g, top.cart.txt_zurueck);
	}
 	else
 	{
 	}
	
	 // Navigation
	 if (maxPage > 1)
	 {
		var navigation = '<br><div align="center"><center><table border="0" width="100%">';
		navigation += '  <tr>';
		navigation += '    <td class="body1" align="center">';

		if (absolutePage > 1)
		{
			navigation += '<a href=\'' + aktSeite + '?pos=' + ((absolutePage - 2) * pagesize) + '\'>' + top.cart.txt_Zurueck + '</a>&nbsp;&nbsp;';
		}

		for (z=0;z<maxPage;z++)
		{
			if (z != absolutePage-1)
			{
				navigation += ' | <a href=\'' + aktSeite + '?pos=' + (z * pagesize) + '\'>' + (z + 1) + '</a> ';
			}
			else
			{
				if (maxPage > 1)
				{
					navigation += ' | <b><big>' + (z + 1) + '</big></b> ';
				}
				else
				{
					navigation += ' <b><big>' + (z + 1) + '</big></b> ';
				}
			}
		}

		if (absolutePage < maxPage)
		{
			navigation += ' |&nbsp;&nbsp;&nbsp;<a href=\'' + aktSeite + '?pos=' + ((absolutePage) * pagesize) + '\'>' + top.cart.txt_Weiter + '</a>';
		}
		navigation += '</td></tr></table></center></div><br></body>';
		staticBottom = staticBottom.replace(/\[zurueck]/g, '[zurueck]' + navigation);
	 }
	 
	 if (suchtyp == "Produkt")
	 	staticBottom = staticBottom.replace(/\[zurueck]/g, "<a href='JavaScript:void(history.go(-1))'>" + top.cart.txt_zurueck + "</a>");
	 else
	 	staticBottom = staticBottom.replace(/\[zurueck]/g, "");
	 	
	// restliche Platzhalter löschen
	staticBottom = staticBottom.replace(/\[[^\[]*\]/g, "");
	
	TxtTotalPage += staticBottom;
	TxtTotalPage = TxtTotalPage.replace(/\<html>/ig, "");
	TxtTotalPage = TxtTotalPage.replace(/\<\/html>/ig, "");
	// TxtTotalPage = TxtTotalPage.replace(/\<body[^\>]*>/ig, "");
	TxtTotalPage = TxtTotalPage.replace(/\<\/body>/ig, "");

	if (suchtyp == "VolltextBezeichnerSuche")
	{
		// Ausgabefenster.document.open("text/html","replace");
		// Ausgabefenster.document.writeln('<html>');
		// Ausgabefenster.document.writeln('<head>');
		// Ausgabefenster.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
		// Ausgabefenster.document.writeln('<title>Suchergebnis</title>');
		// Ausgabefenster.document.writeln('<link rel="stylesheet" type="text/css" href="suchergebnis.css">');
		// Ausgabefenster.document.writeln('<!-- var Design = ""; -->');
		// Ausgabefenster.document.writeln('</head>');
		Ausgabefenster.document.open();
		Ausgabefenster.document.writeln(TxtTotalPage);
		Ausgabefenster.document.close();
		// Ausgabefenster.document.writeln('</body>');
		// Ausgabefenster.document.writeln('</html>');
		// Ausgabefenster.document.close();
	}
	else
	{
		// var timerID = setTimeout("Ausgabefenster.document.writeln(TxtTotalPage)", 1);
		// WK-Funktion
		
		switch (vorlage)
		{
			case "v_produkte.txt":
				Ausgabefenster.document.writeln('<link rel="stylesheet" type="text/css" href="produkte.css">');
				break;			
			case "v_einzelseite.txt":
				Ausgabefenster.document.writeln('<link rel="stylesheet" type="text/css" href="einzelseite.css">');
				break;			
			case "v_startseite.txt":
				Ausgabefenster.document.writeln('<link rel="stylesheet" type="text/css" href="startseite.css">');
				break;			
			case "v_suchergebnis.txt":
				Ausgabefenster.document.writeln('<link rel="stylesheet" type="text/css" href="suchergebnis.css">');
				break;			
			default:
				Ausgabefenster.document.writeln('<link rel="stylesheet" type="text/css" href="produkte.css">');
				break;
		}
		
		Ausgabefenster.document.writeln(TxtTotalPage);
	}
}



function charInString (c, s)
{   for (j = 0; j < s.length; j++)
    {   if (s.charAt(j) == c) return true;
    }
    return false
}


function stripInitialWhitespace (s)
{   var k = 0;

    while ((k < s.length) && charInString (s.charAt(k), whitespace))
       k++;

    return s.substring (k, s.length);
}

function stripTrailingWhitespace (s)
{   var k = s.length-1;

    while ((k > 0) && charInString (s.charAt(k), whitespace))
    {
       k--;
    }
       

    return s.substring (0, k+1);
}

  
 function Pruefen(str)
 {
   if ( str.length < 4 )
   {
     alert( "Bitte geben Sie mehr als 3 Zeichen ein!" ); 
     return false;
   }
   return true;
 }

 function showCrosselling (str, anID)
 {
 	txt = "";
 	reihenfolge = 1;
 	 	
 	for (k=0;k<parent.suche.Eintrag.length;k++)
	{
		aSplitEintrag = parent.suche.Eintrag[k].split(";");
		if (str.indexOf("#" + aSplitEintrag[0]) == -1)
		{
			continue;
		}
		
		aSplit = str.split(trennzeichen);
		
		for (i=1;i<aSplit.length;i++)
		{
			if (aSplitEintrag[0] == aSplit[i])
			{
				filename = top.suche.katalogstruktur[aSplitEintrag[1]-1].split(";")[1] + "#" + top.suche.katalogstruktur[aSplitEintrag[1]-1].split(";")[2];
				filename = filename.replace(/Kategorien#/g, "");
				filename = filename.replace(/#/g, "_");
				filename = filename.replace(/[^a-zA-Z0-9_]/g, "");
				filename = "sg_" + filename + ".htm";
				if (vorlage == "v_produkte.txt" || aktKatalogseite.indexOf("ID=") > -1)
				{
					if (i < reihenfolge)
					{
						txt = '<!--' + (1000 + i) + '--><a href="' + filename + '?ID=' + aSplitEintrag[0] + '&ref=' + aktKatalogseite + '">' + aSplitEintrag[3] + '</a><br>' + txt;
					}
					else
					{
						txt = txt + '<!--' + (1000 + i) + '--><a href="' + filename + '?ID=' + aSplitEintrag[0] + '&ref=' + aktKatalogseite + '">' + aSplitEintrag[3] + '</a><br>';
					}
				}
				else
				{
					txt = txt + '<!--' + (1000 + i) + '--><a href="' + filename + '?ID=' + aSplitEintrag[0] + '&ref=' + aktKatalogseite + '?ID=' + anID + '">' + aSplitEintrag[3] + '</a><br>';
				}
				reihenfolge = i;
			}
		}
		aSplitTxt = txt.split("<!--");
		aSplitTxt.sort();
		txt = aSplitTxt.join("<!--")
		
	}
 	return txt;
 }

