﻿/*struttura.master*/
/*$(function() {

		//run the currently selected effect
		function runEffect(){
			//alert($("#sottoMenu"));
			//run the effect
			var options = {};
			
			$("#sottoMenu").toggle("drop",options,500);
			  
		};
			
		//set effect from select menu value
		$("#voce1").click(function() {
			runEffect();
			return false;
		});
		
		
		
		$("#sottoMenu").hide();
	});
	
*/	
	/*struttura.master*/
/*$(function() {

		//run the currently selected effect
		function runEffect(){
			//alert($("#sottoMenu"));
			//run the effect
			var options = {};
			//alert($(this).find("ul").id);
			//$(this).find("ul").show("drop",options,500);
			  $(this).find("ul").find("li").css("background","red");
		};
		
		function runEffect2(){
			//alert($("#sottoMenu"));
			//run the effect
			var options = {};
			
			$(this).find("ul").hide("drop",options,500);
			
			  
		};
			
		//set effect from select menu value
		$("#voce1").hover(function() {
			runEffect();
			return false;
		});
		
		$("#voce2").hover(function() {
			runEffect();
			return false;
		});
		$("#voce3").hover(function() {
			runEffect2();
			return false;
		});
		$("#voce4").hover(function() {
			runEffect2();
			return false;
		});
		$("#voce5").hover(function() {
			runEffect2();
			return false;
		});
		$("#voce6").hover(function() {
			runEffect2();
			return false;
		});
		$("#sottoMenu").hide();
	})

*/
/*
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;
var options = {};
var count = 0;
function jsddm_open()
{  //jsddm_canceltimer();
   //jsddm_close();
   if(count == 0){
   ddmenuitem = $(this).find('.sottoLivello').show("drop",options,500);}
    count = count + 1;
   }
function jsddm_open2()
{  //jsddm_canceltimer();
   //jsddm_close();
//   alert();
   ddmenuitem = $(this).find('ul').show("drop",options,500);}

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.hide("drop",options,500);
    count = 0;

}

/*
function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}*/
/*
$(document).ready(function()
{  $('#menu > .primoLivello').bind('mouseover', jsddm_open);
$('#menu > .primoLivello > .sottoLivello').bind('mouseover', jsddm_open2)
   //$('#menu > li').bind('mouseout',  jsddm_close)
   });

document.onclick = jsddm_close;*/

		// initialise plugins
		jQuery(function(){
			jQuery('#menu').superfish({ 
            delay:       1000,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'slow',                          // faster animation speed 
            autoArrows:  false,                           //
 //disable generation of arrow mark-up 
            dropShadows: true                            // disable drop shadows 
        }); 

		});
		  
	function encodeMyHtml(encodeHtml) {
		 encodedHtml = escape(encodeHtml);
		 encodedHtml = encodedHtml.replace(/\//g,"%2F");
		 encodedHtml = encodedHtml.replace(/\?/g,"%3F");
		 encodedHtml = encodedHtml.replace(/=/g,"%3D");
		 encodedHtml = encodedHtml.replace(/&/g,"%26");
		 encodedHtml = encodedHtml.replace(/@/g,"%40");
		 return encodedHtml;
	} 

