/* Navigation support functions */
/* By Karl Kornel <kornel.1@osu.edu> */

/* makeLink: Returns link code to the caller, linking to the link_id */

function makeLink(link_id,source_id) {
return '<A HREF=\"#\" onMouseUp=\"transit(\'' + source_id + '\',\'' + link_id + '\')\" onMouseOver=\"getTitle(\'' + link_id + '\'); return true\">' + getTitle(link_id) + '</A>';
}

/* getTitle: Obtains and returns the title of a certain link_id */

function getTitle(link_id) {
return indexName[getIndex(link_id)];
}

/* getLocation: Finds the URL of a ceratain link_id */

function getLocation(link_id) {
return indexLoc[getIndex(link_id)];
}

/* getIndex: Used by some functions, determines the array index of a link, based on link_id */

function getIndex(link_id) {
var i = 0;
var correctIndex = 0;

while (i <= indexID.length) {
   if (indexID[i] == link_id) {
      correctIndex = i;
   }
   i = i + 1;
}
return correctIndex;
}
