function popper(thisUrl,thisWidth,thisHeight,thisTop,thisLeft)
{
var optionString,mainWin;
optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=no,menubar=no,resizable=no,scrollbars=no');
mainWin = window.open(thisUrl,"",optionString);
}

function popperScroll(thisUrl,thisWidth,thisHeight,thisTop,thisLeft)
{
var optionString,mainWin;
optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=no,menubar=no,resizable=no,scrollbars=yes');
mainWin = window.open(thisUrl,"",optionString);
}

/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 * @param   object   the background color
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }

    return true;
} // end of the 'setPointer()' function

function disableButtons() {
  var num_elem, num_forms;

  num_forms = window.document.forms.length;
  for (var i=0; i <num_forms; i++) {
    num_elem = window.document.forms[i].elements.length;
    for (var j=0; j<num_elem; j++) {
    frm = window.document.forms[i];
      if (frm.elements[j].type == 'submit') {
         frm.elements[j].disabled='true';
      }
      if (frm.elements[j].type == 'button') {
         frm.elements[j].disabled='true';
      }
      if (frm.elements[j].type == 'reset') {
         frm.elements[j].disabled='true';
      }
    }
  }
}
