
/* Display all objects properties */
function show_obj(name, obj) {

  var str = '';
  for( x in obj ) {
    try {
      str += name + "[" + x + "]='" + obj[x] + "'<br />";
    } catch(e) {
      str += name + "[" + x + "]='Unable to read: <font color=red>" + e + "</font>'<br />";
    }
  }
  document.write(str);

}

/* center components with javascript */
function placeComponents() {
  try {
    var holder = document.getElementById('holderbox');
    var body = document.getElementsByTagName('body')[0];

    var bh = body.clientHeight;
    var bw = body.clientWidth;

    var hh = holder.clientHeight;
    var hw = holder.clientWidth;

    holder.style.left = (bw - hw)/2;
    holder.style.top = (bh - hh)/2;
    holder.style.visibility = 'visible';

    //    show_obj('holder', holder);
  } catch(e) { alert('Exception: ' + e);}
}

