var nCounter = 0;
function StartMove(nParam) {
	nCounter = 1; 
	if (nParam == 0) { 
		moveToPrevious();
	} else {
		moveToNext()
	}
} 
function StopMove(nParam) { 
	nCounter = 100000; 
	if (nParam == 0) { 
		moveToPrevious();
	} else {
		moveToNext()
	}
}

nProduktLeisteMaxLeft = 0;


nSpeedMove = 0.3;
function moveToPrevious() {
	nCounter = nCounter+1;
	if (nCounter < 10000) {
		xTempElement = document.getElementById("imageBoxInside");
		nLeft = xTempElement.style.marginLeft;
		nLeft = nLeft.replace("px", "");
		if (isNaN(nLeft) || nLeft == "" ) nLeft = 0;
		
		nLeft = Number(nLeft);
		// console.log(nLeft + " < " + nProduktLeisteMaxLeft);
		
		if (nLeft < nProduktLeisteMaxLeft ) {
			xTempElement.style.marginLeft = nLeft+86 + "px";
			// console.log(xTempElement.style.marginLeft);
			// new Effect.Move('imageBoxInside', { x: 86, y: 0, mode:"relative", duration: nSpeedMove });
		} else {
			if (nLeft != nProduktLeisteMaxLeft ) {
				// xTempElement.style.marginLeft = nLeft+nLeft-nProduktLeisteMaxLeft+ "px"; 
				// new Effect.Move('imageBoxInside', { x: -1 * (nLeft-nProduktLeisteMaxLeft), y: 0, mode:"relative", duration: nSpeedMove }); 
			}
			nCounter = 100000;
		}
		window.setTimeout("moveToPrevious()", 500);
	}
}  

function moveToNext() {
	nCounter = nCounter+1;
	if (nCounter < 10000) {
		xTempElement = document.getElementById("imageBoxInside");
		nLeft = xTempElement.style.marginLeft;
		nLeft = nLeft.replace("px", "");
		if (isNaN(nLeft) || nLeft == "" ) nLeft = 0;
		
		nMaxLeft = -344;
		nMaxLeft = nMaxLeft + nProduktLeisteMaxLeft;
		if (nLeft > nMaxLeft) {
			xTempElement.style.marginLeft = nLeft-86 + "px";
			// new Effect.Move('imageBoxInside', { x: -86, y: 0, mode:"relative", duration: nSpeedMove });
		} else {
			nCounter = 100000;
		} 
		window.setTimeout("moveToNext()", 500);
	}
}

function ChangePic (nNewIndex) {
	if (nNewIndex == nAktImageIndex) { } else {
		nFarbIndex = 1;
		switch (strProdTitel) {
			case "fatboy avenue" : 
				switch (nAktForm) {
					case 0 : if (nAktMuster == 1) { nFarbIndex = 3; strImagePath = arrPfade[1]; } else { nFarbIndex = 1; strImagePath = arrPfade[0]; } break;
					case 1 : if (nAktMuster == 1) { nFarbIndex = 7; strImagePath = arrPfade[3]; } else { nFarbIndex = 5; strImagePath = arrPfade[2]; } break;
				}
				arrAktArray = arrProdukte[nAktFarbe];
				break;
			case "fatboy flowerpowersol" : 
				switch (nAktProd) {
					case 0 : nFarbIndex = 1; break;
					case 1 : nFarbIndex = 1; break;
				}
//				console.log(arrSol[nAktProd][nAktFarbe]);
				arrAktArray = arrSol[nAktProd][nAktFarbe];
				break;
			default : arrAktArray = arrProdukte[nAktFarbe]; break;
		}
	
		arrAllPictures = arrAktArray[nFarbIndex];
//		console.log(arrAllPictures);
		strNewSrc = "";
		strNewSrc = strImagePath + "details/" + arrAllPictures[nNewIndex];
		strNewAlt = arrProdukte[nAktFarbe][0];
		strNewTitle = arrProdukte[nAktFarbe][0];
		
		xHauptbild = document.getElementById("Hauptbild");
		new Effect.Fade(xHauptbild, {duration: 0.1 });
		// in 2 Sekunden wird das neue Grossbild eingeblendet
		// window.setTimeout("ChangeBildGross(xGrossImage, strNewGrossSrc, strNewGrossAlt, strNewGrossTitle)", 551);
		window.setTimeout("ChangeBildGross(xHauptbild, strNewSrc, strNewAlt, strNewTitle)", 151);				
		
		xOldPic = document.getElementById("Pic" + (nAktImageIndex+1));
		Element.removeClassName(xOldPic, 'aktiv');
		
		xNewPic = document.getElementById("Pic" + (nNewIndex+1));
		Element.addClassName(xNewPic, 'aktiv');
		
		nAktImageIndex = nNewIndex;
		if (strProdTitel == "fatboy cuscino") {
			ChangeLinkLightbox();
		}
	}
}


function ChangePicDoggie (nNewIndex) {
	if (nNewIndex == nAktImageIndex) { } else {
		arrAllPictures = arrProdukte[nAktFarbe][1];
		strNewSrc = "";
		
		switch (nAktGroesse) {
			case 0 : strImagePath = strImagePathL; break;
			case 1 : strImagePath = strImagePathS; break;
		}
		
		strNewSrc = strImagePath + "details/" + arrAllPictures[nNewIndex];
		strNewAlt = arrProdukte[nAktFarbe][0];
		strNewTitle = arrProdukte[nAktFarbe][0];
		
		xHauptbild = document.getElementById("Hauptbild");
		new Effect.Fade(xHauptbild, {duration: 0.1 });
		// in 2 Sekunden wird das neue Grossbild eingeblendet
		// window.setTimeout("ChangeBildGross(xGrossImage, strNewGrossSrc, strNewGrossAlt, strNewGrossTitle)", 551);
		window.setTimeout("ChangeBildGross(xHauptbild, strNewSrc, strNewAlt, strNewTitle)", 151);				
		
		xOldPic = document.getElementById("Pic" + (nAktImageIndex+1));
		Element.removeClassName(xOldPic, 'aktiv');
		
		xNewPic = document.getElementById("Pic" + (nNewIndex+1));
		Element.addClassName(xNewPic, 'aktiv');
		
		nAktImageIndex = nNewIndex;
	}
}

function ChangeMuster (nNewMuster) {
	if (nAktMuster == nNewMuster) {} else {
		switch (nAktMuster) {
			case 0 :
				// Akt. Muster ist Parc -> Neues Muster wird Block
				strElem = "ImgMusterParc";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/parc.png";
				
				strElem = "ImgMusterBlock";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/block-aktiv.png";
				
				xH1Ele = document.getElementById("H1Avenue");
				if (nAktForm == 1) { xH1Ele.src = "images/avenue/h1-secondblock.gif"; } else { xH1Ele.src = "images/avenue/h1-firstblock.gif";  }
				break;
			case 1 :
				// Akt. Muster ist Block -> Neues Muster wird Parc
				strElem = "ImgMusterParc";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/parc-aktiv.png";
				
				strElem = "ImgMusterBlock";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/block.png";
				
				xH1Ele = document.getElementById("H1Avenue");
				if (nAktForm == 1) { xH1Ele.src = "images/avenue/h1-secondparc.gif"; } else { xH1Ele.src = "images/avenue/h1-firstparc.gif";  }
				break;
		}
		nAktMuster = nNewMuster;
		ChangeFarbe(nAktFarbe, true);
	}
}

