menu_status = new Array();
// SET [EXPAND] IMAGE FILE NAME:
var imagePLUS='images/plus.gif';
// SET [COLLAPSE] IMAGE FILE NAME:		
var imageMINUS	='images/minus.gif';
	
function showHide(theid){
    if (document.getElementById) {
          var switch_id = document.getElementById(theid);
		  var img_id = document.getElementById(theid+'_cursor');
        if(menu_status[theid] != 'byzcu_show') 
		{
           switch_id.className = 'byzcu_show'; 
           menu_status[theid] = 'byzcu_show';
		   //set image cursor
		   img_id.setAttribute('src',imageMINUS);		   
		   //set cookie
           set_cookie(theid,'byzcu_hide');
        }else{
           switch_id.className = 'byzcu_hide';
           menu_status[theid] = 'byzcu_hide';
		   //set image cursor
		   img_id.setAttribute('src',imagePLUS);		   
		   //set cookie
           set_cookie(theid,'byzcu_show');
        }
    }
}

function showHideAll()
{
      var menuState;
	  var img_id;
	  for (z=0; z<11; z++)
	  {
		  if (document.getElementById('byzcu_mymenu'+z))
		  {
			  menuState = get_cookie ('byzcu_mymenu'+z); 
			  if (menuState != null){
			  menu_status['byzcu_mymenu'+z]=menuState;
			  showHide('byzcu_mymenu'+z);
			  //set image cursor
			   img_id = document.getElementById('byzcu_mymenu'+z+'_cursor');
			   if(menuState=='byzcu_hide')
			   {
				   img_id.setAttribute('src',imageMINUS);	
			   }
			   else
			   {
				   img_id.setAttribute('src',imagePLUS);	
			   }  
			}
		  }
		  
		  if (document.getElementById('byzcu_mymenu1'+z))
		  {
			  menuState = get_cookie ('byzcu_mymenu1'+z); 
			  if (menuState != null){
			  menu_status['byzcu_mymenu1'+z]=menuState;
			  showHide('byzcu_mymenu1'+z);
			  
			  //set image cursor
			   img_id = document.getElementById('byzcu_mymenu1'+z+'_cursor');
			   if(menuState=='byzcu_hide')
			   {
				   img_id.setAttribute('src',imageMINUS);	
			   }
			   else
			   {
				   img_id.setAttribute('src',imagePLUS);	
			   }  
			  } 
		  }
	  }

}



function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );


  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );

  if ( secure )
        cookie_string += "; secure";

  document.cookie = cookie_string;
}
