/*--------------------------------------------------------------
* Copyright (c) 2006 TELUS Communications Inc.,
*
* All Rights Reserved.
* This document contains proprietary information that shall be
* distributed or routed only within TELUS, and its authorized
* clients, except with written permission of TELUS.
*
* Description: Default function
*--------------------------------------------------------------*/


///////////////////////////////////////////////////////////////////////////////
// textsize
function SetTextSizeFromCookie()
{
    var size = GetCookie('textsize');
    if(size!=null)
        TextSize(size);
}

function TextSize(name)
{
    document.getElementById('textsmall').className = 'textsmallOff';
    document.getElementById('textmedium').className = 'textmediumOff';
    document.getElementById('textbig').className = 'textbigOff';

    if(name!='big' && name!='medium') { name = 'small'; }

    document.getElementById('text' + name).className = 'text' +  name + 'On';
    document.getElementById('content').className = 'content' + name;
}

function SetTextSize(name)
{
    SetCookie('textsize',name,100);
}

///////////////////////////////////////////////////////////////////////////////
// Go to section
function GoToSection()
{
    if(document.Gotoform.Gotosection.options[document.Gotoform.Gotosection.selectedIndex].value!='')
        alert('Go to : '+document.Gotoform.Gotosection.options[document.Gotoform.Gotosection.selectedIndex].value);
}

///////////////////////////////////////////////////////////////////////////////
// cookie
function SetCookie(name,value,days)
{
    var expires = "";

	if (days)
    {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}

	document.cookie = name+"="+value+expires+"; path=/";
}

function GetCookie(name)
{
	name = name + "=";

	var cookie_array = document.cookie.split(';');
	for(var i=0; i < cookie_array.length; i++)
    {
		var c = cookie_array[i];

		while (c.charAt(0)==' ')
            c = c.substring(1,c.length);

		if (c.indexOf(name) == 0)
            return c.substring(name.length, c.length);
	}

	return null;
}

function DeleteCookie(name)
{
	setCookie(name,"",-1);
}


