function returnFormData(formName,esclusioni) {
	eval('var form = document.'+formName);
	Nelementi = form.elements.length;
	tmpString = "";
	for (i=0; i<Nelementi; i++) {
		elemento = form.elements[i];
		if ((elemento.length > 0) && (elemento.type != "select-one")) {
			for (a=0; a<elemento.length; a++) {
				if (elemento[a].name) {
					switch(elemento[a].type) {
						case('checkbox'):
						case('radio'):
							if (elemento.checked) {
								valore = elemento[a].value;
							} else {
								valore = false;
							}
						break;
						default:
							valore = elemento[a].value;
						break;
					}
					if (valore) {
						valore = valore.replace("'","\'");
						valore = valore.replace('+','%2B');
						valore = valore.replace('\\','%5C');
						valore = valore.replace('&','%26');
						tmpString+= elemento[a].name+"="+valore+"&";
					}
				}
			}
		} else {
			switch(elemento.type) {
				case('checkbox'):
				case('radio'):
					if (elemento.checked) {
						//alert(elemento.value+" > "+elemento.checked);
						valore = elemento.value;
					} else {
						valore = false;
					}
				break;
				default:
					valore = elemento.value;
				break;
			}
			if (valore) {
				valore = valore.replace("'","\'");
				valore = valore.replace('+','%2B');
				valore = valore.replace('\\','%5C');
				valore = valore.replace('&','%26');
				tmpString+= elemento.name+"="+valore+"&";
			}
		}
	}
	sendDati = tmpString.substring(0,(tmpString.length-1));
	return sendDati;
}

function imgGallery(id,img) {
	id = document.getElementById(id);
	id.src=img;
}

function popup_html(url,width,height) {
	popupImage = window.open(url,'_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=yes,resizable=no,width='+width+',height='+height+'');
}

jQuery(function($){
	$.datepicker.regional['it'] = {
            clearText: 'Svuota', clearStatus: '',
			clearStatus: 'Cancella la data corrente',
			closeText: 'Chiudi', closeStatus: '',
			closeStatus: 'Chiudi senza cambiamenti',
			prevText: '&lt;Prec', prevStatus: '',
			prevStatus: 'Mostra il mese precedente',
			nextText: 'Succ&gt;', nextStatus: '',
			nextStatus: 'Mostra il mese successivo',
			currentText: 'Oggi', currentStatus: '',
			currentStatus: 'Mostra il mese corrente',
			monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
			monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'],
			monthStatus: 'Mostra un altro mese',
			yearStatus: 'Mostra un altro anno',
			weekHeader: 'Sm', weekStatus: '',
			weekStatus: 'Settimana dell\'anno',
			dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
			dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
			dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'],
			dayStatus: 'Imposta DD come primo giorno della settimana',
			dateStatus: 'Seleziona DD, M d',
			dateFormat: 'dd/mm/yy', firstDay: 1,
			initStatus: 'Seleziona una data',
			isRTL: false
		};
	$.datepicker.setDefaults($.datepicker.regional['it']);
});
