/*
 * Welcome to the site of Ashley Kyd. You're more than welcome to have a poke
 * around to get a feel for how I do things.
 * 
 * This is a dynamically generated Javascript file, which is one of the perks of
 * good web architecture. No more client slow-down due to having to request and
 * download several javascript files. They're all here.
 * 
 * Not a lot of the following is all that interesting. You're welcome to go
 * through it though if you'd like. All external code has been credited and
 * documented in-line.
 */ 
 
/* We'll use this function to set the styleheet, contextually. */
function setActiveStyleSheet(title) {
	// Credit: http://alistapart.com/stories/alternate/
	var i, a, main;
	var styleSheetFound = false;
	
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
			a.disabled = true;
			
			if(a.getAttribute("title") == title) a.disabled = false;

		}
	}
}


/* We want larger viewports to load the larger style-sheet, to prevent
 * the layout seeming "bunched up". No scripting results in the default
 * stylesheet which is fine down to ~VGA resolutions.
 * This is essentially catering for everyone.
 */
if(typeof window.innerWidth == 'undefined'){
	window.onload=function(){

		if(document.body.clientWidth > 1152){
			// Thanks for ruining the party, Internet Explorer. :)
			setActiveStyleSheet('Large Screen Style');
		}
	}
}else if(window.innerWidth > 1152){
	setActiveStyleSheet('Large Screen Style');
}

