function toggleEl( oCaller, sId )
{
   oEl = document.getElementById( sId );
   if ( oEl && oCaller )
   {
      oEl.style.display = ( oCaller.checked ) ? '' : 'none';
   }
}

function popup_picture( sSrc )
{
   ShowDynamicImage( sSrc, 300, 200, '' );
}

function ShowDynamicImage( oImg, width, height, alt )
{
   var scroll;
   scroll="no";
   var top=10, left=10;

   if ( oImg['oImg'] )
      sUrl = oImg.src;
   else
      sUrl = oImg;

   width = Math.min(width, screen.width-10);
   height = Math.min(height, screen.height-28);

   var wnd = window.open( "","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
   wnd.document.write(
   "<html><head>"+
   "<"+"script type=\"text/javascript\">"+
   "function KeyPress(e)"+
   "{"+
   " if ( window.event ) {"+
   "   if (window.event.keyCode == 27) "+
   "     window.close();"+
   " } else if ( e.keyCode == 27 ) {" +
   "   window.close(); }" +
   "}"+
   "</"+"script>"+
   "<title>"+ alt +"</title>"+
   "<style>"+
   "  body { "+
   "    padding : 0;" +
   "    margin  : 0;" +
   "  } "+
   "</style>"+
   "</head>"+
   "<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress(event)\">"+
   "<scri"+"pt type='text/javascript'>"+
//   " if (navigator.userAgent.indexOf('MSIE') != -1 )" +
   " {"+
   "    oImg =  new Image(); oImg.src = '"+sUrl+"';"+
   "    oImg.onload = function() { "+
   "        nW = oImg.width; "+
   "        nH = oImg.height; "+
   "        window.resizeTo( nW + 10, nH + 30 ); "+
   "      } "+
   " }"+
   "</script>"+
   "<img id='img_zzzz' src=\""+sUrl+"\" border=\"0\" alt=\""+alt+"\" />"+
   "</body></html>"
   );
   wnd.document.close();

   return false;
}
