
bMoveFarb = false;
function FarbweltOver(element, strAktion) {
	strElID = element.id;
	strElID2 = strElID.replace("F", "");
	i=1;
	while (bMoveFarb && i < 25) { i++; }
	
	strImageID = "FI" + strElID2;
	
	xImgPri = document.getElementById(strImageID);
	xImgSecL = null;
	xEleSecL = null;
	xImgSecR = null;
	xEleSecR = null;
	
	arrElID = strElID2.split("-");
	nIndex = arrElID[1];
	
	if (nIndex == 1) {
		strSecR = "FI" + arrElID[0] + "-" + (Number(nIndex)+1);
		xImgSecR = document.getElementById(strSecR);
		strSecR = "F" + arrElID[0] + "-" + (Number(nIndex)+1);
		xEleSecR = document.getElementById(strSecR);
	} 
	if (nIndex == 6) {
		strSecL = "FI" + arrElID[0] + "-" + (Number(nIndex)-1);
		xImgSecL = document.getElementById(strSecL);
		strSecL = "F" + arrElID[0] + "-" + (Number(nIndex)-1)
		xEleSecL = document.getElementById(strSecL)
	}
	
	if (nIndex > 1 && nIndex < 6) {
		strSecR = "FI" + arrElID[0] + "-" + (Number(nIndex)+1)
		xImgSecR = document.getElementById(strSecR);
		strSecR = "F" + arrElID[0] + "-" + (Number(nIndex)+1);
		xEleSecR = document.getElementById(strSecR);
		
		strSecL = "FI" + arrElID[0] + "-" + (Number(nIndex)-1)
		xImgSecL = document.getElementById(strSecL);
		strSecL = "F" + arrElID[0] + "-" + (Number(nIndex)-1)
		xEleSecL = document.getElementById(strSecL)
	}
	bMoveFarb = true;
	if (strAktion == "over") {
		if (xImgSecL != null && xImgSecR != null) {
			new Effect.Parallel([
				new Effect.Move(xImgPri, { y: 0, mode: 'absolute', afterFinish : function() { bMoveFarb = false; } }),
				new Effect.Move(xImgSecL, { y: 9, mode: 'absolute' }),
				new Effect.Move(xImgSecR, { y: 9, mode: 'absolute' })
			], {
				duration:0.2
			});
			element.style.background = "url(images/startseite/schatten-oben.png) 5px 2px no-repeat";
			xEleSecL.style.background = "url(images/startseite/schatten-mitte.png) 5px 2px no-repeat";
			xEleSecR.style.background = "url(images/startseite/schatten-mitte.png) 5px 2px no-repeat";
		}
		
		if (xImgSecL != null && xImgSecR == null) {
			new Effect.Parallel([
				new Effect.Move(xImgPri, { y: 0, mode: 'absolute', afterFinish : function() { bMoveFarb = false; }  }),
				new Effect.Move(xImgSecL, { y: 9, mode: 'absolute' })
			], {
				duration:0.2
			});
			element.style.background = "url(images/startseite/schatten-oben.png) 5px 2px no-repeat";
			xEleSecL.style.background = "url(images/startseite/schatten-mitte.png) 5px 2px no-repeat";
		}
		
		if (xImgSecR != null) {
			new Effect.Parallel([
				new Effect.Move(xImgPri, { y: 0, mode: 'absolute', afterFinish : function() { bMoveFarb = false; }  }),
				new Effect.Move(xImgSecR, { y: 9, mode: 'absolute' })
			], {
				duration:0.2
			});
			element.style.background = "url(images/startseite/schatten-oben.png) 5px 2px no-repeat";
			xEleSecR.style.background = "url(images/startseite/schatten-mitte.png) 5px 2px no-repeat";
		}
	}
	
}


