/*	
	Onirica Template
	File: global.js
	Stefano Giliberti - kompulsive@gmail.com clickswitch.net		
*/

$(document).ready(function(){
	/* Hides by default the project's infos */
	$(".proj-desc").css("right", "-28%");
	/* This apply on each link with class "proj-zoomer" the fancybox lightbox */
 	$(".proj a.proj-zoomer").fancybox({ "zoomSpeedIn": 300, "zoomSpeedOut": 400 });
	
	/* On .proj class hover.. */
    $(".proj").hover( 
      function () {
        $(this).find(".proj-desc").animate({ right: "0" }, 250); /* Move in 250 ms the .proj-desc div to right:0 */
      }, 
      function () {
        $(this).find(".proj-desc").animate({ right:"-28%" }, 800); /* When mouse goes out hides it again in 800 ms */
      }
    );

	/* Homepage slideshow */
	$("#feat-slides #slides").cycle({ /* This apply the slideshow to #slides div in #feat-slides div */
    	fx: "fade", /* You can see a list of all the effects that you can use here: http://malsup.com/jquery/cycle/browser.html */
		before: function (){
			$("#current-desc").slideUp(); /* Before show the next image slides up #current-desc div. You can also change the duration
											 just putting in the ( ) the ms (ex. slideup(2000)) */
		},
		after: function (){
			$("#current-desc").fadeIn().html(this.alt); /* After, shows #current-desc div changing the text with the alt="" of each image */
		}
	});
});