function ChangeForm(nNewForm) {
	if (nAktForm == nNewForm) {} else {
		switch (nAktForm) {
			case 0 :
				// Akt. Form ist First -> Neue Form wird Second
				strElem = "ImgFormFirst";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/first.png";
				
				strElem = "ImgFormSecond";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/second-aktiv.png";
				
				xH1Ele = document.getElementById("H1Avenue");
				if (nAktMuster == 1) { xH1Ele.src = "images/avenue/h1-secondblock.gif"; } else { xH1Ele.src = "images/avenue/h1-secondparc.gif";  }
				break;
			case 1 :
				// Akt. Form ist Second -> Neue Form wird First
				strElem = "ImgFormFirst";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/first-aktiv.png";
				
				strElem = "ImgFormSecond";
				xElement = document.getElementById(strElem);
				xElement.src = "images/avenue/second.png";
				
				xH1Ele = document.getElementById("H1Avenue");
				if (nAktMuster == 1) { xH1Ele.src = "images/avenue/h1-firstblock.gif"; } else { xH1Ele.src = "images/avenue/h1-firstparc.gif";  }
				
				break;
		}
		nAktForm = nNewForm;
		ChangeFarbe(nAktFarbe, true);
	}
}


function ChangeFarbe (nNewFarbIndex, bChange) {
	if (nNewFarbIndex == nAktFarbe && !bChange) {
		
	} else {
		switch (strProdTitel) {
			case "fatboy avenue" : 
				nFarbIndex = 1;
				nNewPreis = nAvenueFP;
				switch (nAktForm) {
					case 0 : if (nAktMuster == 1) { nFarbIndex = 3; strImagePath = arrPfade[1]; nNewPreis = nAvenueFB; } else { nFarbIndex = 1; strImagePath = arrPfade[0]; nNewPreis = nAvenueFP;} break;
					case 1 : if (nAktMuster == 1) { nFarbIndex = 7; strImagePath = arrPfade[3]; nNewPreis = nAvenueSP;} else { nFarbIndex = 5; strImagePath = arrPfade[2]; nNewPreis = nAvenueSB;} break;
				}
				arrAktArray = arrProdukte[nNewFarbIndex]; 
				arrAktImages = arrAktArray[nFarbIndex];
				strNewProdTitel = arrAktArray[0];
				strNewArtikelNummer = arrAktArray[nFarbIndex+1];
				
				strPreis = FormatPreis(nNewPreis, false);
				arrPreis = strPreis.split(",");
				strPreisShow = "";
				if (arrPreis[1] == "00") {
					strPreisShow = arrPreis[0] + ",-";
				} else {
					strPreisShow = strPreis;
				}
				
				xPreisboxValue = document.getElementById("preisboxValue");
				xPreisboxValue.innerHTML = strPreisShow;
				break;
			case "fatboy flowerpowersol" :
				nFarbIndex = 1;
				nNewPreis = nFlowerpowersol;
				switch (nAktProd) {
					case 0 : nNewPreis = nFlowerpowersol; break;
					case 1 : nNewPreis = nFlowerpowerBase; nNewFarbIndex = 0; break;
				}
				arrAktArray = arrSol[nAktProd][nNewFarbIndex]; 
				arrAktImages = arrAktArray[nFarbIndex];
				strNewProdTitel = arrAktArray[0];
				strNewArtikelNummer = arrAktArray[nFarbIndex+1];
				
				strPreis = FormatPreis(nNewPreis, false);
				arrPreis = strPreis.split(",");
				strPreisShow = "";
				if (arrPreis[1] == "00") {
					strPreisShow = arrPreis[0] + ",-";
				} else {
					strPreisShow = strPreis;
				}
				
				xPreisboxValue = document.getElementById("preisboxValue");
				xPreisboxValue.innerHTML = strPreisShow;
				break;
			default : 
				arrAktArray = arrProdukte[nNewFarbIndex];
				arrAktImages = arrAktArray[1];
				strNewProdTitel = arrAktArray[0];
				strNewArtikelNummer = arrAktArray[2];
				break;
		}	
		
		xArtikelNr = document.getElementById("FormIDPR");
		xArtikelNr.value = strNewArtikelNummer;
		
		strNewGrossImage = "";
		strNewGrossImageAlt = "";
		strNewGrossImageTitle = "";
		
		strNewThumbPic1 = "";
		strNewThumbPicAlt1 = "";
		strNewThumbPicTitle1 = "";
		strNewThumbPic2 = "";
		strNewThumbPicAlt2 = "";
		strNewThumbPicTitle2 = "";
		strNewThumbPic3 = "";
		strNewThumbPicAlt3 = "";
		strNewThumbPicTitle3 = "";
		strNewThumbPic4 = "";
		strNewThumbPicAlt4 = "";
		strNewThumbPicTitle4 = "";
		
		// bei den H1-Überschriften von Rockies ändert sich die Klasse
		switch (strProdTitel) {
			case "fatboy rockies" : 
				xElement = document.getElementById("H1Rockie");
				switch (nNewFarbIndex) {
					case 0: xElement.src = "images/rockies/h1-titel-cassius.gif"; break;
					case 1: xElement.src = "images/rockies/h1-titel-joe.gif"; break;
					case 2: xElement.src = "images/rockies/h1-titel-george.gif"; break;
				}
				break;
			case "fatboy djeksuns" : 
				xElement = document.getElementById("H1Djeksun");
				switch (nNewFarbIndex) {
					case 0: xElement.src = "images/djeksuns/h1-titel-michael.gif"; break;
					case 1: xElement.src = "images/djeksuns/h1-titel-janet.gif"; break;
					case 2: xElement.src = "images/djeksuns/h1-titel-latoya.gif"; break;
				}
				break;
		}
		
		xFarbenLeiste = null;
		strFarbenLeiste = "FI" + (nAktFarbe + 1);
		xFarbenLeiste = document.getElementById(strFarbenLeiste);
		strFarbenLI = "F" + (nAktFarbe + 1);
		xFarbenLI = document.getElementById(strFarbenLI);
		if (xFarbenLeiste != null) {
			strOldSrc = xFarbenLeiste.src;
			arrOldSrc = strOldSrc.split("/");
			strOldSrcImg = arrOldSrc[arrOldSrc.length-1];
			strOldSrcImg = strOldSrcImg.replace("-middle", "");
			strOldSrcImg = strOldSrcImg.replace("-top", "");
			strOldSrcImg = strOldSrcImg.replace("-aktiv", "");
			
			strNewPath = "images/produktseiten/farbwelt/";
			strNewSrc = strOldSrcImg
			strNewSrc = strNewPath + strNewSrc;
			nNewWidth = 33;
			nNewHeight = 59;
		
			xFarbenLeiste.src = strNewSrc;
			xFarbenLeiste.width = nNewWidth;
			xFarbenLeiste.height = nNewHeight;
			// console.log(xFarbenLeiste.id +":::" +  xFarbenLeiste.src + "++" + xFarbenLeiste.width + "##" + xFarbenLeiste.height);
			Element.removeClassName(xFarbenLI, 'FarbeAktiv');
			Element.addClassName(xFarbenLI, 'FarbeStandard');
			xFarbenLI.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
		}
		
		xFarbenLeiste = null;
		strFarbenLeiste = "FI" + (nNewFarbIndex + 1);
		xFarbenLeiste = document.getElementById(strFarbenLeiste);
		
		strFarbenLI = "F" + (nNewFarbIndex + 1);
		xFarbenLI = document.getElementById(strFarbenLI);
		if (xFarbenLeiste != null) {
			strOldSrc = xFarbenLeiste.src;
			arrOldSrc = strOldSrc.split("/");
			strOldSrcImg = arrOldSrc[arrOldSrc.length-1];
			strOldSrcImg = strOldSrcImg.replace("-middle", "");
			strOldSrcImg = strOldSrcImg.replace("-top", "");
			strOldSrcImg = strOldSrcImg.replace("-aktiv", "");
			
			strNewPath = "images/produktseiten/farbwelt/";
			arrTemp = strOldSrcImg.split(".");
			strNewSrc = arrTemp[0] + "-aktiv." + arrTemp[1];
			strNewSrc = strNewPath + strNewSrc;
			nNewWidth = 45;
			nNewHeight = 58;
		
			xFarbenLeiste.src = strNewSrc;
			xFarbenLeiste.width = nNewWidth;
			xFarbenLeiste.height = nNewHeight;
			// console.log(xFarbenLI)
			Element.removeClassName(xFarbenLI, 'FarbeStandard');
			// console.log(xFarbenLI)
			Element.addClassName(xFarbenLI, 'FarbeAktiv');
			// console.log(xFarbenLI)
			ResetProduktFarben(xFarbenLI);
			// ProduktFarben(xFarbenLI, "out");
		}
		if (strProdTitel != "fatboy rockies" && strProdTitel != "fatboy djeksuns") { 
			switch (arrAktImages.length) {
				case 1: 
					xDivPic2 = document.getElementById("DivPic2");
					xDivPic2.style.display = "none";
					xDivPic3 = document.getElementById("DivPic3");
					xDivPic3.style.display = "none";
					xDivPic4 = document.getElementById("DivPic4");
					xDivPic4.style.display = "none";
					break;
				case 2: 
					xDivPic3 = document.getElementById("DivPic3");
					xDivPic3.style.display = "none";
					xDivPic4 = document.getElementById("DivPic4");
					xDivPic4.style.display = "none";
					break;
				case 3: 
					xDivPic4 = document.getElementById("DivPic4");
					xDivPic4.style.display = "none";
					break;
			}
		}
		
		for (i=0; i < arrAktImages.length; i++) {
			if (i==0) {
				strNewGrossImage = strImagePath + "details/" + arrAktImages[0];
				strNewGrossImageAlt = strNewProdTitel;
				strNewGrossImageTitle = strNewProdTitel;
				
				// Grossbild wird ausgeblendet
				xHauptbild = document.getElementById("Hauptbild");
				new Effect.Fade(xHauptbild, {duration: 0.2 });
				
				// in 2 Sekunden wird das neue Grossbild eingeblendet
				window.setTimeout("ChangeBildGross(xHauptbild, strNewGrossImage, strNewGrossImageAlt, strNewGrossImageTitle)", 251);
			}
			if (strProdTitel != "fatboy djeksuns") { 
				strNewThumbPic = strImagePath + "thumbs/" + arrAktImages[i];
				strNewThumbPicAlt =strNewProdTitel;
				strNewThumbPicTitle = strNewProdTitel;
				
				strElemImgX = "Pic" + (i+1);
				xThumbImgX = document.getElementById(strElemImgX);
				strElemDivX = "DivPic" + (i+1);
				xThumbDivX = document.getElementById(strElemDivX);
				
				switch (i) {
					case 0 : 
						// in 2 Sekunden wird das neue Bild eingeblendet
						xThumbImg1 = xThumbImgX;
						Element.addClassName(xThumbImg1, 'aktiv');
						strNewThumbPic1 = strNewThumbPic;
						strNewThumbPicAlt1 = strNewThumbPicAlt;
						strNewThumbPicTitle1 = strNewThumbPicTitle;
						
						xThumbImg1.src = strNewThumbPic1;
						xThumbImg1.alt = strNewThumbPicAlt1;
						xThumbImg1.title = strNewThumbPicTitle1;
						break;
					case 1 : 
						// in 2 Sekunden wird das neue Bild eingeblendet
						xThumbImg2 = xThumbImgX;
						Element.removeClassName(xThumbImg2, 'aktiv');
						xThumbDivX2 = xThumbDivX;
						strNewThumbPic2 = strNewThumbPic;
						strNewThumbPicAlt2 = strNewThumbPicAlt;
						strNewThumbPicTitle2 = strNewThumbPicTitle;
						// Bild wird ausgeblendet
						if (arrAktImages[i] != "") {
							xThumbImg2.src = strNewThumbPic2;
							xThumbImg2.alt = strNewThumbPicAlt2;
							xThumbImg2.title = strNewThumbPicTitle2;
							xThumbDivX2.style.display = "block";
						} else {
							xThumbDivX2.style.display = "none";
						}
						break;
					case 2 : 
						// in 2 Sekunden wird das neue Bild eingeblendet
						xThumbImg3 = xThumbImgX
						Element.removeClassName(xThumbImg3, 'aktiv');
						xThumbDivX3 = xThumbDivX;
						strNewThumbPic3 = strNewThumbPic;
						strNewThumbPicAlt3 = strNewThumbPicAlt;
						strNewThumbPicTitle3 = strNewThumbPicTitle;
						// Bild wird ausgeblendet
						if (arrAktImages[i] != "") {
							xThumbImg3.src = strNewThumbPic3;
							xThumbImg3.alt = strNewThumbPicAlt3;
							xThumbImg3.title = strNewThumbPicTitle3;
							xThumbDivX3.style.display = "block";
						} else {
							xThumbDivX3.style.display = "none";
						}
						break;
					case 3 : 
						// in 2 Sekunden wird das neue Bild eingeblendet
						xThumbImg4 = xThumbImgX;
						Element.removeClassName(xThumbImg4, 'aktiv');
						xThumbDivX4 = xThumbDivX;
						strNewThumbPic4 = strNewThumbPic;
						strNewThumbPicAlt4 = strNewThumbPicAlt;
						strNewThumbPicTitle4 = strNewThumbPicTitle;
						// Bild wird ausgeblendet
						if (arrAktImages[i] != "") {
							xThumbImg4.src = strNewThumbPic4;
							xThumbImg4.alt = strNewThumbPicAlt4;
							xThumbImg4.title = strNewThumbPicTitle4;
							xThumbDivX4.style.display = "block";
						} else {
							xThumbDivX4.style.display = "none";
						}
						break;
				}
				if (arrAktImages[i] != "") {
					strNewSrcGross = "";
					strNewSrcGross = strImagePath + "details/" + arrAktImages[i];
					MM_preloadImages(strNewSrcGross);
				}
			} // if (strProdTitel != "fatboy djeksuns")
		}
		nAktFarbe = nNewFarbIndex
		nAktImageIndex = 0;
		
		if (strProdTitel == "fatboy cuscino") {
			ChangeLinkLightbox();
		}
	}
}

