/****************************
made by kieran@keymedia.co.uk
****************************/

function bg_on(obj){
	var id = obj.parentNode.id;
	obj.parentNode.style.backgroundImage = 'url(/assets/img/' + id + '.gif)';
}
function bg_off(obj){
	obj.parentNode.style.backgroundImage = 'none';
}
function bgc_on(obj){
	obj.parentNode.style.backgroundColor = '#97a012';
}
function bgc_off(obj){
	obj.parentNode.style.backgroundColor = 'transparent';
}
function init_leftnav(id){
	var ary = document.getElementsByTagName('a');
	for(var i=0;i<ary.length;i++){
		if(ary[i].parentNode.className == 'leftnav'){
			if(ary[i].getAttribute('href') == id){
				ary[i].parentNode.style.backgroundColor = '#97a012';
				ary[i].removeAttribute('onmouseover');
				ary[i].removeAttribute('onmouseout');
			}
		}
	}
}

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 setFooter() {
	if (document.getElementById) {
 		var windowHeight=getWindowHeight();
 		if (windowHeight>0) {
 			var contentHeight=document.getElementById('main_container').offsetHeight;
 			var footerElement=document.getElementById('footer_container');
 			var footerHeight=footerElement.offsetHeight;
 			if (windowHeight-(contentHeight+footerHeight)>=0) {
 				footerElement.style.position='relative';
 				footerElement.style.top=(windowHeight-(contentHeight+footerHeight))+'px';
 				} else {
 				footerElement.style.position='static';
 				}
 			}
 		}
	}

window.onload = function() {
  setFooter();
}
window.onresize = function() {
  setFooter();
}
