function MM_preloadImages() { 
  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 change_background(i)
{
	for(h=1;h<=8;h++)
	{
		var str = 'table' + h;
		document.getElementById(str).bgColor = "#a0a0aa";
	};
	var str = 'table' + i;
	document.getElementById(str).bgColor = "#0000FF";
}
function MM_swapImgRestore() { 
  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) { 
  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];}
}

function gonext()
{
	bild++;
	if(bild >= 27)
	{
		bild = 1;
	};
	if(bild <= 9)
	{
		bild = '0' + bild;
	};
	MM_swapImage('Sylt-Wenningstedt-Sturmfried-Nr-3-1','','bilder/' + bild + '.jpg',1);
}

function goback()
{
	bild--;
	if(bild <= 0)
	{
		bild = 27;
	};
	if(bild <= 9)
	{
		bild = '0' + bild;
	};
	MM_swapImage('Sylt-Wenningstedt-Sturmfried-Nr-3-1','','bilder/' + bild + '.jpg',1);
}

function b(z)
{
	bild = z;
}

function fillup(){
	if (iedom){
		cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
		cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
		cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide;
		actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth;
		cross_slide2.style.left=actualwidth+20+"px";
	}
	else if (document.layers){
		ns_slide=document.ns_slidemenu.document.ns_slidemenu2;
		ns_slide2=document.ns_slidemenu.document.ns_slidemenu3;
		ns_slide.document.write(leftrightslide);
		ns_slide.document.close();
		actualwidth=ns_slide.document.width;
		ns_slide2.left=actualwidth+20;
		ns_slide2.document.write(leftrightslide);
		ns_slide2.document.close();
	}
	lefttime=setInterval("slideleft()",30);
}

function slideleft(){
	if (iedom){
		if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
			cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px";
		else
			cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+"px";

		if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
			cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px";
		else
			cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+"px";
	}
	else if (document.layers){
		if (ns_slide.left>(actualwidth*(-1)+8))
			ns_slide.left-=copyspeed;
		else
			ns_slide.left=ns_slide2.left+actualwidth;

		if (ns_slide2.left>(actualwidth*(-1)+8))
			ns_slide2.left-=copyspeed;
		else
			ns_slide2.left=ns_slide.left+actualwidth;
	}
}
