function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var strAktMaxBildID = "";
var nAktMaxBildModus = 0;

gnAnzahlStufen = 50;

function ShowAll (elementName, nModus, strBildPath, nRandom) {
	// wenn der Layer per Mausklick aufgeht (also kein autom. Bildlauf), dann wird der Wert "strRandomShowAll" = 0 gesetzt
	if (nRandom == 0) strRandomShowAll = 0;
	ele = document.getElementById(elementName);
	coordinaten = getElementCoords(ele);
	
	if (strBildPath == "../de_img/layer/") {
		if (navigator.appName.indexOf("Microsoft") > -1 && navigator.appVersion.indexOf("6.0") > -1) coordinaten.x = coordinaten.x + 540;
		if (navigator.appName.indexOf("Microsoft") > -1 && navigator.appVersion.indexOf("7.0") > -1) coordinaten.x = coordinaten.x - 14;
	}
	
	if (strBildPath == "../de_img/luemmel-live/") {
		//if (navigator.appName.indexOf("Microsoft") > -1 && navigator.appVersion.indexOf("6.0") > -1) coordinaten.x = coordinaten.x + 859;
		//if (navigator.appName.indexOf("Microsoft") > -1 && navigator.appVersion.indexOf("7.0") > -1) coordinaten.x = coordinaten.x - 14;
	}
	// alert(coordinaten.x + " x " + coordinaten.y);
	
	// Ermitteln der aktuellen Werte des Divs
	var nStartHoehe = 0, nStartBreite = 0, nEndHoehe = 0, nEndBreite = 0;
	strBildURL = "";
	for (i=0; i < arrDivWerte.length; i++) {
		if (arrDivWerte[i][0] == elementName) {
			nStartBreite = arrDivWerte[i][1];
			nStartHoehe = arrDivWerte[i][2];
			nEndHoehe = arrDivWerte[i][3];
			nEndBreite = arrDivWerte[i][4];
			strKurzText = arrDivWerte[i][5];
			strLangText = arrDivWerte[i][6];
			strBildURL = arrDivWerte[i][7];
			i = arrDivWerte + 100;
		}
	}
	// alert(nStartHoehe + ". " + nStartBreite);
	var deltaX = 0; deltaY = 0;
	deltaX = nEndHoehe - nStartHoehe;
	deltaY = nEndBreite - nStartBreite;
	
	nSchrittweiteH = (deltaX) / gnAnzahlStufen;
	nSchrittweiteH = parseInt(nSchrittweiteH);
	nSchrittweiteW = (deltaY) / gnAnzahlStufen;
	nSchrittweiteW = parseInt(nSchrittweiteW);
	if (nSchrittweiteH % 2 == 1) nSchrittweiteH++;
	if (nSchrittweiteW % 2 == 1) nSchrittweiteW++;
	// alert(nSchrittweiteH + "--" + nSchrittweiteW);
	// alert(coordinaten.x + "," + coordinaten.y + ", " + nStartHoehe + ", " + nStartBreite + ", " +strBildURL);
	// Layer an der Stelle des Bildes positionieren
	ShowLayer(coordinaten.x, coordinaten.y, nStartHoehe, nStartBreite, strBildURL, strBildPath);
	
	ExpandLayer (nModus, nStartHoehe, nStartBreite, nEndHoehe, nEndBreite, nSchrittweiteH, nSchrittweiteW, 0, 0, elementName);
}

function getElementCoords(eo){
	if(eo){
		var coords = {x: 0, y: 0};
		var i = 0;
		var eo_original = eo;
		do {
			i++;
			coords.x += eo.offsetLeft;
			coords.y += eo.offsetTop;
			eo = eo.offsetParent;
		} while(eo);
		return coords;
	} else {
		return null;
	}
}

function ShowLayer(nStartX, nStartY, nStartHeight, nStartWidth, strBild, strPath) {
	
	var o = document.getElementById("bildlayer");
	// Positionieren des Layer
	o.style.left = nStartX + "px";
	o.style.top = nStartY + "px";
	// StartBreite und StartHoehe des Layer
	o.style.height = nStartHeight + "px";
	o.style.width = nStartWidth + "px";

	// oLink = document.getElementById("bildLayerLink");
	// oLink.style.display = "none";
	// oLink.style.width = "100px";
	
	imglayer = document.getElementById("DivImg");
	imglayer.src = strPath + strBild;
	imglayer.width = nStartWidth;
	imglayer.height = nStartHeight;
	DisplayBlock(o);
}

