// header definitions and functions

function expandMainMenu(button){
	document.getElementById('Button'+button).style.display='block';
}

function collapseMainMenu(button){
	document.getElementById('Button'+button).style.display='none';
}

function expandSideMenu(button){
	document.getElementById('Side'+button).style.display='block';
}

function collapseSideMenu(button){
	document.getElementById('Side'+button).style.display='none';
}

function getSize() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myWidth = document.body.clientWidth;
  }
  return myWidth;
}

showing=[0,0,0];
function show_hide(index){
	if(showing[index]){
		showing[index]=0;document.getElementById('segment'+index).style.display='none';document.getElementById('button'+index).innerHTML='<span onclick="show_hide('+index+');" style="color:#A65905; font-weight:bold;cursor:pointer;">[show older entries]</span>';
	}else{
		showing[index]=1;document.getElementById('segment'+index).style.display='';document.getElementById('button'+index).innerHTML='<span onclick="show_hide('+index+');" style="color:#A65905; font-weight:bold;cursor:pointer;">[hide older entries]</span>';
	}
}

function rotator_top(){
	num_images=12;
	random=Math.floor(Math.random()*num_images+1);
	document.getElementById('rotator_top').src='_images/top_slides/slide'+random+".jpg";
}
