$(document).ready(function() {

$('nav > div, nav > aside').hide();
$('nav > h1').click(function() {
$('nav> div, nav > aside').slideToggle();
})

$('.frontnav').mouseover(function() {
	$(this).css('background-color','#b1004c')
}).mouseout(function(){
	$(this).css('background-color','#e81e75')
});



var width2 = $(window).width()-400;
var height2 = $(window).height()-400;
						 
$(".boule").each(function(){
	$(this).css('opacity','0');
	$(this).attr('unselectable', 'on').css('-moz-user-select', 'none').each(function() { this.onselectstart = function() { return false; };});
	$(this).draggable({
			drag: function() {$(this).css({'z-index':'100','cursor':'pointer','opacity':'1'});},
			stop: function() {$(this).css({'z-index':'1','opacity':'0.8'});}
			});
		var randomX=Math.floor(Math.random()*width2+200);
		var randomY=Math.floor(Math.random()*height2+300);
		var thiswidth = $(this).width();
	$(this).animate({opacity:'0.8'}, 300);

/*
.animate({
		left: randomX-$(this).width(),
		top: randomY-$(this).height()
		
	})
*/
	
	/* $('*').attr('unselectable', 'on').css('-moz-user-select', 'none').each(function() { this.onselectstart = function() { return false; };}); */
});
	
$("li[class*='menu-item']").hover(function(){
thisclass = $(this).attr("id");
$("div."+thisclass).css('z-index','10').animate({opacity:'1'}, 100);
}, function(){
thisclass = $(this).attr("id");
$("div."+thisclass).css('z-index','1').animate({opacity:'0.8'}, 150);

}
);

$(".boule").hover(function(){
	$(this).css('z-index','10').animate({opacity:'1'}, 150).stop(true, true);
	}, function(){
	$(this).css('z-index','1').animate({opacity:'0.8'}, 150);
	});


});
