var req = new Request.JSON({
            method: 'post',
            url: url_faq,
            secure: true,
            onSuccess: mostra_faq
        }).send();


function mostra_faq(originalRequest) {

  var obj = originalRequest;
  if (obj) {
    if (obj.errore == 0) {
    var lista_faq = obj.lista_faqs;
    
    var html = '<strong>FAQ</strong><br><br><div id="accordion">';
    for(var i=0; i<lista_faq.length; i++) {
      var faq = lista_faq[i];
      
      html += '<h3 class="toggler atStart">'+faq.domanda+'</h3><div class="element atStart">'+faq.risposta+'</div>';
    }
    html += '</div>';
    $('faqtd').innerHTML = html;
    
    var accordion = new Accordion($('accordion'), 'h3.atStart', 'div.atStart', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#333333');
			toggler.setStyle('cursor', 'pointer');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#ffffff');
		}
	});
/*
    var accordion = new Accordion('h3.atStart', 'div.atStart', {
                            opacity: false,
                            onActive: function(toggler, element){
                            toggler.setStyle('color', '#ffffff');
							toggler.setStyle('cursor', 'pointer');
                          },
                          onBackground: function(toggler, element){
                            toggler.setStyle('color', '#173504');
                          }
                        }, $('accordion'));
 
*/
    var newTog = new Element('h3', {'class': 'toggler'});
 
    var newEl = new Element('div', {'class': 'element'});
 
    accordion.addSection(newTog, newEl, 0);
    
    } else {
      alert('Non sono riuscito a caricare la faq:'+"\n"+obj.messaggio);
    }
  }

}