// JavaScript Document
$(document).ready(function(){
	$(".btn-slide").click(function(){
		$("#panel").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	$('#slidewidth a').click(function() {
		$(this).next().animate({width: 'toggle'});
		if (document.getElementById("actu-inter").className=="active2"){
			document.getElementById("actu-inter").className="actu-inter";
		}else{document.getElementById("actu-inter").className="active2";
		}
	 });
		$("a[rel]").overlay({ 
		expose: {color: '#fff', 
        //loadSpeed: 200, 
        opacity: 0.8 },
		effect: 'apple',
		onBeforeLoad: function() { 
			// grab wrapper element inside content
			var wrap = this.getContent().find(".contentWrap");
			// load the page specified in the trigger
			wrap.load(this.getTrigger().attr("href"));
		} 
	});
	
	
	
	
	
	$("div.scrollable").scrollable({onSeek: function(event, i) {		
		// calclulate large image's URL based on the thumbnail URL (flickr specific)
		var url = $(".items img").eq(i).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;
	  
    },clickable:false}).autoscroll({autoplay:true, interval:3000}).circular();
	
});
