function createWindow(url,width,height,location,windowName) {
    if (!windowName) { windowName='popup'; }
    if (!width) { width=500; }
    if (!height) { height=400; }
    if (!location) { location=1; }
    var features =
        'width='        + width +
        ',height='      + height +
        ',directories=' + '0' +
        ',location='    + location +
        ',menubar='     + '0' +
        ',scrollbars='  + '1' +
        ',status='      + '0' +
        ',toolbar='     + '0' +
        ',resizable='   + '1';

    window.open (url, windowName, features);
}

function confirmSubmit(question) {
   var agree=confirm(question);
   if (agree)
      return true ;
   else
      return false ;
}

function openhelp(type,name,scope) {
    var fullurl = scope + ".cgi?printable=1;section=help;method=" + scope + ";" + type + "=" + name;
    window.open(fullurl,"help", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=500,height=450,left=5,top=5")
}


function go()
{
        box = document.forms[0].db_table;
        destination = "?section=logs;subsection=search;db_table=" + box.options[box.selectedIndex].value;
        if (destination) location.href = destination;
}

function change_limits(question,two,three)
{
      var method=question;
        if (method == "add") {  document.nav.limit_start.value = two + three; }
        if (method == "subtract") {  document.nav.limit_start.value = two - three; }
}

function change_limits_form(form,question,two,three)
{
      var method=question;
        if (method == "add") {  form.limit_start.value = two + three; }
        if (method == "subtract") {  form.limit_start.value = two - three; }
}

function checkall(formname,field,boxes)
{
 var x = "formname."+field+".checked";
 var y = eval(x);
 var i;
 for (i = 0; i < boxes; i++) {
   if (y) {
     box = "formname.line"+i+".checked = true";
   }
   else {
     box = "formname.line"+i+".checked = false";
   }
   var result = eval(box);
 }
}

function checkall2(formname,type,boxes)
{
 var form = "document."+formname;
 var x = form+".selectall_"+type+".checked";
 var y = eval(x);
 var i;
 for (i = 0; i < boxes; i++) {
   if (y) {
     box = form+".line"+i+".checked = true";
   }
   else {
     box = form+".line"+i+".checked = false";
   }
   var result = eval(box);
 }
}


