function checkReg() {
	var elemento=document.getElementById("regForm");
	if (elemento) {
		
		if (elemento.regMail.value.length<=0 || elemento.regMail.value.indexOf('@')<=0 || elemento.regMail.value.indexOf('.')<=0){alert('E-Mail mancante o errata');elemento.regMail.className='textInputErr';elemento.regMail.focus();return false;} else { elemento.regMail.className='textInput'; }
		
		if (elemento.regPass.value.length<=0){alert('Password mancante');elemento.regPass.className='textInputErr';elemento.regPass.focus();return false;} else { elemento.regPass.className='textInput'; }
		
		if (elemento.regPassRepeat.value.length<=0){alert('Password mancante');elemento.regPassRepeat.className='textInputErr';elemento.regPassRepeat.focus();return false;} else { elemento.regPassRepeat.className='textInput'; }
		
		if (elemento.regGoogleKey.value.length<=0){alert('Google Key mancante');elemento.regGoogleKey.className='textInputErr';elemento.regGoogleKey.focus();return false;} else { elemento.regGoogleKey.className='textInput'; }
		
		if (elemento.regPassRepeat.value!=elemento.regPass.value){alert('Password differenti');
		elemento.regPassRepeat.className='textInputErr';elemento.regPass.className='textInputErr';
		elemento.regPass.focus();return false;} else { elemento.regPassRepeat.className='textInput';elemento.regPass.className='textInput'; }
		
		if (elemento.regName.value.length<=0){alert('Nominativo mancante');elemento.regName.className='textInputErr';elemento.regName.focus();return false;} else { elemento.regName.className='textInput'; }

	}
}

function checkContatti() {
	var elemento=document.getElementById("contattiForm");
	if (elemento) {
		
		if (elemento.contattiEmail.value.length<=0 || elemento.contattiEmail.value.indexOf('@')<=0 || elemento.contattiEmail.value.indexOf('.')<=0){alert('E-Mail mancante o errata');elemento.contattiEmail.className='textInputErrNoWidth';elemento.contattiEmail.focus();return false;} else { elemento.contattiEmail.className='textInputNoWidth'; }
		
		if (elemento.contattiNome.value.length<=0){alert('Nominativo mancante');elemento.contattiNome.className='textInputErrNoWidth';elemento.contattiNome.focus();return false;} else { elemento.contattiNome.className='textInputNoWidth'; }
		
		if (elemento.contattiRichiesta.value.length<=0){alert('Richiesta mancante');elemento.contattiRichiesta.className='textInputErrNoWidth';elemento.contattiRichiesta.focus();return false;} else { elemento.contattiRichiesta.className='textInputNoWidth'; }
		
	}
}

function checkMoreURLForm() {
	var elemento=document.getElementById("moreURLForm");
	if (elemento) {
		var nLineCount=0;var re=/\s{1,}/g;var re2=/^\s+|\s+$/;
		var nLine=elemento.nKeyOnLine.value.replace("\r","").toLowerCase().split("\n");
		if (nLine.length>0) {
			if (elemento.delOldKey.checked==true) {
				for (nLineCount=document.formEsecuzione.codKey_ok.length-1;nLineCount>=0;nLineCount--) {
					document.formEsecuzione.codKey_ok.options[nLineCount]=null;
				}
			}
			for (nLineCount=0;nLineCount<nLine.length;nLineCount++) {
				nLine[nLineCount]=nLine[nLineCount].replace(re2,"").replace("\r","");
				var tempvalueCombo=null;
				if (nLine[nLineCount].replace("\r","").replace(re," ").length>0 && nLine[nLineCount]!=null) {
					if (nLine[nLineCount].indexOf(" ")<=0){ var nPosLineCunt=nLine[nLineCount].length } else { var nPosLineCunt=nLine[nLineCount].indexOf(" ") }
					tempvalueCombo=Left(nLine[nLineCount], parseInt(nPosLineCunt)).replace(re," ").toLowerCase();
					if (Left(tempvalueCombo, 4) == "www.") {
						tempvalueCombo="http://"+tempvalueCombo;
						document.formEsecuzione.codKey_ok.options[document.formEsecuzione.codKey_ok.length]=new Option(tempvalueCombo,tempvalueCombo);
					} else if (Left(tempvalueCombo, 7) == "http://" || Left(tempvalueCombo, 8) == "https://") {
						document.formEsecuzione.codKey_ok.options[document.formEsecuzione.codKey_ok.length]=new Option(tempvalueCombo,tempvalueCombo);
					} else {
						tempvalueCombo="http://www."+tempvalueCombo;
						document.formEsecuzione.codKey_ok.options[document.formEsecuzione.codKey_ok.length]=new Option(tempvalueCombo,tempvalueCombo);
					}
				}
			}
			var nKeyinserite=document.getElementById("nURLInseriti");
			nKeyinserite.innerHTML="<strong>"+document.formEsecuzione.codKey_ok.length+"</strong>";
			delDiv("multiKey");
		} else {
			alert("Insert an URL !");
			return false;
		}
	}
}

function selectCheckInForm(bolValue,strFormName) {
	var elemento=document.getElementById(strFormName);
	if (elemento) {
		for (var ppok=0;ppok<elemento.selectToAnalizeDett.length;ppok++) {
			elemento.selectToAnalizeDett[ppok].checked=bolValue;
		}
	}
}

function checkSaveAnalisi(strSession) {
	var elemento=document.getElementById("saveAnalisiName");
	if (elemento) {
		if (elemento.value.length<5 || elemento.value.length>29) {
			alert('Il nome dell\'Analisi deve essere di min. 5 e max. 30 caratteri');
			return false;
		} else {
			var tempAnalisiName=elemento.value.toLowerCase().replace(' ','_');
			location.href="saveAnalisi.asp?n="+tempAnalisiName+"&s="+strSession;
		}
	}
}