﻿// JScript File

// ------------------------------------------------------------------
/*
function blinklink()
{
if (!document.getElementById('blink').style.color)
	{
	document.getElementById('blink').style.color="yellow"
	}
if (document.getElementById('blink').style.color=="yellow")
	{
	document.getElementById('blink').style.color="white"
	}
else
	{
	document.getElementById('blink').style.color="yellow"
	}
timer=setTimeout("blinklink()", 100)
}

function stoptimer()
{
    clearTimeout(timer);
}
*/
//-----------------------------------------
    delay = 3700;            // delay time of the animations (.1 sec.)
    imgNumber = 0;          // number of the image in the animation 
    totalimgNumber = 37;     // total number of images
    anim = new Array();     // images array

    // text Array
    var textArray = new Array();
    
    textArray[0] = "<strong>Back</strong>: Provost David Kertzer, Associate Provost Pam O'Neil, Charles Lawrence, Daniel Weinreich, Vice President for Research Clyde Briant, Sorin Istrail.   <strong>Front</strong>: Alex Brodsky, Jean Wu, Ben Raphael, Will Fairbrother.";
    textArray[1] = "Daniel Weinreich and William Thompson";
    textArray[2] = "Brown University President Ruth Simmons introducing Craig Venter during the 2006 Symposium, \"The Genome and the Computational Sciences: The Next Paradigms\".";
    textArray[3] = "Ben Raphael delivering a presentation on his research foci.";
    textArray[4] = "Sorin Istrail presenting the Distinguished 10th Anniversary Award to the founding fathers of the oldest Computational Biology Program in the world: Bill Suggs, Franco Preparata, and David Rand ";
    textArray[5] = "The 2006 Symposium \"The Genome and the Computational Sciences: The Next Paradigms\" Keynote speaker Craig Venter";
    textArray[6] = "Franco Preparata, Bill Suggs, Charles Lawrence, Daniel Weinreich, and William Thompson";
    textArray[7] = "David E. Shaw from D.E. Shaw Research responding to questions during the December 2006 Symposium, \"The Genome and the Computational Sciences: The Next Paradigms\".";
    textArray[8] = "";
    textArray[9] = "Map of the Human Genome";
    textArray[10] = "Sorin Istrail";
    textArray[11] = "Jean Wu and Suzanne Sindi";
    textArray[12] = "Associate Provost Pam O'Neil, Vice President for Research Clyde Briant, and Provost David Kertzer";
    textArray[13] = "";
    textArray[14] = "Sorin Istrail delivering a CCMB overview presentation.";
    textArray[15] = "Associate Provost Pam O'Neil and Vice President for Research Clyde Briant";
    textArray[16] = "Vice President for Research Clyde Briant";
    textArray[17] = "Leon Cooper and President Ruth Simmons";
    textArray[18] = "Jeffrey Skolnick";
    textArray[19] = "Eric Kronstadt";
    textArray[20] = "";
    textArray[21] = "Symposium participants, organizers, and attendees";
    textArray[22] = "";
    textArray[23] = "Craig Venter";
    textArray[24] = "David E. Shaw";
    textArray[25] = "Stephen Hoffman and President Ruth Simmons";
    textArray[26] = "Jean Wu";
    textArray[27] = "Dan Weinreich";
    textArray[28] = "Suzanne Sindi";
    textArray[29] = "";
    textArray[30] = "Associate Provost Pam O'Neil and Vice President for Research Clyde Briant";
    textArray[31] = "";
    textArray[32] = "";
    textArray[33] = "Associate Provost Pam O'Neil, Vice President for Research Clyde Briant, and Provost David Kertzer";
    textArray[34] = "";
    textArray[35] = "";
    textArray[36] = "Will Fairbrother";
    textArray[37] = "";
    

    // creating image array
    for (i = 0; i < totalimgNumber; i++) 
    {
        anim[i] = new Image (239, 390);
        anim[i].src = './images/anim/2' + (i + 1) + '.jpg';
    } 
    
    // switching images
    function Switch() 
    {   
        document.getElementById('waveanim').src = anim[imgNumber].src;
        changeText();
        imgNumber++;
        
        if(imgNumber >= totalimgNumber) 
            imgNumber = 0; 
    }
    
    // animating
    function animate() 
    {
        Switch();
        setTimeout( "animate()", delay);
    }    

    // changing texts
    function changeText()
    { 
	    document.getElementById('textUnderImage').innerHTML =  textArray[imgNumber];
	}

