//<!--
var c_n2,c_e2,mappa3,riq3='';
//************** DoFSCommand *********************
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1
// Handle all the the FSCommand messages in a Flash movie
function mappa_DoFSCommand(command,args)
{  var mappaObj = InternetExplorer ? mappa : document.mappa;
   if (args!='ZZZZ') mapriq(args);
}

// Hook for Internet Explorer

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
          navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1)
          {
          document.write('<SCRIPT LANGUAGE=VBScript\> \n');
          document.write('on error resume next \n');
          document.write('Sub mappa_FSCommand(ByVal command, ByVal args)\n');
          document.write('  call mappa_DoFSCommand(command, args)\n');
          document.write('end sub\n');
          document.write('</SCRIPT\> \n');
          }

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1
// Handle all the the FSCommand messages in a Flash movie
function micsofreenet_DoFSCommand(command,args)
{  var micsofreenetObj = InternetExplorer ? homepage : document.homepage;
   //** inizio pop-up micso
/*
var dimensioni= "width=200px,height=300px,resizable='0'";
var micsofn= window.open("","micso-freenet",dimensioni);
micsofn.document.write("
<HTML>
<BODY>

<table border="0" width="220" cellspacing="0" cellpadding ="15">
        <tr>
                <td width="220" bgcolor="#EFDB42" valign="top">

          <p align="center">

          <font size="1">
          <a href="http://www.micso.net/icm/reg.mpl?codice=IST71106">
          <img border="0" src="micsofn.gif" width="169" height="107">
          </a></font>

          <br><br>

          <font face="Arial" color="#FE0000" size="3">
          <b>INTERNET GRATIS<br>IN TUTTA ITALIA !!</b>
          </font>

          <br>

          <font face="Arial" color="#0065A5" size="1">
          Collegamento Gratuito ISDN/PSTN<br>superveloce ad Internet
          </font>

          <br><br>

          <font face="Arial" color="#0065A5" size="3">
          <b>Antivirus sulle E-Mail</b>
          </font>

          <br>

          <font face="Arial" color="#0065A5" size="3">
          <b>Spazio Illimitato E-Mail</b>
          </font>

          <br>

          <font face="Arial" color="#0065A5" size="1">
          Assistenza telefonica Gratuita
          </font>

          <br><br>

          <font face="Arial" color="#FE0000" size="3">
          <a href="http://www.micso.net/icm/reg.mpl?codice=IST71106">
                  <b>REGISTRATI QUI</b>
          </a></font>

          </p>

        </td>
        </tr>
</table>

</BODY>
</HTML>
         */
   //** fine pop-up micso
}

// Hook for Internet Explorer

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
          navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1)
          {
          document.write('<SCRIPT LANGUAGE=VBScript\> \n');
          document.write('on error resume next \n');
          document.write('Sub micsofreenet_FSCommand(ByVal command, ByVal args)\n');
          document.write('  call micsofreenet_DoFSCommand(command, args)\n');
          document.write('end sub\n');
          document.write('</SCRIPT\> \n');
          }

//************** cerca schede in mappa e riquadro passato da DoFSCommand *********************
function mapriq(args)
{

  var mappa2=args.substr(0,2);
  var riq=args.substr(2,2);
  var current_loc=window.location.toString();
  if (current_loc.indexOf("main_search.php")!=-1) var loc='main_search.php?mappa='+mappa2+'&riq='+riq+'&cerca_dove=dove';
  else if (current_loc.indexOf("toponimo_search.php")!=-1) var loc='toponimo_search.php?mappa='+mappa2+'&riq='+riq+'&cerca_via=via';
  window.parent.mainFrame.location.href=loc;
}

//************** Funzioni di navigazione mappa *********************
function reset_zoom()
{
var filmato=window.document.mappa;
if (filmato) filmato.Zoom(0);
}

function zoom_in()
{
var filmato=window.document.mappa;
if (filmato) filmato.Zoom(75);
}

function zoom_out()
{
var filmato=window.document.mappa;
if (filmato) filmato.Zoom(125);
}

function dx()
{
var filmato=window.document.mappa;
if (filmato)  filmato.Pan(20, 0, 1);
}

