function submitDownloadForm(){
document.downloadForm.submit();
}

function submitStaticDownloadForm(param1){
  document.downloadForm.action=par1;
  alert("document.downloadForm.action = " + document.downloadForm.action);
  document.downloadForm.submit();
}

function submitFormViewOldReport(){
	document.viewOldReport.submit();
}

function goAndSetLista()
{
document.authreset.idlista.value=document.authreset.liste.options[document.authreset.liste.selectedIndex].value;
	if (document.authreset.idlista.value != ""){
		document.authreset.nomelista.value=document.authreset.liste.options[document.authreset.liste.selectedIndex].text;
		document.authreset.submit();
	}
}


function ModModal(par1)
{
document.authreset.ComuneC.value=document.authreset.town.options[document.authreset.town.selectedIndex].text;
//document.authreset.NumeroSezioniTotali.value=document.authreset.town.value;
document.authreset.provName.value=par1;
document.authreset.submit();
}


function goReport(par1, par2)
{
document.menuprovince.prov.value=par1;
document.menuprovince.provName.value=par2;
document.menuprovince.submit();
return;
}

function goStaticReportLevel1(par1, par2, par3)
{
document.menuprovince.action=createPathLevel1(par1+"/"+par3+par1+".html");
//alert("document.menuprovince.action = " + document.menuprovince.action);

document.menuprovince.prov.value=par1;
document.menuprovince.provName.value=par2;
//document.menuprovince.basepage.value=par
document.menuprovince.submit();
return;
}

function createPathLevel1(pagina) {

  var path = window.location.pathname.substring( window.location.pathname.indexOf("/")+ 1)

  //alert('path: '+path);

  path = path.substring(0,path.lastIndexOf ("/"))


  alert('path: '+path);

  //path = path.substring(0,path.lastIndexOf ("/"))

  //alert('path: '+path);

  ///alert(window.location.protocol + '//' + window.location.host + "/" + path + "/" +  pagina);

  return window.location.protocol + '//' + window.location.host + "/" + path + "/" +  pagina

}




function goStaticReport(par1, par2, par3)
{
document.menuprovince.action=createPath(par1+"/"+par3+par1+".html");
//alert("document.menuprovince.action = " + document.menuprovince.action);

document.menuprovince.prov.value=par1;
document.menuprovince.provName.value=par2;
//document.menuprovince.basepage.value=par
document.menuprovince.submit();
return;
}

function createPath(pagina) {

  var path = window.location.pathname.substring( window.location.pathname.indexOf("/")+ 1)

  //alert('path: '+path);

  path = path.substring(0,path.lastIndexOf ("/"))


  //alert('path: '+path);

  path = path.substring(0,path.lastIndexOf ("/"))

  //alert('path: '+path);

  ///alert(window.location.protocol + '//' + window.location.host + "/" + path + "/" +  pagina);

  return window.location.protocol + '//' + window.location.host + "/" + path + "/" +  pagina

}


function openChartWindow(larghezza,altezza,titolo)

{
	var myVar = 'width='+larghezza+',height='+altezza+',toolbar=0 ,titlebar='+titolo;
    var chartWindow = window.open("","chartWindow",myVar);
    document.chartForm.submit();
    chartWindow.focus();
    return;
}


function goReport4(par1, par2)
{
//alert('Par1 '+par1)
document.menuprovince.action=par1;
//alert('Par2 '+par2)
document.menuprovince.orderby.value=par2;
document.menuprovince.submit();
return;
}

function goReport4Prov(par1, par2, par3)
{
document.menuprovince.prov.value=par1;
document.menuprovince.provName.value=par2;
document.menuprovince.orderby.value=par3;
document.menuprovince.submit();
return;
}

function goReportImg(par1, par2)
{
document.imgprovince.prov.value=par1
document.imgprovince.provName.value=par2
document.imgprovince.submit();
return;
}

function goMessaggio(par1)
{
alert(par1);
return;
}

function changeRilevamento(par1)
{
document.menurilevamento.idRilevamento.value=par1
document.menurilevamento.submit();
return;
}

function changeStaticRilevamento(par1)
{

  var path = window.location.pathname.substring( window.location.pathname.indexOf("/")+ 1)


  path = path.substring(0,path.lastIndexOf ("/"))

  document.menuprovince.action= window.location.protocol + '//' + window.location.host + "/" + path + "/" +  pagina


   document.menurilevamento.idRilevamento.value=par1

  document.menurilevamento.submit();
return;
}



function changeAffluenza(par1, par2)
{
document.menuaffluenza.prov.value=par1
document.menuaffluenza.provName.value=par2
document.menuaffluenza.submit();
return;
}


function goReportByLista()
{
listaScelta = document.menuliste.lista.options[document.menuliste.lista.options.selectedIndex].value;
if(listaScelta!="")
	document.menuliste.submit();
return;
}

function goReportByListaLink(listaID)
{
document.menuliste.lista.value=listaID;
document.menuliste.submit();
return;
}