var m_cstrStylesheet_normal = "/cms/cms/intranet6/empty.css";
var m_cstrStylesheet_large =  "/cms/cms/intranet6/amu-fyn_stor.css";

var m_blnUseLargeStylesheet = (GetCookie("UseLargeStylesheet", "0") == "1");

function UseStyleSheet(smallTextCaption, largeTextCaption)
{

	if (m_blnUseLargeStylesheet)
	{
	  	document.getElementById("linkStylesheet").href = m_cstrStylesheet_large;
		try
		{
			document.getElementById("styleShifter").title = smallTextCaption;
			document.getElementById("styleShifter").textContent = smallTextCaption;
			document.getElementById("styleShifter").innerText = smallTextCaption;
		}
		catch (e) {}
	}
	else
	{
		document.getElementById("linkStylesheet").href = m_cstrStylesheet_normal;
		try
		{
			document.getElementById("styleShifter").title = largeTextCaption;
			document.getElementById("styleShifter").textContent = largeTextCaption;			
			document.getElementById("styleShifter").innerText = largeTextCaption;
		}
		catch (e) {}
	}
}


function SwitchStylesheet(smallTextCaption, largeTextCaption)
{
	// flip state
	m_blnUseLargeStylesheet = !m_blnUseLargeStylesheet;

	// and save state in cookie
	if (m_blnUseLargeStylesheet)
	{
		SetCookie("UseLargeStylesheet", "1");
	}
	else
	{
		SetCookie("UseLargeStylesheet", "0");
	}
	UseStyleSheet(smallTextCaption, largeTextCaption);
	//document.location.reload();
}

function SetCookie(name, value)
{
	var str;

	str = name + '=' + escape(value) + '; path=/';
	document.cookie = str;
}

function GetCookie(name, defaultValue)
{
	var re, arr, val;

	re = new RegExp(name + '=([^;$]*)');
	arr = document.cookie.match(re);
	if (arr == null)
		return defaultValue;

	val = arr[1];

	return val;
}

function Body_OnLoad(smallTextCaption, largeTextCaption)
{
	UseStyleSheet(smallTextCaption, largeTextCaption);
}