Blame Identity/Webenv/phpBB/3.0.4/styles/modern/template/styleswitcher.js

ef5584
ef5584
function fontsizeup()
ef5584
{
ef5584
	var active = getActiveStyleSheet();
ef5584
ef5584
	switch (active)
ef5584
	{
ef5584
		case 'A--':
ef5584
			setActiveStyleSheet('A-');
ef5584
		break;
ef5584
ef5584
		case 'A-':
ef5584
			setActiveStyleSheet('A');
ef5584
		break;
ef5584
ef5584
		case 'A':
ef5584
			setActiveStyleSheet('A+');
ef5584
		break;
ef5584
ef5584
		case 'A+':
ef5584
			setActiveStyleSheet('A++');
ef5584
		break;
ef5584
ef5584
		case 'A++':
ef5584
			setActiveStyleSheet('A');
ef5584
		break;
ef5584
ef5584
		default:
ef5584
			setActiveStyleSheet('A');
ef5584
		break;
ef5584
	}
ef5584
}
ef5584
ef5584
function fontsizedown()
ef5584
{
ef5584
	active = getActiveStyleSheet();
ef5584
ef5584
	switch (active)
ef5584
	{
ef5584
		case 'A++' : 
ef5584
			setActiveStyleSheet('A+');
ef5584
		break;
ef5584
ef5584
		case 'A+' : 
ef5584
			setActiveStyleSheet('A');
ef5584
		break;
ef5584
ef5584
		case 'A' : 
ef5584
			setActiveStyleSheet('A-');
ef5584
		break;
ef5584
ef5584
		case 'A-' : 
ef5584
			setActiveStyleSheet('A--');
ef5584
		break;
ef5584
ef5584
		case 'A--' : 
ef5584
		break;
ef5584
ef5584
		default :
ef5584
			setActiveStyleSheet('A--');
ef5584
		break;
ef5584
	}
ef5584
}
ef5584
ef5584
function setActiveStyleSheet(title)
ef5584
{
ef5584
	var i, a, main;
ef5584
ef5584
	for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
ef5584
	{
ef5584
		if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title'))
ef5584
		{
ef5584
			a.disabled = true;
ef5584
			if (a.getAttribute('title') == title)
ef5584
			{
ef5584
				a.disabled = false;
ef5584
			}
ef5584
		}
ef5584
	}
ef5584
}
ef5584
ef5584
function getActiveStyleSheet()
ef5584
{
ef5584
	var i, a;
ef5584
ef5584
	for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
ef5584
	{
ef5584
		if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title') && !a.disabled)
ef5584
		{
ef5584
			return a.getAttribute('title');
ef5584
		}
ef5584
	}
ef5584
ef5584
	return null;
ef5584
}
ef5584
ef5584
function getPreferredStyleSheet()
ef5584
{
ef5584
	return ('A-');
ef5584
}
ef5584
ef5584
function createCookie(name, value, days)
ef5584
{
ef5584
	if (days)
ef5584
	{
ef5584
		var date = new Date();
ef5584
		date.setTime(date.getTime() + (days*24*60*60*1000));
ef5584
		var expires = '; expires=' + date.toGMTString();
ef5584
	}
ef5584
	else
ef5584
	{
ef5584
		expires = '';
ef5584
	}
ef5584
ef5584
	document.cookie = name + '=' + value + expires + style_cookie_settings;
ef5584
}
ef5584
ef5584
function readCookie(name)
ef5584
{
ef5584
	var nameEQ = name + '=';
ef5584
	var ca = document.cookie.split(';');
ef5584
ef5584
	for (var i = 0; i < ca.length; i++)
ef5584
	{
ef5584
		var c = ca[i];
ef5584
ef5584
		while (c.charAt(0) == ' ')
ef5584
		{
ef5584
			c = c.substring(1, c.length);
ef5584
		}
ef5584
ef5584
		if (c.indexOf(nameEQ) == 0)
ef5584
		{
ef5584
			return c.substring(nameEQ.length, c.length);
ef5584
		}
ef5584
	}
ef5584
ef5584
	return null;
ef5584
}
ef5584
ef5584
function load_cookie()
ef5584
{
ef5584
	var cookie = readCookie('style_cookie');
ef5584
	var title = cookie ? cookie : getPreferredStyleSheet();
ef5584
	setActiveStyleSheet(title);
ef5584
}
ef5584
ef5584
function unload_cookie()
ef5584
{
ef5584
	var title = getActiveStyleSheet();
ef5584
	createCookie('style_cookie', title, 365);
ef5584
}
ef5584
ef5584
onload_functions.push('load_cookie()');
ef5584
onunload_functions.push('unload_cookie()');
ef5584
ef5584
/*
ef5584
var cookie = readCookie("style");
ef5584
var title = cookie ? cookie : getPreferredStyleSheet();
ef5584
setActiveStyleSheet(title);
ef5584
*/