/**
 * @author joac
 */
function rotatePfotos()
		{	function getNewScrollable()
				{
						var api = $("#flowpanes").scrollable({api: true});
						api.nextPage();
				}
				setInterval(getNewScrollable, 5000);
		}
		
// execute your scripts when the DOM is ready. this is a good habit
$(document).ready(function(){
	// select #flowplanes and make it scrollable. use circular and navigator plugins
	//$("#flowpanes").scrollable({size: 1}).circular().mousewheel(400);
	$("#flowpanes").scrollable({size: 1}).circular();
	
	
	
	// execute your scripts when the DOM is ready. this is a good habit
	$(function() {

		// initialize scrollable
		$("div.scrollable").scrollable().mousewheel(400);

	});
	

	$(function() {

		$(".items img").click(function() {

			// calclulate large image's URL based on the thumbnail URL (flickr specific)
			var url = $(this).attr("src").replace("_t", "");

			// get handle to element that wraps the image and make it semitransparent
			var wrap = $("#image_wrap").fadeTo("medium", 0.5);

			// the large image from flickr
			var img = new Image();

			// call this function after it's loaded
			img.onload = function() {

				// make wrapper fully visible
				wrap.fadeTo("fast", 1);

				// change the image
				wrap.find("img").attr("src", url);

			};

			// begin loading the image from flickr
			img.src = url;

			// when page loads simulate a "click" on the first image
		}).filter(":first").click();
	});
	

	
	//initialize slide show after load
	setTimeout(rotatePfotos, 10000)
	//pretty Photo
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
});