function FarbweltOut(element, strAktion) {
	strElID = element.id;
	strElID2 = strElID.replace("F", "");
	
	i++;
	while (bMoveFarb && i < 25) { i++; }
	
	strImageID = "FI" + strElID2;

	xImgPri = document.getElementById(strImageID);
	xImgSecL = null;
	xEleSecL = null;
	xImgSecR = null;
	xEleSecR = null;
	
	arrElID = strElID2.split("-");
	nIndex = arrElID[1];
	
	if (nIndex == 1) {
		strSecR = "FI" + arrElID[0] + "-" + (Number(nIndex)+1);
		xImgSecR = document.getElementById(strSecR);
		strSecR = "F" + arrElID[0] + "-" + (Number(nIndex)+1);
		xEleSecR = document.getElementById(strSecR);
	} 
	if (nIndex == 6) {
		strSecL = "FI" + arrElID[0] + "-" + (Number(nIndex)-1);
		xImgSecL = document.getElementById(strSecL);
		strSecL = "F" + arrElID[0] + "-" + (Number(nIndex)-1)
		xEleSecL = document.getElementById(strSecL)
	}
	
	if (nIndex > 1 && nIndex < 6) {
		strSecR = "FI" + arrElID[0] + "-" + (Number(nIndex)+1)
		xImgSecR = document.getElementById(strSecR);
		strSecR = "F" + arrElID[0] + "-" + (Number(nIndex)+1);
		xEleSecR = document.getElementById(strSecR);
		
		strSecL = "FI" + arrElID[0] + "-" + (Number(nIndex)-1)
		xImgSecL = document.getElementById(strSecL);
		strSecL = "F" + arrElID[0] + "-" + (Number(nIndex)-1)
		xEleSecL = document.getElementById(strSecL)
	}
	bMoveFarb = true;
	if (strAktion == "out") {
		if (xImgSecL != null && xImgSecR != null) {
			new Effect.Parallel([
				new Effect.Move(xImgPri, {y: 12, mode: 'absolute', afterFinish : function() { bMoveFarb = false; }}),
				new Effect.Move(xImgSecL, {y: 12, mode: 'absolute'}),
				new Effect.Move(xImgSecR, {y: 12, mode: 'absolute'})
			], {
				duration:0.2
			});
			element.style.background = "url(images/startseite/schatten-unten.png) 5px 2px no-repeat";
			xEleSecL.style.background = "url(images/startseite/schatten-unten.png) 5px 2px no-repeat";
			xEleSecR.style.background = "url(images/startseite/schatten-unten.png) 5px 2px no-repeat";
		}
		
		if (xImgSecL != null && xImgSecR == null) {
			new Effect.Parallel([
				new Effect.Move(xImgPri, {y: 12, mode: 'absolute', afterFinish : function() { bMoveFarb = false; }}),
				new Effect.Move(xImgSecL, {y: 12, mode: 'absolute'})
			], {
				duration:0.2
			});
			element.style.background = "url(images/startseite/schatten-unten.png) 5px 2px no-repeat";
			xEleSecL.style.background = "url(images/startseite/schatten-unten.png) 5px 2px no-repeat";
		}
		
		if (xImgSecR != null) {
			new Effect.Parallel([
				new Effect.Move(xImgPri, {y: 12, mode: 'absolute', afterFinish : function() { bMoveFarb = false; }}),
				new Effect.Move(xImgSecR, {y: 12, mode: 'absolute'})
			], {
				duration:0.2
			});
			element.style.background = "url(images/startseite/schatten-unten.png) 5px 2px no-repeat";
			xEleSecR.style.background = "url(images/startseite/schatten-unten.png) 5px 2px no-repeat";
		}
	}
	bMoveFarb = false;
}



// Konfiguration für Slideshow auf Startseite
strImagePath = "images/startseite/";
gnAnzPics = 7;
nAktPic = 0;
nAnzahlLeft = 3;
nAnzahlRight = 3;

arrPictures = new Array();

arrPictures[0] = new Array();
arrPictures[0][0] = "fatboy original"; // alt- bzw title Tag für Thumbnails und Grossbild
arrPictures[0][1] = "original-th.jpg"; // src - des Thumbnails
arrPictures[0][2] = "impressionen/original.jpg"; // src - des Grossbilds
arrPictures[0][3] = "original-titel.gif"; // src von PreisboxTitel
arrPictures[0][4] = 179; // Preis
arrPictures[0][5] = "fatboy_original_living.asp"; // Living-URL
arrPictures[0][6] = ""; // Top-Koord
arrPictures[0][7] = ""; // Left-Koord
arrPictures[0][8] = ""; // Top-Koord
arrPictures[0][9] = ""; // Left-Koord

