//function settextsize() {

// 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);

/*if the cookie wasn't found (text sizing never having been done before), 
output the bog-standard stylesheet html tag  */
if (starter < 0) {
	//alert('no cookie');
	//document.getElementById('sizecss').href='/css/front/bodysize.css';
	document.write('<link rel="stylesheet" type="text/css" href="/css/front/mss_bodysize.css" id="sizecss" />');
	var size = "";
}
/*Otherwise, if the cookie IS found, load the correct size.*/
else {
	//alert('/css/front/import' +size+ '.css');
	//document.getElementById('sizecss').href='/css/front/bodysize' +size+ '.css';
	document.write('<link rel="stylesheet" type="text/css" href="/css/front/mss_bodysize'+size+'.css" id="sizecss" />');
}
//}

function textsizer(){
	//if there is no size specified, we're on small currently - increase to medium
	if(size==""){
	var the_cookie ="TEXTSIZE=medENDTEXTSIZE; path=/";
	//var the_cookie ="TEXTSIZE=ENDTEXTSIZE; path=/";
	document.cookie = the_cookie;
	//document.getElementById('sizecss').href='/css/front/bodysize.css';
	window.location.reload( true );
	}
	
	if (size=="med"){
		//if we're on medium currently, increase to large
		var the_cookie ="TEXTSIZE=lrgENDTEXTSIZE; path=/";
		//var the_cookie ="TEXTSIZE=medENDTEXTSIZE; path=/";
		document.cookie = the_cookie;
		//document.getElementById('sizecss').href='/css/front/bodysizemed.css';
		window.location.reload( true );
	}
	
	if (size=="lrg"){
		//if we're on large currently, revert back to small
		//var the_cookie ="TEXTSIZE=lrgENDTEXTSIZE; path=/";
		var the_cookie ="TEXTSIZE=ENDTEXTSIZE; path=/";
		document.cookie = the_cookie;
		//document.getElementById('sizecss').href='/css/front/bodysizelrg.css';
		window.location.reload( true );
	}
}

