function new_wind(url_wind)
{
  var popUpWin = window.open("","mywin",'resizable=no,scrollbars=no,width=400,height=400');
  popUpWin.focus();
  popUpWin.document.write("<html><body leftmargin=\"0\" topmargin=\"0\"><SCRIPT>");
  popUpWin.document.write("function imageLoaded()");
  popUpWin.document.write("{");
  popUpWin.document.write("  var mto_x = window.parent.window.screenTop + 10;");
  popUpWin.document.write("  var mto_y = 40;");
  popUpWin.document.write("  width  = cur_img.width+10;");
  popUpWin.document.write("  height = cur_img.height+30;");
  popUpWin.document.write("  new_x = ((screen.availWidth / 2)- (width / 2));");
  popUpWin.document.write("  new_y = ((screen.availHeight / 2) - (height / 2));");
  popUpWin.document.write("  if(new_x<10)new_x = 10;");
  popUpWin.document.write("  if(new_y<10)new_y = 10;");
  popUpWin.document.write("  window.moveTo( new_x, new_y);");
  popUpWin.document.write("  window.resizeTo( width, height);");
  popUpWin.document.write("}");
  popUpWin.document.write("function imageClick()");
  popUpWin.document.write("{");
  popUpWin.document.write("  window.close()");
  popUpWin.document.write("}");
  popUpWin.document.write("</SCRIPT>");
  popUpWin.document.write("<BODY>");
  popUpWin.document.write("<a href=\"#\" onclick=\"imageClick()\"><IMG id=\"cur_img\" SRC=\""+url_wind+"\" onload=\"imageLoaded()\" border=\"0\"></a>");
  popUpWin.document.write("</BODY></body></html>");
}

function GetFile(img, form, text, curl)
{
  var result = showModalDialog("filelist.php?curl="+curl, null , "dialogHeight: 400 px; dialogWidth: 500px; center: yes; edge: sunken; help: no; status: no; scroll: no; resizable: yes;"); 
  if(result)
  {
    if(img)document.images[img].src = result;
    if(text)eval('document.forms[form].' + text + '.value = result;');
  }
} 

