// Written by Aien @ Ahmad Azarinurazie for IIA frontpage headline
// Created on 18th April 2008
// Last modified on 

function toggleHeadline(obj) {
	obj = obj.parentNode;
	
	var obj_id = obj.id;
	
	//Loop through tab's siblings and turn all the designs to un-selected mode
	for (i=0; i<obj.parentNode.childNodes.length; i++) {
		if (obj.parentNode.childNodes[i].nodeName == "LI") {
			obj.parentNode.childNodes[i].className = "off";
		}
	}
	
	//Turn the design of required tab to selected mode
	obj.className = "on";
	
	obj = document.getElementById('headline-content');
	
	//Loop through all content's siblings and hide them
	for (i=0; i<obj.childNodes.length; i++) {
		if (obj.childNodes[i].nodeName == "LI") {
			obj.childNodes[i].className = "hide";
		}
	}
	
	//Display the required content
	document.getElementById(obj_id + '_content').className = "show";
}