
var openEl;


function getEl(id)
{
  return document.getElementById(id);
}


// Initializes the page onload.
function init()
{
  // Get the menu items.

  var el1     = getEl('about');

  el1.open = false;
  el1.openHeight = 230;


  elArr = new Array();
  elArr[0] = el1;

  toggle(0);
}

function toggle(nr)
{
  if (openEl != null)
  {
    closeText(openEl);
  }
  if (elArr[nr] != openEl)
  {
    openText(elArr[nr]);
    openEl = elArr[nr];
  }
  else
  {
    openEl = null;
  }
  document.body.focus();
}

function openText(el)
{
  t1 = new Tween(el.style,'height',Tween.bounceEaseOut, 1, el.openHeight, 1.5, 'px');
  t1.start();
  el.open = true;
}

function closeText(el)
{
  t2 = new Tween(el.style, 'height',Tween.bounceEaseOut, el.openHeight, 1, 1.5, 'px');
  t2.start();
  el.open = false;
}


//=============================================================================//
// setCookie, getCookie & removeCookie                                         //
//=============================================================================//

function setCookie( sName, sValue, nDays ) 
{
  var expires = "";
  if ( nDays ) 
  {
    var d = new Date();
    d.setTime( d.getTime() + nDays * 24 * 60 * 60 * 1000 );
    expires = "; expires=" + d.toGMTString();
  }
  document.cookie = sName + "=" + sValue + expires + "; path=/";
};

function getCookie(sName) 
{
  var re = new RegExp( "(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)" );
  var res = re.exec( document.cookie );
  return res != null ? res[3] : null;
};

function removeCookie( name ) 
{
  setCookie( name, "", -1 );
};



window.onload = init;
