var Phone = new Array();
// Marvin's room
Phone['539'] = '(510) 642-4753';

// Steve's room
Phone['545'] = '(510) 642-1709';

// Katherine's room
Phone['529'] = '(510) 642-9345';



Phone['501'] = '(510) 642-2635';
Phone['503'] = '(510) 642-2635';
Phone['505'] = '(510) 486-6607';
Phone['507'] = '(510) 642-1031';
Phone['517'] = '(510) 642-1031';
Phone['525'] = '(510) 643-3374';
Phone['542'] = '(510) 643-3374';



// The key to People must be the person's username on civet 
// since it is the basis for building their email address

var People = new Array(); 
People['mlcohen']     = ['Prof. ', 'Marvin L.', 'Cohen',  '539', '"http://civet.berkeley.edu/cohen/mlcohen/"'];
People['sglouie']     = ['Prof. ', 'Steven G.', 'Louie',  '545', '"http://civet.berkeley.edu/louie/sglouie/"'];

People['deraadt']     = ['', 'Katherine', 'de Raadt',     '529', '' ];

People['syquek']      = ['Dr. ',   'Su Ying',    'Quek',       '',    ''];
People['lyang']       = ['Dr. ',   'Li',         'Yang',       '505', ''];
People['giustino']    = ['Dr. ',   'Feliciano',  'Giustino',   '501', '"http://civet.berkeley.edu/~giustino"'];
People['gsm']         = ['Dr. ',   'Georgy',     'Samsonidze', '517', '"http://civet.berkeley.edu/~gsm"'];
People['fribeiro']    = ['Dr. ',   'Filipe J.',  'Ribeiro',    '501', '"http://civet.berkeley.edu/~fribeiro"'];
People['hkiee3']      = ['Dr. ',   'Hoonkyung',  'Lee',        '525', ''];

People['mjain']       = ['Dr. ',   'Manish',     'Jain',       '503', ''];
People['jusheng']     = ['Prof. ', 'Sheng',      'Ju',         '525', ''];

People['kioup']       = ['', 'Emmanouil',  'Kioupakis',  '505', '"http://socrates.berkeley.edu/~kioup"'];
People['cheolwhan']   = ['', 'Cheol Hwan', 'Park',       '507', ''];
People['jay']         = ['', 'Jaydeep',    'Sau',        '503', ''];
People['jdeslip']     = ['', 'Jack',       'Deslippe',   '517', '"http://civet.berkeley.edu/~jdeslip"'];
People['kchan']       = ['', 'Kevin',      'Chan',       '517', ''];
People['bmalone']     = ['', 'Brad',       'Malone',     '542', ''];
People['jnoffsinger'] = ['', 'Jesse',      'Noffsinger', '507', ''];
People['dstrubbe']    = ['', 'David',      'Strubbe',    '505', '"http://civet.berkeley.edu/~dstrubbe"'];
People['sang']        = ['', 'Sangkook',   'Choi',       '542', ''];

People['jmoussa']     = ['', 'Jonathan',   'Moussa',     '',    '"http://civet.berkeley.edu/~jmoussa"'];



function MakePeopleList(Names, PI) 
{
  var ncol = (Names.length == 1) ? 1 : 2;
  var colwidth = (PI) ? 400 : ncol * 320;
  var List = '<table border="1" width="' + colwidth + '" align="center">';
  for (var i=0; i<Names.length; i++) 
  {
    var name = Names[i];
    var email = name + '@' + (PI ? '' : 'civet.') + 'berkeley' + '.edu';
    var person = People[name];
    var ititle   = 0;
    var iname    = 1;
    var isurname = 2;
    var iroom    = 3;
    var iwebpage = 4;
    

    List += (i % ncol == 0) ? '<tr>' : ''; 

    List += '<td width="100" align="center">';
    List += (person[iwebpage] == '') ? '' : '<a href=' + person[iwebpage] + '>';
    List += '<img src="/photos/' + name + '.jpg" border="0">';
    List += (person[iwebpage] == '') ? '' : '<\/a>';
    List += '<\/td>';

    List += '<td width="220" align="center">';

    List += '<p style="margin-top: 0; margin-bottom: 0">';
    
    List += '<h4>';
    List += (person[iwebpage] == '') ? '' : '<a href=' + person[iwebpage] + '>';
    List += person[ititle] + person[iname] + ' ' + person[isurname];
    List += (person[iwebpage] == '') ? '' : '<\/a>';
    List += '</h4>';
    List += '<\/p>';

    List += '<p style="margin-top: 0; margin-bottom: 0">';
    
    List += 'E-mail: <a href="mailto:' + email + '"> ' + email + '</a>';

    //List += 'E-mail: ' + name + '<img src="/images/civet.berkeley.edu.gif" align="absbottom">'; 
    List += '<\/p>';

    if (person[iroom] != '') 
    {
        List += '<p style="margin-top: 0; margin-bottom: 0">';
        List += 'Campus Address: ' + person[iroom] + ' Birge Hall'; 
        List += '<\/p>';

        List += '<p style="margin-top: 0; margin-bottom: 0">';
        List += 'Phone: ' + Phone[person[iroom]]; 
        List += '<\/p>';
    }
    List += '<\/td>';

    List += ((i+1) % ncol == 0) ? '<\/tr>' : ''; 
  }
  List += '<\/table>';
  document.write(List);
}
