
//Controlla il form di ricerca dei contenuti nelle pagine del sito
function check_form_ricerca_dati(campo_testo, uri, valore) {
	
	//alert("Avvio la ricerca.....");
	var frm = document.getElementById("frmCerca");
	var txt = document.getElementById(campo_testo);
	var stxt = get_string(txt);
	if (stxt != "") {
		uri += "?p=1&f="+stxt;
	}
	document.location.href = uri;
	
}

//Controlla il form di login
function check_form_login_utente() {
	var frm = document.getElementById("frm");
	var usr = document.getElementById("username_utente");
	var psw = document.getElementById("password_utente");
	var uri = "gestione/libs/system/checklogin.php";
	
	var susr = get_string(usr);
	var spsw = get_string(psw);
	
	if (susr == "") {
		alert("Inserisci il tuo username nella casella.");
		usr.focus();
		return;
	}
	
	if (spsw == "") {
		alert("Inserisci la password di accesso.");
		psw.focus();
		return;
	}
	
	frm.action = uri;
	frm.submit();
	
	
}


//Doenload allehato
function download_allegato(id_file, sdata) {
	var uri = "gestione/libs/system/download_file.php?id_file="+id_file+"&data="+sdata;
	document.location.href = uri;
}