function sx()
{
var filmato=window.document.mappa;
if (filmato)  filmato.Pan(-20, 0, 1);
}

function up()
{
var filmato=window.document.mappa;
if (filmato)  filmato.Pan(0, -20, 1);
}

function down()
{
var filmato=window.document.mappa;
if (filmato) filmato.Pan(0, 20, 1);
}

function quadro_unione()
{
document.mappa.LoadMovie("0","mappe/mappa.swf");
document.mappa.LoadMovie("0","mappe/qu.swf");
if ((c_n2!='')&&(c_e2!='')) setTimeout('punto(c_n2,c_e2)',800);
con_m=document.getElementById('c_map');
con_m.innerHTML="<b>mappa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-</b>";
con_r=document.getElementById('c_riq');
con_r.innerHTML="<b>riquadro&nbsp;&nbsp;-</b>";
if (((mappa3>0)&&(mappa3<30))) con_m.innerHTML="<b>mappa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+mappa3+"</b>";
if (riq3!='') con_r.innerHTML="<b>riquadro&nbsp;&nbsp;"+riq3+"</b>";
}

//************** zoom di riquadro *********************
function zoom_riq(mappa2,riq)
{
  if (!((mappa2>0)&&(mappa2<30))) return false;
  var filmato=window.document.mappa;
  //document.m_r.map_riq.value=mappa2+riq;
  y=riq.substr(0,1);
  x=riq.substr(1,1);
  // 4 x 4  --- 19 mappe
  // mappe fatte: 13 -
  if ((mappa2=='03')||(mappa2=='04')||(mappa2=='06')||(mappa2=='08')||(mappa2=='11')||(mappa2=='12')||(mappa2=='13')||(mappa2=='15')||(mappa2=='16')||(mappa2=='17')||(mappa2=='18')||(mappa2=='19')||(mappa2=='20')||(mappa2=='21')||(mappa2=='22')||(mappa2=='23')||(mappa2=='24')||(mappa2=='25')||(mappa2=='29'))
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='C')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
          }
      else if (x=='3')
          {
           setTimeout("dx()",800);
          }
      else
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      }

// 4 x 5  --- 5 mappe
else if ((mappa2=='07')||(mappa2=='09')||(mappa2=='10')||(mappa2=='26')||(mappa2=='27'))
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='D')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else if (y=='E')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
          //non fa niente
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);

          }
      else if (x=='3')
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      else
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      }

// 4 x 6 --- 3 mappe
else if ((mappa2=='01')||(mappa2=='02')||(mappa2=='05'))
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='C')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='D')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else if (y=='E')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
          }
      else if (x=='3')
          {
           setTimeout("dx()",800);
          }
      else
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      }
// 5 x 6  --- 2 mappe
// mappe_fatte: 14
//if ((mappa2=='14')||(mappa2=='28'))
else
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='C')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='D')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else if (y=='E')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='4')
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      else if (x=='5')
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      else {}
      }
}

//************** zoom mappa e mostra il punto *********************
function vai_a(mappa,riq,c_n,c_e)
{
document.location='#top';
if (riq!='')
 {
  //document.m_r.map_riq.value=mappa+riq;
  zoom_riq(mappa,riq);
 }
if ((c_n>0)&&(c_e>0))
 {
  punto(c_n,c_e);
 }
//azzera();
}

//************** mappa di fuori area *********************
function goto_map(rif,stampa)
{
if (typeof(fuori_area) =='undefined')
{
var dimensioni= "width=450px,height=463px,resizable='0'";
var fuori_area= window.open("","fuori_area",dimensioni);
fuori_area.document.write("<html>\n<head>\n<title>Mappa: "+stampa+"</title>\n<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>\n");
fuori_area.document.write("\n</head>\n<body oncontextmenu=\"return false\" onselectstart=\"return false\"ondragstart=\"return false\" leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>\n");
fuori_area.document.write("<table width='450' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='mappe/fuoriarea_"+rif+".gif' border='0' hspace='0' vspace='0'></td></tr></table>");
fuori_area.document.write("\n</body></html>");
fuori_area.document.close();
res=(window.screen.width);
switch (res)
{
 case 800: x=50; y=20; break;
 case 1024: x=100; y=20; break;
 case 1152: x=100; y=20; break;
 case 1280: x=150; y=20; break;
 case 1600: x=150; y=20; break;
 default: x=50; y=20; break;
}
fuori_area.moveTo (x,y);
fuori_area.focus();
}
}

