function footerCheck() {
	var pager = document.getElementById( 'pager' )
	pager.style.position = ( document.body.clientHeight + 70 < window.innerHeight ) ? "absolute" : "relative"
	/*
	var myHeight = ( pager.style.position == "static" ) ? document.body.clientHeight : document.body.clientHeight + pager.clientHeight
	pager.style.position = ( document.body.clientHeight + pager.clientHeight < window.innerHeight ) ? "absolute" : "static"
	*/
	
	if (navigator.userAgent.match( /iPad/ )) {
		document.getElementById( 'pager' ).style.fontSize = '0.9em'
		if (window.innerHeight > 900) {
			document.body.style.fontSize = '1.2em'
			document.getElementById( 'newsArticles' ).innerHTML = 'Articles'
			document.getElementById( 'copyright' ).innerHTML = 'All Rights Reserved'
		}
		else {
			document.body.style.fontSize = '0.9em'
			document.getElementById( 'newsArticles' ).innerHTML = 'News / Articles'
			document.getElementById( 'copyright' ).innerHTML = 'Copyright &copy; 2010. All Rights Reserved'
		}
	}
}

function jumpToSearchURL( searchTerm ) {
	location.href = '/search/' + searchTerm
}

var directionKeyNav = {
	init:function() {
		if (!document.getElementById) return
		document.onkeydown = directionKeyNav.changeArrowStyle
		document.onkeyup = directionKeyNav.handler
	},
	changeArrowStyle:function( e ) {
		e = e || window.event
		var el = e.target || e.srcElement
		if(!el || !el.nodeName || !/input|select|textarea/i.test(el.nodeName)) {
			var key = e.which || e.charCode || e.keyCode
			var previous = document.getElementById( 'previous' )
			var next = document.getElementById( 'next' )
			if (previous && key==37) {
				previous.className = 'currentPageLink'
			}
			else if (next && key==39) {
				next.className = 'currentPageLink'
			}
		}
	},
	handler:function( e ) {
		e = e || window.event
		var el = e.target || e.srcElement;
		if(!el || !el.nodeName || !/input|select|textarea/i.test(el.nodeName)) {
			var key = e.which || e.charCode || e.keyCode;
			var previous = document.getElementById( 'previous' )
			var next = document.getElementById( 'next' )
			if (previous && key==37)
				location.href = previous.href
			else if (next && key==39)
				location.href = next.href
		}
	}
 }
 
window.onload = function() {
	directionKeyNav.init()
}

window.onorientationchange = footerCheck