function PopupHandler(name,link,aobj) {
   if (document.getElementById)
      if (document.getElementById(name)) {
         if (aobj) {
            var oA = Position.cumulativeOffset(aobj)
            var oP = Position.cumulativeOffset(document.getElementById(name).parentNode)
            var oH = Math.round(parseInt(document.getElementById(name).style.height,10)/2)
            document.getElementById(name).style.top = (oA[1]-oP[1]-oH>0) ? oA[1]-oP[1]-oH : 0
         }
         if (link) {
            if (typeof DetectFlashVer == "function")
               link += (link.indexOf("?") == -1 ? "?" : "&") + "webFlashEnabled=" + DetectFlashVer(4,0)
            document.getElementById(name).src = link
            document.getElementById(name).style.visibility = 'visible'
         } else
            document.getElementById(name).style.visibility = 'hidden'
      }
}
var globalfile
var popups = new Array()
function open_preview(title,cont,width,height,type) {
   if (type=='image') {
      var content_doc = '\r\n'
      content_doc += '<html><head ><title>'+title+'</title></head>\r\n'
      content_doc += '<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">\r\n'
      content_doc += '<img src="'+cont+'" alt="'+title+'">\r\n';	
      content_doc += '</body></html>\r\n'
      if (popups.length)
         if (!popups[popups.length-1].closed)
            popups[popups.length-1].close()
      popups[popups.length] = window.open('','','status=no,width='+width+',height='+height+',resizable=no,scrollbars=auto,toolbar=no');
      var preview=popups[popups.length-1]
      preview.document.open()
      preview.document.write(content_doc)
      preview.document.close()
      preview.focus()
   } else {
      globalfile = cont
      if (!width) width = 630
      if (!height) height = 400
      var temp = window.open('/cgi-bin/evoweb.dll/wheels?form=getfileopener','DRUCKVERSION','toolbar=yes,status=no,width='+width+',height='+height+',resizable=yes,scrollbars=yes');
   }
}