//************** vai a mappa zoom riquadro e mostra punto - per link esterni (rif_s) *************
function goto_riq(map_da_s,riq_da_s,id_scheda,c_n,c_e)
{
c_n2=c_n;
c_e2=c_e;
document.mappa.LoadMovie(0,"mappe/mappa"+map_da_s+".swf");
setTimeout("",3000);
reset_zoom();
// identificazione del browser
isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

// identificazione degli elementi in base al browser
if (isNS4){
con_m=document.layers.c_mpa;
con_r=document.layers.c_riq;
con_m.innerHTML=="<b>mappa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+map_da_s+"</b>";
con_r.innerHTML="<b>riquadro&nbsp;&nbsp;"+riq_da_s+"</b>";
//objElement = document.layers[div_id];
}
else if (isIE4)
{
con_m=document.all.c_mpa;
con_r=document.all.c_riq;
con_m.innerHTML=="<b>mappa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+map_da_s+"</b>";
con_r.innerHTML="<b>riquadro&nbsp;&nbsp;"+riq_da_s+"</b>";
//objElement = document.all[div_id];
}
else if (isIE5 || isNS6)
{
con_m=document.getElementById('c_map');
con_m.innerHTML="<b>mappa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+map_da_s+"</b>";
con_r=document.getElementById('c_riq');
con_r.innerHTML="<b>riquadro&nbsp;&nbsp;"+riq_da_s+"</b>";


var tbl_l=window.tbl_sch.length;
for(i=0;i<tbl_l;i++)
{
if (i % 2 ==0){
    if (id_scheda==tbl_sch[i].name) window.tbl_sch[i].style.background='#ffedc8';
    else window.tbl_sch[i].style.background='#e8f7fc';
    }

else {
    if (id_scheda==tbl_sch[i].name) window.tbl_sch[i].style.background='#ffedc8';
    else window.tbl_sch[i].style.background='#d7e6fb';
    }
 }
}
zoom_riq(map_da_s,riq_da_s);
//alert(c_n+'\n'+c_e)
punto(c_n,c_e);
mappa3=map_da_s;
riq3=riq_da_s;
}

//************** vai a mappa zoom riquadro *************
function goto_riq2(map_da_s,riq_da_s,set_zoom)
{
//if (window.name=='mainFrame')
    document.mappa.LoadMovie(0,"mappe/mappa"+map_da_s+".swf");

setTimeout("",3000);
reset_zoom();
zoom_riq_via(map_da_s,riq_da_s,set_zoom);
}

//************** zoom riquadro - via *********************
function zoom_riq_via(mappa2,riq,set_zoom)
{
  var filmato=window.document.mappa;
  //document.m_r.map_riq.value=mappa2+riq;
  y=riq.substr(0,1);
  x=riq.substr(1,1);
  // 4 x 4  --- 19 mappe
  if ((mappa2=='03')||(mappa2=='04')||(mappa2=='06')||(mappa2=='08')||(mappa2=='11')||(mappa2=='12')||(mappa2=='13')||(mappa2=='15')||(mappa2=='16')||(mappa2=='17')||(mappa2=='18')||(mappa2=='19')||(mappa2=='20')||(mappa2=='21')||(mappa2=='22')||(mappa2=='23')||(mappa2=='24')||(mappa2=='25')||(mappa2=='29'))
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='C')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
          }
      else if (x=='3')
          {
           setTimeout("dx()",800);
          }
      else
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }

      }

// 4 x 5  --- 5 mappe
else if ((mappa2=='07')||(mappa2=='09')||(mappa2=='10')||(mappa2=='26')||(mappa2=='27'))
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='D')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else if (y=='E')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
          //non fa niente
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);

          }
      else if (x=='3')
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      else
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      }