function DisplayBlock(ele) {
	ele.style.display = "block";
}

function MinimizeLayer () {
	var oLayer = document.getElementById("bildlayer");
	var orgDiv = document.getElementById(strAktMaxBildID);

	// oLink = document.getElementById("bildLayerLink");
	// oLink.style.display = "none";
	// oLink.style.width = "100px";
	
	coordsLayer = getElementCoords(oLayer);
	coordsOrgDiv = getElementCoords(orgDiv);
	// alert(coordsOrgDiv.x + " .. " + coordsOrgDiv.y);
	if (strAktMaxBildID == "") {
		oLayer.style.display = "none";
	} else {
		// Ermitteln der aktuellen Werte des Divs
		var nStartHoehe = 0, nStartBreite = 0, nEndHoehe = 0, nEndBreite = 0;
		
		for (i=0; i < arrDivWerte.length; i++) {
			if (arrDivWerte[i][0] == strAktMaxBildID) {
				nStartBreite = arrDivWerte[i][1];
				nStartHoehe = arrDivWerte[i][2];
				nEndBreite = arrDivWerte[i][3];
				nEndHoehe = arrDivWerte[i][4];
				i = arrDivWerte + 100;
			}
		}
				
		var deltaX = 0; deltaY = 0;
		deltaX = nEndHoehe - nStartHoehe;
		deltaY = nEndBreite - nStartBreite;
		
		nSchrittweiteH = (deltaX) / gnAnzahlStufen;
		nSchrittweiteH = parseInt(nSchrittweiteH);
		nSchrittweiteW = (deltaY) / gnAnzahlStufen;
		nSchrittweiteW = parseInt(nSchrittweiteW);
		
		if (nSchrittweiteH % 2 == 1) nSchrittweiteH++;
		if (nSchrittweiteW % 2 == 1) nSchrittweiteW++;
		// alert(nSchrittweiteH + "--" + nSchrittweiteW);
				
		// alert(nAktMaxBildModus + "---" + nStartHoehe + "x" + nStartBreite + "####" + nEndHoehe + "X" + nEndBreite);
		ReduceLayer (nAktMaxBildModus, nStartHoehe, nStartBreite, nEndHoehe, nEndBreite, nSchrittweiteH, nSchrittweiteW, 0, 0, strAktMaxBildID);
	}
}

function ExpandLayer (nModus, nStartHoehe, nStartBreite, nEndHoehe, nEndBreite, nSchrittweiteH, nSchrittweiteW, nTempWertX, nTempWertY, strDivID) {
	var oLayer = document.getElementById("bildlayer");
	oLayer.style.cursor = "wait";
	var imglayer = document.getElementById("DivImg");
	nTempH = parseInt(oLayer.style.height.replace("px", "") );
	nTempW = parseInt(oLayer.style.width.replace("px", "") );
	
	switch (nModus) {
		case 1: 
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
		case 2: 
			nTempLeft = oLayer.style.left;
			nTempLeft = Number(nTempLeft.replace("px", "") )
			nTempLeft = nTempLeft - (nSchrittweiteW/2); 
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
		case 3: 
			nTempLeft = oLayer.style.left;
			nTempLeft = Number(nTempLeft.replace("px", "") )
			nTempLeft = nTempLeft - nSchrittweiteW;
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
			
		case 4: 
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop - (nSchrittweiteH/2);
			// alert(oLayer.style.top + "--" + nTempTop);
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
		case 5: 
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") )
			nTempTop = nTempTop - (nSchrittweiteH/2);
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") )
			nTempLeft = nTempLeft - (nSchrittweiteW/2);
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
		case 6: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") )
			nTempLeft = nTempLeft - nSchrittweiteW;
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") )
			nTempTop = nTempTop - (nSchrittweiteH/2);
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			
			break;
			
		case 7: 
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop - nSchrittweiteH;
			oLayer.style.top = nTempTop + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
		case 8: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") );
			nTempLeft = nTempLeft - (nSchrittweiteW/2);
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop - nSchrittweiteH;
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
		case 9: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") );
			nTempLeft = nTempLeft - nSchrittweiteW;
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop - nSchrittweiteH;
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			
			break;
			
		default: 
			oLayer.style.height = (nTempH + nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW + nSchrittweiteW) + "px";
			imglayer.height = nTempH + nSchrittweiteH;
			imglayer.width = nTempW + nSchrittweiteW;
			break;
	}
	
	if (nTempH + nSchrittweiteH < nEndHoehe && nTempW + nSchrittweiteW < nEndBreite) {
		window.setTimeout("ExpandLayer(" + nModus + ", " + nStartHoehe + ", " + nStartBreite + ", " + nEndHoehe + ", " + nEndBreite + ", " + nSchrittweiteH + ", " + nSchrittweiteW + ", " + nTempWertX + ", " + nTempWertY + ", '" + strDivID + "')",10);
	} else {
		strAktMaxBildID = strDivID;
		nAktMaxBildModus = nModus;
		oLayer.style.cursor = "pointer";
		// window.setTimeout("ShowLayerLink(" + nEndBreite + ")", 800);
	}
}

