function getBrowserHeight() { 
	if (window.innerHeight) {return window.innerHeight;}	
	else if (document.documentElement && document.documentElement.clientHeight != 0) {
		return document.documentElement.clientHeight;
	}
	else if (document.body) {return document.body.clientHeight;}
	return 0;
}

function getBrowserWidth() { 
	if (window.innerWidth) {return window.innerWidth;}	
	else if (document.documentElement && document.documentElement.clientWidth != 0) {
		return document.documentElement.clientWidth;
	}
	else if (document.body) {return document.body.clientWidth;}
	return 0;
}
function determineStyle() { //inspired by A List Apart - www.alistapart.com
	var browserWidth = getBrowserWidth();
	if(browserWidth <= 1150) {
	 	for(var q = 0; (a = document.getElementsByTagName("link")[q]); q++) {
	 		if(a.getAttribute("title") == "wide") a.disabled = true;
        	else if(a.getAttribute("title") == "narrow") a.disabled = false;
	 	}
 	}
 	if(browserWidth > 1150) {
		for(var q = 0; (a = document.getElementsByTagName("link")[q]); q++) {
	 		if(a.getAttribute("title") == "narrow") a.disabled = true;
			else if(a.getAttribute("title") == "wide") a.disabled = false;
 		}
 	}
}

function doResize() {
	determineStyle();
	var author = document.getElementById("author");
	var browserWidth = getBrowserWidth();
	if(browserWidth <= 1150) {
		author.parentNode.removeChild(author);
		document.getElementsById("main").appendChild(author);
	}
	if(browserWidth > 1150) {
		author.parentNode.removeChild(author);
		document.getElementById("sidebar").appendChild(author);
	}
}

window.onresize = doResize;
window.onload = doResize;