function ChangeLinkLightbox () {
	arrAktBilder = arrProdukte[nAktFarbe][1];
	strAktBild = arrAktBilder[nAktImageIndex];
	strNewSrcLightbox = strImagePath + "zoom/" + strAktBild;
	strNewSrcLightbox1 = strImagePath + "details/" + strAktBild;
	xLinkHauptBild = document.getElementById("LinkHauptBild");
	if (xLinkHauptBild != null) { 
		jQuery(".MYCLASS").remove();
		xdivHauptBild = document.getElementById("divHauptBild");
		xdivHauptBild.innerHTML = '<a href="' + strNewSrcLightbox + '" class="MYCLASS" title="MYTITLE" rel="lightbox zoom" id="LinkHauptBild"><img id="Hauptbild" src="' + strNewSrcLightbox1 + '" width="400" height="240" border="0" alt="Fatboy Cuscino" title="Fatboy Cuscino" /></a>';
		jQuery(".MYCLASS").jqzoom(options);
		initLightbox();
	}
}



function GetNewFarbUL() {
	switch (strProdTitel) {
		case "fatboy flowerpowersol": arrProdukt = arrSol[nAktProd]; break;
	}
	
	nTempProd = nAktProd;
	nIndexFarbe = 3;
	
	strNewHTML = "";
	for (i=0; i < arrProdukt.length; i++) {
	
		strNewFarbe = arrProdukt[i][0]; strNewFarbe = strNewFarbe.replace(" ", "");
		strImageName = arrProdukt[i][nIndexFarbe];
		strNewArtikelNummer = arrProdukt[i][2];
		strNewLine = "<li id=\"F" + (i+1) + "\" class=\"FarbeStandard\" style=\"margin-right:4px;\" onclick=\"ChangeFarbe(" + i + ", false);\" onmouseover=\"ProduktFarben(this, 'over');\" onmouseout=\"ProduktFarben(this, 'out');\">";
		strNewLine = strNewLine + "<img id=\"FI" + (i+1)+ "\" src=\"images/produktseiten/farbwelt/" + strImageName + ".png\" border=\"0\" width=\"33\" height=\"59\" alt=\"" + strNewFarbe + "\" title=\"" + strNewFarbe + "\" />";
		
		nWidth = 58; overclass = ""; 
		if (strImageName == "unikko-black") { nWidth = 113; overclass=" mariblase"; }
		if (strImageName == "unikko-red") { nWidth = 113; overclass=" mariblase"; }
		
		strNewLine = strNewLine + "<div class=\"blase" + overclass + "\"><img src=\"images/produktseiten/farbwelt/" + strImageName + "-blase.png\" border=\"0\" alt=\"" + strNewFarbe + "\" title=\"" + strNewFarbe + "\" width=\"" + nWidth +"\" height=\"27\" /></div>";
		strNewLine = strNewLine + "</li>";
		strNewHTML = strNewHTML + strNewLine;
	}
	xUL = document.getElementById("FarbUL");
	xUL.innerHTML = strNewHTML;
}

