var starter = document.cookie.indexOf("TEXTSIZE=");
var ender = document.cookie.indexOf("ENDTEXTSIZE");
var size = document.cookie.substring(starter+9,ender);
	
/* Write out the stylesheet link. If the cookie wasn't found (text sizing never having been done before), 
output the bog-standard stylesheet html tag  */
var beginhtml = '<link rel="stylesheet" href="/css/text_';
var endhtml = '.css" type="text/css">';
var fullhtml = beginhtml+size+endhtml;

if (starter < 0) {
	document.write('<link rel="stylesheet" href="/css/text_.css" type="text/css">');
}
/*Otherwise, if the cookie IS found, print out the html tag INCLUDING the size of the stylesheet required.
The size has been pulled from the cookie.*/
else {
	document.write(fullhtml);
}