arrPictures[1] = new Array();
arrPictures[1][0] = "fatboy metahlowski";
arrPictures[1][1] = "metahlowski-th.jpg";
arrPictures[1][2] = "impressionen/metahlowski.jpg";
arrPictures[1][3] = "metahlowski-titel.gif";
arrPictures[1][4] = 299;
arrPictures[1][5] = "fatboy_metahlowski_living.asp";
arrPictures[1][6] = "228"; // Top-Koord
arrPictures[1][7] = "464"; // Left-Koord
arrPictures[1][8] = "-95"; // Top-Koord
arrPictures[1][9] = "464"; // Left-Koord

arrPictures[2] = new Array();
arrPictures[2][0] = "fatboy djeksuns";
arrPictures[2][1] = "djeksuns-th.jpg";
arrPictures[2][2] = "impressionen/djeksuns.jpg";
arrPictures[2][3] = "djeksuns-titel.gif";
arrPictures[2][4] = 349;
arrPictures[2][5] = "fatboy_djeksuns_living.asp";
arrPictures[2][6] = "114"; // Top-Koord
arrPictures[2][7] = "423"; // Left-Koord
arrPictures[2][8] = "-211"; // Top-Koord
arrPictures[2][9] = "423"; // Left-Koord

arrPictures[3] = new Array();
arrPictures[3][0] = "fatboy headdemock";
arrPictures[3][1] = "headdemock-th.jpg";
arrPictures[3][2] = "impressionen/headdemock.jpg";
arrPictures[3][3] = "headdemock-titel.gif";
arrPictures[3][4] = 369;
arrPictures[3][5] = "fatboy_headdemock_living.asp";
arrPictures[3][6] = "72"; // Top-Koord
arrPictures[3][7] = "464"; // Left-Koord
arrPictures[3][8] = "-253"; // Top-Koord
arrPictures[3][9] = "464"; // Left-Koord

arrPictures[4] = new Array();
arrPictures[4][0] = "fatboy junior";
arrPictures[4][1] = "junior-th.jpg";
arrPictures[4][2] = "impressionen/junior.jpg";
arrPictures[4][3] = "junior-titel.gif";
arrPictures[4][4] = 125;
arrPictures[4][5] = "fatboy_junior_living.asp";
arrPictures[4][6] = "131"; // Top-Koord
arrPictures[4][7] = "464"; // Left-Koord
arrPictures[4][8] = "-191"; // Top-Koord
arrPictures[4][9] = "464"; // Left-Koord

arrPictures[5] = new Array();
arrPictures[5][0] = "fatboy buggle-up";
arrPictures[5][1] = "buggle-up-th.jpg";
arrPictures[5][2] = "impressionen/buggle-up.jpg";
arrPictures[5][3] = "buggle-up-titel.gif";
arrPictures[5][4] = 259;
arrPictures[5][5] = "fatboy_buggle-up_living.asp";
arrPictures[5][6] = "69"; // Top-Koord
arrPictures[5][7] = "464"; // Left-Koord
arrPictures[5][8] = "-255"; // Top-Koord
arrPictures[5][9] = "464"; // Left-Koord

arrPictures[6] = new Array();
arrPictures[6][0] = "fatboy edison";
arrPictures[6][1] = "edison-th.jpg";
arrPictures[6][2] = "impressionen/edison.jpg";
arrPictures[6][3] = "edison-titel.gif";
arrPictures[6][4] = 399;
arrPictures[6][5] = "fatboy_edison_living.asp";
arrPictures[6][6] = "231"; // Top-Koord
arrPictures[6][7] = "473"; // Left-Koord
arrPictures[6][8] = "-90"; // Top-Koord
arrPictures[6][9] = "473"; // Left-Koord

arrPictures[7] = new Array();
arrPictures[7][0] = "fatboy marimekko";
arrPictures[7][1] = "marimekko-th.jpg";
arrPictures[7][2] = "impressionen/marimekko.jpg";
arrPictures[7][3] = "marimekko-titel.gif";
arrPictures[7][4] = 259;
arrPictures[7][5] = "fatboy_marimekko_living.asp";
arrPictures[7][6] = "233"; // Top-Koord
arrPictures[7][7] = "466"; // Left-Koord
arrPictures[7][8] = "-90"; // Top-Koord
arrPictures[7][9] = "466"; // Left-Koord