function ChangeSize(nNewGroesse) {
	if (strProdTitel == "fatboy flowerpowersol") { nAktGroesse = nAktProd; }
	
	if (nNewGroesse == nAktGroesse) { } else { 
		nAktGroesse = nNewGroesse;
		switch (nAktGroesse) {
			case 0 :
				switch (strProdTitel) {
					case "fatboy füllung" :
						xImg = document.getElementById("ImgFuellungKlein");
						xImg.src = "images/fuellung/groesse-klein-sel.png";
						
						xImg = document.getElementById("ImgFuellungGross");
						xImg.src = "images/fuellung/groesse-gross.png";
						break;
					case "fatboy doggielounge" :
						xImg = document.getElementById("ImgDoggieSmall");
						xImg.src = "images/doggielounge/groesse-small.png";
						
						xImg = document.getElementById("ImgDoggieBig");
						xImg.src = "images/doggielounge/groesse-big-sel.png";
						break;
					case "fatboy flowerpowersol" :
						xImg = document.getElementById("ImgFlowerSol");
						xImg.src = "images/flowerpowersol/prod-sol-sel.png";
						
						xImg = document.getElementById("ImgFlowerBase");
						xImg.src = "images/flowerpowersol/prod-base.png";
						nAktProd = nAktGroesse;
						break;
				}
				break;
			case 1 : 
				switch (strProdTitel) {
					case "fatboy füllung" :
						xImg = document.getElementById("ImgFuellungGross");
						xImg.src = "images/fuellung/groesse-gross-sel.png";
						
						xImg = document.getElementById("ImgFuellungKlein");
						xImg.src = "images/fuellung/groesse-klein.png";
						break;
					case "fatboy doggielounge" :
						xImg = document.getElementById("ImgDoggieBig");
						xImg.src = "images/doggielounge/groesse-big.png";
						
						xImg = document.getElementById("ImgDoggieSmall");
						xImg.src = "images/doggielounge/groesse-small-sel.png";
						break;
					case "fatboy flowerpowersol" :
						xImg = document.getElementById("ImgFlowerSol");
						xImg.src = "images/flowerpowersol/prod-sol.png";
						
						xImg = document.getElementById("ImgFlowerBase");
						xImg.src = "images/flowerpowersol/prod-base-sel.png";
						nAktProd = nAktGroesse;
						break;
				}
				break;
		}
		if (strProdTitel == "fatboy flowerpowersol") { 
			GetNewFarbUL();
			ChangeFarbe (nAktFarbe, true); 
		} else {
			ChangeFarbeDoggie (nAktFarbe, true); 
		}
	}
}