// 4 x 6 --- 3 mappe
else if ((mappa2=='01')||(mappa2=='02')||(mappa2=='05'))
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='C')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='D')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else if (y=='E')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
          }
      else if (x=='3')
          {
           setTimeout("dx()",800);
          }
      else
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      }
// 5 x 6  --- 2 mappe
//if ((mappa2=='14')||(mappa2=='28'))
else
      {
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      setTimeout("zoom_in()",600);
      if (y=='A')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='B')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='C')
          {
           setTimeout("up()",800);
           setTimeout("up()",800);
          }
      else if (y=='D')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else if (y=='E')
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      else
          {
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
           setTimeout("down()",800);
          }
      if (x=='1')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='2')
          {
           setTimeout("sx()",800);
           setTimeout("sx()",800);
           setTimeout("sx()",800);
          }
      else if (x=='4')
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      else if (x=='5')
          {
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
           setTimeout("dx()",800);
          }
      else {}
      }

if (set_zoom==2)
          {
           setTimeout("zoom_out()",800);
           setTimeout("down()",800);
           setTimeout("zoom_in()",800);
          }
else if (set_zoom==3)
          {
           setTimeout("zoom_out()",800);
           setTimeout("zoom_out()",800);
           setTimeout("down()",800);
           setTimeout("dx()",800);
          }
else if (set_zoom>3)
          {
           setTimeout("zoom_out()",800);
           setTimeout("zoom_out()",800);
           setTimeout("zoom_out()",800);
           setTimeout("zoom_out()",800);
           setTimeout("down()",800);
           setTimeout("dx()",800);
          }
}

