function Cookie(name) {
	this.name = name;

}

Cookie.prototype.store = function(value) { // store a single variable cookie
	document.cookie = this.name + "=" + encodeURIComponent(value);
	

}

Cookie.prototype.read = function() { // store a single variable cookie
	var allCookies = document.cookie;  // get all cookies
	var pos = allCookies.indexOf(this.name);  // find our cookie
		//alert(document.cookie);
	if (pos != -1) {
		var start = pos + this.name.length + 1; // find our cookie position in string
		var end = allCookies.indexOf(";", start); 
		if (end == -1) end = allCookies.length;  // only one cookie variable
		
		var temp = decodeURIComponent(allCookies.substring(start, end));  // return our value from name-value pair
		//alert(this.name+"   "+temp+"    "+start+"   "+end);
		return temp;
			
	} else {
		return null;  // cookie not set
	}

}

var cookieSize = new Cookie("textsize"); // store text size in a cookie	
var cookieMarker = new Cookie("marker"); // store marker colour in a cookie
var cookieWidth = new Cookie("width"); // store comtent width in a cookie