function ChangeFarbeDoggie (nNewFarbIndex, bChange) {
	if (nNewFarbIndex == nAktFarbe && !bChange) {
		
	} else {
		strNewProdTitel = arrProdukte[nNewFarbIndex][0];
		nNewPreis = 0;
		switch (nAktGroesse) {
			case 0 :
				switch (strProdTitel) {
					case "fatboy doggielounge": 
						strImagePath = strImagePathL; 
						arrAktImages = arrProdukte[nNewFarbIndex][1];
						strNewArtikelNummer = arrProdukte[nNewFarbIndex][2];
						
						nNewPreis = nDoggieBig;
						if (strNewArtikelNummer == "0022-01" || strNewArtikelNummer == "0022-02") nNewPreis = nDoggieMariBig;
						break;
					case "fatboy füllung": 
						strImagePath = strImagePathS; 
						arrAktImages = arrProdukte[nNewFarbIndex][1];
						strNewArtikelNummer = arrProdukte[nNewFarbIndex][2];
						
						nNewPreis = nFuellSmall;
						break;
					case "fatboy flowerpowersol": 
						arrAktImages = arrSol[nAktProd][nNewFarbIndex][1];
						strNewArtikelNummer = arrSol[nAktProd][nNewFarbIndex][2];
						
						nNewPreis = nFlowerpowersol;
						break;
				}
				break;
			case 1 : 
				switch (strProdTitel) {
					case "fatboy doggielounge": 
						strImagePath = strImagePathS; 
						arrAktImages = arrProdukte[nNewFarbIndex][3];
						strNewArtikelNummer = arrProdukte[nNewFarbIndex][4];
						
						nNewPreis = nDoggieSmall;
						if (strNewArtikelNummer == "0023-01" || strNewArtikelNummer == "0023-02") nNewPreis = nDoggieMariSmall;
					break;
					case "fatboy füllung": 
						strImagePath = strImagePathL; 
						arrAktImages = arrProdukte[nNewFarbIndex][3];
						strNewArtikelNummer = arrProdukte[nNewFarbIndex][4];
						
						nNewPreis = nFuellBig;
						break;
					case "fatboy flowerpowersol": 
						arrAktImages = arrSol[nAktProd][nNewFarbIndex][1];
						strNewArtikelNummer = arrSol[nAktProd][nNewFarbIndex][2];
						
						nNewPreis = nFlowerpowerBase;
						break;
				}
					
				break;
		}
		
		xArtikelNr = document.getElementById("FormIDPR");
		xArtikelNr.value = strNewArtikelNummer;
		
		strPreis = FormatPreis(nNewPreis, false);
		arrPreis = strPreis.split(",");
		strPreisShow = "";
		if (arrPreis[1] == "00") {
			strPreisShow = arrPreis[0] + ",-";
		} else {
			strPreisShow = strPreis;
		}
		
		xPreisboxValue = document.getElementById("preisboxValue");
		xPreisboxValue.innerHTML = strPreisShow;
		
		strNewGrossImage = "";
		strNewGrossImageAlt = "";
		strNewGrossImageTitle = "";
		
		strNewThumbPic1 = "";
		strNewThumbPicAlt1 = "";
		strNewThumbPicTitle1 = "";
		strNewThumbPic2 = "";
		strNewThumbPicAlt2 = "";
		strNewThumbPicTitle2 = "";
		strNewThumbPic3 = "";
		strNewThumbPicAlt3 = "";
		strNewThumbPicTitle3 = "";
		strNewThumbPic4 = "";
		strNewThumbPicAlt4 = "";
		strNewThumbPicTitle4 = "";
		
		
		xFarbenLeiste = null;
		strFarbenLeiste = "FI" + (nAktFarbe + 1);
		xFarbenLeiste = document.getElementById(strFarbenLeiste);
		strFarbenLI = "F" + (nAktFarbe + 1);
		xFarbenLI = document.getElementById(strFarbenLI);
		if (xFarbenLeiste != null) {
			strOldSrc = xFarbenLeiste.src;
			arrOldSrc = strOldSrc.split("/");
			strOldSrcImg = arrOldSrc[arrOldSrc.length-1];
			strOldSrcImg = strOldSrcImg.replace("-middle", "");
			strOldSrcImg = strOldSrcImg.replace("-top", "");
			strOldSrcImg = strOldSrcImg.replace("-aktiv", "");
			
			strNewPath = "images/produktseiten/farbwelt/";
			strNewSrc = strOldSrcImg
			strNewSrc = strNewPath + strNewSrc;
			nNewWidth = 33;
			nNewHeight = 59;
		
			xFarbenLeiste.src = strNewSrc;
			xFarbenLeiste.width = nNewWidth;
			xFarbenLeiste.height = nNewHeight;
			// console.log(xFarbenLeiste.id +":::" +  xFarbenLeiste.src + "++" + xFarbenLeiste.width + "##" + xFarbenLeiste.height);
			Element.removeClassName(xFarbenLI, 'FarbeAktiv');
			Element.addClassName(xFarbenLI, 'FarbeStandard');
			xFarbenLI.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
		}
		
		xFarbenLeiste = null;
		strFarbenLeiste = "FI" + (nNewFarbIndex + 1);
		xFarbenLeiste = document.getElementById(strFarbenLeiste);
		
		strFarbenLI = "F" + (nNewFarbIndex + 1);
		xFarbenLI = document.getElementById(strFarbenLI);
		
		if (xFarbenLeiste != null) {
			strOldSrc = xFarbenLeiste.src;
			arrOldSrc = strOldSrc.split("/");
			strOldSrcImg = arrOldSrc[arrOldSrc.length-1];
			strOldSrcImg = strOldSrcImg.replace("-middle", "");
			strOldSrcImg = strOldSrcImg.replace("-top", "");
			strOldSrcImg = strOldSrcImg.replace("-aktiv", "");
			
			strNewPath = "images/produktseiten/farbwelt/";
			arrTemp = strOldSrcImg.split(".");
			strNewSrc = arrTemp[0] + "-aktiv." + arrTemp[1];
			strNewSrc = strNewPath + strNewSrc;
			nNewWidth = 45;
			nNewHeight = 58;
		
			xFarbenLeiste.src = strNewSrc;
			xFarbenLeiste.width = nNewWidth;
			xFarbenLeiste.height = nNewHeight;
			// console.log(xFarbenLI)
			Element.removeClassName(xFarbenLI, 'FarbeStandard');
			// console.log(xFarbenLI)
			Element.addClassName(xFarbenLI, 'FarbeAktiv');
			// console.log(xFarbenLI)
			ResetProduktFarben(xFarbenLI);
			// ProduktFarben(xFarbenLI, "out");
		}
		if (strProdTitel != "fatboy füllung") {
			switch (arrAktImages.length) {
				case 1: 
					xDivPic2 = document.getElementById("DivPic2");
					xDivPic2.style.display = "none";
					xDivPic3 = document.getElementById("DivPic3");
					xDivPic3.style.display = "none";
					xDivPic4 = document.getElementById("DivPic4");
					xDivPic4.style.display = "none";
					break;
				case 2: 
					xDivPic3 = document.getElementById("DivPic3");
					xDivPic3.style.display = "none";
					xDivPic4 = document.getElementById("DivPic4");
					xDivPic4.style.display = "none";
					break;
				case 3: 
					xDivPic4 = document.getElementById("DivPic4");
					xDivPic4.style.display = "none";
					break;
			}		
		}
		
		for (i=0; i < arrAktImages.length; i++) {
			if (i==0) {
				strNewGrossImage = strImagePath + "details/" + arrAktImages[0];
				strNewGrossImageAlt = strNewProdTitel;
				strNewGrossImageTitle = strNewProdTitel;
				
				// Grossbild wird ausgeblendet
				xHauptbild = document.getElementById("Hauptbild");
				new Effect.Fade(xHauptbild, {duration: 0.2 });
				
				// in 2 Sekunden wird das neue Grossbild eingeblendet
				window.setTimeout("ChangeBildGross(xHauptbild, strNewGrossImage, strNewGrossImageAlt, strNewGrossImageTitle)", 251);
			}
			
			strNewThumbPic = strImagePath + "thumbs/" + arrAktImages[i];
			strNewThumbPicAlt =strNewProdTitel;
			strNewThumbPicTitle = strNewProdTitel;
			
			strElemImgX = "Pic" + (i+1);
			xThumbImgX = document.getElementById(strElemImgX);
			strElemDivX = "DivPic" + (i+1);
			xThumbDivX = document.getElementById(strElemDivX);
			switch (i) {
				case 0 : 
					// in 2 Sekunden wird das neue Bild eingeblendet
					xThumbImg1 = xThumbImgX;
					Element.addClassName(xThumbImg1, 'aktiv');
					strNewThumbPic1 = strNewThumbPic;
					strNewThumbPicAlt1 = strNewThumbPicAlt;
					strNewThumbPicTitle1 = strNewThumbPicTitle;
					
					xThumbImg1.src = strNewThumbPic1;
					xThumbImg1.alt = strNewThumbPicAlt1;
					xThumbImg1.title = strNewThumbPicTitle1;
					break;
				case 1 : 
					// in 2 Sekunden wird das neue Bild eingeblendet
					xThumbImg2 = xThumbImgX;
					Element.removeClassName(xThumbImg2, 'aktiv');
					
					xThumbDivX2 = xThumbDivX;
					strNewThumbPic2 = strNewThumbPic;
					strNewThumbPicAlt2 = strNewThumbPicAlt;
					strNewThumbPicTitle2 = strNewThumbPicTitle;
					
					// Bild wird ersetzt
					if (arrAktImages[i] != "") {
						xThumbImg2.src = strNewThumbPic2;
						xThumbImg2.alt = strNewThumbPicAlt2;
						xThumbImg2.title = strNewThumbPicTitle2;
						xThumbDivX2.style.display = "block";
					} else {
						xThumbDivX2.style.display = "none";
					}
					break;
				case 2 : 
					// in 2 Sekunden wird das neue Bild eingeblendet
					xThumbImg3 = xThumbImgX
					Element.removeClassName(xThumbImg3, 'aktiv');
					xThumbDivX3 = xThumbDivX;
					strNewThumbPic3 = strNewThumbPic;
					strNewThumbPicAlt3 = strNewThumbPicAlt;
					strNewThumbPicTitle3 = strNewThumbPicTitle;
					// Bild wird ausgeblendet
					if (arrAktImages[i] != "") {
						xThumbImg3.src = strNewThumbPic3;
						xThumbImg3.alt = strNewThumbPicAlt3;
						xThumbImg3.title = strNewThumbPicTitle3;
						xThumbDivX3.style.display = "block";
					} else {
						xThumbDivX3.style.display = "none";
					}
					break;
				case 3 : 
					// in 2 Sekunden wird das neue Bild eingeblendet
					xThumbImg4 = xThumbImgX;
					Element.removeClassName(xThumbImg4, 'aktiv');
					xThumbDivX4 = xThumbDivX;
					strNewThumbPic4 = strNewThumbPic;
					strNewThumbPicAlt4 = strNewThumbPicAlt;
					strNewThumbPicTitle4 = strNewThumbPicTitle;
					// Bild wird ausgeblendet
					if (arrAktImages[i] != "") {
						xThumbImg4.src = strNewThumbPic4;
						xThumbImg4.alt = strNewThumbPicAlt4;
						xThumbImg4.title = strNewThumbPicTitle4;
						xThumbDivX4.style.display = "block";
					} else {
						xThumbDivX4.style.display = "none";
					}
					break;
			}
			if (arrAktImages[i] != "") {
				strNewSrcGross = "";
				strNewSrcGross = strImagePath + "details/" + arrAktImages[i];
				MM_preloadImages(strNewSrcGross);
			}
		}
		nAktFarbe = nNewFarbIndex
		nAktImageIndex = 0;
	}
}


