// JavaScript Document
function showDescription(){
	
	var str = this.id;
	elemNum = parseInt(str.substring(5));

	if (descriptionHide[elemNum] == true){
		this.style.backgroundImage='url(img/arrow_up.gif)';
		document.getElementById('description'+elemNum).style.display='none';
		descriptionHide[elemNum] = false;
	}else{
		this.style.backgroundImage='url(img/arrow_down.gif)';
		document.getElementById('description'+elemNum).style.display='block';
		descriptionHide[elemNum] = true;
	}

};


function underline(){
	this.style.textDecoration = 'underline';
	document.body.style.cursor= 'pointer';
}

function un_underline(){
	this.style.textDecoration = 'none';	
	document.body.style.cursor= 'text';
}

function initShowHide(){
	// count the h3's where the show hide will take place
	var tagsArray = document.getElementsByTagName('h3');
	numberOfObjects = tagsArray.length;

	descriptionHide = new Array();
	i = 1;
	while(i<=numberOfObjects){
		document.getElementById('arrow'+i).onclick = showDescription;
		document.getElementById('arrow'+i).onmouseover = underline;
		document.getElementById('arrow'+i).onmouseout = un_underline;
		// Define array as global to be able to pass to other functions
		descriptionHide[i-1] = false;
		i ++;
	}
}
	