//************** apre pagina di info extra *********************
function open_info(cat,nome,mappa,indirizzo,comune,tel1,info1,info2,info3,info4,info5,info6,image,image_size,riq,email,url,num,coord_n,coord_e,id_rif,stampa,fuori_area)
{
if ((mappa>0)&&(mappa<30)) goto_riq(mappa,riq,num,coord_n,coord_e);
else if (fuori_area==1) goto_map(id_rif,stampa);
if (typeof(info) != "undefined" && info.closed == false) info.close();
if ((nome.search("<br>")!=-1)&&(cat.search("<br>")==-1)) {var h = 500; var titolo=nome.replace("<br>"," ");}
else if ((cat.search("<br>")!=-1)&&(nome.search("<br>")==-1)) {var h = 500;}
else if ((nome.search("<br>")!=-1)&&(cat.search("<br>")!=-1)) {var h = 520; var titolo=nome.replace("<br>"," ");}
else {var h = 480; var titolo=nome;}
if ((email!='')&&(email!=' ')&&(email!='undefined')) h=(1*h)+15;
if ((url!='')&&(url!=' ')&&(url!='undefined')) h=(1*h)+15;
if ((info1.length+info2.length+info3.length+info4.length+info5.length+info6.length)>400) h=(h*1)+15;
if ((info1.length+info2.length+info3.length+info4.length+info5.length+info6.length)>450) h=(h*1)+15;
if ((info1.length+info2.length+info3.length+info4.length+info5.length+info6.length)>500) h=(h*1)+15;
if ((info1.length+info2.length+info3.length+info4.length+info5.length+info6.length)>550) h=(h*1)+15;
//var dimensioni= "width=330,height="+h+",resizable='0',scrollbar='auto'";
var dimensioni= "width=336,height="+h+",resizable=0";
var info = window.open("","extra_info",dimensioni);
var img_h;
if (image_size=='medium') img_h=178;
if (image_size=='high') {img_h=274; h=h+20;}
info.document.write("<html>\n<head>\n<title>Info: "+titolo+"</title>\n<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>\n");
info.document.write("\n<link rel='stylesheet' href='dove.css' type='text/css'>");
info.document.write("\n</head>\n<body bgcolor='#FEFEFE' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>\n");
info.document.write("\n<table width='330' height='"+h+"' border='0' cellspacing='0' cellpadding='3' align='center' name='tbl_info'>\n");
info.document.write("\n<tr bgcolor='#0099CC'>\n<td align='center' height='8' class=info-categ><b> \n");
info.document.write("\n"+cat+"</b></td></tr>\n<tr><td align='center' height='2' class=info-title>"+nome);
if (image!='') info.document.write("\n<tr><td height="+img_h+" valign='top' align='center'><img src='images/pub/"+image+"' width='250' height="+img_h+"></td></tr>");
info.document.write("\n</td></tr>\n<tr><td align='left' valign='top' class=info-text><blockquote>");
if (info1!='') info.document.write(info1+"<br>\n");
if (info2!='') info.document.write(info2+"<br>\n");
if (info3!='') info.document.write(info3+"<br>\n");
if (info4!='') info.document.write(info4+"<br>\n");
if (info5!='') info.document.write(info5+"<br>\n");
if (info6!='') info.document.write(info6+"<br>\n");
var conta=0;
if ((email!='')&&(email!=' ')&&(email!='undefined'))
   {
    var array_email=email.split(' ');
    var i;
    var l=array_email.length;
    if (l=='1') info.document.write("<br>E-mail: <a href=mailto:"+array_email[0]+">"+array_email[0]+"</a>");
    else
      {
       for (i=0;i<l;i++)
        {
         if (i=='0') info.document.write("<br>E-mail: <a href=mailto:"+array_email[i]+">"+array_email[i]+"</a>");
         else info.document.write("<br>&nbsp;oppure: <a href=mailto:"+array_email[i]+">"+array_email[i]+"</a>");
         if (i>0) conta=conta+10;
        }
      }
    }

if ((url!='')&&(url!=' ')&&(url!='undefined'))
   {
    var array_url=url.split(' ');
    var i;
    var l=array_url.length;
    if (l=='1'){
     if (array_url[0]=='www.diocesipescara.it') info.document.write("<br><a href=http://"+array_url[0]+" target=_blank title='"+array_url[0]+"'>Sito ufficiale della Diocesi</a></a>");
     else info.document.write("<br><a href=http://"+array_url[0]+" target=_blank title='"+array_url[0]+"'>Sito internet</a></a>");}
    else
      {
       for (i=0;i<l;i++)
        {
         if (i=='0'){
          if (array_url[i]=='www.diocesipescara.it') info.document.write("<br><a href=http://"+array_url[i]+" target=_blank title='"+array_url[i]+"'>Sito ufficiale della Diocesi</a>\n");
          else info.document.write("<br><a href=http://"+array_url[i]+" target=_blank title='"+array_url[i]+"'>Sito internet</a>\n");}
         else {
          if (array_url[i]=='www.diocesipescara.it') info.document.write("<br><a href=http://"+array_url[i]+" target=_blank title='"+array_url[i]+"'>Sito ufficiale della Diocesi</a>\n");
          else info.document.write("<br><a href=http://"+array_url[i]+" target=_blank title='"+array_url[i]+"'>altro sito internet</a>");}
         if (i>0) conta=conta+10;
        }
      }
    }

info.document.write("</blockquote></td></tr>\n");
info.document.write("\n<tr bgcolor='#0099CC'><td height='2' valign='center' class=info-pie><blockquote>");
if (tel1=='')
    info.document.write("\n"+indirizzo+" <br> "+comune+"</blockquote></td></tr></table>");
else
    info.document.write("\n"+indirizzo+" <br> "+comune+"<br>tel. "+tel1+"</blockquote></td></tr></table>");
info.document.write("\n</body></html>");
info.document.close();
res=(window.screen.width);
var x,y,plus;

switch (res)
{
 case 800: x=445; y=-4; plus=10; break;
 case 1024: x=565; y=5; plus=15; break;
 case 1152: x=300; y=30; plus=50; break;
 case 1280: x=700; y=30; plus=60; break;
 case 1600: x=300; y=30; plus=90; break;
 default: x=300; y=1; plus=20; break;
}
info.moveTo (x,y);
info.resizeTo('336',h+plus+conta);
info.focus();
return false;
}

