var imgHolder, theImgs, header, content, para, text, topnavholder, topnav;
var hdrtext = ['What Do We Do?','Our Selected Recent Publications...','Welcome','Computational Tools','New Class on Energy','News & Events','Links'];

function changeContent() {
    header.firstChild.data = '';
    header.firstChild.data = hdrtext[this.number];
    
    // be sure to escape each line break with a \ character
    switch (this.number) {
        case 0: 
        	content.innerHTML = '<p class="firstpara">The focus of our study is to develop a strong program in theoretical nano-science to chemically and physically characterize nanoparticles and to study their fate in the environment. Toward this end we are creating a novel multiscale computer simulation approach.</p>';
        	changeNav(0);
       		break;
        
        case 1: content.innerHTML = '<p class="firstpara"><strong>&bull;</strong> S. Fiedler, A. Violi "Simulating Carbonaceous Pollutant Nanoparticles An Aid to Discovery", EM Magazine, Aug 2009, Air & Waste Management Association<br/></p><strong>&bull;</strong> L. K. Huynh, Kuang C. Lin, A. Violi "Kinetic Modeling of Methyl Butanoate in Shock Tube", J. Phys. Chem. A 112(51): 13470-13480 (2008).</p>  \
		<p><strong>&bull;</strong> S. H. Chung, A. Violi "Insights on the Nanoparticle Formation Process in Counterflow Diffusion Flames", CARBON, 45(12): 2400-2410 (2007). <br/></p>';
        	changeNav(1);
        	break;
        
        case 2: content.innerHTML = '<p class="firstpara">Welcome to the Multiscale Computational Nanoscience Lab at the University of Michigan. This Lab is the research group of Professor Angela Violi, Associate Professor in the departments of Mechanical Engineering, Chemical Engineering and Biomedical Engineering.</p> \
        	<p>Current areas of research include chemical kinetics for real fuels. The study of nanoparticle growth and self-assembly and nanoparticle interactions with biomolecular systems.</p>';
        	changeNav(2);
        	break;
           
        case 3: content.innerHTML = '<p class="firstpara">Our research requires the use of sophisticated molecular and particle-based simulation, analysis, and visualization methods. Among the software we are using AMPI, CHARMM, CHEMKIN, DL_POLY, Gaussian, GROMACS, NAMD and VMD.</p> \
		<p>To aid our investigations, we develop and implement wherever necessary programs to describe multiscale processes.</p>';
        	changeNav(3);
        	break;

        case 4: content.innerHTML = '<p class="firstpara"><strong>ME599-01: Energy Processes for Novel Fuels</strong><br /><br />This class deals with the energy processes for the production of fuels. After an overview of the broader aspects of energy use from viewpoints of sustainability, resource availability, environmental effects and economics, a review of the fundamentals for the combustion chemistry of novel fuels will be presented.</p> \
		<p></p>';
        	changeNav(4);
        	break;
        
        case 5: content.innerHTML = '<p class="firstpara" style="margin-top: 10"><strong>Congratulations!</strong><br/><br/> The University of Michigan has approved <strong><br/>Prof. Violi\'s promotion to Associate Professor with Tenure.</strong><br/><br/><strong>(May 2009)</strong></p> \
		<p></p>';
        	changeNav(5);
        	break;
        
        case 6: content.innerHTML = '<p class="firstpara"></p> \
		<p></p>';
        	changeNav(6);
        	break;
        

    }
}

function defaultContent() {
    header.firstChild.data = '';
    header.firstChild.data = hdrtext[2];
    content.innerHTML = '<p class="firstpara">Welcome to the Multiscale Computational Nanoscience Lab at the University of Michigan. This Lab is the research group of Professor Angela Violi, Associate Professor in the departments of Mechanical Engineering, Chemical Engineering and Biomedical Engineering.</p> \
                <p>Current areas of research include chemical kinetics for real fuels. The study of nanoparticle growth and self-assembly and nanoparticle interactions with biomolecular systems.</p>'; 
    defaultNav();
}

function openWin() {
    open(this.href,'_blank','toolbar=1,location=1,status=1,top=25,left=25,resizable=1,scrollbars=1,width=500,height=400');
    return false;
}

function changeNav(chosen) {
    defaultNav();
    topnav[chosen].className = 'highlight';
}

function defaultNav() {
    for (var i=0; i<topnav.length; i++) {
        topnav[i].className = '';
    }
}

window.onload = function() {
  if (typeof document.getElementById != 'undefined') {
     imgHolder = document.getElementById('images');
     theImgs = imgHolder.getElementsByTagName('img');
     topnavholder = document.getElementById('cnav');
     topnav = topnavholder.getElementsByTagName('a');
     header = document.getElementById('mainheader');
     content = document.getElementById('indent');
     for (var i=0; i<theImgs.length; i++) {
         theImgs[i].number = i;
         theImgs[i].onmouseover = changeContent;
         theImgs[i].onmouseout = defaultContent;
     }
     for (i=0; i<6; i++) {
         topnav[i].number = i;
         topnav[i].onmouseover = changeContent;
         topnav[i].onmouseout = defaultContent;
     }

  }
  if (typeof document.getElementsByTagName != 'undefined') {
     var allLinks = document.getElementsByTagName('a');
     for (var i=0; i<allLinks.length; i++) {
        if ((allLinks[i].href.match(/\.pdf/)) || (allLinks[i].className=='newwin')) allLinks[i].onclick = openWin;
     }  
  }
}
