var DHTML = (document.getElementById || document.all || document.layers);
var verbose = true;

if(!DHTML)
  alert('No compatible layer support in browser!');

// Get the div or span object
function getObj(name) {
  if (document.getElementById) {
    this.obj = document.getElementById(name);
    //this.obj.innerHTML = 'Foobar';
    this.style = document.getElementById(name).style;
  }
  else if (document.all) {
    this.obj = document.all[name];
    this.style = document.all[name].style;
  }
  else if (document.layers) {
    this.obj = document.layers[name];
    this.style = document.layers[name];
  }
  return this.obj;
}

function update(object, string) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.innerHTML = string;
}

function append(object, string) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  /*alert(string);*/
  o.innerHTML += string + '<br/>';
}

function show(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.visibility = 'visible';
}

function showAsBlock(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.visibility = 'visible';
  o.style.display = 'block';
}

function showDetails() {
  if (!DHTML)
    return;
  var o = new getObj('details');

  o.style.visibility = 'visible';
}

function showFullText(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.visibility = 'visible';
  o.style.display = 'block';
}

function ready(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.color = '#000000';
  o.style.borderBottom = '2px solid #dddddd';
}

function done(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.color = 'green';
  o.style.borderBottom = '0';
}

function failed(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.color = 'red';
  o.style.borderBottom = '0';
}

function hide(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.visibility = 'hidden';
  o.style.display = 'none';
}

function hideBlock(object) {
  if (!DHTML)
    return;
  var o = new getObj(object);
  o.style.visibility = 'hidden';
  o.style.display = 'none';
}

function redirect(location) {
  window.location = location;
}

function edit(url)
{
  newWindow = window.open(url,'name','height=550,width=1100');
  if (window.focus) {
    newWindow.focus()
  }
  return false;
}

function check(field) {
    for (i = 0; i < field.length; i++) {
        field[i].checked = true;
    }
}