var path_assoluto;
if(typeof($)=="function"){
	path_assoluto = location.href;
	$(document).ready (menu);

}
/* Funzione per Menù 
- - - - - - - - - - - - - - - - - - - - */
function menu(){
	// #menu_vert_3lev
	//masterdivSX
	$("#menu_vert_3lev a.active").parent().parent().addClass("on");
	$("#menu_vert_3lev ul li ul").not(".on").hide();
	$("#menu_vert_3lev ul li a").click(function(){
		if($(this).attr("href")=="#"){
			if ($(this).next().attr("class") == "on") {
				$(this).parent().children().not("a").removeClass("on").slideUp("fast"); 
			} else {
				$(this).parent().parent().find("ul.on").removeClass("on").slideUp("fast");
				$(this).parent().children().not("a").addClass("on").slideDown("normal");
			}
			return false;
		}
	});
	apriMenu();
	my_accordion();
	$("img[@src='']").src='/img/trasp.gif';
	$("#reg_btn").hide();
	
	
}
function apriMenu(){
	// #menu_vert_3lev
	$("#menu_vert_3lev a.on").each(function(){
		var el=this;
		var conta=0;
		while(el !== null && conta<30){
			el=$(el).parent();
			if(el[0].tagName=="UL"){
				$(el).parent().children().not("a").show();
				$(el).parent().children().addClass("on");
				
			}else if (el[0].tagName=="LI"){
				conta++;
			}else if (el[0].tagName=="DIV"){
				el=null;
			}else{
				conta++;
			}
		}
	});
}
/* Funzione per Accordion 
- - - - - - - - - - - - - - - - - - - - */
function my_accordion(){
	$("h2 a[@rel='accordion']").click(function(){
		var thed=$(this).parent().next();
		$(".hidden:visible").not($(thed)).slideUp("fast");
		$(this).parent().next().slideDown("fast");
		return false;
	});
}

