var ordonare = function(order) {
	
	$.post("request.php", { ordonare: order},
		function(data){
			if(data == 'ok'){
				window.location.reload(true);
			}else{
				alert('Ordonare invalida');
			}
	}, "text");
}

$(document).ready(function(){
	  $(".opacity").fadeTo(1, 0.5);
	  $(".opacity").hover(
		function () {
		  $(this).fadeTo("fast", 1);
		},
		function () {
		  $(this).fadeTo("normal", 0.5);
		}
	  );

	
	$("#hoverImgBox").hover(
		function () {
			$("#hoverImgBox .hoverImg").fadeIn();
		}, 
		function () {
			$("#hoverImgBox .hoverImg").fadeOut();
		}
    );

	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$("#firstpane p.menu_head").click(function()
    {
		$(this).css({backgroundImage:"url(images/arrowdown.jpg)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	$(this).siblings().css({backgroundImage:"url(images/arrowdown.jpg)"});
	});
	//slides the element with class "menu_body" when mouse is over the paragraph
	$("#secondpane p.menu_head").mouseover(function()
    {
	     $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
         $(this).siblings().css({backgroundImage:"url(left.png)"});
	});
	
});  
