/*********************************************
	
 JavaScript Document: Window Sizer
 Author: Anthony Hessler (HesslerDesign.com)
	
*********************************************/

var windowHeight_num;
var windowWidth_num;
var liveWidth_num = 960;

function getWindowHeight() {
	var lHeight;
	if (typeof(window.innerHeight) == 'number') {
		lHeight = window.innerHeight;
	} else if ( (document.documentElement) && (document.documentElement.clientHeight) ) {
		lHeight = document.documentElement.clientHeight;
	} else if ( (document.body) && (document.body.clientHeight) ) {
		lHeight = document.body.clientHeight;
	}
	return lHeight;
}
function getWindowWidth() {
	var lWidth;
	if (typeof(window.innerWidth) == 'number') {
		lWidth = window.innerWidth;
	} else if ( (document.documentElement) && (document.documentElement.clientWidth) ) {
		lWidth = document.documentElement.clientWidth;
	} else if ( (document.body) && (document.body.clientWidth) ) {
		lWidth = document.body.clientWidth;
	}
	return lWidth;
}
function getDimensions() {
	var lArray_arr = [getWindowWidth(), getWindowHeight()];
	return lArray_arr;
}
function setDimensions() {
	windowHeight_num = getWindowHeight();
	windowWidth_num = getWindowWidth();
	if (windowWidth_num < liveWidth_num) {
		setWrapperWidth(liveWidth_num+'px');
	} else {
		setWrapperWidth('100%');
	}
}
function setWrapperWidth(pWidth_num) {
	var lDiv = getWrapperDiv();
	var lRelDiv = getRelWrapperDiv();
	lDiv.style.width = pWidth_num;
	lRelDiv.style.width = pWidth_num;
}
function getWrapperDiv() {
	var lDiv = document.getElementById('wrapper');
	if (!lDiv) {
		lDiv = window.getElementById('wrapper');
	}
	return lDiv;
}
function getRelWrapperDiv() {
	var lDiv = document.getElementById('rel-wrap');
	if (!lDiv) {
		lDiv = window.getElementById('rel-wrap');
	}
	return lDiv;
}
window.onresize = function() {
	setDimensions();
}
setDimensions();
