	function shuffle (inputArr) {
		var valArr = [],
			k = '',
			i = 0,
			strictForIn = false,        populateArr = [];
	 
		for (k in inputArr) { // Get key and value arrays
			if (inputArr.hasOwnProperty(k)) {
				valArr.push(inputArr[k]);            if (strictForIn) {
					delete inputArr[k];
				}
			}
		}    valArr.sort(function () {
			return 0.5 - Math.random();
		});
	 
		strictForIn = false;
		populateArr = strictForIn ? inputArr : populateArr; 
		for (i = 0; i < valArr.length; i++) { // Repopulate the old array
			populateArr[i] = valArr[i];
		}
		 return strictForIn || populateArr;
	}

    jQuery(document).ready(function(){    





    jQuery("#menu-01 a").hover(
		function(){ if (!jQuery(this).hasclass("current-menu-item")) jQuery(this).animate({ right: "-205px" }, {queue:false, duration:"0"} );}, 
		function(){ if (!jQuery(this).hasclass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});

	jQuery("#menu-02 a").hover(
		function(){ if (!jQuery(this).hasclass("current-menu-item")) jQuery(this).animate({ right: "-124px" }, {queue:false, duration:"0"} );}, 
		function(){ if (!jQuery(this).hasclass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-03 a").hover(
			function(){jQuery(this).animate({ right: "-93px" }, {queue:false, duration:"0"} );}, 
			function(){jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-04 a").hover(
			function(){jQuery(this).animate({ right: "-69px" }, {queue:false, duration:"0"} );}, 
			function(){jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-05 a").hover(
			function(){jQuery(this).animate({ right: "-77px" }, {queue:false, duration:"0"} );}, 
			function(){jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-06 a").hover(
			function(){jQuery(this).animate({ right: "-61px" }, {queue:false, duration:"0"} );}, 
			function(){jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-07 a").hover(
			function(){jQuery(this).animate({ right: "-63px" }, {queue:false, duration:"0"} );}, 
			function(){jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});

	jQuery("#menu-08 a").hover(
			function(){jQuery(this).animate({ right: "-35px" }, {queue:false, duration:"0"} );}, 
			function(){jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});

	jQuery("#menu-09 a").hover(
			function(){jQuery(this).animate({ right: "-108px" }, {queue:false, duration:"0"} );}, 
			function(){jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
  




     jQuery("#menu-item-40 a").hover(
		function(){  if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-205px" }, {queue:false, duration:"0"} );}, 
		function(){  if (!jQuery(this).parent().hasClass("current-menu-item"))jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});

	jQuery("#menu-item-29 a").hover(
		function(){  if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-124px" }, {queue:false, duration:"0"} );}, 
		function(){  if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-item-28 a").hover(
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-93px" }, {queue:false, duration:"0"} );}, 
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-item-27 a").hover(
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-69px" }, {queue:false, duration:"0"} );}, 
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-item-26 a").hover(
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-77px" }, {queue:false, duration:"0"} );}, 
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-item-25 a").hover(
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-61px" }, {queue:false, duration:"0"} );}, 
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});
	
	jQuery("#menu-item-32 a").hover(
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-63px" }, {queue:false, duration:"0"} );}, 
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item"))jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});

	jQuery("#menu-item-75 a").hover(
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-35px" }, {queue:false, duration:"0"} );}, 
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});

	jQuery("#menu-item-31 a").hover(
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "-108px" }, {queue:false, duration:"0"} );}, 
			function(){ if (!jQuery(this).parent().hasClass("current-menu-item")) jQuery(this).animate({ right: "0" }, {queue:false, duration:"0"} );});



   	jQuery('#menu-main-menu a').empty(); 

		var immagini= new Array("01.jpg","02.jpg","03.jpg","04.jpg","05.jpg","06.jpg","07.jpg","08.jpg","09.jpg");
		var immagini_sh = shuffle(immagini);
	
		for (var i=0; i< immagini_sh.length; i++)
		{
			jQuery("body").append('<img src="/wp-content/themes/editheme/img/slider/'+ immagini_sh[i] +'" alt="" title="Federico Ferrarini" class="slidemaximage" />');
		}
    });
