// JavaScript Document
	
	function chgImg(imgMain,newImg) {
		if (document.images)
			document[imgMain].src= eval(newImg + '.src')
	}
	
	function changeObjectVisibility(objectID, value) {
		var object = document.getElementById(objectID);
		object.style.visibility = value;
	}
	
	function findLivePageWidth() {
		if (window.innerWidth)
			return window.innerWidth;
		if (document.body.clientWidth)
			return document.body.clientWidth;
		return (null);
	}
	
	function findLivePageHeight() {
		if (window.innerHeight)
			return window.innerHeight;
		if (document.body.clientHeight)
			return document.body.clientHeight;
		return (null);
	}

	function moveObjectTo(objectID,x,y) {
		var object = document.getElementById(objectID);
		object.style.marginLeft = x + 'px';
		object.style.marginTop = y + 'px';
	}
	
	function centerObject(objectID) {
		var object = document.getElementById(objectID);
		object.style.margin = '0px auto';
	}
	
	function changeOffset() {
		x = findLivePageWidth() - 1180
		if (x > -75 && x < 0) {
			//appendHTML('debug', ' moving site to x=' + x);
			moveObjectTo('site', x, 0);
		} 
		else if (x < -75)  {
			//appendHTML('debug', ' moving site to x=' + x);
			moveObjectTo('site', -75, 0);
		}
		else if (x > 0) {
			//appendHTML('debug', ' centering site x=' + x);
			centerObject('site');
		}
		//updateHTML('position', 'background=' + x + ' page=' + findLivePageWidth());
	}
	
	function appendHTML(objectID, value) {
		var object = document.getElementById(objectID);
		object.innerHTML = object.innerHTML + value;
	}
	
	function updateHTML(objectID, value) {
		var object = document.getElementById(objectID);
		object.innerHTML = value;
	}
	
