	function makeModelFilter (theKind, theSelect, source, par){
		if (par == '')	par = 1;
		if (source){
			theModList = (document.getElementById('model').value).match (new RegExp ('#' + source + '[^#]*'));
			if (theModList){
				theModItems = theModList[0].split ('|');
				with (theSelect.form[theKind]){
					options.length = 0;			
					for ( theIndex = 1; theIndex < theModItems.length -1; theIndex++){
						tmp=theModItems[theIndex].split ('$$');
						options[theIndex-par] = new Option( tmp[1], tmp[0]);
					}
				}
			}
			else theSelect.form[theKind].options.length = 0;
		}
		else theSelect.form[theKind].options.length = 0;
	}	
	
//----------------------------------------------------------------------------------------------	

	function makeMuniFilter (theKind, theSelect, source, par){
		if (par=="undefined" || par=="")	par = 1;
		if (source){
			theModList = (document.getElementById('muni').value).match (new RegExp ('#' + source + '[^#]*'));
			if (theModList){
				theModItems = theModList[0].split ('|');
				with (theSelect.form[theKind]){
					options.length = 0;					
					for ( theIndex = 1; theIndex < theModItems.length -1; theIndex++){
						tmp=theModItems[theIndex].split ('$$');
						options[theIndex-par] = new Option( tmp[1], tmp[0])
					}
				}
			}
			else theSelect.form[theKind].options.length = 0;
		}
		else theSelect.form[theKind].options.length = 0;
	}	
	
//----------------------------------------------------------------------------------------------	

function doRegister(){
		if (document.forms['reg'].u_name.value.length == 0){
			alert('Please, fill Name field!');
			document.forms.reg.u_name.focus();
			return (false);
		}
		if (document.forms['reg'].u_user.value.length == 0){
			alert('Please, fill Username field!');
			document.forms.reg.u_user.focus();
			return (false);
		}
		if (document.forms['reg'].u_pass.value.length < 3){
			alert('Please, enter Password with more than 3 symbols!');
			document.forms.reg.u_pass.focus();
			return (false);
		}
		if (document.forms['reg'].u_email.value.length == 0){
			alert('Please, fill E-mail field!');
			document.forms.reg.u_email.focus();
			return (false);
		}
		var eFilter=/^.+@.+\..{2,3}$/;
  		if (document.forms.reg.u_email.value.length>0 && !eFilter.test(document.forms.reg.u_email.value)) {
			alert("Please, put a valid e-mail address!")
    		document.forms.reg.u_email.select();
    		document.forms.reg.u_email.focus();
    		return (false);
		}
	document.forms.reg.submit();
}

//----------------------------------------------------------------------------------------------	

function doNext(){
		flag=false;
		tmp="";
		for (i=1; i<=document.forms.ad.exn.value; i++){
			if (document.forms.ad.elements['ex'+i].checked){
				if (flag) tmp+="|";
				else flag=true;
				tmp+=document.forms.ad.elements['ex'+i].value;
			} 
		}
		document.forms.ad.exn.value=tmp;
		document.forms.ad.submit();
}

//----------------------------------------------------------------------------------------------	

function doEmail2fr(){
	if (document.forms['em'].yourname.value.length < 3){
		alert('Per cortesia, compila il campo "Il tuo nome"!');
		document.forms.em.yourname.focus();
		return (false);
	}
	if (document.forms['em'].email.value.length == 0){
		alert('Per cortesia, compila il campo "Indirizzo E-mail dellamico"!');
		document.forms.em.email.focus();
		return (false);
	}
	var eFilter=/^.+@.+\..{2,3}$/;
		if (document.forms.em.email.value.length>0 && !eFilter.test(document.forms.em.email.value)) {
		alert("Per cortesia, inserisci un'email valida!");
	  	document.forms.em.u_email.select();
	  	document.forms.em.u_email.focus();
	  	return (false);
	}
	if (document.forms['em'].youremail.value.length == 0){
		alert('Per cortesia, compila il campo "La tua E-mail"!');
		document.forms.em.youremail.focus();
		return (false);
	}
	if (document.forms.em.youremail.value.length>0 && !eFilter.test(document.forms.em.youremail.value)) {
		alert("Per cortesia, inserisci un'email valida!");
	  	document.forms.em.youremail.select();
	  	document.forms.em.youremail.focus();
	  	return (false);
	}
	document.forms.em.submit();
}
