/*

  Applied Mathematics at UTSA - Navigation Menu

  Import: 'relURL' and 'refURL'.

  Use your judgement to determine when the substring '_c' stands for "castellano."

*/ 

AM_DEPT_EMAIL = "Wanda.Crotty@utsa.edu"

//  Put in frame.
if (top == self) 
  if (relURL != '') location.replace(relURL)
  else if (refURL != '') location.replace(refURL)
  else location.replace('applied.math.utsa.edu')

function put(s) {
  if (top != self) parent.frames[0].document.writeln(s)
}

//  This is the menuEntry object.
function menuEntry(hRef, target, label, height) {
  this.hRef = hRef
  this.target = target
  this.label = label
  this.height = height
}

standard_height = 17
hr_height = 6
hr_width = 6

//  Instantiate menyEntry objects.
var menuArray = new Array()

function makeMenu(language) {

  //  English  //////////

  if (language == 'e') {

    menuArray[menuArray.length] = new menuEntry('home.html', '_top', 'Home', standard_height)
    menuArray[menuArray.length] = new menuEntry('directory.html', '_top', 'Directory', standard_height)
    menuArray[menuArray.length] = new menuEntry('degrees.html', '_top', 'Degrees', standard_height)
    menuArray[menuArray.length] = new menuEntry('research.html', '_top', 'Research', standard_height)
    menuArray[menuArray.length] = new menuEntry('seminars.html', '_top', 'Seminars', standard_height)
    menuArray[menuArray.length] = new menuEntry('journals.html', '_top', 'Journals', standard_height)
    menuArray[menuArray.length] = new menuEntry('staff.html', '_top', 'Staff', standard_height)
    menuArray[menuArray.length] = new menuEntry('news.html', '_top', 'News', standard_height)
    menuArray[menuArray.length] = new menuEntry('album.html', '_top', 'Photo Album', standard_height)
    menuArray[menuArray.length] = new menuEntry('events.html', '_top', 'Departmental Events', standard_height)
    menuArray[menuArray.length] = new menuEntry('jobs.html', '_top', 'Jobs/Opportunities', standard_height)
    menuArray[menuArray.length] = new menuEntry('links.html', '_top', 'Links', standard_height)

    menuArray[menuArray.length] = new menuEntry('<HR>', '', hr_width , hr_width)

    menuArray[menuArray.length] = new menuEntry('tutoring_lab.html', '_top', 'Tutoring Lab', standard_height)
    menuArray[menuArray.length] = new menuEntry('computing.html', '_top', 'Computing', standard_height)
    //menuArray[menuArray.length] = new menuEntry('../help/', '_blank',
    //  'Student Help', standard_height)
    menuArray[menuArray.length] = new menuEntry('mailto:' + AM_DEPT_EMAIL, '_blank', 'Send Email', standard_height)

    menuArray[menuArray.length] = new menuEntry('<HR>', '', hr_width , hr_width)

    //  Generate HTML Page
    put('<HTML>')
    put('<HEAD>')
    put('<TITLE>Applied Mathematics at UTSA - Menu Page</TITLE>')
    put('</HEAD>')
    put('<STYLE>')
    put('  A {TEXT-DECORATION: none; COLOR: ' + MENU_LINK_COLOR + '}')
    put('  A:hover {color:' + MENU_HOVER_COLOR + '; text-decoration: underline; background: ' + MENU_HOVER_BGCOLOR + '}')
    put('  A:hover {color:' + MENU_HOVER_COLOR + '; text-decoration: underline}')
    put('</STYLE>')
    put('<BODY BGCOLOR=' + MENU_BODY_COLOR + ' TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 TEXT=' + MENU_TEXT_COLOR + '>')

    //  Generate links from table.
    put('<TABLE WIDTH=180 BORDER=0 CELLSPACING=0 CELLPADDING=0>')
    put('  <TR><TD HEIGHT=30 ALIGN=CENTER VALIGN=MIDDLE>&nbsp;</TD></TR>')
    for (var i = 0; i < menuArray.length; i++) with (menuArray[i]) {
      //  This header begins this row:
      header = '  <TR><TD HEIGHT=' + height + ' ALIGN=CENTER><FONT SIZE=-1 FACE="ARIAL,HELVETICA">'
      put(header)
      if (hRef == '<HR>') put('    ' + '<HR WIDTH=' + label + ' SIZE=' + height +  ' COLOR=' + 
        MENU_HR_COLOR + ' NOSHADE></TD></TR>')
      else if (hRef == '') put('    ' + label + '</TD></TR>')
      else if (hRef == relURL) put('    <B>' + label + '</B></TD></TR>')
      else if (hRef == refURL) put('    <I><B><A HREF="' + hRef + '" TARGET=' + target + '><FONT COLOR=' + 
        MENU_LINK_COLOR2 + '>' + 
        label + '</FONT></A></B></I></TD></TR>')
      else put('    <A HREF="' + hRef + '" TARGET=' + target + '>' + label + '</A></FONT></TD></TR>')
    }

    //  Static Links
    put(header + '<A HREF="home_c.html" TARGET=_top>Espaņol</A></FONT></TD></TR>')

    put('<TR><TD HEIGHT=6 ALIGN=CENTER><FONT SIZE=-1 FACE="ARIAL,HELVETICA">' + 
      '<HR WIDTH=6 SIZE=6 COLOR=660000 NOSHADE></TD></TR>')

    put(header + '<A HREF="math_chair_ad.pdf" TARGET=_top>Chair Search</A></FONT></TD></TR>')
    put(header + '<A HREF="PutnamInvitation.pdf" TARGET=_top>Putnam</A></FONT></TD></TR>')

    //  Terminate
    put('  <TR><TD HEIGHT=1900>&nbsp;</TD></TR>')
    put('</TABLE>')

    put('</BODY>')
    put('</HTML>')
  }

  else {

    //  Spanish  /////////

    menuArray[menuArray.length] = new menuEntry('home_c.html', '_top', 'P&aacute;gina Principal', standard_height)
    menuArray[menuArray.length] = new menuEntry('directory_c.html', '_top', 'Directorio', standard_height)
    menuArray[menuArray.length] = new menuEntry('degrees_c.html', '_top', 'T&iacute;tulos Acad&eacute;micos', standard_height)
    menuArray[menuArray.length] = new menuEntry('research_c.html', '_top', 'Investigaci&oacute;n', standard_height)
    menuArray[menuArray.length] = new menuEntry('seminars_c.html', '_top', 'Seminarios', standard_height)
    menuArray[menuArray.length] = new menuEntry('journals_c.html', '_top', 'Revistas', standard_height)
    menuArray[menuArray.length] = new menuEntry('staff_c.html', '_top', 'Personal', standard_height)
    menuArray[menuArray.length] = new menuEntry('news_c.html', '_top', 'Noticias', standard_height)
    menuArray[menuArray.length] = new menuEntry('album_c.html', '_top', 'Album Fotogr&aacute;fico', standard_height)
    menuArray[menuArray.length] = new menuEntry('events_c.html', '_top', 'Eventos Departamentales', standard_height)
    menuArray[menuArray.length] = new menuEntry('jobs_c.html', '_top', 'Empleo/Oportunidades', standard_height)
    //--menuArray[menuArray.length] = new menuEntry('http://math.utsa.edu', '_top', 'Matem&aacute;ticas en la UTSA', standard_height)
    menuArray[menuArray.length] = new menuEntry('links_c.html', '_top', 'Enlaces', standard_height)

    menuArray[menuArray.length] = new menuEntry('<HR>', '', hr_width , hr_width)

    //== menuArray[menuArray.length] = new menuEntry('http://www.math.utsa.edu/~prep/', '_blank',
    //==   'Labor de Alcance', standard_height)
    menuArray[menuArray.length] = new menuEntry('tutoring_lab_c.html', '_top', 'Centro de Tutor&iacute;as', standard_height)
    menuArray[menuArray.length] = new menuEntry('computing_c.html', '_top', 'C&oacute;mputo', standard_height)
    //menuArray[menuArray.length] = new menuEntry('http://math.utsa.edu/help/', '_blank',
    //  'Asistencia', standard_height)
    menuArray[menuArray.length] = new menuEntry('mailto:' + AM_DEPT_EMAIL, '_blank', 'Env&iacute;e Correo', standard_height)

    menuArray[menuArray.length] = new menuEntry('<HR>', '', hr_width , hr_width)

    //  Generate HTML Page
    put('<HTML>')
    put('<HEAD>')
    put('<TITLE>Applied Mathematics at UTSA - Menu Page</TITLE>')
    put('</HEAD>')
    put('<STYLE>')
    put('  A {TEXT-DECORATION: none; COLOR: ' + MENU_LINK_COLOR + '}')
    put('  A:hover {color:' + MENU_HOVER_COLOR + '; text-decoration: underline; background: ' + MENU_HOVER_BGCOLOR + '}')
    put('  A:hover {color:' + MENU_HOVER_COLOR + '; text-decoration: underline}')
    put('</STYLE>')
    put('<BODY BGCOLOR=' + MENU_BODY_COLOR + ' TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 TEXT=' + MENU_TEXT_COLOR + '>')

    //  Generate links from table.
    put('<TABLE WIDTH=180 BORDER=0 CELLSPACING=0 CELLPADDING=0>')
    put('  <TR><TD HEIGHT=30 ALIGN=CENTER VALIGN=MIDDLE>&nbsp;</TD></TR>')
    for (var i = 0; i < menuArray.length; i++) with (menuArray[i]) {
      //  This header begins this row:
      header = '  <TR><TD HEIGHT=' + height + ' ALIGN=CENTER><FONT SIZE=-1 FACE="ARIAL,HELVETICA">'
      put(header)
      if (hRef == '<HR>') put('    ' + '<HR WIDTH=' + label + ' SIZE=' + height +  ' COLOR=' + 
        MENU_HR_COLOR + ' NOSHADE></TD></TR>')
      else if (hRef == '') put('    ' + label + '</TD></TR>')
      else if (hRef == relURL) put('    <B>' + label + '</B></TD></TR>')
      else if (hRef == refURL) put('    <I><B><A HREF="' + hRef + '" TARGET=' + target + '><FONT COLOR=' + 
        MENU_LINK_COLOR2 + '>' + 
        label + '</FONT></A></B></I></TD></TR>')
      else put('    <A HREF="' + hRef + '" TARGET=' + target + '>' + label + '</A></FONT></TD></TR>')
    }
 
    //  Static Links
    put(header + '<A HREF="home.html" TARGET=_top>English</A></FONT></TD></TR>')

    //  Terminate
    put('  <TR><TD HEIGHT=1900>&nbsp;</TD></TR>')
    put('</TABLE>')
  
    put('</BODY>')
    put('</HTML>')
  }
}