//************** apre finestra di help *********************
function help()
{
if (typeof(info_help) =='undefined')
{
var dimensioni= "width=650px,height=583px,resizable='0'";
var info_help = window.open("","HELP",dimensioni);
info_help.document.write("<html><head><title>Help</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>\n");
info_help.document.write("<link rel='stylesheet' href='dove.css' type='text/css'></head><body bgcolor='#fefefe' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>\n");
info_help.document.write("<table width='650' border='0' cellspacing='0' cellpadding='0'><tr><td class=help-title height='18' colspan='2'><b>&nbsp;&nbsp;COME FARE LA RICERCA</b></td></tr><tr><td class=bordo-help>&nbsp;&nbsp;&nbsp;</td>\n");
info_help.document.write("<td class=help-text>&nbsp;&Egrave; possibile fare una ricerca in due modi:<br>&nbsp;<b>1</b> - Nel modo classico, cioč riempiendo i campi conosciuti riguardanti la scheda da trovare. <br> &nbsp;&nbsp;Per maggiori dettagli leggere &#039;<b>cerca INFO</b>&#039;.");
info_help.document.write("<br> &nbsp;<b>2</b> - Nel modo innovativo specifico del nostro servizio, cioč semplicemente cliccando su un riquadro della mappa. <br> &nbsp;&nbsp;Per maggiori dettagli leggere &#039;<b>cerca DOVE</b>&#039;. </td> </tr> <tr> <td class=help-title height='18' colspan='2'><b>&nbsp;&nbsp;cerca DOVE</b></td> </tr>\n");
info_help.document.write("<tr> <td class=bordo-help> <p>&nbsp;</p> </td> <td class=help-text> <p>&nbsp;Cliccando su una delle 29 mappe dell&#039;area metropolitana di Pescara, si acceder&agrave; ad essa. <br> &nbsp; Di seguito &egrave; possibile accedere alle informazioni semplicemente cliccando su un punto qualsiasi della mappa.<br> &nbsp; Pi&ugrave; esattamente compariranno le informazioni riferite al riquadro della mappa indicato dal cursore.");
info_help.document.write("<br><img src='images/es_5_help.gif' width='87' height='50' align='top' hspace='10' border='0' alt='Cliccando sul riquadro &quot;c2&quot; della mappa &quot;06&quot; otteremo tutte le schede relative a quel riquadro' name='es_1_help'> <br> &nbsp; In questo modo possiamo conoscere le informazioni di una zona senza sapere nulla (nome, ragione sociale,<br> &nbsp; &nbsp;indirizzo, etc.) riguardo ci&ograve; che cerchiamo, se &egrave;");
info_help.document.write("in quella zona comparir&agrave; tra i risultati. Provate a vedere cosa c&#039;&egrave; <br> &nbsp;&nbsp; nella zona in cui lavorate o abitate... </p> </td> </tr>\n<tr> <td class=help-title colspan='2'><b>&nbsp;&nbsp;cerca INFO</b></td> </tr> <tr> <td class=bordo-help> <p>&nbsp;</p> </td> <td class=help-text> <p>&nbsp;In questa sezione &egrave; possibile fare la ricerca selezionando ");
info_help.document.write("una macro categoria <br>&nbsp;&nbsp;oppure riempiendo i campi di ricerca conosciuti.<br>&nbsp;Le macro categorie non sono abbinabili a nessun altro campo; esse comprendono circa i due terzi delle schede in <br>&nbsp;&nbsp;banca-dati, e sono di facile consulatazione.<br>&nbsp;Per esempio se voglio trovare chi vende <i>mobili da giardino</i>, seleziono <i>casa</i> dalle macro categorie, otterr&ograve; delle <br>&nbsp;&nbsp;sottocategorie da cui scegliere a loro volta ");
info_help.document.write("<i>esterno</i>, quindi arrivo alle categorie vere e proprie ed a questo punto <br>&nbsp;&nbsp;seleziono <i>arredi e mobili per giardini e terrazze</i> ed ottengo le schede cercate. <br>&nbsp;Provate a farlo anche voi, &egrave; pi&ugrave; facile farlo che dirlo!<br>&nbsp;Per quanto riguarda la ricerca pi&ugrave; classica si possono combinare i seguenti campi: <br>&nbsp;&nbsp;un marchio (<b>acme</b>) o una categoria (<b>edilizia</b>) ovvero un oggetto (<b>bicicletta</b>),");
info_help.document.write(" la denominazione, &nbsp;l&#039;indirizzo, <br>&nbsp;&nbsp;il numero civico, la mappa (o eventualmente mappa e riquadro), il cap, il comune ed il telefono.<br> &nbsp;Pi&ugrave; campi si combinano e pi&ugrave; precisi saranno i risultati della ricerca, ma si rischia di non trovarne affatto a causa <br> &nbsp;&nbsp;dell&#039;inesattezza anche di uno solo dei dati inseriti. Quindi conviene inserire i soli dati sicuri.");
info_help.document.write("</td> </tr> <tr> <td class=help-title colspan='2'><b>&nbsp;&nbsp;cerca VIE</b></td> </tr> <tr> <td class=bordo-help height='62'> <p>&nbsp;</p>\n</td> <td class=help-text height='62'> <p>&nbsp;In questa sezione oltre alle vie &egrave; possibile trovare altri toponimi importanti quali: stazioni ferroviarie, aerostazioni, <br> &nbsp; porti, nomi di quartiere, ecc.<br> &nbsp;Anche per questa ricerca conviene inserire parole ");
info_help.document.write("sicuramente contenute nel nome della via cercata.<br> &nbsp;Es.: digitando <i>sandro</i> troveremo <i>Volta, Manzoni, Pertini e altri</i>.<br> &nbsp;Non &egrave; necessario specificare via, viale, piazza, corso, ecc.<br> &nbsp; Inoltre &egrave; possibile cercare le vie di una zona semplicemente cliccandoci sopra.<br>&nbsp;Per di pi&ugrave; cliccando sul link <i>cerca info</i> vengono fuori le schede informative relative a quel toponimo.</p> </td> </tr></table></body></html>");
info_help.document.close();
info_help.moveTo (60,1);
info_help.focus();
}
else info_help.focus();
return false;
}

