	// ************************
	// Arrays that contain the content for each CMU Themed Homepage Tab
	
	//Nav Array
	navArray = new Array();
	navArray[0] = "toptab_01"
	navArray[1] = "toptab_02"
	navArray[2] = "toptab_03"
	navArray[3] = "toptab_04"
	navArray[4] = "toptab_05"

	// Location Themed Header
	locationThemedName = new Array()
	
	locationThemedName[0] = "Energy &#38; the Environment"
	locationThemedName[1] = "Health &#38; Wellness"
	locationThemedName[2] = "Creativity &#38; the Arts"
	locationThemedName[3] = "Global Society &#38; Economy"
	locationThemedName[4] = "Next Generation Computing"
				
	// Location Content Description for each Theme
	locationThemedDescriptions = new Array();

        locationThemedPhotos = new Array();
        locationThemedCaptions = new Array();

        function setTheme(themeCode)
        {
          var content=document.getElementById('locationThemedContent');
          if (content!=null) {
               content.innerHTML =  locationThemedDescriptions[themeCode];
          }
          content=document.getElementById('home_defaultPhoto');
          if (content!=null) {
               content.innerHTML = locationThemedPhotos[themeCode];
          }
          content=document.getElementById('home_defaultHeading');
          if (content!=null) {
               content.innerHTML = locationThemedCaptions[themeCode];
          }
        }


        function processThemes(type, data, evt)
        {
           var themes=data.getElementsByTagName("theme");
           var i;
           var defThemeNum=0;

           for (i=0;i<themes.length;i++) {
              var heads=themes[i].getElementsByTagName("headline");
              var headline=heads[0].firstChild.nodeValue;
              var project=themes[i].getElementsByTagName("project")[0];
              var title=project.getElementsByTagName("title")[0].firstChild.nodeValue;
              var def=project.getAttribute("default");
              if (def=="true") {
                 defThemeNum=i;
              }
              var article=themes[i].getElementsByTagName("article")[0];
              var articleText=project.getElementsByTagName("teaser")[0].firstChild.nodeValue;
              var articleLink=article.getAttribute("linkID");
              var photo=project.getElementsByTagName("photo")[0];
              var photoLink=photo.getAttribute("alternateID");
              var submitter=photo.getAttribute("author");
              var email=photo.getAttribute("emailAddress");
              locationThemedDescriptions[i]='<div class=\"homeThemedHeader\">'+locationThemedName[i]+'</div><br/><div class=\"homeThemedSubHeader\">'+title+'</div><br/><div class=\"homeThemedContent\">'+articleText+'<br/><br/><a href=\"'+articleLink+'\"><img src=\"../homeimages/home_btn_readarticle.gif\" alt=\"Read Article\" width=\"102\" height=\"15\" border=\"0\"></a></div>'
              locationThemedPhotos[i]='<img alt=\"\" border=\"0\" height=\"236\" src=\"'+photoLink+'\" width=\"236\"/>';
              locationThemedCaptions[i]=title;
           }
           setTheme(defThemeNum);
        }

	

	// ************************
	
	function swapThemes(themeCode)
	{
              if (locationThemedDescriptions.length==0) {
                 dojo.io.bind({
                   url:"../themes.xml",
                   useCache:true,
                   preventCache:true,
                   mimetype:"text/xml",
                   load:dojo.lang.hitch(this,this.processThemes)
                  });                
              }
              else {
                 setTheme(themeCode);
              }
	}