<!--
function trim(sString) {
	/*
	while (sString.substring(0,1) == ' ') {
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ') {
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
	*/
	return sString.replace(/\s+$|^\s+/g,"");
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function hide_element(element_id) {
	var div_element = document.getElementById(element_id);
	if (div_element) {
		div_element.style.display = 'none';
	}
}
function show_element(element_id) {
	var div_element = document.getElementById(element_id);
	if (div_element) {
		div_element.style.display = 'block';
	}
}
function hide_show_element(element_id)  {
	var div_element = document.getElementById(element_id);
	if (div_element) {
		if (div_element.style.display == 'none') {
			div_element.style.display = 'block';
		}
		else {
			div_element.style.display = 'none';
		}
	}
}
function goto_url(url) {
	window.location.assign(url);
}
function popup(nomefile, larghezza, altezza, x, y)
{
    win_popup = window.open(nomefile, "", "toolbar= 0,location= 0,directories= 0,status= 0,menubar= 0,scrollbars= 0,resizable= 0,marginheight= 0,marginwidth= 1,copyhistory= 0,width=" + (larghezza+30) + ",height=" + (altezza+60));
    x = parseInt(x);
    y = parseInt(y);
    win_popup.moveTo(x, y);
}
function resize_popup(new_width, new_height, doscroll) { //v2.0
	window.resizeTo(new_width,new_height);
}

function select_menu(menu_id, normal_css_class, select_css_class) {
	for (i=0;i<menu_element.length; i++) {
		var div_output = document.getElementById(menu_element[i]); 
		if (div_output) { 
			if (menu_element[i] == menu_id) {
				div_output.className = normal_css_class + ' ' + select_css_class; 
			}
			else {
				div_output.className = normal_css_class; 
			}
		}
	}
}

function google_search() {
	var fm_search_testo = document.getElementById("fm_search_testo");
	if (fm_search_testo) {
		if (check_required(fm_search_testo, "textfield", "textfield_err")) {
			alert(empty_testo_ricerca);
			fm_search_testo.focus();
		}
		else {
			window.open('http://www.google.it/search?hl=it&q=' + escape(trim(fm_search_testo.value)));
		}
	}

	
}

function show_fm_new_comment()  {
	var div_fm_new_comment = document.getElementById('div_fm_new_comment');
	if (div_fm_new_comment) {
		if (div_fm_new_comment.style.display == 'none' || div_fm_new_comment.style.display == '') {
			div_fm_new_comment.style.display = 'block';
		}
		else {
			div_fm_new_comment.style.display = 'none';
		}
	}
}

function show_fm_sendnews()  {
	var div_fm_sendnews = document.getElementById('div_fm_sendnews');
	if (div_fm_sendnews) {
		if (div_fm_sendnews.style.display == 'none' || div_fm_sendnews.style.display == '') {
			div_fm_sendnews.style.display = 'block';
		}
		else {
			div_fm_sendnews.style.display = 'none';
		}
	}
}

function disable_form(form_name) {
	var _fm_handle = document.getElementById(form_name); 
	if (_fm_handle) {
		_fm_handle.action = '#javascript;';
		hide_element(form_name + '_invia');
	}
}

function JQuery_initialization() {
	$(document).ready(function() { 

		/*$('a[href^="http://"]')  
		.attr("target", "_blank"); */

		$('a[rel="external"]')
		.attr("target", "_blank");

	}); 

	/*
	// attivare jquery-ui-personalized-1.5.1.min.js e ui.datepicker-it.js in header.php
	var accordions = jQuery('#list1a, #list1b');

	jQuery().ready(function(){
		// simple accordion
		jQuery('#list1a').accordion();
		jQuery('#list1b').accordion({
			autoHeight: false
		});
		$.datepicker.setDefaults({rangeSelect: false});
		$.datepicker.setDefaults($.datepicker.regional['it']);
		$('input#fm_search_date').datepicker(); 

	});
	*/
}

var menu_element = new Array();

-->
