	/*  The scripts in this file are for use with the dropdown menus of all CIDCM pages EXCEPT the homepage.  */

	var arrTheme = [

			{ name:'', color:'' },
			{ name:'Research and Data Sets', color:'#C3B996' },
			{ name:'Policy Analysis', color:'#94A6AA' },
			{ name:'Training and Practice', color:'#ABB79F' },
			{ name:'Education', color:'#C3A696' }

			];

	function display_menu(themeElem) {

		if (!document.getElementById) return;

		var menuIcon;
		var menu;

		hide_menus(pageTheme);

		themeElem.style.backgroundColor = '#B3BABD';

		menuIcon = themeElem.firstChild.firstChild.nextSibling.firstChild

		menuIcon.style.display = 'none';

		menu = themeElem.firstChild.lastChild

		menu.style.display = 'block';

	}


	function hide_menus(themeName) {

		if (!document.getElementById) return;

		var themeElem;
		var menuIcon;
		var menu;
		var i;

		for (i = 1; i <= 4; i++) {

			themeElem = document.getElementById('theme_' + i);

			if(themeName) {

				if (themeName.toLowerCase() == arrTheme[i].name.toLowerCase()) {

					themeElem.style.backgroundColor = arrTheme[i].color;

				} else {

					themeElem.style.backgroundColor = '#959595';

				}

			} else {

				themeElem.style.backgroundColor = arrTheme[i].color;

			}

			menuIcon = themeElem.firstChild.firstChild.nextSibling.firstChild

			menuIcon.style.display = 'block';

			menu = themeElem.firstChild.lastChild

			menu.style.display = 'none';

		}

	}
