//-----------------------------------------------------------------------------------------------------------
//--- File include JS
//--- 
//--- Author: eTT s.r.l. - UG
//--- Edited: 10 August 2004
//---
//--- INDICE
//-----------------------------------------------------------------------------------------------------------


//==========================================================================================================
//---  checkInsertUpdateNews(theForm): Form di Inserimento e Modifica --------------------------------------
function checkInsertNews01(theForm)
{
	if ((theForm.ddmDayddmData.value == -1) || (theForm.ddmMonthddmData.value == -1) || (theForm.ddmYearddmData.value == -1) )
	{
		alert("Compilare correttamente il campo \"Data\" ");
		theForm.ddmDayddmData.focus();
		return true;
	}

	if (IsStringEmpty(theForm.txtTitolo.value))
	{
		alert("Il campo \"Titolo\" è obbligatorio");
		theForm.txtTitolo.focus();
		return;
	}
	//--- Conrolli superati	
	theForm.submit();
	theForm.btnSubmit.disabled = true;
}

//==========================================================================================================
//---  checkInsertUpdateNews(theForm): Form di Inserimento e Modifica --------------------------------------
function checkInsertNews02(theForm)
{
	if (IsStringEmpty(theForm.txaTesto1.value))
	{
		alert("Il campo \"Testo 1\" è obbligatorio");
		theForm.txaTesto1.focus();
		return;
	}
	//--- Conrolli superati	
	theForm.submit();
	theForm.btnSubmit.disabled = true;
}

//==========================================================================================================
//---  checkUpdateNews(theForm): Form di Modifica --------------------------------------
function checkUpdateNews(theForm)
{
	if ((theForm.ddmDayddmData.value == -1 ) || (theForm.ddmMonthddmData.value == -1 ) || (IsStringEmpty(theForm.ddmYearddmData.value)) )
	{
		alert("Compilare correttamente il campo \"Data\" ");
		theForm.ddmDayddmData.focus();
		return true;
	}

	if (IsStringEmpty(theForm.txtTitolo.value))
	{
		alert("Il campo \"Titolo\" è obbligatorio");
		theForm.txtTitolo.focus();
		return;
	}

	if (IsStringEmpty(theForm.txaTesto1.value))
	{
		alert("Il campo \"Testo 1\" è obbligatorio");
		theForm.txaTesto1.focus();
		return;
	}
	//--- Conrolli superati	
	theForm.submit();
	theForm.btnSubmit.disabled = true;		
	
}
//==========================================================================================================
//---  checkRichiediInfo(theForm): Form di Richiesta  PR--------------------------------------
function checkRichiediInfo(theForm)
{
	//--- Dati anagrafici
	if (IsStringEmpty(theForm.txtNome.value))
	{
		alert("Il campo \"Nome\" è obbligatorio");
		theForm.txtNome.focus();
		return;
	}

	if (IsStringEmpty(theForm.txtCognome.value))
	{
		alert("Il campo \"Cognome\" è obbligatorio");
		theForm.txtCognome.focus();
		return;
	}
	
	if (IsStringEmpty(theForm.txtAzienda.value))
	{
		alert("Il campo \"Azienda\" è obbligatorio");
		theForm.txtAzienda.focus();
		return;
	}
	
	//--- Telefono/E-mail
	if ((IsStringEmpty(theForm.txtTelefono.value)) && (IsStringEmpty(theForm.txtEmail.value)))
	{
		alert("Compilare almeno un campo tra \"Telefono\" e \"E-mail\" ");
		theForm.txtTelefono.focus();			
		return;
	}
	
	if (!IsStringEmpty(theForm.txtEmail.value))
	{
		if (!checkMail(theForm.txtEmail.value))
			return;	
	}
	
	//--- Note
	if (IsStringEmpty(theForm.txtaNote.value))
	{
		alert("Il campo \"Note\" è obbligatorio");
		theForm.txtaNote.focus();
		return;
	}
	
	//--- E-Mail
	/*
	{
		if (!checkMail(theForm.txtEmail.value))
			return;	
	}
	*/
	
	//--- Conrolli superati	
	theForm.submit();
	theForm.btnButton.disabled = true;

}