function ChangeBildGross(xImage, strNewImage, strNewImageAlt, strNewImageTitle) {
	xImage.src = strNewImage;
	xImage.alt = strNewImageAlt;
	xImage.title = strNewImageTitle;
	new Effect.Appear(xImage, {duration:0.2, delay:0.1 });
}

function ChangeBild1(xImage1, strNewImage1, strNewImageAlt1, strNewImageTitle1) {
	xImage1.src = strNewImage1;
	xImage1.alt = strNewImageAlt1;
	xImage1.title = strNewImageTitle1;
	new Effect.Appear(xImage1, {duration:0.3});
}
function ChangeBild2(xDiv2, xImage2, strNewImage2, strNewImageAlt2, strNewImageTitle2) {
	xImage2.src = strNewImage2;
	xImage2.alt = strNewImageAlt2;
	xImage2.title = strNewImageTitle2;
	new Effect.Appear(xDiv2, {duration:0.3});
}
function ChangeBild3(xDiv3, xImage3, strNewImage3, strNewImageAlt3, strNewImageTitle3) {
	xImage3.src = strNewImage3;
	xImage3.alt = strNewImageAlt3;
	xImage3.title = strNewImageTitle3;
	new Effect.Appear(xDiv3, {duration:0.3});
}
function ChangeBild4(xDiv4, xImage4, strNewImage4, strNewImageAlt4, strNewImageTitle4) {
	xImage4.src = strNewImage4;
	xImage4.alt = strNewImageAlt4;
	xImage4.title = strNewImageTitle4;
	new Effect.Appear(xDiv4, {duration:0.3});
}

function ResetProduktFarben (element) {
	element.style.background = "none";
	
	strElID = element.id;
	strElID2 = strElID.replace("F", "");
	
	nCheckID = Number(strElID2);
	nCheckID = nCheckID-1;
	
	nIndex = strElID2;
	if (strProdTitel == "fatboy flowerpowersol") {
		arrProdukte = arrSol[nAktProd];
	}
	nMaxAnzahl = arrProdukte.length;
			
	strImageID = "FI" + strElID2;
	xImgPri = document.getElementById(strImageID);
	xImgSecL = null;
	xEleSecL = null;
	xImgSecR = null;
	xEleSecR = null;
	strDefPath = "images/produktseiten/farbwelt/";
	nIndex = strElID2;
	
	strOldSrcPR = xImgPri.src;
	arrOldSrcPR = strOldSrcPR.split("/");
	strOldSrcPRImg = arrOldSrcPR[arrOldSrcPR.length-1];
	strOldSrcPRImg = strOldSrcPRImg.replace("-middle", "");
	
	var strOldSrcPRR = "", strOldSrcPRRImg = "";
	var strOldSrcPRL = "", strOldSrcPRLImg = "";
	var nTempIndexL = -1, nTempIndexR = -1;
	
	if (nIndex == 1) {
		strSecR = "FI" + (Number(nIndex)+1);
		xImgSecR = document.getElementById(strSecR);
		if (xImgSecR != null) { 
			strOldSrcPRR = xImgSecR.src;
			arrOldSrcPRR = strOldSrcPRR.split("/");
			strOldSrcPRRImg = arrOldSrcPRR[arrOldSrcPRR.length-1];
			strOldSrcPRRImg = strOldSrcPRRImg.replace("-middle", "");
			strOldSrcPRRImg = strOldSrcPRRImg.replace("-top", "");
			strOldSrcPRRImg = strOldSrcPRRImg.replace("-aktiv", "");
		}
		strSecR = "F" + (Number(nIndex)+1);
		xEleSecR = document.getElementById(strSecR);
		if (xEleSecR != null) { 
			nTempIndexR = String(xImgSecR.id)
			nTempIndexR = nTempIndexR.replace("FI", "");
		}
	} 
	if (nIndex == nMaxAnzahl) {
		strSecL = "FI" + (Number(nIndex)-1);
		xImgSecL = document.getElementById(strSecL);
		strSecL = "F" + (Number(nIndex)-1)
		xEleSecL = document.getElementById(strSecL);
		if (xImgSecL != null) { 
			strOldSrcPRL = xImgSecL.src;
			arrOldSrcPRL = strOldSrcPRL.split("/");
			strOldSrcPRLImg = arrOldSrcPRL[arrOldSrcPRL.length-1];
			strOldSrcPRLImg = strOldSrcPRLImg.replace("-middle", "");
			strOldSrcPRLImg = strOldSrcPRLImg.replace("-top", "");
			strOldSrcPRLImg = strOldSrcPRLImg.replace("-aktiv", "");
			
			nTempIndexL = String(xImgSecL.id).replace("FI", "");
		}
	}
	if (nIndex > 1 && nIndex < nMaxAnzahl) {
		strSecR = "FI" + (Number(nIndex)+1)
		xImgSecR = document.getElementById(strSecR);
		strSecR = "F" + (Number(nIndex)+1);
		xEleSecR = document.getElementById(strSecR);
		if (xImgSecR != null) { 
			strOldSrcPRR = xImgSecR.src;
			arrOldSrcPRR = strOldSrcPRR.split("/");
			strOldSrcPRRImg = arrOldSrcPRR[arrOldSrcPRR.length-1];
			strOldSrcPRRImg = strOldSrcPRRImg.replace("-middle", "");
			strOldSrcPRRImg = strOldSrcPRRImg.replace("-top", "");
			strOldSrcPRRImg = strOldSrcPRRImg.replace("-aktiv", "");
			
			nTempIndexR = String(xImgSecR.id).replace("FI", "");
		}
		strSecL = "FI" + (Number(nIndex)-1)
		xImgSecL = document.getElementById(strSecL);
		strSecL = "F" + (Number(nIndex)-1)
		xEleSecL = document.getElementById(strSecL)
		
		if (xImgSecL != null) {
			strOldSrcPRL = xImgSecL.src;
			arrOldSrcPRL = strOldSrcPRL.split("/");
			strOldSrcPRLImg = arrOldSrcPRL[arrOldSrcPRL.length-1];
			strOldSrcPRLImg = strOldSrcPRLImg.replace("-middle", "");
			strOldSrcPRLImg = strOldSrcPRLImg.replace("-top", "");
			strOldSrcPRLImg = strOldSrcPRLImg.replace("-aktiv", "");
		}
		nTempIndexL = String(xImgSecL.id).replace("FI", "");
	}
	
	if (xImgSecL != null && xImgSecR != null) {
		if (nTempIndexL != (nAktFarbe+1) ) {
			strNewSrc = strOldSrcPRLImg;
			strNewSrc = strNewSrc.replace("-middle", "");
			xImgSecL.src = strDefPath + strNewSrc;
			xEleSecL.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
		} 
		
		if (nTempIndexR != (nAktFarbe+1) ) {
			strNewSrc = strOldSrcPRRImg;
			strNewSrc = strNewSrc.replace("-middle", "");
			xImgSecR.src = strDefPath + strNewSrc;
			xEleSecR.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
		} 
	}
	
	if (xImgSecL != null && xImgSecR == null) {
		if (nTempIndexL != (nAktFarbe+1) ) {
			strNewSrc = strOldSrcPRLImg;
			strNewSrc = strNewSrc.replace("-middle", "");
			xImgSecL.src = strDefPath + strNewSrc;
			xEleSecL.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
		}
	}
	
	if (xImgSecR != null) {
		if (nTempIndexR != (nAktFarbe+1) ) {
			strNewSrc = strOldSrcPRRImg;
			strNewSrc = strNewSrc.replace("-middle", "");
			xImgSecR.src = strDefPath + strNewSrc;
			xEleSecR.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
		}
	}
}

