function doDown(obj)
{
	//if (browser == "Mozilla")
	//	var key = e.which;
	//else
	
	var key = event.keyCode;
	
	if (key == 0 || key == 13)
	{
		if (obj.src != null)
			obj.src = obj.src.replace(/s.gif$/i,'.gif');
		else
			obj.style.backgroundImage = obj.style.backgroundImage.replace(/s.gif/i,'.gif');	
	}
}
function doUp(obj)
{
	if (obj.src != null)
	{
		if (obj.src.match(/s.gif$/i) == null)
			    obj.src = obj.src.replace(/.gif$/i,'s.gif');
	}
	else
		if (obj.style.backgroundImage.match(/s.gif/i) == null)
			obj.style.backgroundImage = obj.style.backgroundImage.replace(/.gif/i,'s.gif');
}

function getCookie(name)
{
    var re = new RegExp(name + '=([^;]+)');
    var value = re.exec(document.cookie);
    return (value != null) ? unescape(value[1]) : null;
}

var today = new Date();
var expiry = new Date(today.getTime() + 100 * 24 * 60 * 60 * 1000);

function setCookie(name, value)
{ 
	document.cookie = name + '=' + escape(value) + '; expires=' + expiry.toGMTString();
}

function textSize()
{
    var cookie = getCookie('BigText');
    var bigtext = (cookie == null) ? (screen.height >= 1024) : (cookie == 'true');
    setCookie('BigText', bigtext);
    return bigtext;
}
function toggleTextSize()
{
    var bigtext = textSize();
    bigtext = !bigtext;
    setCookie('BigText', bigtext);
    doTextSize(bigtext);
    document.getElementById('Content').style.display = 'none';  // redraw dhtml
    document.getElementById('Content').style.display = 'block';
}
function doTextSize(big)
{
    if (browser == "Mozilla")
    {
        if (big)
        {
            document.styleSheets[0].cssRules[2].style.fontFamily = "'Palatino Linotype', Serif";
            document.styleSheets[0].cssRules[2].style.fontSize = "14pt";
            document.styleSheets[0].cssRules[9].style.fontSize = "12pt";
        }
        else
        {
            document.styleSheets[0].cssRules[2].style.fontFamily = "Verdana, Sans-Serif";
            document.styleSheets[0].cssRules[2].style.fontSize = "10pt"; 
            document.styleSheets[0].cssRules[9].style.fontSize = "10pt";
        }
    }
    else
    {
       if (big)
       {        
            document.styleSheets[0].rules[2].style.fontFamily = "'Palatino Linotype', Serif";
            document.styleSheets[0].rules[2].style.fontSize = "14pt";
            document.styleSheets[0].rules[9].style.fontSize = "12pt";
       }
       else
       {
            document.styleSheets[0].rules[2].style.fontFamily = "Verdana, Sans-Serif";
            document.styleSheets[0].rules[2].style.fontSize = "10pt";
            document.styleSheets[0].rules[9].style.fontSize = "10pt";
       }
    }        
}

function setTop()
{
    var cookie = getCookie('MenuTop');
    document.getElementById('MenuScroll').scrollTop = (cookie == null || isNaN(cookie)) ? 0 : parseInt(cookie);
}
function saveTop()
{
    setCookie('MenuTop', document.getElementById('MenuScroll').scrollTop);		
}
