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

function handleWindowResize() {
	if (window.innerWidth) {
		winWidth = window.innerWidth;
	} else {
		winWidth = document.body.offsetWidth;
	}

	if (winWidth < 1000) {
		$('.hideonnarrow').hide();
		$('.hideonwide').show();
		//changeCss('.hideonnarrow', 'display', 'none');
		//changeCss('.hideonwide', 'display', '');
	} else {
		$('.hideonnarrow').show();
		$('.hideonwide').hide();
		//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;
//			}
//		}
//	}
//}

//function changeCss(theClass, element, value) {
//	//Last Updated on July 4, 2011
//	//documentation for this script at
//	//http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
//	var cssRules;

//	for (var S = 0; S < document.styleSheets.length; S++) {
//		try {
//			document.styleSheets[S].insertRule(theClass + ' { ' + element + ': ' + value + '; }', document.styleSheets[S][cssRules].length);
//		} catch (err) {
//			try {
//				document.styleSheets[S].addRule(theClass, element + ': ' + value + ';');
//			} catch (err) {
//				try {
//					if (document.styleSheets[S]['rules']) {
//						cssRules = 'rules';
//					} else if (document.styleSheets[S]['cssRules']) {
//						cssRules = 'cssRules';
//					} else {
//						//no rules found... browser unknown
//					}
//					for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
//						if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
//							if (document.styleSheets[S][cssRules][R].style[element]) {
//								document.styleSheets[S][cssRules][R].style[element] = value;
//								break;
//							}
//						}
//					}
//				} catch (err) { }
//			}
//		}
//	}
//}
