var IE=(navigator.appName.indexOf('Microsoft') != -1);

if (document.getElementById) { 		//NN6 or newer and IE6 or newer
  layerRef="document.getElementsByTagName('div')";
  styleSwitch=".style";
  textSwitchOn="'visible'";
  textSwitchOff="'hidden'";

} else if (document.all) { 			//old IE
  layerRef="document.all";
  styleSwitch=".style";
  textSwitchOn="'visible'";
  textSwitchOff="'hidden'";
}

else if (document.layers) { 			//old NS

  layerRef="document.layers";
  styleSwitch="";
  textSwitchOn="'show'";
  textSwitchOff="'hide'";

}

function showLayer(layerName) {

  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility='+textSwitchOn);

}

function hideLayer(layerName) {

  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility='+textSwitchOff);

}

if (IE) {
  document.writeln("<style>");
  document.writeln("#speakers { z-index:1 }");
  document.writeln("#directors { z-index:1 }");
  document.writeln("#about { z-index:1 }");
  document.writeln("#past { z-index:1 }");
  document.writeln("</style>");
} else {
  document.writeln("<style>");
  document.writeln("#speakers { z-index:1; border: thin solid #000000 }");
  document.writeln("#directors { z-index:1; border: thin solid #000000 }");
  document.writeln("#about { z-index:1; border: thin solid #000000 }");
  document.writeln("#past { z-index:1; border: thin solid #000000 }");
  document.writeln("</style>");
}

function center() {
  var width = 0;
  if (window.navigator.appName == "Netscape") { width = window.innerWidth }
  if (window.navigator.appName == "Microsoft Internet Explorer")  { width = document.body.clientWidth }
  
  var center_speakers = ((width-650>=0) ? ((width-650)/2 + 84) : 84);
  var center_directors = ((width-650>=0) ? ((width-650)/2 + 210) : 210);
  var center_about = ((width-650>=0) ? ((width-650)/2 + 330) : 330);
  var center_past = ((width-650>=0) ? ((width-650)/2 + 456) : 456);

  document.getElementsByTagName('div')["speakers"].style.left = (center_speakers + "px");
  document.getElementsByTagName('div')["directors"].style.left = (center_directors + "px");
  document.getElementsByTagName('div')["about"].style.left = (center_about + "px");
  document.getElementsByTagName('div')["past"].style.left = (center_past + "px");
}
