window.onload = setScreenClass;
window.onresize = setScreenClass;
// Following transition classes will be declared:
//
// classname screenwidth
// ------------------------------------------
// pda_ver 240px
// pda_hor 320px
// screen_ultralow 320px - 640px
// screen_low 640px - 800px
// screen_med 800px - 1024px
// screen_high 1024px - 1280px
// screen_wide 1280px - 1366px
// screen_awesome > 1366px
function setScreenClass() {
	var fmt = document.documentElement.clientWidth;
	var cls = (fmt<=240)?'pda_ver':(fmt>240&&fmt<=320)?'pda_hor':(fmt>320&&fmt<=640)?'screen_ultralow':(fmt>640&&fmt<=800)?'screen_low':(fmt>800&&fmt<=1024)?'screen_med':(fmt>1024&&fmt<=1280)?'screen_high':(fmt>1280&&fmt<=1330)?'screen_wide':'screen_awesome';
	
	//Randy, you can comment out the next line to disable the count.
	//I left it in for testing purposes
	//document.getElementById('count').innerHTML=fmt+'px -> '+cls;
	$('body').removeAttr('class');
	$('body').addClass(cls);
	//document.body.className=cls;
	/*var bigWidthDiv = document.getElementById("bigWidthDiv");
	switch(cls) {
		case "pda_ver":
		case "pda_hor":
		case "screen_ultralow":
		case "screen_low":
		case "screen_med":
		case "screen_high":
		case "screen_wide":
			if(document.getElementById('bigWidthDiv')) {
				$('#bigWidthDiv').css('display', 'none');
			}
		break;
		case "screen_awesome":
			if(document.getElementById('bigWidthDiv')) {
				$('#bigWidthDiv').css('display', 'block').after('#count');
			}
		break;
		default:
			if(document.getElementById('bigWidthDiv')) {
				$('#bigWidthDiv').css('display', 'none');
			}
	}*/
	console.log($('#bigWidthDiv').length);
	if( $('#bigWidthDiv').length > 0 ) {
		if( $('body').hasClass('screen_awesome') ) {
			console.log('path1');
			$('#bigWidthDiv').css('display', 'block').insertAfter('#count');
		}
		else {
			console.log('path2');
			$('#bigWidthDiv').css('display', 'none').insertAfter('#home-content');
		}
	}
}; 
