// JavaScript 1.2 Document
/*
	Libreria funzioni controllo ausiliarie:
		Versione 1.0
		Ultima modifica/revisione: 09/05/2007.
		Ultima modifica: 18/03/2004.		
		Autore: Baket, Leonardo, Antonio
*/

var msgChkBool = 'Necessario spuntare la casella';
var elNum = 6;			// Numero di elementi minimi
var firstEl = 3;		// primo elemento utile

function fldCheckBool(fld, fldName) {
	if ( !fld.checked ) {
		alert(fldName + ': ' + msgChkBool);
		fld.focus();
		return false;	
	}
	return true;
}

var msgChkCombo = 'Selezionare un valore non nullo';

function fldCheckCombo(fld, fldName) {
	var str='';
	if (fld && (fld.selectedIndex >= 0))
		str = fld.options[fld.selectedIndex].value;	
	if (str=='') {
		alert(fldName + ': ' + msgChkCombo);
		fld.focus();
		return false;		
	}	
	return true;	
}

function getPath() {
	var path = '';
	var url = document.URL;
	var i;
		
	tmp = url.split('/');

	if (tmp.length > elNum) {
		for (i=firstEl; i < (tmp.length-elNum) + firstEl;i++)
			path = path + '/' + tmp[i];		
	}

	return path + '/';
}