// 1.0 Expanding and Contracting Boxes (independent) //

	function changeDisplayState(sBoxId,sLinkId)
	{
		if (document.getElementById) {
			oBox = document.getElementById(sBoxId);
			oLink = document.getElementById(sLinkId);
			if (oBox.style.display == "block"){
				oBox.style.display = "none";
				oLink.className = "off";
			}
			else {
				oBox.style.display = "block";
				oLink.className = "on";
			}
		}
	}


// 2.0 Expanding and Contracting Boxes (dependent) //




// 3.0	Expanding and Contracting Menu List //

	function getThis(sId)
	{
		var oObject;
		oObject = false;
		
		if (IS_DOM) {
			if (document.getElementById(sId)) {
				oObject = document.getElementById(sId);
			}
		}
		return oObject;
	}
	
	function changeStyle(oElement, sPropertyName, sNewValue)
	{
		if (oElement != false) {
			// get element style attribute
			oStyle = oElement.style;
			// apply new style value to provided property
			eval("oStyle." + sPropertyName + " = '" + sNewValue + "'");
		}
	}
	
	function getStyle(oElement, sPropertyName)
	{
		var sReturn = false;
		
		if (oElement != false) {
			oStyle = oElement.style;
			sReturn = eval("oStyle." + sPropertyName);
		}
		return sReturn;
	}
	
	/* START: Dropdown Menu Handler for Case Studies Navigation */
	oDropdown = false;
	
	function getDropdown()
	{
		oDropdown = getThis("countrySelector");
		if (oDropdown != false) {
			if (IS_IE) {
				oDropdown.onclick = handleDropdownClick;
			} else {
				oDropdown.addEventListener('click',handleDropdownClick,false);
			}
		}
	}
	
	window.onload = getDropdown;
	
	function handleDropdownClick()
	{
		sNewStyle = "visible";
		sCurrentStyle = getStyle(oDropdown, "overflow");
		if (sCurrentStyle == sNewStyle) {
			sNewStyle = "hidden";
		}
		changeStyle(oDropdown, "overflow", sNewStyle);
		return true;
	}


// 4.0	Rollover Show/Hide Element (textual link) //
	
	/* Number Image preloads */
	showHideTextual = new Array();
	showHideTextual = ["1","2","3","4"];
	for (i = 0; i < showHideTextual.length; i++) {
		eval("T"+i+"on = new Image();"); eval("T"+i+"off = new Image();");
		eval("T"+(i)+"on.src = \"images/home/btn-"+showHideTextual[i]+"-r.gif\";");
		eval("T"+(i)+"off.src = \"images/home/btn-"+showHideTextual[i]+"-0.gif\";");
	}
	
	function switchTextual(theProject,onImage,container) {
		
		var dhtmlTextualList = new Array();
		dhtmlTextualList = ["dhtmlTextOne","dhtmlTextTwo","dhtmlTextThree","dhtmlTextFour"];
		
		if (document.getElementById) {
			oLink = document.getElementById(onImage);
			oList = document.getElementById(container);
			oLinksCollection = oList.getElementsByTagName("a");
			for (i = 0; i < oLinksCollection.length; i++) {
				oLinksCollection[i].className = "off";
			}
			oLink.className = "on";
		}
	
		// turn off all divs
		for (i = 0; i < dhtmlTextualList.length; i++) {
			eval("document.getElementById('" + dhtmlTextualList[i] + "').style.display = 'none';");
		}
		// turn on the moused-over div
		document.getElementById(theProject).style.display = "block";
	}

// 5.0	Rollover Show/Hide Element (graphical link) //
	
	/* Number Image preloads */
	featuredProjects = new Array();
	featuredProjects = ["1","2","3","4"];
	for (i = 0; i < featuredProjects.length; i++) {
		eval("F"+i+"on = new Image();"); eval("F"+i+"off = new Image();");
		eval("F"+(i)+"on.src = \"files/btn-"+featuredProjects[i]+"-r.gif\";");
		eval("F"+(i)+"off.src = \"files/btn-"+featuredProjects[i]+"-0.gif\";");
	}
	
	function switchFeaturedProject(theProject,onImage) {
		
		var presentationList = new Array();
		presentationList = ["dhtmlGraphicalOne","dhtmlGraphicalTwo","dhtmlGraphicalThree","dhtmlGraphicalFour"];
		
		for (i = 0; i < 4; i++) {
			eval("changeImages('F" + i + "','F" + i + "off');");
		}
		eval("changeImages('" + onImage + "','" + onImage + "on');");
		
		// turn off all divs
		for (i = 0; i < presentationList.length; i++) {
			eval("document.getElementById('" + presentationList[i] + "').style.display = 'none';");
		}
		// turn on the moused-over div
		document.getElementById(theProject).style.display = "block";
	}

// 6.0 Homepage Randomizing Tagline //
	function imageRandomizer(){
		image = [];
		number = 0;
		
		// imageArray
		image[number++] = "<img src='files/template01.gif' width='100' height='50' alt='image one' />"
		image[number++] = "<img src='files/template02.gif' width='100' height='50' alt='image two' />"
		image[number++] = "<img src='files/template03.gif' width='100' height='50' alt='image three' />"
		image[number++] = "<img src='files/template04.gif' width='100' height='50' alt='image four' />"
		image[number++] = "<img src='files/template05.gif' width='100' height='50' alt='image five' />"
		image[number++] = "<img src='files/template06.gif' width='100' height='50' alt='image six' />"
		// keep adding items here...
		
		increment = Math.floor(Math.random() * number);
		document.write(image[increment]);				
	
	}