function zoom_hq(fn, w, h)
{ var aw = screen.width
  var ah = screen.height
  var sx = parseInt(w) + 12
  var sy = parseInt(h) + 46 //38
  var x = (aw < sx)?0:(aw-sx)/2
  var y = (ah < sy)?0:(ah-sy)/2
  var dx = (aw < sx)?aw:sx
  var dy = (ah < sy)?ah:sy
  if ((zoom_win) && !zoom_win.closed)
  { zoom_win.close()
    zoom_win = null
  }
  zoom_win = window.open('', '', 'toolbar=no, location=no, directories=no, menubar=no, scrollbars=no, resizable=yes, status=no, width='+dx+', height='+dy+', innerWidth='+dx+', innerHeight='+dy+', top='+y+', left='+x)
  if (zoom_win)
  { zoom_win.moveTo(x, y)
    zoom_win.resizeTo(dx, dy)
    zoom_win.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n")
    zoom_win.document.write("\"http://www.w3.org/TR/html4/loose.dtd\">\n")
    zoom_win.document.write("<html>\n")
    zoom_win.document.write("<head>\n")
    zoom_win.document.write("<title>"+document.title+"</title>")
    zoom_win.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n")

    var i, cacheobj, t
    for(i=0; (cacheobj=document.getElementsByTagName("link")[i]); i++)
    { if(cacheobj.getAttribute("rel").toLowerCase().indexOf("stylesheet")!=-1)
       break;
    }
    
    zoom_win.document.write("<link href='"+cacheobj.href+"' rel='stylesheet' type='text/css'>\n")
    zoom_win.document.write("</head>")
    zoom_win.document.write("<body>")
    zoom_win.document.write("<div align='center'>")
    zoom_win.document.write("<a href='javascript:window.close()'><img id='zoom_img' name='zoom_img' src='"+fn+"' width='"+w+"px' height='"+h+"px' alt='' title=\""+document.title+"\" /></a>")
    zoom_win.document.write("</div></body>")
    zoom_win.document.write("</html>")
  }
  return true
 }
 
 function post_vars(v)
 { f = document.createElement("form")
   document.body.appendChild(f)
   //f.action = "?section=ps&cat="+id
   f.method = "POST"
   for (t = 0; t < v.length; t++)
   { e = document.createElement("input")
     e.type = "hidden"
     ev = v[t].split("=")
     e.id = ev[0]
     e.name = ev[0]
     e.value = ev[1]
     f.appendChild(e)
   }
   for (t=0; t < tree.length; t++)
   { e = document.createElement("input")
     e.type = "hidden"
     e.id = "pcat_is_opened|"+tree[t].cat			//Al Submit viene inviato il 'name', non 'id'
     e.name = "pcat_is_opened|"+tree[t].cat
     e.value = tree[t].isopened
     f.appendChild(e)
   }
   f.action = "index.php"
   f.submit()
 }
 
 function create_list_to_post(v)
 { var s=new Array(), val
   
   for (t=0; t < v.length; t++)
   { o=attach(v[t])
     switch (o.type.substr(0,3))
     { case 'tex':
        val = o.value
        break;
       case 'sel':
        for (k=0,ff=true,val=""; k < o.options.length; k++)
        { if (o.options[k].selected)
          { if (!ff)
             val = val + "|"
            val = val + o.options[k].value.toString()
            ff=false
          }
        }
        break;
     }
     s[s.length] = v[t] + "=" + escape(val)
   }
   return s
 }
 
 function search_in_array(v, val)
 { var vv = new Array()
   var ev = new Array()
   //var eval = val.split('=')
   var eval = new Array()
   
   eval[0] = val.substr(0,val.indexOf('='))
   eval[1] = val.substr(val.indexOf('=')+1)
   for (var t = 0; t < v.length; t++)
   { ev = v[t].split('=')
     if (ev[0] == eval[0])
     { vv[0] = t
       vv[1] = ev[0]
       vv[2] = eval[1]
       return vv
     }
   }
   return false
 }
 
/*
function intercetta() 
{ for (var i=0; i<document.links.length; i++)
   if (document.links.className=="blank" ) 
   { document.links.target="_blank"; }
}

window.onload = intercetta;
*/