function expand(id)
{
  var element = document.getElementById(id);
  if(element.style.display == "inline")
    element.style.display = "none"
  else
    element.style.display = "inline"
}

function createCookie(name,value,days)
{
  if(days)
  {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++)
  {
    var c = ca[i];
    while(c.charAt(0)==' ')
      c = c.substring(1,c.length);
    if(c.indexOf(nameEQ) == 0)
      return c.substring(nameEQ.length,c.length);
  }
  return null;
}

var timeOut = new Array();
function opacityStart(id, opacStart, opacEnd, millisec)
{
  //speed for each frame
  var speed = Math.round(millisec / 100);
  var timer = 0;

  //determine the direction for the blending, if start and end are the same nothing happens
  if(opacStart > opacEnd)
  {
    for(i = opacStart, x = 0; i >= opacEnd; i--,x++)
    {
      timeOut[x] = setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
      timer++;
    }
  }
  else if(opacStart < opacEnd)
  {
    for(i = opacStart, x = 0; i <= opacEnd; i++,x++)
    {
      timeOut[x] = setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
      timer++;
    }
  }
}
function opacity(id, opacStart, opacEnd, millisec)
{
  //speed for each frame
  var speed = Math.round(millisec / 100);
  var timer = 0;

  //determine the direction for the blending, if start and end are the same nothing happens
  if(opacStart > opacEnd)
  {
    for(i = opacStart; i >= opacEnd; i--)
    {
      setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
      timer++;
    }
  }
  else if(opacStart < opacEnd)
  {
    for(i = opacStart; i <= opacEnd; i++)
    {
      setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
      timer++;
    }
  }
}
function opacityObject(element, opacStart, opacEnd, millisec)
{
  //speed for each frame
  var speed = Math.round(millisec / 100);
  var timer = 0;

  //determine the direction for the blending, if start and end are the same nothing happens
  if(opacStart > opacEnd)
  {
    for(i = opacStart; i >= opacEnd; i--)
    {
      setTimeout("changeOpac(" + i + ",'" + element + "')",(timer * speed));
      timer++;
    }
  }
  else if(opacStart < opacEnd)
  {
    for(i = opacStart; i <= opacEnd; i++)
    {
      setTimeout("changeOpac(" + i + ",'" + element + "')",(timer * speed));
      timer++;
    }
  }
}
//change the opacity for different browsers
function changeOpac(opacity, id)
{
  var object = document.getElementById(id).style;
  if(object)
  {
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
  }
}
function changeOpacObject(opacity, object)
{
  if(object)
  {
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
  }
}

