function getClientWidth( ) {
	return filterResults ( window.innerWidth ? window.innerWidth : 0,
						   document.documentElement ? document.documentElement.clientWidth : 0,
						   document.body ? document.body.clientWidth : 0 );
}

function getClientHeight( ) {
	return filterResults ( window.innerHeight ? window.innerHeight : 0,
						  document.documentElement ? document.documentElement.clientHeight : 0,
						  document.body ? document.body.clientHeight : 0 );
}

function getScrollTop( ) {
	return filterResults ( window.pageYOffset ? window.pageYOffset : 0,
						   document.documentElement ? document.documentElement.scrollTop : 0,
						   document.body ? document.body.scrollTop : 0 );
}

function filterResults( nWindow, nDocElement, nBody ) {
	var nResult = nWindow ? nWindow : 0;

	if ( nDocElement && ( !nResult || ( nResult > nDocElement ) ) )
		nResult = nDocElement;

	return nBody && ( !nResult || ( nResult > nBody ) ) ? nBody : nResult;
}