// JavaScript Document

//WPC JavsScript library

function noSpam(address)
{
	// goofy way to generate email addresses to prevent crawlers from finding them
	var a = address;
	var d = '';
	var t = '';
	var p = '';
	// arguments are optional, but if you want to skip one, you must include a value or '' for the default
	if(arguments.length > 1)
		{d = arguments[1];}
	if(d == '')
		{d='WhitefieldPlastics';};
	if(arguments.length > 2)
		{t = arguments[2];}
	if(t == '')
		{t='com';};
	var e = a+'@'+d+'.'+t
	if(arguments.length > 3)
		{p = arguments[3];}
		else
		{p = e;}
	document.write('<a href="mailto:'+e+'" title="Click here to send email">'+p+'</a>');
}

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('content').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.top = '0px';
			}
		}
		//alert('windowHeight='+windowHeight+' footertop='+footerElement.style.top);
	}
}