arrPictures[8] = new Array();
arrPictures[8][0] = "fatboy point";
arrPictures[8][1] = "point-th.jpg";
arrPictures[8][2] = "impressionen/point.jpg";
arrPictures[8][3] = "point-titel.gif";
arrPictures[8][4] = 65;
arrPictures[8][5] = "fatboy_point_living.asp";
arrPictures[8][6] = "231"; // Top-Koord
arrPictures[8][7] = "476"; // Left-Koord
arrPictures[8][8] = "-91"; // Top-Koord
arrPictures[8][9] = "476"; // Left-Koord

arrPictures[9] = new Array();
arrPictures[9][0] = "fatboy doggielounge";
arrPictures[9][1] = "doggielounge-th.jpg";
arrPictures[9][2] = "impressionen/doggielounge.jpg";
arrPictures[9][3] = "doggielounge-titel.gif";
arrPictures[9][4] = 75;
arrPictures[9][5] = "fatboy_doggielounge_living.asp";
arrPictures[9][6] = "67"; // Top-Koord
arrPictures[9][7] = "409"; // Left-Koord
arrPictures[9][8] = "-256"; // Top-Koord
arrPictures[9][9] = "409"; // Left-Koord

arrPictures[10] = new Array();
arrPictures[10][0] = "fatboy rockies";
arrPictures[10][1] = "rockies-th.jpg";
arrPictures[10][2] = "impressionen/rockies.jpg";
arrPictures[10][3] = "rockies-titel.gif";
arrPictures[10][4] = 349;
arrPictures[10][5] = "fatboy_rockies_living.asp";
arrPictures[10][6] = "270"; // Top-Koord
arrPictures[10][7] = ""; // Left-Koord
arrPictures[10][8] = "-53"; // Top-Koord
arrPictures[10][9] = ""; // Left-Koord

arrPictures[11] = new Array();
arrPictures[11][0] = "fatboy soulbag metallic";
arrPictures[11][1] = "soulbag-metallic-th.jpg";
arrPictures[11][2] = "impressionen/soulbag-metallic.jpg";
arrPictures[11][3] = "soulbag-metallic-titel.gif";
arrPictures[11][4] = 119;
arrPictures[11][5] = "fatboy_soulbag-metallic_designer-tasche.asp";
arrPictures[11][6] = "87"; // Top-Koord
arrPictures[11][7] = "431"; // Left-Koord
arrPictures[11][8] = "-240"; // Top-Koord
arrPictures[11][9] = "431"; // Left-Koord

arrPictures[12] = new Array();
arrPictures[12][0] = "fatboy catbag";
arrPictures[12][1] = "catbag-th.jpg";
arrPictures[12][2] = "impressionen/catbag.jpg";
arrPictures[12][3] = "catbag-titel.gif";
arrPictures[12][4] = 69;
arrPictures[12][5] = "fatboy_catbag_living.asp";
arrPictures[12][6] = "72"; // Top-Koord
arrPictures[12][7] = "477"; // Left-Koord
arrPictures[12][8] = "-253"; // Top-Koord
arrPictures[12][9] = "477"; // Left-Koord

arrPictures[13] = new Array();
arrPictures[13][0] = "fatboy bags";
arrPictures[13][1] = "bags-th.jpg";
arrPictures[13][2] = "impressionen/bags.jpg";
arrPictures[13][3] = "bags-titel.gif";
arrPictures[13][4] =  19.95;
arrPictures[13][5] = "fatboy_taschen_bags.asp";
arrPictures[13][6] = "112"; // Top-Koord
arrPictures[13][7] = "448"; // Left-Koord
arrPictures[13][8] = "-213"; // Top-Koord
arrPictures[13][9] = "448"; // Left-Koord


