//if (window.jQuery === undefined){document.write(' no jquery loaded for slide');}
//else{document.write(' jquery loaded for slide');}

if (window.jQuery === undefined){
document.write ('<script src="http://www.verfrisser.net/tweety/widgets/jquery-1.3.2.min.js" type="text/javascript"></script>');
}
document.write ('<script src="http://www.verfrisser.net/tweety/widgets/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>');
document.write ('<div style="position:relative;width:130px;height:130px;">');
document.write ('		<img src="" id="preloadTweetySlide" style="display:none;" />');
document.write ('		<div id = "containerTweetySlide" style="position:absolute;top:1px;left:1px;width:128px;height:128px;">');
document.write ('			<a id = "linkTweetySlide" title="Click to see this picture in the largest Tweet picture collection on earth" href="http://www.verfrisser.net/tweety/tweetypics.php?start=-1" target="_blank">');
document.write ('			<div id="TweetyImageTweetySlide" style="width:128px;height:128px;" >');
document.write ('				');
document.write ('			</div>');
document.write ('			</a>');
document.write ('		</div>');
document.write ('	</div>');
					
var counterTweetySlide = Math.ceil(679*Math.random()) + 1;
	function ZeroNumberTweetySlide(number) {
				
		cntString = '0';
		if (number < 10){
			cntString += '0';
		}
		if (number < 100){
			cntString += '0';
		}
		cntString += number;
		return cntString;
	}
	function SlidedTweetySlide(){
		counterTweetySlide = counterTweetySlide + 1;
		if (counterTweetySlide > 680) {
			counterTweetySlide = 1;
		}
		cntString = ZeroNumberTweetySlide(counterTweetySlide);
		$("#TweetyImageTweetySlide").css("background-position", "center center");
		$("#TweetyImageTweetySlide").css("background-repeat", "no-repeat");
		var src = "http://www.verfrisser.net/tweety/pictures/thumbs/Tweety_picture_" + cntString + ".jpg";
		$("#TweetyImageTweetySlide").css('backgroundImage','url(' + src +')'); 
		$("#linkTweetySlide").attr('href','http://www.verfrisser.net/tweety/tweetypics.php?_directnavigate=' + cntString);
		//preloading next image 
		var newcount = counterTweetySlide + 1;
		cntString = ZeroNumberTweetySlide(newcount);
		var imgtt = new Image();
		imgtt.src = "http://www.verfrisser.net/tweety/pictures/thumbs/Tweety_picture_" + cntString + ".jpg"
		$("#preloadTweetySlide").attr('src',"http://www.verfrisser.net/tweety/pictures/thumbs/Tweety_picture_" + cntString + ".jpg");

		}
		var a = 0;
		var loopt = 0;
		function StartSlidingTweetySlide01(){
			//als er nog geen jquery is dan dadelijk nogmaals proberen
			if (window.jQuery === undefined){
				a += 1;
				//console.info("probeer later sliding " + a);
				window.setTimeout(StartSlidingTweetySlide01, 1000);
				return;	
			}
			loopt += 1;
			//console.info("loopt " + loopt);	
			$("#containerTweetySlide").toggle("slide",null,800, SlidedTweetySlide);
			$("#containerTweetySlide").toggle("slide",null,800);
			window.setTimeout(StartSlidingTweetySlide01, 5000);
		}
		function StartTweetySlide01(){
			window.setTimeout(StartSlidingTweetySlide01, 1000);
		}
 	StartTweetySlide01();



	
