﻿function bookmark() {
	if (window.sidebar)
		window.sidebar.addPanel(document.title, window.location.href, "");
	else if (window.external)
		window.external.AddFavorite(window.location.href, document.title);
	else if (window.opera && window.print) {
		var bookmark = document.createElement("a");
		bookmark.setAttribute("rel", "sidebar");
		bookmark.setAttribute("href", window.location.href);
		bookmark.setAttribute("title", document.title);
		bookmark.click();
	}
}

var textSizes = ["", "large", "xlarge", "xxlarge"];
function getTextSize() {
	for (var i = 0, n = textSizes.length; i < n; ++i)
		if (document.body.className == textSizes[i])
			return i;
	return 0;
}

function setTextSize(size) {
	document.body.className = textSizes[size];

	var cookieExpireDate = new Date();
	cookieExpireDate.setDate(cookieExpireDate.getDate() + 7); // 1 Week
	document.cookie = "textsize" + "=" + escape(size) + ";expires=" + cookieExpireDate.toGMTString() + ";path=/";
}

function sizeText(size) {
	setTextSize(size);
}

function upsizeText() {
	var size = getTextSize() + 1;
	if (size <= 3)
		setTextSize(size);
}

function downsizeText() {
	var size = getTextSize() - 1;
	if (size >= 0)
		setTextSize(size);
}
