var navagation_links = new Array();

navagation_links[0] = '<DL><DT><A HREF="../info/main.html" TARGET="_self" style="color: #000000"><font color="000000">What is CNL-CAP?</font></A>';

navagation_links[1] = '<BR><DT><A HREF="../operate/main.html" TARGET="_self" style="color: #000000"><font color="000000">Operating Your Centre</font></A></DT>';

navagation_links[2] = '<BR><DT><A HREF="../internet/main.html" TARGET="_self" style="color: #000000"><font color="000000">The Internet and You</font></A></DT>';

navagation_links[3] = '<BR><DT><A HREF="../centres/main.html" TARGET="_self" style="color: #000000"><font color="000000">CAP Communities</font></A></DT>';

navagation_links[4] = '<BR><DT><A HREF="../news/current/index.html" TARGET="_top" style="color: #000000"><font color="000000">News!etter</font></A></DT>';

navagation_links[5] = '<BR><DT><A HREF="../resources/main.html" TARGET="_self" style="color: #000000"><font color="000000">Resource Centre</font></A></DT>';

navagation_links[6] = '<BR><DT><A HREF="../job/main.html" TARGET="_self" style="color: #000000"><font color="000000">Youth Initiative</font></A></DT>';

navagation_links[7] = '<BR><DT><A HREF="../conference/main.html" TARGET="_self" style="color: #000000"><font color="000000">CAP Conference</font></A></DT>';

navagation_links[8] = '';

var max = navagation_links.length-2;

/*  	function: level_handler(string, levels)
	Purpose:  This function accepts a string(usually one of the strings from the above array
AND the level at which the web page using this script is at.  For example, if we are in the "What Is CNL-CAP?" section which is in directory "INFO" and we add another directory within "INFO" called "PARTNERS" then "PARTNERS" is at level 2 and "INFO" is at level 1.  The purpose for this information is so that the function can alter the string so that as the depth of directorys increases it is easy to alter the links, so that they point to the correct file.  A level 2 directory requires ../../ however the above array strings only use ../  This level_handler will add the appropriate number of ../'s to the string so that all links are properly active.  */

function level_handler(string, levels){
	var i = 1;	
	var dir_back = "";

	for(i; i<levels; i++){
		dir_back += "../"		
	}
	var broken_string = string.split('HREF="');
	var new_string = broken_string[0] + 'HREF="' + dir_back + broken_string[1];
	
	if(new_string.indexOf("src=") >=0){
	var broken_string2 = new_string.split('src="');
	var new_string2 = broken_string2[0] + 'src="' + dir_back + broken_string2[1];
	// alert(new_string2);
	return new_string2;
	}else{
		return new_string;
}

}

function a_message(choice, levels) 
{
var line = "";
var i = 0;

/*
for(i=0; i<max; i++){
	navagation_links[i] = level_handler(navagation_links[i], levels);
}
*/

if(choice > max+1){
	choice = max;
	alert("Please note your choice was too large");
}

document.write('<FONT FACE="Arial, verdana, Times New Roman, Sans Serif" SIZE=2 color="#000000"><B>');

if(levels == 1){
	for(i=0; i<choice-1; i++){
		document.write(navagation_links[i]);
		document.write('<BR><img src="../images/line.gif">');
	}
	if(i==0) document.write(navagation_links[i]);
	else document.write('<BR>' + navagation_links[i]);

	document.write('<FONT color="#000000">');

}else{

	for(i=0; i<choice-1; i++){
		document.write(level_handler(navagation_links[i], levels));
	}

	document.write('<BR>' + level_handler(navagation_links[i], levels));
	document.write('<FONT color="#000000">');
}	

if(choice == 1){
	document.write(level_handler('<LI type=square><A HREF="../info/faq.html" TARGET="Main" style="color: #000000"><font color="000000">FAQ\'s</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../partners/main.html" TARGET="Main" style="color: #000000"><font color="000000">Partners</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../contact/main.html" TARGET="Main" style="color: #000000"><font color="000000">CNL-CAP Staff</font></A>', levels));
document.write('<BR>');
}
else if(choice == 9){

	document.write(level_handler('<LI type=square><A HREF="../info/faq.html" TARGET="Main" style="color: #000000"><font color="000000">FAQ\'s</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../partners/main.html" TARGET="Main" style="color: #000000"><font color="000000">Partners</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../contact/main.html" TARGET="Main" style="color: #000000"><font color="000000">CNL-CAP Staff</font></A>', levels));
document.write('<BR>');

}else if(choice==2) {

	document.write(level_handler('<LI type=square><A HREF="../operate/promote.html" TARGET="Main" style="color: #000000"><font color="000000">Promoting Your Centre</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../operate/funds.html" TARGET="Main" style="color: #000000"><font color="000000">Fundraising Ideas</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../operate/web.html" TARGET="Main" style="color: #000000"><font color="000000">Web Site Creation</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../operate/people.html" TARGET="Main" style="color: #000000"><font color="000000">Human Resources</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="../operate/use.html" TARGET="Main" style="color: #000000"><font color="000000">Acceptable Use Policy</font></A>', levels));
document.write('<BR>');
}
else if(choice==3) {

	document.write(level_handler('<LI type=square><A HREF="gonline.html" TARGET="Main" style="color: #000000"><font color="000000">Government Online</A>', levels));
	document.write(level_handler('<LI type=square><A HREF="email.html" TARGET="Main" style="color: #000000"><font color="000000">Send/Receive Email</A>', levels));
	document.write(level_handler('<LI type=square><A HREF="ecom.html" TARGET="Main" style="color: #000000"><font color="000000">Online Business</A>', levels));
	document.write(level_handler('<LI type=square><A HREF="learn.html" TARGET="Main" style="color: #000000"><font color="000000">Take a Course</A>', levels));
	document.write(level_handler('<LI type=square><A HREF="work.html" TARGET="Main" style="color: #000000"><font color="000000">Find a Job</A>', levels));
	document.write(level_handler('<LI type=square><A HREF="message.html" TARGET="Main" style="color: #000000"><font color="000000">Instant Messaging</A>', levels));
	document.write(level_handler('<LI type=square><A HREF="life.html" TARGET="Main" style="color: #000000"><font color="000000">That\'s Life!</A>', levels));
	document.write(level_handler('<LI type=square><A HREF="fun.html" TARGET="Main" style="color: #000000"><I><font color="000000">Have Fun!</I></A>', levels));
document.write('<BR>');
}

else if(choice==4) {

	document.write(level_handler('<LI type=square><A HREF="main.html" TARGET="Main" style="color: #000000"><font color="000000">Regional Listing</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="alphalist.html" TARGET="Main" style="color: #000000"><font color="000000">Alphabetical Listing</font></A>', levels));
	document.write(level_handler('<LI type=square><A HREF="cancap.html" TARGET="Main" style="color: #000000"><font color="000000">Across Canada</font></A>', levels));
document.write('<BR>');
}

else if(choice==5) {
document.write('<BR>');
}

else if(choice==6) {

document.write('<BR>');
}

else if(choice==7) {

document.write('<BR>');
}

else{
}

document.write('</FONT>');


if(levels == 1){
	for(i++; i<=max; i++){
		document.write('<BR><img src="../images/line.gif">');
		document.write(navagation_links[i]);
	}
}else{
	for(i++; i<=max; i++){
		document.write(level_handler(navagation_links[i], levels));
}
}

document.write('</DL>');
document.write('</FONT>');

} 
