function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// apertura immagini
<!--

PositionX = 100;
PositionY = 100;
defaultWidth = 660;
defaultHeight = 740;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about :blank','',optNN);}
if (isIE){imgWin=window.open('about :blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.moveTo(10,10);');
writeln('window.resizeTo(100,100);');
writeln('window.scrollTo(10000,10000);');
writeln('window.resizeBy(document.body.scrollLeft,document.body.scrollTop);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onClick="self.close()">');
writeln('<a href="#"><img name="George" src='+imageURL+' border="0" style="display:block" alt=".:: close ::."></a></body></html>');
close();
}}

// validazione per modulo
function checkrequired(which) { 

var pass=true

requiredmail=roccagelli.requiredmail.value; 
 

   if (requiredmail.indexOf("@")==-1) { 
     alert ("Inserisci un'email valida"); 
     return false; 
   } 


if (document.images){

for (i=0;i<which.length;i++){

var tempobj=which.elements[i]

if (tempobj.name.substring(0,8)=="required"){

if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){

pass=false

break

}

}

}

}

if (!pass){

alert("Non hai compilato correttamente il form. Alcune informazioni non sono state inserite. Clicca su OK e verifica l'errore")

return false

}

else

return true
}
function obw(theURL,winName,features)
{window.open(theURL,winName,features);}
function iFrameHeight(win) {
if (!document.all) 
with (win){
   h=window.innerHeight
   win.height=h
 }
else
{
  h = document.frames('iframename').document.body.scrollHeight;
  document.all.iframename.style.height = h;
 }
}
//-->
// funzione stampa
function stampa_popup() {
var testo = "<html><head><title>"+document.title+"</title><link href=../a_copia_sito_toscana//"/stile.css/" rel=\"stylesheet\" type=\"text/css\"></head>";
testo += "<body><table width=\"100%\" border=\"0\"><tr><td class=\"percorsi\"><center><a href=\"javascript:print();\">Clicca per stampare</a><br></td></tr>";
testo += "<tr><td class=\"percorsi\">";
testo += document.getElementById('stampa').innerHTML+"</td></tr>";
testo += "<tr><td class=\"percorsi\" height=\"65\"><center><a href=\"javascript:print();\">Clicca per stampare</a></td></tr></table>";
testo += "</body></html>";
var ident_finestra = window.open("","finestra_stampa","height=250,width=458,scrollbars=yes");
ident_finestra.document.open();
ident_finestra.document.write(testo);
ident_finestra.document.close();
}
//-->
