function cpic (pic, ww, hh)
{
  if (ww=='' || hh=='') {return;}
  var rww = ww;
  var rhh = hh;
  var scr = 'no';
  var sww = screen.availWidth;
  var shh = screen.availHeight - 35;
  var cww = Math.round(sww/2)-Math.round(ww/2);
  var chh = Math.round(shh/2)-Math.round(hh/2);
  //alert (ww+'-'+sww);
  if (ww>sww) {cww = 0; ww = sww;}
  if (hh>shh) {chh = 0; hh = shh; ww += 16; scr='yes';}
  if (ww>sww) {ww -= 22;}
  var obj=window.open('', '', 'menubar=no,width='+ww+',height='+hh+',scrollbars='+scr+',resizeable=no,left='+cww+',top='+chh);
  obj.document.clear();
  obj.document.write('<html><head>');
  obj.document.write('<title>http://www.marazalite.lv'+pic+'</title>');
  obj.document.write('<META HTTP-EQUIV="imagetoolbar" CONTENT="no">');
  obj.document.write('<META HTTP-EQUIV="MSThemeCompatible" Content="No">');
  obj.document.write('</head><body bgcolor="#ffffff" topmargin="0" marginwidth="0" marginheight="0" leftmargin="0">');
  if (pic.substr (pic.length-4,4) != '.swf')
  {
    obj.document.write('<img src="'+pic+'" border="0" width="'+rww+'" height="'+rhh+'" alt="">');
  }
  else
  {
    obj.document.write('<OBJECT 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 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>');
  }
  obj.document.write('</body>');
  obj.document.write('</html>');
  obj.document.focus();
  obj.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 popup (file)
{
  var ww = 450;
  var hh = 400;
  var dati = 'menubar=no,width='+ww+',height='+hh+',scrollbars=yes,resizeable=no,'+center_window (ww,hh);
  var wind = window.open (file, 'popup', dati);
  wind.focus();
}

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");}
}

function goBookmark (f)
{
  window.location = "#" + f;
}
