/**
 * @author Christos Pantazis
 */
jQuery(function(){

/* fix language last li */
$("#language li:last-child").addClass("last");


/* Animate menu */
$('#menu li:not(.current-cat) a')
		.css( {backgroundPosition: "0 -10px", paddingLeft:"0em"} )
		.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"0 10px",paddingLeft:"1em"}, 
			{duration:300})
		})
		.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"0 -10px",paddingLeft:"0em"}, 
			{duration:300})
		})

/* Add shadows */
$(".shadow").wrap("<div class='shadowwrap'>");
/* Gallery */
$('.photos').cycle({ 
    fx:    'fade', 
	delay: 5000
  });
  
/* Add lightbox class to all links with a rel=gallery */
$("a[rel=gallery]").lightBox();
$(".gallery-icon a").lightBox();
/* Datepickers functions */
var activelang = $("#language li.active a").attr("hreflang");
if (activelang=="en") activelang="";
$.datepicker.setDefaults($.extend({showMonthAfterYear: false}, $.datepicker.regional['']));
$('#firstDate').datepicker($.extend($.datepicker.regional[activelang]));
$('#endDate').datepicker($.extend($.datepicker.regional[activelang]));
$("#firstDate").datepicker({
	onSelect:function(theDate) {
	$("#endDate").datepicker('option','minDate',new Date(theDate))
	}
});
$("#endDate").datepicker({
	onSelect:function(theDate) {
	$("#firstDate").datepicker('option','maxDate',new Date(theDate))
	}
});


});