nStartIndex = 11;
nStart = false;
nMaxLength = 7;
width = 75;
function MoveTest(nParam) {
	if (nParam == 1) {
		nStart = true;
		nStartIndex++;
		if (nStartIndex > arrPictures.length) nStartIndex = 1;
	} else {
		if (nStart == true) { 
			arrayTemp = GetAktArray();
			MoveAllElements(arrayTemp);
			nIndexGross = (arrayTemp[3][0]);
			ChangeGrossbild (nIndexGross);
			nStartIndex++;
			if (nStartIndex > arrPictures.length) nStartIndex = 1;
		}
	}
	window.setTimeout("MoveTest(2)", 5000);
}
function GetAktArray() {
	var arrTemp = new Array();
	nIndex = 0;
	for (i=nStartIndex; i < arrPictures.length; i++) {
		if (arrTemp.length < nMaxLength) {
			arrTemp[nIndex] = new Array();
			arrTemp[nIndex][0] = i; // akt. Index;
			nIndex++;
		} else { break; }
	}
	
	for (i=0; i < arrPictures.length; i++) {
		if (arrTemp.length < nMaxLength) {
			arrTemp[nIndex] = new Array();
			arrTemp[nIndex][0] = i; // akt. Index;
			nIndex++;
		} else { break; }
	}
	return arrTemp;
}


function MoveAllElements(arrTemp) {
	// der letzte aus dem neuen Array wird um 100 px nach links verschoben (außerhalb des sichtbaren Bereichs)
	nLastIndex = nStartIndex
	if (nLastIndex > arrPictures.length) nLastIndex = 1;
	strLTHElement = "LTH-" + nLastIndex;
	xLTHElement =  document.getElementById(strLTHElement);
	if (xLTHElement != null) { 
		strAktPos = xLTHElement.style.left;
		nAktPos = strAktPos.replace("px","");
		new Effect.Move(xLTHElement, {x: -100, y : 10, mode:'absolute'});
	}
	
	strInList = "";
	for (Movej = 0; Movej < arrTemp.length; Movej++) {
		nNewPos = Movej*width;
		
		nAktIndexElement = arrTemp[Movej][0] + 1;
		strLTHElement = "LTH-" + nAktIndexElement;
		xLTHElement = document.getElementById(strLTHElement);
		if (xLTHElement != null) { 
			strAktPos = xLTHElement.style.left;
			nAktPos = strAktPos.replace("px","");
			new Effect.Move("LTH-" + nAktIndexElement, {x: nNewPos, y : 10, mode:'absolute'});
		}
		
		if (strInList != "") strInList = strInList + ",";
		strInList = strInList + "" + arrTemp[Movej][0];
	}
	
	window.setTimeout("RemoveNotNec('" + strInList + "')", 1000);
}

function ShowAllElements(arrTemp) {
	strInList = "";
	for (Movej = 0; Movej < arrTemp.length; Movej++) {
		nNewPos = Movej*width;
		
		nAktIndexElement = arrTemp[Movej][0] + 1;
		strLTHElement = "LTH-" + nAktIndexElement;
		xLTHElement = document.getElementById(strLTHElement);
		if (xLTHElement != null) { 
			strAktPos = xLTHElement.style.left;
			nAktPos = strAktPos.replace("px","");
			xLTHElement.style.left = nNewPos + "px";
			xLTHElement.style.zIndex = 100;
		}
		
		if (strInList != "") strInList = strInList + ",";
		strInList = strInList + "" + arrTemp[Movej][0];
	}
	window.setTimeout("RemoveNotNec('" + strInList + "')", 100);
}

function RemoveNotNec(strInList2) {
	arrList2 = strInList2.split(",");
	for (Remi=0; Remi < arrPictures.length; Remi++) {
		bFound = FoundArrTemp (arrList2, Remi);
		if (!bFound) {
			nAktIndexElement = Remi + 1;
			strLTHElement = "LTH-" + nAktIndexElement;
			xLTHElement2 = document.getElementById(strLTHElement);
			if (xLTHElement2 != null) { 
				xLTHElement2.style.display = "none";
				xLTHElement2.style.left = "580px"; 
				window.setTimeout("Reshow('" + strLTHElement + "')", 1000);
			}
		}
	}
}
function Reshow (strTempName) {
	xLTHTemp = document.getElementById(strTempName);
	xLTHTemp.style.display = "block";
}

