// 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 //
	
	
	// begin homepage scripts	

	function imageRandomizer(){
		image = [];
		number = 0;
		
		// imageArray
		image[number++] = "<img src='img/art/homepage/homepage01.jpg' width='557' height='209' alt='' />"
		// keep adding items here...
		
		increment = Math.floor(Math.random() * number);
		document.write(image[increment]);				
	
	}
	
	function attorneyRandomizer(){
		image = [];
		number = 0;
		
		// imageArray
		image[number++] = "<a href='" + "http://cowan/~development/burns_and_levinson/bur001-www/buildarea/www/our-attorneys/attorney-detail.asp?id=138&scrollpos=1343'" + "><img src='img/homepage/focus-attorney/attny-f-segall.jpg' width='221' height='247' alt='' /></a>"
		image[number++] = "<a href='" + "http://cowan/~development/burns_and_levinson/bur001-www/buildarea/www/our-attorneys/attorney-detail.asp?id=145&scrollpos=1343'" + "><img src='img/homepage/focus-attorney/attny-l-studen.jpg' width='221' height='247' alt='' /></a>"
		image[number++] = "<a href='" + "http://cowan/~development/burns_and_levinson/bur001-www/buildarea/www/our-attorneys/attorney-detail.asp?id=138&scrollpos=1343'" + "><img src='img/homepage/focus-attorney/attny-p-mastrocola.jpg' width='221' height='247' alt='' /></a>"
		// keep adding items here...

		increment = Math.floor(Math.random() * number);
		document.write(image[increment]);				
	
	}
	
	// end homepage scripts	

	function quoteRandomizerAttorneys(section){
		image = [];
		number = 0;
		
		// imageArray
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-01.gif' width='221' height='247' alt='' />"
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-02.gif' width='221' height='247' alt='' />"
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-03.gif' width='221' height='247' alt='' />"
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-04.gif' width='221' height='247' alt='' />"
		// keep adding items here...
		
		increment = Math.floor(Math.random() * number);
		document.write(image[increment]);				
	
	}
	
	function quoteRandomizerFirm(section){
		image = [];
		number = 0;
		
		// imageArray
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-01.gif' width='221' height='247' alt='' />"
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-02.gif' width='221' height='247' alt='' />"
		// keep adding items here...
		
		increment = Math.floor(Math.random() * number);
		document.write(image[increment]);				
	
	}
	
	function quoteRandomizerPractices(section){
		image = [];
		number = 0;
		
		// imageArray
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-01.gif' width='221' height='247' alt='' />"
		image[number++] = "<img src='../img/art/landing/quote-" + section + "-02.gif' width='221' height='247' alt='' />"
		// keep adding items here...
		
		increment = Math.floor(Math.random() * number);
		document.write(image[increment]);				
	
	}			
	
	
