var t;
  function display_me(ids){
   clearTimeout(t);
   var to_do=ids;
   for(var i=0; i<to_do.length; i++){
   document.getElementById(to_do[i]).style.display='block';
   }
  }
  
  function hide_me(ids){
    var to_do=ids;
	for(var i=0; i<to_do.length; i++){
	shortcut=document.getElementById(to_do[i]);
	shortcut.style.display='none';
	}
  }
  
  function check_open(me,next,image){
    first=document.getElementById(me);
	next=document.getElementById(next);
      if(next.style.display='block'){
	    first.style.background='url(images/ongoing-past-over.gif)';
	}
  }
  
  function change_src(id,image){
    link=document.getElementById(id);
	link.src=image;
  }
  
  function rollover(id,image){
  link=document.getElementById(id);
    link.style.background='url('+image+')';
	link.style.opacity='1';
  }
  
  function going_on(id){
   link=document.getElementById(id);
   rollover(id,'images/ongoing-past-over.gif');
   link.style.color='#0099cc';
  }
  
  function going_off(id){
   link=document.getElementById(id);
   rollover(id,'images/ongoing-past.gif');
   link.style.color='#666666';
  }
  
  function small_on(id,child){
		if(child=="past"){
			rollover(id,'images/past_back_over.gif');
		}else{
			rollover(id,'images/items-ongoing-over.gif');
		}
  }
  
  function small_off(id,child){
		if(child=="past"){
			rollover(id,'images/past_back.gif');
		}else{
			 rollover(id,'images/items-ongoing.gif');
		}
  }
  
  function show_poster(image,cat,section,child,link){
   small_on(child,cat);
   link=document.getElementById(child);
   link.style.color='#0099cc';
   display_me(['poster']);
   document.getElementById('poster_img').src='images/'+image;
   document.getElementById('child_name').value=child;
   document.getElementById('cat_name').value=cat;
   document.getElementById('section').value=section;

  }
  
  function hide_poster(child,cat){
   small_off(child,cat);
   link=document.getElementById(child);
   link.style.color='#666666';
   hide_me(['poster'])
  }
  
  function poster_on(child){
  var cat_name;
  var child_name;
  var section;
   change_src('projects','images/projects-over.gif');
   cat_name=document.getElementById('cat_name').value;
   going_on(cat_name);
   child_name=document.getElementById('child_name').value;
   section=document.getElementById('section').value;
   display_me(['poster',section,'first_child_layer']);
   document.getElementById(child_name).style.color='#0099cc';
   small_on(child_name,cat_name);
  }
  
  function poster_off(){
  var cat_name;
  var child_name;
   hide_me(['poster','second_child_layer','first_child_layer']);
   change_src('projects','images/projects.gif');
   cat_name=document.getElementById('cat_name').value;
   child_name=document.getElementById('child_name').value;
   document.getElementById(child_name).style.color='#666666';
   going_off(cat_name);
   small_off(child_name,cat_name);
  }