//////////////////////////////////////////////////////////////////////////
// 
// Javascript to write a list of links for a website
// Jared Donovan 2002
// jared@itee.uq.edu.au.nospam
//
// To Use this file:
// 
// 1/ Edit the array of links so that it has your links
//
// 2/ In the <head> section of your webpage, include the following;
//      <script language="javascript" src="[PATH TO THIS FILE]"></script>
//     
// 3/ Include the following in the body of your webpage where you'd like 
// the list of links to go;
//      <script language="javascript">write_links([PATH TO ROOT OF WEB], [INDEX OF PAGE]);</script>
//
////////////////////////////////////////////////////////////////////////// 

// An array to hold the list of links for the web. Edit this to hold the links you want on your page.
// Here you need to write everything after the href=" relative to your root folder.
// Use the index of the link to specify which one you are calling the function from so that there won't 
// be a link written for that one, (remember that the array is 0 indexed!)
var siteLinks = new Array(
	'index.htm\">&gt; Main Page</a><BR>',												// 0
    'baby/baby.htm\">&gt; Family photos</a><BR>',										// 1
    'PresentationTimer/index.htm\">&gt; A Powerpoint timer</a><BR>',					// 2
    'itee_websites.htm\">&gt; ITEE Websites</a><br>'									// 3
)
        
var externalLinks = new Array(
    'http://www.itee.uq.edu.au/~pig/\">&gt; pig group</a><br>',							// 4
    'http://www.accs.edu.au/\">&gt; ACCS</a><br>',										// 5
    'http://www.interactiondesign.com.au/\">&gt; ACID</a><br>'						// 6
)

// Function to write the list of links
function writeLinks(pathToRoot, pageIndex){
var strLinkHead = '<a href=\"';
var strLinks = '';

// Construct the head of the links with the 'pathToRoot' argument
strLinkHead = strLinkHead + pathToRoot;

    for (index=0; index<siteLinks.length; index++){
        if (index != pageIndex) {
            strLinks = strLinks + strLinkHead + siteLinks[index]; 
        }
    }
    
    document.write(strLinks);
    
    // Now write the external links
 
    strLinks = '<br /><b>External links</b><br />';
    strLinkHead = '<a href="';
    
    for (index=0; index<externalLinks.length; index++){
    	strLinks = strLinks + strLinkHead + externalLinks[index]; 
    }
    
    document.write(strLinks);

}


