//menuHover = function() {
//	$$('#topMenu li').each(function(e){
//						  	e.onmouseover	= function(){var e = this.down('ul'); if(e) e.show();}
//							e.onmouseout	= function(){var e = this.down('ul'); if(e) e.hide();}
//						  });
//}
//
//Event.observe(window, 'load', menuHover);

$j(function() {
	$j('.slideshow').nivoSlider({
		pauseTime:			5000,
		pauseOnHover:		false,
		controlNavThumbs:	true,
		effect:				'fade'
	});
	$j('div.descrizione').expander({
		slicePoint:			150,
		expandPrefix:		'',
		expandText:			'[...]',
		collapseTimer:		false,
		userCollapseText:	'[^]'
	});
	$j('div.login').corner('15px');
});

Subscribe = function(){
	new Ajax.Request('/ajax/NewsLetter.php?T' + Math.random(), {
			asynchronous: true,
			method      : 'post',
			parameters  : $('Subscriber').serialize(),
			onLoading   : function(rq){$('form_results').hide();$('form_wait').show();},
			onComplete  : function(rq){$('form_wait').hide();$('form_results').show();},
			onFailure   : function(rq){alert('Errore ' + rq.status + ' -- ' + rq.statusText);},
			onSuccess   : function(rq){
							if(!rq.responseText.isJSON()){alert('JSON: NOT A JSON RESPONSE.');return false;}
							var obj = rq.responseText.evalJSON();
							alert(obj.ResultDesc);
							$('NL_FName').value='';
							$('NL_LName').value='';
							$('NL_Email').value='';
						}
		}
	);
	return false;
}
