// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function openWindow(url, name, width, height, scroll, status) {
  var left,up,w;
  if (!width)
    width=350;
  if (!height)
    height=450;
  if (!scroll)
    scroll='yes';
  if (!status)
    status='no';

  left = (screen.availWidth/2)-(width/2)-5;
  up   = (screen.availHeight/2)-(height/2);
  if (left < 0)
    left = 0;
  if (up < 0)
  up = 0;
  w = window.open(url,name,'width='+width+',height='+height+',top='+up+',left='+left+',scrollbars='+scroll+',toolbar=no,location=no,status='+status+',resizable=yes,resizeable=yes');
  w.focus();
}
