Event.addBehavior({
  '#credits:click': function() {
    
    element = $("logo_panel");
    if(element.getStyle("height") != "59px")
    {
      contract();
    }
    else
    {
      expand();
    }
    return false;
  }
});

// HELPER FUNCTIONS
function logoContract()
{
  return new Effect.Morph('logo_panel', {style: {height:'59px'}}, { sync: true });
}

function logoExpand()
{
  return new Effect.Morph('logo_panel', {style: {height:'200px'}}, { sync: true });
}

function expand()
{
  if(!currentWindowMoved())
  {
    new Effect.Parallel( 
       [ 
         logoExpand(), 
         new Effect.Morph('currentWindow', {style: {top:'261px'}}, { sync: true }) 
       ], {}
     );
  }
  else
  {
    logoExpand();
  }
}

function contract()
{
  if(!currentWindowMoved())
  { 
    new Effect.Parallel( 
     [ 
       logoContract(), 
       new Effect.Morph('currentWindow', {style: {top:'120px'}}, { sync: true }) 
     ], {}
    );
  }
  else
  {
    logoContract();
  }
}


// check to see if current window is in the original spot
function currentWindowMoved()
{
  return currentWindow == undefined || $('currentWindow') == undefined || movedWindow;
}