var sImgPath = "web/pix/";

/********************************************************************/
// general functions slideshow flash
/********************************************************************/
// Funktionen für Slideshow
function writeCaption(txt) {
	if (document.getElementById(captionDiv)) {
		document.getElementById(captionDiv).innerHTML = txt;
	}
}

function writeFlashSlideshowBtns(slideshowDiv) {
	if (aSlidesThumb) {
		for (i=0; i<aSlidesThumb.length; i++) {
			newSrc = aSlidesThumb[i];
			if (i == 0) {
				document.write("<a href=\"javascript:flashShowImg(" + i + ", '" + slideshowDiv + "');\" onfocus=\"this.blur()\"><img src=\"" + dummyThumb + "\" id=\"slideBtn" + i + "\" alt=\"\" width=\"10\" height=\"10\" /></a>\n");
				activeBtn = eval("document.getElementById('slideBtn" + i + "')");
				activeSrc = newSrc;
			}
			else {
				document.write("<a href=\"javascript:flashShowImg(" + i + ", '" + slideshowDiv + "');\" onfocus=\"this.blur()\"><img src=\"" + newSrc + "\" id=\"slideBtn" + i + "\" alt=\"\" width=\"10\" height=\"10\" /></a>\n");
			}
		}
	}
}

function flashShowImg(imgIndex, slideshowDiv) {
	if (displayMode == "text") { swapDescription(false); }

	var flashvars = {
		sPix: aSlides[imgIndex],
		btnId: imgIndex
	};

	var params = {
		allowscriptaccess: "samedomain",
		quality: "high",
		bgcolor: "#323232",
		scale: "noscale",
		salign: "tl",
		menu: "false",
		wmode: "window"
	};

	var attributes = {
		id: slideshowDiv,
		name: slideshowDiv
	};

	swfobject.embedSWF("web/pix/slideshow_products.swf", slideshowDiv, "100%", "100%", requiredFlashVersion, false, flashvars, params, attributes);
}

function swapBtnHighlight(linkId) {
	imgBtn = document.getElementById('slideBtn' + linkId);
	if (activeBtn) {
		activeBtn.src = activeSrc;
	}
	if (imgBtn) {
		activeBtn = imgBtn;
		activeSrc = imgBtn.src;
		imgBtn.src = dummyThumb;
	}
	//writeCaption(aSlideTxt[linkId]);
}