var today = new Date();
var expirenow = new Date(today.getTime());
/*
//Leave me in, just in case compatability issues require a jscript cookie killed too
var the_cookie="textonly=offendtextonly; path=/; expires="+expirenow;
document.cookie = the_cookie;
*/
// Searches for existance of cookie
var starter = document.cookie.indexOf("TEXTSIZE=");
var ender = document.cookie.indexOf("ENDTEXTSIZE");
var size = document.cookie.substring(starter+9,ender);

//variables to contain start, midsection and end of the html code to be inlayed
var beginhtml = '<link rel="stylesheet" href="/css/front/css7_';
var endhtml = '.css" type="text/css">';
var fullhtml = beginhtml+size+endhtml;

/*if the cookie wasn't found (text sizing never having been done before), 
output the bog-standard stylesheet html tag  */
if (starter < 0) {
	<!--- alert('cookie not found'); --->
	document.write('<link rel="stylesheet" href="/css/front/css7_.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);
}

function textsizer(){
var the_size = document.cookie.substring(starter+9,ender);
	
	if (starter<0) {
		//If the cookie wasn't found, create it and make the size one bigger
		var the_cookie ="TEXTSIZE=medENDTEXTSIZE; path=/";
		document.cookie = the_cookie;
		window.location.reload( true );
	}
	else {
		//if there is no size specified (only possible if the sizer has been fully rotated once)
		//make the size one bigger
		if(the_size==""){
		var the_cookie ="TEXTSIZE=medENDTEXTSIZE; path=/";
		document.cookie = the_cookie;
		window.location.reload( true );
		}
		
		if (the_size=="med"){
			//if the cookie says the current size is medium, make it large
			var the_cookie ="TEXTSIZE=lrgENDTEXTSIZE; path=/";
			document.cookie = the_cookie;
			window.location.reload( true );
		}
		
		if (the_size=="lrg"){
			//if the cookie says the current size is large, rotate it back down to nothing
			//NOTE: the deletion of this cookie (using expires=) may not work, 
			//so that is why other code is used to check for existance above.
			var the_cookie ="TEXTSIZE=ENDTEXTSIZE; path=/";
			var the_cookie ="TEXTSIZE=ENDTEXTSIZE; expires="+expirenow+"; path=/";
			document.cookie = the_cookie;
			window.location.reload( true );
		
		}
	}
}