function ShowLayerLink(nEndBreite) {
	var oLink = document.getElementById("bildLayerLink");
	oLink.style.width = nEndBreite + "px";
	oLink.style.display = "block";
}

function ReduceLayer (nModus, nStartHoehe, nStartBreite, nEndHoehe, nEndBreite, nSchrittweiteH, nSchrittweiteW, nTempWertX, nTempWertY, strDivID) {
	// var oLink = document.getElementById("bildLayerLink");
	// oLink.style.display = "none";
	var oLayer = document.getElementById("bildlayer");
	oLayer.style.cursor = "wait";
	var imglayer = document.getElementById("DivImg");
	
	nTempH = oLayer.style.height.replace("px", "");
	nTempW = oLayer.style.width.replace("px", "");
	
	switch (nModus) {
		case 1: 
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
		case 2: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") )
			nTempLeft = nTempLeft + (nSchrittweiteW/2); 
			
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
		case 3: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") )
			nTempLeft = nTempLeft + nSchrittweiteW;
			
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
			
		case 4: 
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop + (nSchrittweiteH/2);
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
		case 5: 
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop + (nSchrittweiteH/2);
			
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") );
			nTempLeft = nTempLeft + (nSchrittweiteW/2);
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
		case 6: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") )
			nTempLeft = nTempLeft + nSchrittweiteW;
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") )
			nTempTop = nTempTop + (nSchrittweiteH/2);
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
			
		case 7: 
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop + nSchrittweiteH;
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
		case 8: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") );
			nTempLeft = nTempLeft + (nSchrittweiteW/2);
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop + nSchrittweiteH;
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
		case 9: 
			nTempLeft = oLayer.style.left;
			nTempLeft = parseInt(nTempLeft.replace("px", "") );
			nTempLeft = nTempLeft + nSchrittweiteW;
			nTempTop = oLayer.style.top;
			nTempTop = parseInt(nTempTop.replace("px", "") );
			nTempTop = nTempTop + nSchrittweiteH;
			
			oLayer.style.top = nTempTop + "px";
			oLayer.style.left = nTempLeft + "px";
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
			
		default: 
			oLayer.style.height = (nTempH - nSchrittweiteH) + "px";
			oLayer.style.width = (nTempW - nSchrittweiteW) + "px";
			
			imglayer.height = nTempH - nSchrittweiteH;
			imglayer.width = nTempW - nSchrittweiteW;
			break;
	}

	if (nTempH - nSchrittweiteH > nStartHoehe && nTempW - nSchrittweiteW > nStartBreite) {
		window.setTimeout("ReduceLayer (" + nModus + ", " + nStartHoehe + ", " + nStartBreite + ", " + nEndHoehe + ", " + nEndBreite + ", " + nSchrittweiteH + ", " + nSchrittweiteW + ", " + nTempWertX + ", " + nTempWertY + ", '"  + strDivID + "')",10);
	} else {
		strAktMaxBildID = "";
		nAktMaxBildModus = 0;
		oLayer.style.display = "none";
		imglayer.src="";
		oLayer.style.cursor = "pointer";
	}
	
}

