function $(id)
{
  return document.getElementById(id);
}
function popup (file)
{
  var dati = 'menubar=no,width=350,height=400,scrollbars=no,resizeable=no,'+center_window (350,400);
  var wind = window.open (file, 'popup', dati);
  wind.focus();
}
function center_window (w, h)
{
  var left = Math.round (screen.availWidth / 2) - Math.round (w / 2);
  var top = Math.round (screen.availHeight / 2) - Math.round (h / 2);
  return 'left='+left+',top='+top;
}
function showpic (pic, ww, hh)
{
  if(ww==''||hh=='') return;
  var rww=ww;var rhh=hh;var scr='no';
  var sww=screen.availWidth;var shh=screen.availHeight-30;
  var cww=Math.round(sww/2)-Math.round(ww/2); var chh=Math.round(shh/2)-Math.round(hh/2);
  if(ww>sww){cww=0;ww=sww;}if(hh>shh){chh=0;hh=shh;ww+=16;scr='yes';}if(ww>sww){ww -= 22;}
  var wnd=window.open('','','menubar=no,width='+ww+',height='+hh+',scrollbars='+scr+',resizeable=no,left='+cww+',top='+chh);
  wnd.document.open();
  var doc = wnd.document;
  doc.write('<html><head><title>Preview</title><head><body onclick="self.close();" style="cursor:pointer;">');
  if (pic.substr (pic.length-4,4) != '.swf') doc.write('<img src="'+pic+'" border="0" width="'+rww+'" height="'+rhh+'" style="position:absolute;left:0px;top:0px">');
  else doc.write('<OBJECT style="position:absolute;left:0px;top:0px" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+rww+' HEIGHT='+rhh+'><PARAM NAME=movie VALUE="'+pic+'"> <PARAM NAME=quality VALUE=high><PARAM NAME=menu VALUE=false><EMBED style="position:absolute;left:0px;top:0px" src="'+pic+'" quality=high bgcolor=#FFFFFF  WIDTH='+rww+' HEIGHT='+rhh+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
  doc.write('</body></html>');
  wnd.document.close();
  wnd.focus();
}

function go (f) { window.location = "#" + f; } 
function on(nos) {if (document.images) document[nos].src = eval(nos + "on.src");}
function off(nos) {if (document.images) document[nos].src = eval(nos + "off.src");}