function FoundArrTemp (arrSuch,  nSuchIndex) {
	for (Foundj = 0; Foundj < arrSuch.length; Foundj++) { if(nSuchIndex == arrSuch[Foundj]) return true; }
	return false;	
}

function SetPic(nNewPic) {
	nStart = false; 
	
	nStartIndex = nNewPic;
	nStartIndex = nStartIndex-3;
	if (nStartIndex < 0) { nStartIndex = arrPictures.length - ((-1) * nStartIndex); }
	arrayTemp = GetAktArray();
	// console.log(arrayTemp);
	ShowAllElements(arrayTemp);
	nIndexGross = nNewPic;
	ChangeGrossbild (nIndexGross);
}

function NextPics() {
	nStart = false;
	nStartIndex++;
	if (nStartIndex > arrPictures.length) nStartIndex = 1;
	arrayTemp = GetAktArray();
	ShowAllElements(arrayTemp);
	nIndexGross = arrayTemp[3][0];
	ChangeGrossbild (nIndexGross);
}
function PrevPics() {
	nStart = false;
	nStartIndex--;
	if (nStartIndex < 0) nStartIndex = arrPictures.length;
	arrayTemp = GetAktArray();
	ShowAllElements(arrayTemp);
	nIndexGross = arrayTemp[3][0];
	ChangeGrossbild (nIndexGross);
}

function ChangeGrossbild (nIndexGross) {
	xGrossBildDiv = document.getElementById("impressionBildGross");
	HideGrossbild(xGrossBildDiv);
	window.setTimeout("ShowGrossbild(xGrossBildDiv, "+ nIndexGross + ")", 1800);
}
function HideGrossbild (xGrossDiv) {
	new Effect.Fade(xGrossDiv, {duration:1.5});	
}

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function ShowGrossbild(xGrossDiv, nIndexAkt) {
	xGrossBildDiv = document.getElementById("impressionBildGross");
	arrGrossbild = arrPictures[nIndexAkt];
	strAlt = arrGrossbild[0];
	strNewSrcGross = arrGrossbild[2];
	ximprImage = document.getElementById("imprImage");
	ximprImage.src = strImagePath + strNewSrcGross;
	ximprImage.alt = strAlt;
	ximprImage.title = strAlt;
	ximprImage.width = "630";
	ximprImage.height = "320";
		
	strNewTop = "", strNewLeft = "";
	ximprPreisBox = document.getElementById("imprPreisBox");
	
	if (version == 6 || version == 7) { 
		strNewTop = arrGrossbild[8];
		strNewLeft = arrGrossbild[9];
		if (strNewTop == "") strNewTop = "-90";
		if (strNewLeft == "") strNewLeft = "456";
		
		ximprPreisBox.style.marginLeft = strNewLeft + "px";
		ximprPreisBox.style.marginTop = strNewTop + "px";
	} else {
		strNewTop = arrGrossbild[6];
		strNewLeft = arrGrossbild[7];
		if (strNewTop == "") strNewTop = "228";
		if (strNewLeft == "") strNewLeft = "456";
		
		ximprPreisBox.style.left = strNewLeft + "px";
		ximprPreisBox.style.top = strNewTop + "px";
	}
	
	strNewPreis = arrGrossbild[4];	
	strNewPreis = FormatPreis(strNewPreis, false);
	strPreisShow = "";
	arrNewPreis = strNewPreis.split(",");
	if (arrNewPreis[1] == "00") {
	strPreisShow = arrNewPreis[0] + ",-";
	} else {
	strPreisShow = strNewPreis;
	}
	xpreisboxValue = document.getElementById("preisboxValue");
	xpreisboxValue.innerHTML = strPreisShow;
	
	xpreisboxEuro = document.getElementById("preisboxEuro");
	if (nIndexAkt == 9 || nIndexAkt ==  11 || nIndexAkt == 13) {
		xpreisboxEuro.innerHTML = "ab &euro;";
	} else {
		xpreisboxEuro.innerHTML = "&euro;";
	}
	
	strNewLink = arrGrossbild[5];	
	ximprimageLink = document.getElementById("imprimageLink");
	ximprimageLink.href = strNewLink;
	
	new Effect.Appear(xGrossBildDiv, {duration:1.5});	
} 

