//Gets window inner width or inner height. It's not the entire window, but the current visible part of the page.
//Created by Ivan W. Lam 090118
//Help from http://www.howtocreate.co.uk/tutorials/javascript/browserwindow

function getWindowLength(direction){
	
	//Most browsers (Not IE)
	if (window.innerWidth && window.innerHeight){
		if (direction=="width"){var length=window.innerWidth;}
		else if (direction=="height"){var length=window.innerHeight;}

		//IE 6+ strict
		} else if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth){
		if (direction=="width"){var length=document.documentElement.clientWidth;}
		else if (direction=="height"){var length=document.documentElement.clientHeight;}

		//IE <6
		} else if (document.body.clientWidth && document.body.clientHeight){
		if (direction=="width"){var length=document.body.clientWidth;}
		else if (direction=="height"){var length=document.body.clientHeight;}
		}
		
	return length;
		
	}