var strWackel="";
function WackelStart(strLayer) {
	strWackel=strLayer;
	var whatDiv = document.getElementById(strLayer);
	var nOriginalLeft = Number((String(whatDiv.style.left).replace("px"," ").replace("pt"," ")));
	var nOriginalTop = Number((String(whatDiv.style.top).replace("px"," ").replace("pt"," ")));
	Wackel(strLayer,nOriginalLeft,nOriginalTop,0)
}

function WackelEnd() {
	strWackel="";
}

function Wackel(strLayer, nDx, nDy, nZaehler) {
	var whatDiv = document.getElementById(strLayer);
	if (strWackel==strLayer) {		
		switch(nZaehler%4) {
			case 0:
					nStepX=-1;
					nStepY=0;
					break;
			case 1:
					nStepX=0;
					nStepY=0;
					break;
			case 2:
					nStepX=1;
					nStepY=0;
					break;
			case 3:
					nStepX=0;
					nStepY=0;
					break;
/*
		switch(nZaehler%4) {
			case 0:
					nStepX=-1;
					nStepY=-1;
					break;
			case 1:
					nStepX=0;
					nStepY=-1;
					break;
			case 2:
					nStepX=1;
					nStepY=-1;
					break;
			case 3:
					nStepX=-1;
					nStepY=1;
					break;
*/
/*		switch(nZaehler%8) {
			case 0:
					nStepX=-1;
					nStepY=-1;
					break;
			case 1:
					nStepX=0;
					nStepY=-1;
					break;
			case 2:
					nStepX=1;
					nStepY=-1;
					break;
			case 3:
					nStepX=1;
					nStepY=0;
					break;
			case 4:
					nStepX=1;
					nStepY=1;
					break;
			case 5:
					nStepX=0;
					nStepY=1;
					break;
			case 6:
					nStepX=-1;
					nStepY=1;
					break;
			case 7:
					nStepX=-1;
					nStepY=0;
					break;
*/
		}
			
		whatDiv.style.left = (nDx + (nStepX * 1) ) + "px";
		whatDiv.style.top = (nDy +  (nStepY* 1) ) + "px";
		nZaehler++;
		window.setTimeout("Wackel('"+strLayer+"', "+nDx+", "+nDy+", "+nZaehler+")",50);
	} else {
		whatDiv.style.left = nDx;
		whatDiv.style.top = nDy;
	}
	
}

function ShowRandomImage() {
	arrDivWerteRnd = arrDivWerte;
	fisherYates(arrDivWerteRnd);
	
	for (i=0; i < arrDivWerteRnd.length; i++) {
		if (i>0) { window.setTimeout("DisplayBlock2(" + i + ")", (i*200) ); } else { DisplayBlock2(i); }
	}
}

function fisherYates ( myArray ) {
	var i = myArray.length;
	if ( i == 0 ) return false;
	while ( --i ) {
		var j = Math.floor( Math.random() * ( i + 1 ) );
		var tempi = myArray[i];
		var tempj = myArray[j];
		myArray[i] = tempj;
		myArray[j] = tempi;
	}
}

function DisplayBlock2(tempI) { 
	strTempDiv = arrDivWerte[tempI][0];
	tempobj = document.getElementById(strTempDiv + "IMG");
	tempobj.style.display = "block";
}

strPuls = "";
var nMaxPuls = 6;

