/**
 * toggle div items
 *
 * @param prefix	the prefix of the div item to hide or show
 * @param id 		the id of the div item to hide or show
 * @param single	true to show only one item at a time, false the open as many as you want
 */
function toggleDiv(prefix, id, single) {
		
	if(single) {
		//show only one div at a time
		toggleDivAll(prefix, false);		
		showHideDiv(prefix, id, true);
	}
	else {
		//open as many as you like
		if(document.getElementById(prefix+id).style.display == 'none') {
			showHideDiv(prefix, id, true);
		}
		else {
			showHideDiv(prefix, id, false);
		}			
	}	
}

/**
 * shows or hides a div item at a time depending on the given status
 *
 * @param prefix	the prefix of the div item to hide or show
 * @param id 		the id of the div item to hide or show
 * @param status	true to show the item, false to hide it
 */
function showHideDiv(prefix, id, status) {
	var div_id = prefix+id; //answer
	var icon_id  = prefix+id; // plus/minus icon
	
	if(status) {
		document.getElementById(div_id).style.display = 'block';
		//document.getElementById(icon_id).src = prefix+"_iconMinus";
	}
	else {
		document.getElementById(div_id).style.display = 'none';	
		//document.getElementById(icon_id).src = prefix+"_iconPlus";
	}
}

/**
 * shows or hides all divs items with one click
 *
 * @param prefix	the prefix of the div item to hide or show
 * @param mode		true to show the items, false to hide them
 * @param count		total items to show
 */
function toggleDivAll(prefix, mode, count) {
	for(i = 0; i < count; i++) {
		showHideFaq(prefix, i+1, mode);
	}				
}
