var menu_open = 0;
var height = 0;
var timer;

function show_hide_menu()
{
  if( menu_open )
  {
    document.getElementById( "flip_menu_img" ).src="images/buttons/1/12x12/2downarrow.png";
    window.clearTimeout( timer );
    menu_open = 0;
    timer = window.setTimeout( "hide_menu()", 10 );
  }
  else
  {
    document.getElementById( "flip_menu_img" ).src="images/buttons/1/12x12/2uparrow.png";
    window.clearTimeout( timer );
    menu_open = 1;
    timer = window.setTimeout( "show_menu()", 10 );
  }
}

function show_menu()
{

    document.getElementById( "flip_menu_div" ).style.paddingTop = "4px";
    document.getElementById( "flip_menu_div" ).style.display = 'block';
    timer = window.setTimeout( "show_menu();", 25 );
}

function hide_menu()
{
    document.getElementById( "flip_menu_div" ).style.paddingTop = "0px";
	document.getElementById( "flip_menu_div" ).style.display = 'none';
    timer = window.setTimeout( "hide_menu();", 25 );
}

function show_hide_user_menu()
{
  if( menu_open )
  {
    document.getElementById( "flip_user_menu_img" ).src="images/buttons/1/12x12/2downarrow.png";
    window.clearTimeout( timer );
    menu_open = 0;
    timer = window.setTimeout( "hide_user_menu()", 10 );
  }
  else
  {
    document.getElementById( "flip_user_menu_img" ).src="images/buttons/1/12x12/2uparrow.png";
    window.clearTimeout( timer );
    menu_open = 1;
    timer = window.setTimeout( "show_user_menu()", 10 );
  }
}

function show_user_menu()
{
  if( height < 150 )
  {
    height += 110;
    if( height > 315 ) height = 150;
    document.getElementById( "flip_user_menu_div" ).style.paddingTop = "5px";
    document.getElementById( "flip_user_menu_div" ).style.height = height+"px";
    timer = window.setTimeout( "show_user_menu();", 25 );
  }
}

function hide_user_menu()
{
  if( height > 0 )
  {
    height -= 110;
    if( height < 0 ) height = 0;
    document.getElementById( "flip_user_menu_div" ).style.height = height+"px";
    timer = window.setTimeout( "hide_user_menu();", 25 );
  }
  else
  {
    document.getElementById( "flip_user_menu_div" ).style.paddingTop = "0px";
  }
}