//************** preloading *********************
var preload = new Array();
function preloading()
{
 for (i=0; i<preloading.arguments.length; i++)
      {
      preload[i] = new Image();
      preload[i].src = preloading.arguments[i];
      }
}

//************** metti il punto sulla mappa *********************
function punto(nord,est)
{
var mappa=window.document.mappa;
mappa.SetVariable('est',est);
mappa.SetVariable('nord',nord);
mappa.SetVariable('flag',"1");
}

//************** togli il punto dalla mappa *********************
function azzera()
{
var mappa=window.document.mappa;
mappa.SetVariable('est',"");
mappa.SetVariable('nord',"");
mappa.SetVariable('flag',"0");
}

//************** apre info - bottone grigio *********************
function info_but()
{
if (typeof(info_but) =='undefined')
{
var dimensioni= "width=200px,height=150px,resizable='0'";
var info_but= window.open("","info_but",dimensioni);
info_but.document.write("<html>\n<head>\n<title>info grigio- info blu</title>\n<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>\n");
info_but.document.write("\n</head>\n<body  leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>\n");
info_but.document.write("<table width=100% border='0' cellspacing='0' cellpadding='0'><tr><td><img src='images/no_info.gif' border='0' width='200' height='150' hspace='0' vspace='0' alt='informazioni'></td></tr></table>");
info_but.document.write("\n</body></html>");
info_but.document.close();
res=(window.screen.width);
switch (res)
{
 case 800: x=600; y=200; break;
 case 1024: x=600; y=200; break;
 case 1152: x=300; y=200; break;
 case 1280: x=700; y=200; break;
 case 1600: x=700; y=200; break;
 default: x=300; y=200; break;
}
info_but.moveTo (x,y);
info_but.focus();
}
else info_but.focus;
return false;
}

//************** seleziona macro categorie *********************
function cerca_select()
{
var macro=document.form_cerca_info.cat_select.value;
var loc='main_search.php?cerca_cosa=cosa&cat_altro=&cat_select='+macro;
window.parent.mainFrame.location.href=loc;
return false;
}

