var state = 'hidden';
var real_height = '0px';
var real_width = '990px';
var real_left = '-999px';
var positioning = 'absolute';


function showhide(layer_ref) {
  if (state == 'visible') {
    state = 'hidden';
    real_height = '0px';
    real_width = '990px';
    real_left = '-999px';
    positioning = 'absolute';
  } else {
    state = 'visible';
    real_height = '200px';
    real_width = '100%';
    real_left = '0px';
    positioning = 'relative';
  }

  setproperties(layer_ref);

}

function setproperties(layer_ref) {
  if (document.all) { //IS IE	4	or 5 (or 6 beta)
    eval("document.all." + layer_ref + ".style.visibility = state");
    eval("document.all." + layer_ref + ".style.height = real_height");
    eval("document.all." + layer_ref + ".style.left = real_left");
    eval("document.all." + layer_ref + ".style.width = real_width");
    eval("document.all." + layer_ref + ".style.position = positioning");
  }

  if (document.layers) { //IS	NETSCAPE 4 or	below
    document.layers[layer_ref].visibility = state;
    document.layers[layer_ref].height = real_height;
    document.layers[layer_ref].left = real_left;
    document.layers[layer_ref].width = real_width;
    document.layers[layer_ref].position = positioning;

  }

  if (document.getElementById && !document.all) {
    var maxwell_smart = document.getElementById(layer_ref);
    maxwell_smart.style.visibility = state;
    maxwell_smart.style.height = real_height;
    maxwell_smart.style.left = real_left;
    maxwell_smart.style.width = real_width;
    maxwell_smart.style.position = positioning;
  }
}

function confirmButton(element1, element2, errorMsg) {

  if (element2.value == "") {
    if (document.all) { //IS IE	4	or 5 (or 6 beta)
      eval("document.all." + errorMsg + ".style.visibility = 'visible'");
    }

    if (document.layers) { //IS	NETSCAPE 4 or	below
      document.layers[errorMsg].visibility = 'visible';
    }

    if (document.getElementById && !document.all) {
      maxwell_smart = document.getElementById(errorMsg);
      maxwell_smart.style.visibility = 'visible';
    }

    return false;
  } else {
    if (document.all) { //IS IE	4	or 5 (or 6 beta)
      eval("document.all." + errorMsg + ".style.visibility = 'hidden'");
    }

    if (document.layers) { //IS	NETSCAPE 4 or	below
      document.layers[errorMsg].visibility = 'hidden';
    }

    if (document.getElementById && !document.all) {
      var maxwell_smart = document.getElementById(errorMsg);
      maxwell_smart.style.visibility = 'hidden';
    }

    return true;

  }
}
