function toggle_visibility(id) {
   var e = document.getElementById(id);
   if(e.style.display == 'block')
      e.style.display = 'none';
   else
      e.style.display = 'block';
}

function show_visibility(id) {
   var e = document.getElementById(id);
      e.style.display = 'block';
}

function toggle_visibility_inline(id) {
   var e = document.getElementById(id);
   if(e.style.display == 'inline')
      e.style.display = 'none';
   else
      e.style.display = 'inline';
}

function toggle_visibility_tablerow(id) {
   var e = document.getElementById(id);
   if(e.style.display == 'table-row')
      e.style.display = 'none';
   else
      e.style.display = 'table-row';
}

function show_visibility_inline(id) {
   var e = document.getElementById(id);
      e.style.display = 'inline';
}

function hide_visibility(id) {
   var e = document.getElementById(id);
      e.style.display = 'none';
}

// ACC matherials

function show_visibility_maths( el, id) {
   var box = $( "#tmBox" )[0];
   var e = $( "#"+id )[0];
   var c = $( ".col3")[0];

   var top=$( el ).offset().top;
   var height=$( e ).height()+25;

   if ( top+height>$(window).height()+$(window).scrollTop() ) {
	top=$(window).height()+$(window).scrollTop()-height;
	}

   if ( top+height > $(document).height()-62 ) {
	top=$(document).height()-62-height;
	}

   if ( box.style ) {
	   box.style.position="absolute";
	   box.style.top=( top )+"px";
	   box.style.left=( $( c ).offset().left )+"px";
	   box.style.width=(  $( c ).width() )+"px";

	   e.style.display = 'block';
	   }
   }



