$(document).ready(function() {
	
	/* display current date */
	var currentTime = new Date();
	var months = new Array();
	months[0] = "jan";
	months[1] = "feb";
	months[2] = "mar";
	months[3] = "apr";
	months[4] = "may";
	months[5] = "jun";
	months[6] = "jul";
	months[7] = "aug";
	months[8] = "sep";
	months[9] = "oct";
	months[10] = "nov";
	months[11] = "dec";	
	var month = months[currentTime.getMonth()];
	var day = currentTime.getDate();
	var year = currentTime.getFullYear();
	if (day<10) day= "0" + day;
	$("#date").html(month + " " +  year + "&nbsp;&nbsp;-&nbsp; <span id=\"dateday\">" + day + "</span>");
	$("#copy_date").html(year);

	
	/* thumbnails hover effect */
	$(".pictures ul li").hover(function() { 
		var thumbOver = $(this).find("img").attr("src"); 
		$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
		$(this).find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() 
		});
	} , function() { 
		$(this).find("span").stop().fadeTo('normal', 1).show();
	});
	
	/* smooth scroll */
	  $('a[href*=#]').click(function() {
	    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	    && location.hostname == this.hostname) {
	      var $target = $(this.hash);
	      $target = $target.length && $target
	      || $('[name=' + this.hash.slice(1) +']');
	      if ($target.length) {
	        var targetOffset = $target.offset().top;
	        $('html,body')
	        .animate({scrollTop: targetOffset}, 1000);
	       return false;
	      }
	    }
	  });
	
	/* pirobox */
	$().piroBox({
	      my_speed: 300, //animation speed
	      bg_alpha: 0.5, //background opacity
	      radius: 4, //caption rounded corner
	      scrollImage : false, // true == image follows the page _|_ false == image remains in the same open position
	                           // in some cases of very large images or long description could be useful.
	      slideShow : 'true', // true == slideshow on, false == slideshow off
	      slideSpeed : 3, //slideshow
	      pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
	      pirobox_prev : 'piro_prev', // Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
	      close_all : '.piro_close' // add class .piro_overlay(with comma)if you want overlay click close piroBox
	      });
	
});