function ProduktFarben(element, strAktion) {
	strElID = element.id;
	strElID2 = strElID.replace("F", "");
	
	nCheckID = Number(strElID2);
	nCheckID = nCheckID-1;
	
	if (nAktFarbe == nCheckID) { 
		
	} else {
			if (strProdTitel == "fatboy flowerpowersol") {
				arrProdukte = arrSol[nAktProd];
			}
			
			nMaxAnzahl = arrProdukte.length;
			
			strImageID = "FI" + strElID2;
			xImgPri = document.getElementById(strImageID);
			xImgSecL = null;
			xEleSecL = null;
			xImgSecR = null;
			xEleSecR = null;
			strDefPath = "images/produktseiten/farbwelt/";
			nIndex = strElID2;
			
			strOldSrcPR = xImgPri.src;
			arrOldSrcPR = strOldSrcPR.split("/");
			strOldSrcPRImg = arrOldSrcPR[arrOldSrcPR.length-1];
			strOldSrcPRImg = strOldSrcPRImg.replace("-middle", "");
			
			var strOldSrcPRR = "", strOldSrcPRRImg = "";
			var strOldSrcPRL = "", strOldSrcPRLImg = "";
			var nTempIndexL = -1, nTempIndexR = -1;
			if (nIndex == 1) {
				strSecR = "FI" + (Number(nIndex)+1);
				xImgSecR = document.getElementById(strSecR);
				
				strOldSrcPRR = xImgSecR.src;
				arrOldSrcPRR = strOldSrcPRR.split("/");
				strOldSrcPRRImg = arrOldSrcPRR[arrOldSrcPRR.length-1];
				strOldSrcPRRImg = strOldSrcPRRImg.replace("-middle", "");
				strOldSrcPRRImg = strOldSrcPRRImg.replace("-top", "");
				strOldSrcPRRImg = strOldSrcPRRImg.replace("-aktiv", "");
				
				strSecR = "F" + (Number(nIndex)+1);
				xEleSecR = document.getElementById(strSecR);
				
				nTempIndexR = String(xImgSecR.id)
				nTempIndexR = nTempIndexR.replace("FI", "");
			} 
			if (nIndex == nMaxAnzahl) {
				strSecL = "FI" + (Number(nIndex)-1);
				xImgSecL = document.getElementById(strSecL);
				strSecL = "F" + (Number(nIndex)-1)
				xEleSecL = document.getElementById(strSecL)
				
				strOldSrcPRL = xImgSecL.src;
				arrOldSrcPRL = strOldSrcPRL.split("/");
				strOldSrcPRLImg = arrOldSrcPRL[arrOldSrcPRL.length-1];
				strOldSrcPRLImg = strOldSrcPRLImg.replace("-middle", "");
				strOldSrcPRLImg = strOldSrcPRLImg.replace("-top", "");
				strOldSrcPRLImg = strOldSrcPRLImg.replace("-aktiv", "");
				
				nTempIndexL = String(xImgSecL.id).replace("FI", "");
			}
			if (nIndex > 1 && nIndex < nMaxAnzahl) {
				strSecR = "FI" + (Number(nIndex)+1)
				xImgSecR = document.getElementById(strSecR);
				strSecR = "F" + (Number(nIndex)+1);
				xEleSecR = document.getElementById(strSecR);
				
				strOldSrcPRR = xImgSecR.src;
				arrOldSrcPRR = strOldSrcPRR.split("/");
				strOldSrcPRRImg = arrOldSrcPRR[arrOldSrcPRR.length-1];
				strOldSrcPRRImg = strOldSrcPRRImg.replace("-middle", "");
				strOldSrcPRRImg = strOldSrcPRRImg.replace("-top", "");
				strOldSrcPRRImg = strOldSrcPRRImg.replace("-aktiv", "");
				
				nTempIndexR = String(xImgSecR.id).replace("FI", "");
				
				strSecL = "FI" + (Number(nIndex)-1)
				xImgSecL = document.getElementById(strSecL);
				strSecL = "F" + (Number(nIndex)-1)
				xEleSecL = document.getElementById(strSecL)
				
				strOldSrcPRL = xImgSecL.src;
				arrOldSrcPRL = strOldSrcPRL.split("/");
				strOldSrcPRLImg = arrOldSrcPRL[arrOldSrcPRL.length-1];
				strOldSrcPRLImg = strOldSrcPRLImg.replace("-middle", "");
				strOldSrcPRLImg = strOldSrcPRLImg.replace("-top", "");
				strOldSrcPRLImg = strOldSrcPRLImg.replace("-aktiv", "");
				
				nTempIndexL = String(xImgSecL.id).replace("FI", "");
			}
			// console.log(nAktFarbe + "..." + nTempIndexL + ":.:" + nTempIndexR);
			if (strAktion == "over") {
				if (xImgSecL != null && xImgSecR != null) {
					arrTemp = strOldSrcPRImg.split(".");
					strNewSrc = arrTemp[0] + "-top." + arrTemp[1];
					xImgPri.src = strDefPath + strNewSrc;
					element.style.background = "url(images/startseite/schatten-oben-31.gif) no-repeat";
					
					if (nTempIndexL != (nAktFarbe+1) ) {
						arrTemp = strOldSrcPRLImg.split(".");
						strNewSrc = arrTemp[0] + "-middle." + arrTemp[1];
						xImgSecL.src = strDefPath + strNewSrc;
						xEleSecL.style.background = "url(images/startseite/schatten-mitte-31.gif) no-repeat";
					}
					
					if (nTempIndexR != (nAktFarbe+1) ) {
						arrTemp = strOldSrcPRRImg.split(".");
						strNewSrc = arrTemp[0] + "-middle." + arrTemp[1];
						xImgSecR.src = strDefPath + strNewSrc;
						xEleSecR.style.background = "url(images/startseite/schatten-mitte-31.gif) no-repeat";
					}
				}
				
				if (xImgSecL != null && xImgSecR == null) {
					arrTemp = strOldSrcPRImg.split(".");
					strNewSrc = arrTemp[0] + "-top." + arrTemp[1];
					xImgPri.src = strDefPath + strNewSrc;
					element.style.background = "url(images/startseite/schatten-oben-31.gif) no-repeat";
					
					if (nTempIndexL != (nAktFarbe+1) ) {
						arrTemp = strOldSrcPRLImg.split(".");
						strNewSrc = arrTemp[0] + "-middle." + arrTemp[1];
						xImgSecL.src = strDefPath + strNewSrc;
						xEleSecL.style.background = "url(images/startseite/schatten-mitte-31.gif) no-repeat";
					}			
				}
				
				if (xImgSecL == null && xImgSecR != null) {
					arrTemp = strOldSrcPRImg.split(".");
					strNewSrc = arrTemp[0] + "-top." + arrTemp[1];
					xImgPri.src = strDefPath + strNewSrc;
					element.style.background = "url(images/startseite/schatten-oben-31.gif) no-repeat";
					
					if (nTempIndexR != (nAktFarbe+1) ) {
						arrTemp = strOldSrcPRRImg.split(".");
						strNewSrc = arrTemp[0] + "-middle." + arrTemp[1];
						xImgSecR.src = strDefPath + strNewSrc;
						xEleSecR.style.background = "url(images/startseite/schatten-mitte-31.gif) no-repeat";
					} 
				}
			}
			if (strAktion == "out") {
				if (xImgSecL != null && xImgSecR != null) {
					strNewSrc = strOldSrcPRImg;
					strNewSrc = strNewSrc.replace("-top", "");
					strNewSrc = strNewSrc.replace("-middle", "");
					xImgPri.src = strDefPath + strNewSrc;
					element.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";

					if (nTempIndexL != (nAktFarbe+1) ) {
						strNewSrc = strOldSrcPRLImg;
						strNewSrc = strNewSrc.replace("-middle", "");
						xImgSecL.src = strDefPath + strNewSrc;
						xEleSecL.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
					} 
					
					if (nTempIndexR != (nAktFarbe+1) ) {
						strNewSrc = strOldSrcPRRImg;
						strNewSrc = strNewSrc.replace("-middle", "");
						xImgSecR.src = strDefPath + strNewSrc;
						xEleSecR.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
					} 
				}
				
				if (xImgSecL != null && xImgSecR == null) {
					strNewSrc = strOldSrcPRImg;
					strNewSrc = strNewSrc.replace("-top", "");
					strNewSrc = strNewSrc.replace("-middle", "");
					xImgPri.src = strDefPath + strNewSrc;
					element.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
					
					if (nTempIndexL != (nAktFarbe+1) ) {
						strNewSrc = strOldSrcPRLImg;
						strNewSrc = strNewSrc.replace("-middle", "");
						xImgSecL.src = strDefPath + strNewSrc;
						xEleSecL.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
					}
				}
				
				if (xImgSecR != null) {
					strNewSrc = strOldSrcPRImg;
					strNewSrc = strNewSrc.replace("-top", "");
					strNewSrc = strNewSrc.replace("-middle", "");
					xImgPri.src = strDefPath + strNewSrc;
					element.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
					
					if (nTempIndexR != (nAktFarbe+1) ) {
						strNewSrc = strOldSrcPRRImg;
						strNewSrc = strNewSrc.replace("-middle", "");
						xImgSecR.src = strDefPath + strNewSrc;
						xEleSecR.style.background = "url(images/startseite/schatten-unten-31.gif) no-repeat";
					}
				}
			}
	}
}


