Twenty Thirteen: adjust JavaScript handling for scrolling and finding viewport heigh/width to better support various IE versions. Also consolidate variables at the top of the file per best practices. Fixes #23841, props obenland.

git-svn-id: http://core.svn.wordpress.org/trunk@23965 1a063a9b-81f0-0310-95a4-ce76da25c4cd