/* <CUSTOM> */
/* <CUSTOM_DESCRIPTION> MW 2005-03-24: cookie on MSS has historically contained the string MSSTEXTSIZE */

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;
*/
var something = document.cookie.indexOf("MSSTEXTSIZE=");
var something2 = document.cookie.indexOf("ENDMSSTEXTSIZE");
var size = document.cookie.substring(something+12,something2);
var sheet = '<link rel="stylesheet" href="/css/tcms_front';
var sheet2 = '.css" type="text/css">';
var ohyes = sheet+size+sheet2;
if (something < 0) {
document.write('<link rel="stylesheet" href="/css/tcms_front.css" type="text/css">');
}
else {
document.write(ohyes);
}

function textsizer(){
var the_size = document.cookie.substring(something+12,something2);
	
	if (something<0) {
		var the_cookie ="MSSTEXTSIZE=medENDMSSTEXTSIZE; path=/";
		document.cookie = the_cookie;
		window.location.reload( true );
	}
	else {
	
		if(the_size==""){
		var the_cookie ="MSSTEXTSIZE=medENDMSSTEXTSIZE; path=/";
		document.cookie = the_cookie;
		window.location.reload( true );
		}
		
		if (the_size=="med"){
			var the_cookie ="MSSTEXTSIZE=largeENDMSSTEXTSIZE; path=/";
			document.cookie = the_cookie;
			window.location.reload( true );
		}
		
		if (the_size=="large"){
			var the_cookie ="MSSTEXTSIZE=ENDMSSTEXTSIZE; expires="+expirenow+"; path=/";
			document.cookie = the_cookie;
			window.location.reload( true );
		
		}
	}
}
