function WindowStatus(msg)
      {
        self.status=msg;
        return true;
      }
//
//-------------------------------------------------------------------------------------------------------
// Form submission e verifiche associate
//-------------------------------------------------------------------------------------------------------
//
function submitForm(ival)
{
	var y=document.forms[0].s;
    if (y){document.forms[0].s.value=ival;}
	y=document.forms[0].PriceSelectMin;
    var iSelectMin=0;
    var iSelectMax=0;
    if (y)
    {
     	iSelectMin=parseInt(document.forms[0].PriceSelectMin.options[document.forms[0].PriceSelectMin.selectedIndex].value);
        iSelectMax=parseInt(document.forms[0].PriceSelectMax.options[document.forms[0].PriceSelectMax.selectedIndex].value);
   	}
    if(iSelectMax==0){iSelectMax=1000};
    if (iSelectMin>iSelectMax)
    {
    	alert("Prezzo minimo maggiore del prezzo massimo...");
        return void(0);
	}
	
    iSelectMin=0;
    iSelectMax=0;
    y=document.forms[0].DimensionSelectMin;
    if (y.type != 'hidden')
    {
    	if (y)
    	{
    		iSelectMin=parseInt(document.forms[0].DimensionSelectMin.options[document.forms[0].DimensionSelectMin.selectedIndex].value);
        	iSelectMax=parseInt(document.forms[0].DimensionSelectMax.options[document.forms[0].DimensionSelectMax.selectedIndex].value);
		}
	}
    if(iSelectMax==0)
    {
    	iSelectMax=1000
    };
    if (iSelectMin>iSelectMax)
    {
    	alert("Dimensione minima maggiore della dimensione massima...");
        return void(0);
    }
	document.forms[0].submit();      
}
//
//-------------------------------------------------------------------------------------------------------
// Caricamento immagini
//-------------------------------------------------------------------------------------------------------
//
function MM_preloadImages() {
        var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
          var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
          if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
      }
//
//-------------------------------------------------------------------------------------------------------
// Evento mouse out
//-------------------------------------------------------------------------------------------------------
//
function mouseOut()
{
  	var el = document.getElementById('dr_txt');
  	el.innerHTML = "Clicca sulla cartina per avviare la ricerca&nbsp;";
}
//
//-------------------------------------------------------------------------------------------------------
// Evento mouse over
//-------------------------------------------------------------------------------------------------------
//
function mouseOver(szMapSource,szAlt)
{
 	var el = document.getElementById('dr_txt');
  el.innerHTML = szAlt;
}      			                      
//
//-------------------------------------------------------------------------------------------------------
// Submit
//-------------------------------------------------------------------------------------------------------
//
function maySubmit()
{
        //beware that value doesn't exist into netscape object model for select
        //(until netscape 6)
        if (document.forms[0].t.selectedIndex==0)
        {
      	alert ("Selezionare la provincia");
      	return false;
        }
        if (document.forms[0].c.selectedIndex==0)
        {
      	alert ("Selezionare la categoria");
      	return false;
        }
        return true;
      }
//
//-------------------------------------------------------------------------------------------------------
// Funzione
//-------------------------------------------------------------------------------------------------------
//			
function mayAddUser()
{
        if (document.forms[0].Cognome.value=="")
        {
      	alert ("Manca il cognome");
      	return false;
        }
        if (document.forms[0].Email.value=="")
        {
      	alert ("Indirizzo email obbligatorio");
      	return false;
        }
        if (document.forms[0].Autorizzazione.checked==false)
        {
      	alert ("Impossibile inserire senza l'autorizzazione al trattamento dati");
      	return false;
        }
        return true;
}
//
//-------------------------------------------------------------------------------------------------------
// Richiamo home page
//-------------------------------------------------------------------------------------------------------
//
function gohome()
{
	document.forms[0].action = "default.asp";
	if (document.forms[0].o) 
	{
		if (document.forms[0].o.selectedIndex == 0) {document.forms[0].m.value = 2;}
	}	
	document.forms[0].submit();
}

//
//-------------------------------------------------------------------------------------------------------
// Verifica che sia stato inserito email e quindi trasferimento.Parametro è il form di chiamata
//-------------------------------------------------------------------------------------------------------
//
function checkme(arg)
{
	if (arg.Email.value.match(/^\s*$/)) 
	{
		alert("Necessario inserire email");
		return false;
	}	
	else
	{
		arg.action = "substp2.asp";
		document.forms[0].submit();
	}	
}

//
//-------------------------------------------------------------------------------------------------------
// Funzione
//-------------------------------------------------------------------------------------------------------
//			
function mayStillAddUser()
{
        if (document.forms[0].Cognome.value.match(/^\s*$/))
        {
      		alert ("Manca il cognome");
      		return false;
        }
        if (document.forms[0].Email.value.match(/^\s*$/))
        {
      		alert ("Indirizzo email obbligatorio");
      		return false;
        }
        if (document.forms[0].Scoperto.selectedIndex == 0)
        {
      		alert ("Per favore, indica come ci hai scoperto");
      		return false;
        }
        if (document.forms[0].Autorizzazione.checked==false)
        {
      		alert ("Impossibile inserire senza l'autorizzazione al trattamento dati");
      		return false;
        }
        return true;
}