var newwindow=null;
var popWIN = null;

function viewform(Str){
        
        if (newwindow != null){
                if (newwindow.closed == false) { newwindow.close(); }
                newwindow=null;
                setTimeout("viewform('"+Str+"')",200)
                return;
        }

       if (newwindow == null || newwindow.closed){
            newwindow = window.open(Str,"Documento","width=300,height=310,scrollbars=1,toolbar=no,status=no,location=no,directories=no,resizable=no,screenX=10,screenY=10,top=10,left=10")

      }else{
              newwindow.document.location=Str;
      }
   }

var newwindow=null;

function popupmappa(Str){
        
        if (newwindow != null){
                if (newwindow.closed == false) { newwindow.close(); }
                newwindow=null;
                setTimeout("popupmappa('"+Str+"')",100)
                return;
        }

       if (newwindow == null || newwindow.closed){
            newwindow = window.open(Str,"Documento","width=740,height=580,scrollbars=1,toolbar=no,status=no,location=no,directories=no,resizable=no,screenX=10,screenY=20,top=20,left=10")

      }else{
              newwindow.document.location=Str;
      }
   }

function popup(Str,w,h, opts){
      if (popWIN != null){
                if (popWIN.closed == false) { popWIN.close(); }
                popWIN=null;
                setTimeout("popup('"+Str+"',"+w+","+h+",'"+opts+"')",100)
                return;
        }

      if (popWIN == null || newwindow.closed){
            if ( opts == null || opts == '' ) {
              opts = 'scrollbars=1,resizable=no,'; 
            } else {
              opts += ',';
            }
            popWIN = window.open(Str,"Documento","width="+w+",height="+h+","+opts+"toolbar=no,status=no,location=no,directories=no,screenX=10,screenY=20,top=20,left=10")

      }else{
              popWIN.document.location=Str;
      }
   }



var newwindow=null;

function chisiamo(Str){
        
        if (newwindow != null){
                if (newwindow.closed == false) { newwindow.close(); }
                newwindow=null;
                setTimeout("chisiamo('"+Str+"')",200)
                return;
        }
       if (newwindow == null || newwindow.closed){
            newwindow = window.open(Str,"Doc","width=658,height=448,scrollbars=1,toolbar=no,status=no,location=no,directories=no,resizable=no,screenX=3,screenY=102,top=102,left=3")

      }else{
              newwindow.document.location=Str;
      }
   }
var newwindow=null;

function viewform2(Str){
        
        if (newwindow != null){
                if (newwindow.closed == false) { newwindow.close(); }
                newwindow=null;
                setTimeout("viewform2('"+Str+"')",200)
                return;
        }

       if (newwindow == null || newwindow.closed){
            newwindow = window.open(Str,"Documento","width=450,height=310,scrollbars=1,toolbar=no,status=no,location=no,directories=no,resizable=no,screenX=10,screenY=10,top=10,left=10");

      }else{
              newwindow.document.location=Str;
      }
   }


function openWindow(src, gad, width, height)
{
        if (gad == 'AGR') {
               attr = "width=" + width + ",height=" + height+ ",scrollbars=no,toolbar=no,status=no,location=no,directories=no,resizable=no,screenX=10,screenY=15";
        }
        else { 
               attr = "width=" + width + ",height=" + height+ ",scrollbars=yes,toolbar=no,status=no,location=no,directories=no,resizable=no,screenX=10,screenY=15";
        }
        newwindow = open(src, gad , attr);
}

function openInfoWindow(url,width,height)
{
        newwindow = open(url, "info","width="+width+",height="+height+",scrollbars=1,toolbar=no,status=no,location=no,directories=no,resizable=yes");
        //newwindow.focus();
}


//	window.onerror = null;




function imgOpen(id) {
       width='600';
       height='600';
       document.open("/dettaglio_foto.pl?id="+id, "info","width="+width+",height="+height+",scrollbars=1,toolbar=no,status=no,location=no,directories=no,resizable=yes");

}


