

//-------- BEGIN: Close and open divs------------------// 
function closediv (divtoclose){
	//close (hide) a div - send the name of the div you want to close
	var divname = document.getElementById(divtoclose);
	divname.style.display = 'none';
}

function opendiv (divtoopen){
	// open (show) a div - send the name of the div you want to close
	var divname = document.getElementById(divtoopen);
	divname.style.display = 'block';
}

//-------- BEGIN: Stacking Divs (right hand column) ------------------// 

var t;
	var i = 300;
	var ii = i;
	var iii = i;
	var iv = i;
	var v = i;
	
	function  stack1() {
		
			var boxObj1 = document.getElementById("div1");
			boxObj1.style.margin='0 0 5px '+ i +'px';
			if (i == 0)return;
			if (i == 220)stack2(); 
			i--;
			t=setTimeout("stack1()",1);
	
		}
	function stack2() {
			var boxObj2 = document.getElementById("div2");
			boxObj2.style.margin='0 0 5px '+ ii +'px';
			if (ii == 0)return;
			if (ii == 220)stack3();
			ii--;
			t=setTimeout("stack2()",1);
		}
		
	function stack3() {
			var boxObj3 = document.getElementById("div3");
			boxObj3.style.margin='0 0 5px '+ iii +'px';
			if (iii == 0)return;
			if (iii == 220)stack4();
			iii--;
			t=setTimeout("stack3()",1);
		}
	
	function stack4() {
			var boxObj4 = document.getElementById("div4");
			boxObj4.style.margin='0 0 5px '+ iv +'px';
			if (iv == 0)return;
			if (iv == 220)stack5();
			iv--;
			t=setTimeout("stack4()",1);
		}
	
	function stack5() {
			var boxObj5 = document.getElementById("div5");
			boxObj5.style.margin='0 0 5px '+ v +'px';
			if (v == 0)return;
			v--;
			t=setTimeout("stack5()",1);
		}