window.onload = handleWindowResize;
window.onresize = handleWindowResize;

function handleWindowResize() {
	if (window.innerWidth) {
		winWidth = window.innerWidth;
	} else {
		winWidth = document.body.offsetWidth;
	}
		
	if (winWidth < 950) {
		changeCss('.hideonnarrow', 'display', 'none');
		changeCss('.hideonwide', 'display', '');
	} else {
		changeCss('.hideonnarrow', 'display', '');
		changeCss('.hideonwide', 'display', 'none');
	}
	
}

function changeCss(theClass,element,value) {
	//documentation for this script at http://www.shawnolson.net/a/503/
	var cssRules;
	if (document.all) {
		cssRules = 'rules';
	}
	else if (document.getElementById) {
		cssRules = 'cssRules';
	}
	for (var S = 0; S < document.styleSheets.length; S++){
		for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
		//	alert(document.styleSheets[S][cssRules][R].selectorText.toLowerCase() + '::' + theClass.toLowerCase());
			var st = document.styleSheets[S][cssRules][R].selectorText + '';
			if (st.toLowerCase() == theClass.toLowerCase()) {
				document.styleSheets[S][cssRules][R].style[element] = value;
			}
		}
	}	
}