var Xspeed = 14000;
// Specify the image files
var XPic = new Array(); // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
XPic[0] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_1.jpg';
XPic[1] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_2.jpg';
XPic[2] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_3.jpg';
XPic[3] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_4.jpg';
XPic[4] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_5.jpg';
XPic[5] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_6.jpg';
XPic[6] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_7.jpg';
XPic[7] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_8.jpg';
XPic[8] = 'assets/templates/maenner-im-wasser.pandorafilm.de/images/bg-1920_9.jpg';
$("body").attr("src", "app2.png" );

// do not edit anything below this line
var Xt;
var Xj = 0;
var Xp = XPic.length;
var XpreLoad = new Array();
for (Xi = 0; Xi < Xp; Xi++){
   XpreLoad[Xi] = new Image();
   XpreLoad[Xi].src = XPic[Xi];
}

function runBGSlideShow(){
   if (document.body){
   	//document.body.background = XPic[Xj];
	Xj = 0 + 8*(Math.random());
	Xj = Math.round(Xj);
	document.getElementById("body").style.backgroundImage = "url(" + XPic[Xj] + ")";
   	//Xj = Xj + 1;
   	//if (Xj > (Xp-1)) Xj=0;
   	Xt = setTimeout('runBGSlideShow()', Xspeed);
   }
}



function pausecomp(millis)
{
// Wait for milliseconds (=millis)
var date = new Date();
var curDate = null;
do { curDate = new Date(); }
while(curDate-date < millis);
}

// Show background picture
$(document).ready(function() {
	$('#title').click(function () {
		$('body').fadeTo('slow', 0.0, function () {
			pausecomp(2000);
			$('body').fadeTo('slow', 1.0);
			}
		);
	});
});

// Animate PressQuotes
$(document).ready(function() {
    $('#pressQuotes').cycle({
		//fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	    fx:			'scrollUp', 
	    speed:		500, 
	    timeout:	7000 })
});