function PulsStart2 (temp) {
	strPuls = temp;
	
	obj = document.getElementById(temp);
	strOriginalLeft = obj.style.left;
	nOriginalLeft = strOriginalLeft.replace("px", "");
	strOriginalTop = obj.style.top;
	nOriginalTop = strOriginalTop.replace("px", "");
	
	var nStartHoehe = 0, nStartBreite = 0, nEndHoehe = 0, nEndBreite = 0;
	strBildURL = "", strBildURLSmall = "";
	for (i=0; i < arrDivWerte.length; i++) {
		if (arrDivWerte[i][0] == temp) {
			nStartBreite = arrDivWerte[i][1];
			nStartHoehe = arrDivWerte[i][2];
			nEndHoehe = arrDivWerte[i][3];
			nEndBreite = arrDivWerte[i][4];
			strKurzText = arrDivWerte[i][5];
			strLangText = arrDivWerte[i][6];
			strBildURL = arrDivWerte[i][7];
			strBildURLSmall = arrDivWerte[i][8];
			i = arrDivWerte + 100;
		}
	}
	// objImg = document.getElementById(temp + "IMG");
	// objImg.src="../de_img/layer/" + strBildURL;
	
	// ShowLayer(coordinaten.x, coordinaten.y, nStartHoehe, nStartBreite, strBildURL);
	Puls(temp, nOriginalLeft, nOriginalTop, nStartHoehe, nStartBreite, 0);
}

function PulsEnd2 (temp) {
	strPuls = "";
	
	var whatDiv = document.getElementById(temp);
	var whatImg = document.getElementById(temp + "IMG");
	
	var nStartHoehe = 0, nStartBreite = 0, strOrgCss = "", strBildUrl = "", strBildUrlSmall = "";
	for (i=0; i < arrDivWerte.length; i++) {
		if (arrDivWerte[i][0] == temp) {
			nStartBreite = arrDivWerte[i][1];
			nStartHoehe = arrDivWerte[i][2];
			strBildUrl = arrDivWerte[i][7];
			strBildUrlSmall = arrDivWerte[i][8];
			strOrgCss = arrDivWerte[i][9];
			i = arrDivWerte + 100;
		}
	}
	// alert(strOrgCss);
	arrOrgCss = strOrgCss.split(";");
	for (j=0; j < arrOrgCss.length-1; j++) {
		arrTemp = arrOrgCss[j].split(":");
		strTempVal = arrTemp[0];
		while (strTempVal.indexOf(" ") > -1) {
			strTempVal = strTempVal.replace(" ", "");
		}
		
		switch (strTempVal) {
			case "width" : whatDiv.style.width = parseInt(arrTemp[1]) + "px"; break;
			case "height" : whatDiv.style.height = parseInt(arrTemp[1]) + "px"; break;
			case "left" : whatDiv.style.left = parseInt(arrTemp[1]) + "px"; break;
			case "top" : whatDiv.style.top = parseInt(arrTemp[1]) + "px"; break;
		}
		
	}
	// whatImg.src="../de_img/layer/" + strBildUrlSmall;
	whatImg.width = nStartBreite;
	whatImg.height = nStartHoehe;
	// alert(whatDiv.style.left + " X " + whatDiv.style.top);
}

function Puls (strLayer, coordX, coordY, nStartHoehe, nStartBreite, nZaehler) {
	// alert(strLayer + ", " + coordX + ", " + coordY + ", " + nStartHoehe + ", " + nStartBreite + ", " + nZaehler + "sdsd");
	var whatDiv = document.getElementById(strLayer);
	var whatImg = document.getElementById(strLayer + "IMG");
	nTimeOut = 100;
	if (strPuls == strLayer) {
		if (nZaehler == 0) {
			nZaehler = nMaxPuls;
		} else {
			nZaehler = nZaehler-2;
		}
		if (nZaehler == 0) nTimeOut = 400;
		whatDiv.style.left = ( Number(coordX) - Number(nZaehler) ) + "px";
		whatDiv.style.top = ( Number(coordY) - Number(nZaehler) ) + "px";
		
		whatDiv.style.width = nStartBreite + (2*nZaehler) + "px";
		whatDiv.style.height = nStartHoehe + (2*nZaehler) + "px";
		whatImg.width = nStartBreite + (2*nZaehler);
		whatImg.height = nStartHoehe + (2*nZaehler);
		// alert(whatDiv.style.left + "--" + whatDiv.style.top + whatDiv.style.width + "x" + whatDiv.style.height);
		window.setTimeout("Puls('" + strLayer + "', " + coordX + ", " + coordY + ", " + nStartHoehe + ", " + nStartBreite + ", " + nZaehler + ")", nTimeOut );
	} else {
		whatDiv.style.left = coordX + "px";
		whatDiv.style.top = coordY + "px";
	}
}