function makeIndex(){

// Make an array of all the h2 elements (the topics)

topics = document.getElementsByTagName("h2")

var topIndex="";
// loop through each tag and index and make anchors
for (i=0; i< topics.length; i++)
{
tmpLink = "#link" + i;
// make list item of each heading with link to anchor
topIndex += "<a href=\"" + tmpLink + "\"<li>" + topics[i].innerHTML + "<\/li><\/a>";
// add anchor name to each subhead entry
topics[i].innerHTML= "<a name=\"link" + i + "\">" + topics[i].innerHTML + "<\/a>";
}

// get element where you want to place list
myList = document.getElementById("thingList");
// and change the content to the list
myList.innerHTML=topIndex;
}

// oh... and fire it off when the page loads...

//onload=makeIndex;


/// the following are specific to examples:

//-------------------------------------------------------


// Make an array containing all the class names
myList= new Array(
"First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth");

// fill
function makePulldown(){

var pullDown="";
for(i=0; i<(myList.length); i++)
{pullDown += "<option> "+myList[i];}
return pullDown;
};

//-------------------------------------------------------

// Make an array containing some items

function pickOne () {
var phrase = new Array(
"This is the first phrase.",
"Here's another.",
"Another random phrase from a JavaScript script.",
"Wha' chu talking about Willis?",
"This is, what... the fifth phrase?",
"I'm running out of things to add to this list",
"This should be enough to test it."
)

var randNum = Math.floor(Math.random()*phrase.length);
alert (phrase[randNum]);
}

//-------------------------------------------------------

var atsign = "&#64;";

var here = "jamesburnsdesign.com";

function mailLink(name,isp,link){
document.write ("<a href=mailto:"+ name + atsign + isp +">" + link + "<\/a>");
}

//-------------------------------------------------------
