// JavaScript Document
// FUNCTION THAT CHECKS THE DOM 
function getObj(name){
if (document.getElementById)
{this.obj = document.getElementById(name);}
else if (document.all)
{this.obj = document.all[name];}
else if (document.layers)
{this.obj = document.layers[name];}
}

// CENTER WINDOW //
function getWindowHeight() {
var windowHeight=0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body&&document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}

function setSpacing() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var contentElement = new getObj('holder');
var contentHeight = contentElement.obj.offsetHeight;
if (windowHeight - contentHeight > 0) {	
contentElement.obj.style.position = 'relative';
contentElement.obj.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
}
else {
contentElement.obj.style.position = 'relative';
contentElement.obj.style.top = "0px";
}
}
}
}

// START SITE //

window.onload = function() {
  setSpacing();
	if (window.location.search == "?print" ||window.location.search == "?page=print") {
		goPrint();
	  } 
	else {
		goHome();
	}
  //goHome();
}

window.onresize = function() {
  setSpacing();
}