/*********************************
 *        messagebox.js          *
 *                               *
 * Library for viewing windows-  *
 * like message boxes and modal  *
 * dialogs                       *
 *********************************/

 
 
var _dlgretval = -1;
function _retvalhandler(retval) {
  _dlgretval = retval;
}

function modalDialog(filename, width, height, centered) {
  if ((centered) && (centered=true)) {
    aw = screen.width;
    ah = screen.height;
    // check for double-size and double-height configurations
    if (aw>1900) {
      // double width
      aw=aw/2; // half it
    }
    if (ah>1300) {
      ah=ah/2; // half it
    }
    leftpos = (aw-width)/2;
    toppos = (ah-height)/2;
  }
  scrollbar = "; scroll: 0";
  resizing = "; resizable: 0";
  if ((centered) && (centered=true))
    return window.showModalDialog(filename,null,"dialogWidth: "+width+"px;dialogheight: "+height+"px, "+
                                           "dialogLeft: "+leftpos+"px;dialogTop: "+toppos+"px;help: 0;status: 0"+scrollbar+resizing);
  else
    return window.showModalDialog(filename,null,"dialogWidth:"+width+"px;dialogheight:"+height+"px;help: 0;status: 0"+scrollbar+resizing);
}

var MSG_ICON_INFORMATION = 1;
var MSG_ICON_QUESTION = 2;
var MSG_ICON_WARNING = 3;
var MSG_ICON_ERROR = 4;

function messagebox(text,title,icon,buttons) {
  return modalDialog("messagebox.php?title="+escape(title)+"&text="+escape(text)+"&buttons="+escape(buttons)+"&icon="+escape(icon),
                     350, 150, true);
}


function update(fileid, order){
alert (fileid);
alert (order);
}