// Globale Variable -> wird während der "in den Warenkorb" Aktion auf 1 gesetzt.
var nWKStop = 0;

/* BEGINN FLYIN WARENKORB */
function SendOrder() {
	if (nWKStop == 0) {
		nWKStop = 1;
		
		xStueckPR = document.getElementById("ProdMenge");
		nStueckPR = xStueckPR.value;
		if (nStueckPR == "" || nStueckPR == "0") {
			alert("Bitte eine gültige Stückzahl angeben");
			return false;
		}
		
		bOldFlyOpened = false;
		xFlyOut = document.getElementById("HeaderFlyIn");
		// wenn der Warenkorb im Moment ausgeblendet ist, passiert nichts, ansonsten wird er ausgeblendet
		if (xFlyOut.style.display == "none") { } else { FlyIn(); bOldFlyOpened = true; }
		
		switch (strProdTitel) {	
			case "fatboy doggielounge" : 
				switch (nAktGroesse) {
					case 0 : strArtikelNummer = arrProdukte[nAktFarbe][2]; arrImages = arrProdukte[nAktFarbe][1]; strImagePath = strImagePathL; break;
					case 1 : strArtikelNummer = arrProdukte[nAktFarbe][4]; arrImages = arrProdukte[nAktFarbe][3]; strImagePath = strImagePathS; break;
				}
				if (nAktImageIndex != 0) { ChangePicDoggie(0); }
				break;
			case "fatboy füllung" : 
				switch (nAktGroesse) {
					case 0 : strArtikelNummer = arrProdukte[nAktFarbe][2]; arrImages = arrProdukte[nAktFarbe][1]; strImagePath = strImagePathS; break;
					case 1 : strArtikelNummer = arrProdukte[nAktFarbe][4]; arrImages = arrProdukte[nAktFarbe][3]; strImagePath = strImagePathL; break;
				}
				if (nAktImageIndex != 0) { ChangePicDoggie(0); }
				break;
			case "fatboy avenue" : 
				switch (nAktForm) {
					case 0 : 
						if (nAktMuster == 1) {
							strArtikelNummer = arrProdukte[nAktFarbe][4]; arrImages = arrProdukte[nAktFarbe][3]; strImagePath = strImagePathFB; 
						} else {
							strArtikelNummer = arrProdukte[nAktFarbe][2]; arrImages = arrProdukte[nAktFarbe][1]; strImagePath = strImagePathFP; 
						} 
						break;
					case 1 : 
						if (nAktMuster == 1) {
							strArtikelNummer = arrProdukte[nAktFarbe][8]; arrImages = arrProdukte[nAktFarbe][7]; strImagePath = strImagePathSB; 
						} else {
							strArtikelNummer = arrProdukte[nAktFarbe][6]; arrImages = arrProdukte[nAktFarbe][5]; strImagePath = strImagePathSP; 
						}
						break;
				}
				break;
			default: 
				strArtikelNummer = arrProdukte[nAktFarbe][2];
				if (nAktImageIndex != 0) { ChangePic(0); }
				arrImages = arrProdukte[nAktFarbe][1];
				break;
		}
		xStart = document.getElementById("divHauptBild");
		arrStartKoord = Position.cumulativeOffset(xStart);
		
		strProduktName = "";
		strImageName = "";
		strProduktName = arrProdukte[nAktFarbe][0];
		strImageName = strImagePath + "details/" + arrImages[nAktImageIndex];
		ximgLayer = document.getElementById("imgLayer");
		ximgLayer.src = strImageName;
		ximgLayer.width = "400";
		ximgLayer.height = "240";
		
		xLayer = document.getElementById("layerWK");
		nStartLeft = arrStartKoord[0];
		nStartTop = arrStartKoord[1];
		
		xLayer.style.width = "400px";
		xLayer.style.height = "240px";
		xLayer.style.left = nStartLeft + "px";
		xLayer.style.top = nStartTop + "px";
		xLayer.style.display = "block";
	
		new Effect.Opacity(xStart, { from: 1.0, to: 0.3, duration: 0.5 } );
		
		globalLeft = nStartLeft;
		globalTop = nStartTop;
		nNewZielLeft = nZielLeft + 30;
		new Effect.Parallel([
			new Effect.Move(xLayer, { sync: true, x: nNewZielLeft, y : nZielTop, mode: "absolute" }),
			new Effect.Scale(xLayer, 10, { scaleContent : false, sync: true, restoreAfterFinish : true } ),
			new Effect.Scale(ximgLayer, 10, { scaleContent : false, sync: true, restoreAfterFinish : true } )
		], {
			duration : 2
		});	
		window.setTimeout("xLayer.style.display = 'none'", 1700);
		window.setTimeout("RefreshWK('" + strArtikelNummer + "', '" + nStueckPR + "', '" + bOldFlyOpened + "')", 2000);
	}
	return false;
}

function RefreshWK(strArtikelNr, nStueck, bOldFly) {
	url = "addBasket.asp?IDPR=" + strArtikelNr + "&StueckPR=" + nStueck;
	new Ajax.Request(url, {
	  method: 'post',
	  onSuccess: function(transport) {
	    strReturn = transport.responseText;
		ShowSuccessMsg(strArtikelNr, bOldFly);
	  }
	});
}

function ShowSuccessMsg(strArtikelNr, bOldFlyOpened) {
	// FlyOut vom Warenkorb einblenden
	FlyIn();
	
	window.setTimeout("ReShowImage('" + strArtikelNr + "', '" + bOldFlyOpened + "')", 5000);
}

function ReShowImage(strArtikelNr, bOldFlyOp) {
	// Flyout vom Warenkorb wieder ausblenden
	if (bOldFlyOp + "" == "false") { FlyIn(); }
	
	xStart2 = document.getElementById("divHauptBild");
	new Effect.Opacity(xStart2, { from: 0.3, to: 1.0, duration: 0.5});
	nWKStop = 0;
}
/* ENDE FLYIN WARENKORB */


function AnzPlusAkt () {
	xForm = document.forms.DetailForm;
	xMenge = xForm.menge;
	
	nStueckzahlAkt = Number(xMenge.value);
	nStueckzahlNeu = nStueckzahlAkt + 1;
	
	if (nStueckzahlNeu > 99) nStueckzahlNeu = 99;
	xMenge.value = nStueckzahlNeu;
}

function AnzMinusAkt () {
	xForm = document.forms.DetailForm;
	xMenge = xForm.menge;
	
	nStueckzahlAkt = Number(xMenge.value);
	nStueckzahlNeu = nStueckzahlAkt - 1;
	
	if (nStueckzahlNeu <= 0) nStueckzahlNeu = 1;
	xMenge.value = nStueckzahlNeu;
}
