﻿
function menu(x) {

        var togglers = $$('#menu h3');
	    var elementi = $$('#menu ul');
    	
	    var accordion = new Accordion(togglers, elementi, {
		    opacity: false,
		    //start: 'closed',	//all closed in onload
		    show:	x/*, 		//the Index of the element to show at start.
		    //display:	integer,	//the Index of the element to show at start (with a transition). defaults to 0.
		     onActive: function(toggler, element){
		     			    toggler.addClass('selected');
		     		    },
		     
		      onBackground: function(toggler, element){
		     			    toggler.removeClass('selected');
		     		    }*/
	    });
}

function testi() {
	
	//trova tutti i campi input con la classe txt-input
	var campi = $$('.txt-input');
	
	//per ognuno trova il valore impostato
	campi.each(function(el){
		var valore = el.value;
		//onfocus: se esiste un valore, svuota
		el.addEvents({
			'focus': function() {
				if (valore.contains('nome utente')) el.value = '';
				else if (valore.contains('password')) el.value = '';
				else if (valore.contains('Cerca in tutto il sito')) el.value = '';				
			}/*,
			'blur': function() {
				if(el.value='') el.value = valore;
			}*/
		});		
					
	});
	
}
