/*
  Copyright (C) Program Produkt 2004-2006
  All rights reserved
  Author: Laszlo Grad <laszlo.grad@programprodukt.hu>
*/
function openwin(aurl, awidth, aheight, ahorisontalalign, averticalalign, aframe) {
  if (awidth==undefined) { width=400; } else { width=awidth; }
  if (aheight==undefined) { height=300; } else { height=aheight; }
  if (ahorisontalalign==undefined) { horisontalalign='left'; } else { horisontalalign=ahorisontalalign; }
  if (averticalalign==undefined) { verticalalign='top'; } else { verticalalign=averticalalign; }
  if (aframe==undefined) { frame='_blank'; } else { frame=aframe; }

  if (horisontalalign=='left') {
    leftpos=0;
  } else if (horisontalalign=='right') {
    leftpos=screen.width-width;
  } else {
    leftpos=(screen.width-width)/2;
  }

  if (verticalalign=='top') {
    toppos=0;
  } else if (verticalalign=='bottom') {
    toppos=screen.height-height;
  } else {
    toppos=(screen.height-height)/2;
  }

  win=window.open(aurl, frame, 'resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,directories=0,menubar=0,screenX='+leftpos+',screenY='+toppos+',top='+toppos+',left='+leftpos+',width='+width+',height='+height);
};
