// ************************
	// 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"



  

 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"

 

  

 locationThemedDescriptions = new (Array)();

        locationThemedPhotos = new (Array)();
        locationThemedCaptions = new (Array)();

        function setTheme(themeCode) {
          var content= _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('locationThemedContent');
          if ( _proxy_jslib_handle(null, 'content', content, 0, 0)!=null) {
                _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'content', content, 0, 0), 'innerHTML', '=', (   _proxy_jslib_handle(locationThemedDescriptions, (themeCode), 0, 0)));
          }
           content= _proxy_jslib_assign_rval('', 'content', '=', ( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('home_defaultPhoto')), content);
          if ( _proxy_jslib_handle(null, 'content', content, 0, 0)!=null) {
                _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'content', content, 0, 0), 'innerHTML', '=', (  _proxy_jslib_handle(locationThemedPhotos, (themeCode), 0, 0)));
          }
           content= _proxy_jslib_assign_rval('', 'content', '=', ( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('home_defaultHeading')), content);
          if ( _proxy_jslib_handle(null, 'content', content, 0, 0)!=null) {
                _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'content', content, 0, 0), 'innerHTML', '=', (  _proxy_jslib_handle(locationThemedCaptions, (themeCode), 0, 0)));
          }
        }


        function processThemes(type, data, evt) {
           var themes= _proxy_jslib_handle(data, 'getElementsByTagName', '', 1, 0)("theme");
           var i;
           var defThemeNum=0;

           for (i=0;i<themes.length;i++) {
              var heads= _proxy_jslib_handle( _proxy_jslib_handle(themes, (i), 0, 0), 'getElementsByTagName', '', 1, 0)("headline");
              var headline= _proxy_jslib_handle(heads[0].firstChild, 'nodeValue', '', 0, 0);
              var project= _proxy_jslib_handle( _proxy_jslib_handle(themes, (i), 0, 0), 'getElementsByTagName', '', 1, 0)("project")[0];
              var title= _proxy_jslib_handle( _proxy_jslib_handle(project, 'getElementsByTagName', '', 1, 0)("title")[0].firstChild, 'nodeValue', '', 0, 0);
              var def=project.getAttribute("default");
              if (def=="true") {
                 defThemeNum=i;
              }
              var article= _proxy_jslib_handle( _proxy_jslib_handle(themes, (i), 0, 0), 'getElementsByTagName', '', 1, 0)("article")[0];
              var articleText= _proxy_jslib_handle( _proxy_jslib_handle(project, 'getElementsByTagName', '', 1, 0)("teaser")[0].firstChild, 'nodeValue', '', 0, 0);
              var articleLink=article.getAttribute("linkID");
              var photo= _proxy_jslib_handle(project, 'getElementsByTagName', '', 1, 0)("photo")[0];
              var photoLink=photo.getAttribute("alternateID");
              var submitter=photo.getAttribute("author");
              var email=photo.getAttribute("emailAddress");
               _proxy_jslib_assign('', locationThemedDescriptions, (i), '=', ('<div class=\"homeThemedHeader\">'+ _proxy_jslib_handle(locationThemedName, (i), 0, 0)+'</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>'))

  _proxy_jslib_assign('', locationThemedPhotos, (i), '=', ('<img alt=\"\" border=\"0\" height=\"236\" src=\"'+photoLink+'\" width=\"236\"/>'));
               _proxy_jslib_assign('', 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);
              }
	} ;
_proxy_jslib_flush_write_buffers() ;