var prevQuestionId = null;

function question(id) {

	if(prevQuestionId != null)
		toggleLayer(prevQuestionId);
	
	toggleLayer(id);
	prevQuestionId = id;

}

function toggleLayer(whichLayer) {
    Vquestion = "q"+whichLayer;
    Vcontainer = "i"+whichLayer;
	if (document.getElementById)
	{
		// this is the way the standards work
		var style1 = document.getElementById(Vcontainer).style;
		style1.backgroundImage = style1.backgroundImage? "" : "url(assets/templates/pfhoogovens/images/arrow_down.jpg)";
		
		var style2 = document.getElementById(Vquestion).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way the standards work
		var style1 = document.all[Vcontainer].style;
		style1.backgroundImage = style1.backgroundImage? "" : "url(assets/templates/pfhoogovens/images/arrow_down.jpg)";
		// this is the way old msie versions work
		var style2 = document.all[Vquestion].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way the standards work
		var style1 = document.layers[Vcontainer].style;
		style1.backgroundImage = style1.backgroundImage? "" : "url(assets/templates/pfhoogovens/images/arrow_down.jpg)";
		
		// this is the way nn4 works
		var style2 = document.layers[Vquestion].style;
		style2.display = style2.display? "":"block";
	}
}
