/* Nasty fix to set the width of absolutely positioned main-content
 * box to something suitable */

/* Is my browser the sort of stuff one finds in green bags hanging
 * from hedgerows? */

function Set_Content_Width() {
  if(navigator.appName == "Microsoft Internet Explorer") {
    var x = document.getElementById('main-content');
    var wd = document.body.clientWidth;
    wd = wd - 230;
    x.style.width = wd+'px';
  }
  return true;
}

/* This is the right place to fix the most egregious browser bug that
 * even Microsoft have been capable off.  I refer to the
 * jaw-droppingly dumb balls-up they make of submitting "button"
 * elements in IE6 - unless you know a better one. */

function Finagle_Submit_Button(el) {
  if(navigator.appName != "Microsoft Internet Explorer")
      // huge sigh of relief, exit harmlessly
      return true;
  // ms's own code - but I've checked it very carefully!
  var rv = -1; // Return value assumes failure.
  var ua = navigator.userAgent;
  var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  // end of ms code
  if(rv != -1 && rv < 7) {
      a = document.getElementById("ie6_really_is_a_pile_of_dung");
      if(a)
	  a.value = el.name;  // stick button clicked into variable
  }
  return true;
}