// controllo del form-mail
function controllo_mod()
{
var error='';
var focused=false;;
var form=document.form_dati;
var variazione='';
var i;
for (i=0;i<form.variazione.length;i++)
{
 if (form.variazione[i].checked==true) variazione=form.variazione[i].value;
}
var altro=form.altro2.value;
var rasoc=form.rasoc2.value;
var desc=form.attivita2.value;
var indirizzo=form.indirizzo2.value;
var cap=form.cap2.value;
var comune=form.comune2.value;
var tel=form.telefono2.value;
var fax=form.fax2.value;
var email=form.e_mail2.value;
var piva=form.CF_P_IVA2.value;
var pr=form.pr2.value;

if ((variazione=='')&&(altro==''))
    error="- Selezionare un tipo di operazione (inserimento, modifica, cancellazione od altro)\n";
if ((variazione=='altro')&&(altro==''))
    {
     error='- Specificare il campo "altro"\n';
     if (focused==false)
       {
        form.altro2.focus();
        focused=true;
       }
    }
if ((variazione!='altro')&&(variazione!='')&&(altro!=''))
    {
     error='- Scegliere "altro" per specificare qualche cosa in particolare, oppure cancellare il contenuto del campo "altro"\n';
     if (focused==false)
       {
        form.altro2.focus();
        form.altro2.select();
        focused=true;
       }
    }

if ((altro!='')&&(variazione==''))
    form.variazione[3].checked=true;

if (rasoc=='')
    {
     error=error+'- Compilare il campo "denominazione"\n';
     if (focused==false)
       {
        form.rasoc2.focus();
        focused=true;
       }
    }

if (desc=='')
    {
     error=error+'- Compilare il campo "descrizione"\n';
     if (focused==false)
       {
        form.attivita2.focus();
        focused=true;
       }
    }

if (indirizzo=='')
    {
     error=error+'- Compilare il campo "indirizzo"\n';
     if (focused==false)
       {
        form.indirizzo2.focus();
        focused=true;
       }
    }

if (cap=='')
    {
     error=error+'- Compilare il campo "cap"\n';
     if (focused==false)
       {
        form.cap2.focus();
        focused=true;
       }
    }

if (comune=='')
    {
     error=error+'- Compilare il campo "comune"\n';
     if (focused==false)
       {
        form.comune2.focus();
        focused=true;
       }
    }

if (pr=='')
    {
     error=error+'- Compilare il campo "delegato alle relazione esterne"\n';
     if (focused==false)
       {
        form.pr2.focus();
        focused=true;
       }
    }

if (((cap.length!=5)&&(cap.length!=0))||((cap.search(/[0-9]{5}/)!=0))&&(cap.length!=0))
    {
     error=error+'- Controllare l\'esattezza del campo "cap"\n';
     if (focused==false)
       {
        form.cap2.focus();
        form.cap2.select();
        focused=true;
       }
    }

if ((tel.length!='')&&(tel.search(/[^a-z]/ig)!=0))
    {
     error=error+'- Controllare l\'esattezza del campo "telefono"\n';
     if (focused==false)
       {
        form.telefono2.focus();
        form.telefono2.select();
        focused=true;
       }
    }

if ((fax.length!='')&&(fax.search(/[^a-z]/ig)!=0))
    {
     error=error+'- Controllare l\'esattezza del campo "fax"\n';
     if (focused==false)
       {
        form.fax2.focus();
        form.fax2.select();
        focused=true;
       }
    }
// PHP        "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$
// javascript /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/
// alert(email.search(/^((([a-z0-9-])+([a-z0-9-\.]*))@(([a-z0-9-.])+([a-z]{2,})))/) ); ok
if ((email.length!='')&&(email.search(/^((([a-z0-9-])+([a-z0-9-\.]*))@(([a-z0-9-.])+([a-z]{2,})))/)!=0))
    {
     error=error+'- Controllare l\'esattezza del campo "e-mail"\n';
     if (focused==false)
       {
        form.e_mail2.focus();
        form.e_mail2.select();
        focused=true;
       }
    }

if (error!='')
    {
     error='ATTENZIONE! - errori nella compilazione del modulo:\n'+error;
     alert (error);
    }
if (error!='') return false;
else form.controllo.value='';
}

//-->