function openWin(windowURL, windowName, windowFeatures) { 
  return window.open(windowURL, windowName, windowFeatures); 
} 

function showpic (file, page, width, height) {
var newWindow;
newWindow=openWin(page+"_"+file+".htm","newWin"+width+"_"+height,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+width+",height="+height+",top=50,left=50");
newWindow.focus();
}

function showpage (page, width, height, ttop, lleft) {
var newWindow;
newWindow=openWin(page,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",top="+ttop+",left="+lleft);
newWindow.focus()
}

function add_table(uri_params, width, height, ttop, lleft) {
var newWindow;
var col_num;
col_num=window.prompt("Enter number of columns:", '');
if (isNaN(col_num) || col_num==null || col_num=='') {
window.focus();
} else {
if (uri_params.length) uri_params += '&';
newWindow=openWin("add_table.html?"+uri_params+"col_num="+col_num,"addTable","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",top="+ttop+",left="+lleft);
newWindow.focus();
}
}

function opener_reload(text) {
  window.opener.location.reload();
  window.close();
  window.opener.alert(text);
}

function window_reload(text) {
  window.location.href=window.location.href;
  window.alert(text);
}

function showerror (page, width, height, ttop, lleft) {
  var newWindow;
  newWindow=openWin(page,"errWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",top="+ttop+",left="+lleft);
  newWindow.focus()
}
