// JavaScript Document

function showLayer(id) {	
  var lyr = getElemRefs(id);
  //if (cur_lyr) hideLayer(cur_lyr);
  if (lyr && lyr.css){   
    lyr.css.visibility = "visible";
  }
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  //if (cur_lyr) hideLayer(cur_lyr);
  if (lyr && lyr.css){  
    lyr.css.visibility = "hidden";
  }
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
 }

function resizeSpacer() {
	
  $winHeight = getWinHeight();
  $i = getElemRefs('spacer');
  
  $adjustedHeight= $winHeight - 50;
  //alert( $adjustedHeight ) ;
  // 300 used to do it for serif font
  $i.height = $adjustedHeight;
}

function getWinHeight(){
  var winW = 630, winH = 460;
  if (document.body && document.body.offsetWidth) {
   winW = document.body.offsetWidth;
   winH = document.body.offsetHeight;
  }
  if (document.compatMode=='CSS1Compat' &&
	  document.documentElement &&
	  document.documentElement.offsetWidth ) {
   winW = document.documentElement.offsetWidth;
   winH = document.documentElement.offsetHeight;
  }
  if (window.innerWidth && window.innerHeight) {
   winW = window.innerWidth;
   winH = window.innerHeight;
  }
  
  return winH;
}
