// 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","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"];
	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";
	}

		/* for In the News */
		
		function switchAward(theProject,onImage,container) {
			
			var dhtmlTextualList = new Array();
			dhtmlTextualList = ["ashkin","paw","pa","toby","pinnacle","bmoa","elc","fmcpba","supplier","vendor","uqca","safety","recycling","plant","director","mentoring","triple","quest","frost","frost2"];
			
			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++) {
				if (dhtmlTextualList[i] != theProject) {
					eval("document.getElementById('" + dhtmlTextualList[i] + "').style.display = 'none';");
				}
			}
			// turn on the moused-over div
			if (document.getElementById(theProject).style.display != "block") {
				document.getElementById(theProject).style.display = "block";				
			} else {
				document.getElementById(theProject).style.display = "none";
				oLink.className = "off";
			}
		}
	

// 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]);				
	
	}*/
	
// ----- rotating who we serve logos -----//	
	
function rotateHomepageArt(iStart,sIndustry)
{
	if (document.getElementById) {
		if (sIndustry == 'comm') {
			var aHomepageArt = ["equity-office", "hines", "cadillac-fairview", "jones-lang-lasalle"];
		} else if (sIndustry == 'plant') {
			var aHomepageArt = ["scientific-atlanta", "gulfstream", "cargill", "wyeth", "weyerhaeuser"];
		} else if (sIndustry == 'edu') {
			var aHomepageArt = ["harvard", "univ-miami", "lesley", "rider"];
		} else if (sIndustry == 'retail') {
			var aHomepageArt = ["simon", "staples", "tjx", "tanger-outlets", "macerich-company"];
		} else if (sIndustry == 'financial') {
			var aHomepageArt = ["bank-of-america", "fidelity", "liberty-mutual"];
		} else if (sIndustry == 'govt') {
			var aHomepageArt = ["usgao", "gsa", "uspto"];
		} else if (sIndustry == 'public') {
			var aHomepageArt = ["mia", "gillette-stadium", "museum-of-science", "air-canada-centre"];
		}
		var iDivisor = aHomepageArt.length;
		var iImg = iStart % iDivisor;
		iStart++;
		
		oImg = document.getElementById("logoPlace");
		oImg.src = sFolderLevel + "img/focus/focus-logos/logo-" + aHomepageArt[iImg] + ".gif";
		sFunctionName = "rotateHomepageArt(" + iStart + ", '" + sIndustry + "')"
		setTimeout(sFunctionName, 2000);
	}
	
}

function imageRandomizerCommercial()
{
	rotateHomepageArt(0,"comm");
}

function imageRandomizerPlant()
{
	rotateHomepageArt(0,"plant");
}

function imageRandomizerEducation()
{
	rotateHomepageArt(0,"edu");
}

function imageRandomizerRetail()
{
	rotateHomepageArt(0,"retail");
}

function imageRandomizerGovernment()
{
	rotateHomepageArt(0,"govt");
}

function imageRandomizerPublic()
{
	rotateHomepageArt(0,"public");
}

function imageRandomizerFinancial()
{
	rotateHomepageArt(0,"financial");
}


// ----- randomizing 'awards and associations' callouts -----//	


function rotateHomepageArt(iStart,sIndustry)
{
	if (document.getElementById) {
		if (sIndustry == 'comm') {
			var aHomepageArt = ["equity-office", "hines", "cadillac-fairview", "jones-lang-lasalle"];
		} else if (sIndustry == 'plant') {
			var aHomepageArt = ["scientific-atlanta", "gulfstream", "cargill", "wyeth"];
		} else if (sIndustry == 'edu') {
			var aHomepageArt = ["univ-miami", "lesley", "rider"];
		} else if (sIndustry == 'retail') {
			var aHomepageArt = ["simon", "staples", "tjx", "tanger-outlets", "macerich-company"];
		} else if (sIndustry == 'financial') {
			var aHomepageArt = ["bank-of-america", "fidelity", "liberty-mutual"];
		} else if (sIndustry == 'govt') {
			var aHomepageArt = ["usgao", "gsa", "uspto"];
		} else if (sIndustry == 'public') {
			var aHomepageArt = ["bcec", "mia", "gillette-stadium", "museum-of-science", "air-canada-centre"];
		}
		var iDivisor = aHomepageArt.length;
		var iImg = iStart % iDivisor;
		iStart++;
		
		oImg = document.getElementById("logoPlace");
		oImg.src = sFolderLevel + "img/focus/focus-logos/logo-" + aHomepageArt[iImg] + ".gif";
		sFunctionName = "rotateHomepageArt(" + iStart + ", '" + sIndustry + "')"
		setTimeout(sFunctionName, 2000);
	}
	
}

function rotateImageAward(iStart) {
	var aAwards = ["texinst", "polyone", "frost", "cargill", "boma", "dow", "geon", "liberty-mutual", "ndsc", "president"];
	var oImg = document.getElementById("awardImage");
	
	if (iStart > aAwards.length - 1) {
		iStart = 0;
	}
	oImg.src = sFolderLevel + "img/focus/focus-logos/award-" + aAwards[iStart] + ".gif";
	iStart++;
	sFunctionName = "rotateImageAward(" + iStart + ")";
	setTimeout(sFunctionName, 3000);
}




// ----- randomizing 'awards and associations' callouts -----//	
	function awardsRandomizer(){
		var oContainer = document.getElementById("focusSub");
		var aAwards = oContainer.getElementsByTagName("p");
		var iRandom = Math.floor(Math.random() * aAwards.length);

		aAwards[iRandom].className = "show";
	}

