﻿function changeImagesArray(array) {
	if (preloadFlag == true) {
		var d = document; var img;
		for (i=0;i<array.length;i+=2) {
			img = null; var n = array[i];
			if (d.images) {
				if (d.layers) {img = findElement(n,0);}
				else {img = d.images[n];}
			}
			if (!img && d.getElementById) {img = d.getElementById(n);}
			if (!img && d.getElementsByName) {
				var elms = d.getElementsByName(n);
				if (elms) {
					for (j=0;j<elms.length;j++) {
						if (elms[j].src) {img = elms[j]; break;}
					}
				}
			}
			if (img) {img.src = array[i+1];}
		}
	}
}


function changeImages() {
	changeImagesArray(changeImages.arguments);
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function randomFlash(){
	x=Math.round(Math.random());
	if(x)pfad="images/mainBild_innen.swf"; else pfad="images/mainBild.swf";
	document.write('<object classid="clsid:clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" height="150" width="800">\n');
    document.write('<param name="movie" value="'+pfad+'"/>\n');
    document.write('<embed align="top" height="150" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+pfad+'" type="application/x-shockwave-flash" width="800" quality="best" play="true">\n');
    document.write('</object>\n');
}
function randomImage(){
	x=Math.round(Math.random());
	if(x)pfad="images/mainBack_innen.jpg"; else pfad="images/mainBack.jpg";
	document.write('<img src="'+pfad+'" width="800" height="150"/>');
}

function popup(url,breite,hoehe,sb) {
 y=(screen.width-breite)/2;
 x=(screen.height-hoehe)/2;
 fenster=window.open(url, "", "width="+breite+",height="+hoehe+",left="+y+",top="+x+",scrollbars="+sb);
 fenster.focus();
 return false;
}


