/*
* general utitily javascript functions
*
**/


/**
 * @author rks
 * @access public
 * this function openups a new popup window
 * @return void
 **/

function popupWindow(url, nw, x, y, w, h, atts){
  nw = nw || "mywin";
  atts = atts || "menubar,resizable,scrollbars";
  w = w || 600;
  h = h || 450;
  x = (typeof x=="number")? x: window.opera? 100: Math.round( (screen.availWidth - w)/2 );
  y = (typeof y=="number")? y: window.opera? 20: Math.round( (screen.availHeight - h)/2 );

  atts += ',width='+w+',height='+h+',left='+x+',top='+y;
  var win = window.open(url, nw, atts);
  if (win) {
    if (!win.closed) { win.resizeTo(w,h); win.moveTo(x,y); win.focus(); return false; }
  }
  return true;
}