//-------------------------------

    delay1 = 5000;            // delay time of the animations (.1 sec.)
    imgNumber1 = 0;          // number of the image in the animation 
    totalimgNumber1 = 6;     // total number of images
    anim1 = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber1; i++) 
    {
        anim1[i] = new Image(239, 390);
        anim1[i].src = './images/anim/0' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch1() 
    {   
        document.getElementById('waveanim1').src = anim1[imgNumber1].src;
        imgNumber1++;
           if(imgNumber1 >= totalimgNumber1) 
                imgNumber1 = 0; 
    }
    // animating
    function animate1() 
    {
        Switch1();
        setTimeout( "animate1()", delay1);
    }
//------------------------------

    delay2 = 3700;            // delay time of the animations (.1 sec.)
    imgNumber2 = 0;          // number of the image in the animation 
    totalimgNumber2 = 14;     // total number of images
    anim2 = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber2; i++) 
    {
        anim2[i] = new Image(239, 390);
        anim2[i].src = './images/anim/1' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch2() 
    {   
        document.getElementById('waveanim2').src = anim2[imgNumber2].src;
        imgNumber2++;
           if(imgNumber2 >= totalimgNumber2) 
                imgNumber2 = 0; 
    }
    // animating
    function animate2() 
    {
        Switch2();
        setTimeout( "animate2()", delay2);
    }

//-----------------------------

    delay3 = 5700;            // delay time of the animations (.1 sec.)
    imgNumber3 = 0;          // number of the image in the animation 
    totalimgNumber3 = 3;     // total number of images
    anim3 = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber3; i++) 
    {
        anim3[i] = new Image(239, 390);
        anim3[i].src = './images/anim/3' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch3() 
    {   
        document.waveanim3.src = anim3[imgNumber3].src;
        imgNumber3++;
           if(imgNumber3 >= totalimgNumber3) 
                imgNumber3 = 0; 
    }
    // animating
    function animate3() 
    {
        Switch3();
        setTimeout( "animate3()", delay3);
    }

//-----------------------------




// distinguish 2007-2008 on the index page
//-----------------------------

    delay4 = 4000;            // delay time of the animations (.1 sec.)
    imgNumber4 = 0;          // number of the image in the animation 
    totalimgNumber4 = 3;     // total number of images
    anim4 = new Array();     // images array

    // creating image array
    for (i = 0; i < totalimgNumber4; i++) 
    {
        anim4[i] = new Image(239, 390);
        anim4[i].src = './images/anim/4' + (i + 1) + '.jpg';
    } 
    // switching images
    function Switch4() 
    {   
        document.getElementById('waveanim4').src = anim4[imgNumber4].src;
        imgNumber4++;
           if(imgNumber4 >= totalimgNumber4) 
                imgNumber4 = 0; 
    }
    // animating
    function animate4() 
    {
        Switch4();
        setTimeout( "animate4()", delay4);
    }

//-----------------------------




function init()
{
    document.waveanim = new Object();
    document.waveanim1 = new Object();
    document.waveanim2 = new Object();
    document.waveanim3 = new Object();
    document.waveanim4 = new Object();
    document.div1 = new Object();
    document.div10 = new Object();
    document.div2 = new Object();
    document.div20 = new Object();
    document.div3 = new Object();
    document.div30 = new Object();
    document.div31 = new Object();
    document.div4 = new Object();
    document.div40 = new Object();
    document.div5 = new Object();
    document.div50 = new Object();
    
}

function start()
{

    //blinklink();
    init();
    animate();
    animate1();
    animate2();
    animate3();
    animate4();
}

 function HideContent(d) 
 {
        if(d.length < 1) 
        { 
            return; 
        }
        
        document.getElementById(d).style.display = "none";
 }
 
 function ShowContent(d) 
 {
        if(d.length < 1) 
        { 
            return; 
        }
        
        document.getElementById(d).style.display = "block";
 }
 
 function ReverseContentDisplay(d) 
 {
        if(d.length < 1) 
        { 
            return; 
        }
        
        if(document.getElementById(d).style.display == "none") 
        { 
            document.getElementById(d).style.display = "block"; 
        }
        
        else 
        { 
            document.getElementById(d).style.display = "none"; 
        }
}