var aDir, aIndex, aEnglish, aFrench, sText
aDir =     new Array(
"",
"/en/pub",
"/en/pub/about",
"/en/pub/about/community",
"/en/pub/advisoraccess",
"/en/pub/careers",
"/en/pub/contacts",
"/en/pub/distributions",
"/en/pub/funds",
"/en/pub/funds/financials",
"/en/pub/funds/manager",
"/en/pub/funds/sri",
"/en/pub/funds/profile",
"/en/pub/funds/profile/sophisticated",
"/en/pub/products/symmetry",
"/en/pub/help",
"/en/pub/investoraccess",
"/en/pub/legal",
"/en/pub/media_centre",
"/en/pub/media_centre/multimedia",
"/en/pub/media_centre/mackmedia",
"/en/pub/media_centre/news",
"/en/pub/media_centre/press",
"/en/pub/performance",
"/en/pub/prices",
"/en/pub/products",
"/en/pub/products/groups",
"/en/pub/products/groups/advisors",
"/en/pub/products/groups/sponsors",
"/en/pub/products/lending",
"/en/pub/products/lending/resp",
"/en/pub/products/library",
"/en/pub/products/msp",
"/en/pub/products/msp/fln",
"/en/pub/products/msp/fln/fpseries1",
"/en/pub/products/msp/fln/fpseries2",
"/en/pub/products/msp/fln/fpseries3",
"/en/pub/products/msp/fln/fpseries4",
"/en/pub/products/msp/fln/fpseries5",
"/en/pub/products/msp/fln/fpseries6",
"/en/pub/products/msp/invest",
"/en/pub/products/msp/invest/maxxum",
"/en/pub/products/msp/lp",
"/en/pub/products/msp/lp/2004rlp",
"/en/pub/products/msp/lp/2005rlp",
"/en/pub/products/msp/lp/2006rlp",
"/en/pub/products/other",
"/en/pub/products/other/mit",
"/en/pub/products/other/mmlp",
"/en/pub/products/pcg",
"/en/pub/prospectuses",
"/en/pub/rates",
"/en/pub/sitemap",
"/en/pub/tools",
"/en/pub/tools/burnrate",
"/en/pub/tools/advice",
"/en/pub/tools/calculators",
"/en/pub/tools/guides",
"/en/pub/tools/guides/difficult",
"/en/pub/tools/guides/mackfunds",
"/en/pub/tools/guides/resp",
"/en/pub/tools/guides/retirement",
"/en/pub/tools/guides/rrsp",
"/en/pub/tools/tax_estate",
"/en/pub/tools/tax_estate/estate",
"/en/pub/tools/tax_estate/tax",
"/en/pub/products/msp/fln/armada",
"/en/pub/products/msp/fln/armada/ycseries1",
"/en/pub/products/msp/fln/armada/rocseries1",
"/en/pub/products/charitable",
"/en/pub/products/msp/fln/armada/japanseries1",
"/en/pub/products/lending/quickpay",
"/en/pub/products/gps",
"/en/pub/products/msp/fln/armada/rocseries3",
"/en/pub/products/msp/fln/armada/gcseries3",
"/en/pub/products/founders",
"/en/pub/products/msp/lp/2007rlp",
"/en/pub/products/msp/fln/armada/rocseries4",
"/en/pub/products/msp/fln/armada/gcseries4",
"/en/pub/products/msp/fln/armada/rocseries5",
"/en/pub/products/msp/fln/armada/gcseries5",
"/en/pub/funds/income",
"/en/pub/products/msp/maxxum",
"/en/pub/products/groups/members",
"/en/pub/products/tfsa",
"/en/pub/tools/ytol",
"/en/pub/tools/ytol/20s",
"/en/pub/tools/ytol/30s",
"/en/pub/tools/ytol/40s",
"/en/pub/tools/ytol/50s",
"/en/pub/products/charitable/cttp",
"/en/pub/products/accounts",
"/en/pub/products/accounts/tfsa",
"/en/pub/products/accounts/rrsp",
"/en/pub/products/accounts/rrif",
"/en/pub/products/accounts/ipp",
"/en/pub/saxon",
"/en/pub/products/accounts/resp",
"/en/pub/products/ssi",
"/en/pub/results"
);

aEnglish = new Array(
"Home",
"Home",
"About Us",
"Mackenzie in the Community",
"AdvisorAccess",
"Careers",
"Contact Us",
"Prices & Performance",
"Products & Services",
"Mutual Funds",
"Fund Managers & Management Companies",
"SRI",
"Mutual Funds",
"Fund Profiles",
"Symmetry",
"Help",
"InvestorAccess",
"Legal",
"Media Centre",
"Multimedia",
"Mackenzie in the Media",
"Mackenzie News",
"Press Releases",
"Prices & Performance",
"Prices & Performance",
"Products & Services",
"GroupPlans",
"Advisors",
"Plan Sponsors",
"Mackenzie Lending Products",
"RESP Loans",
"Marketing Materials Library",
"MSP",
"Fund-linked Notes",
"FULPAY Series 1",
"FULPAY Series 2",
"FULPAY Series 3",
"FULPAY Premium Advantage Series 4",
"FULPAY STAR Series 5",
"FULPAY STAR Series 6",
"Investment Funds",
"MSP Maxxum Trust",
"Flow-through LPs",
"Mackenzie 2004 Resource LP",
"MSP 2005 Resource LP",
"MSP 2006 Resource LP",
"Other Investment Products",
"Mackenzie Income Trust",
"Mackenzie Master Limited Partnership",
"Private Client Program",
"Prospectuses",
"Lending Rates",
"Site Map",
"Planning Tools",
"Burn Rate",
"Advice Matters",
"Investment Calculators",
"Investor Guides",
"Investing Throught Difficult Times",
"Guide to Mackenzie Funds",
"Your Time of Life - RESP Investing",
"Your Time of Life - Retirement",
"Your Time of Life - RRSP Investing",
"Tax & Estate Planning",
"Estate Planning Resources",
"Tax Planning Resources",
"ArMADA",
"Maxxum Yield Class",
"Maxxum Yield ROC Class",
"Charitable Giving Fund",
"Japan & International Growth",
"Quick Pay Investment Loan",
"Mackenzie Guided Portfolio Service",
"Series 3 (R.O.C. Yield)",
"Series 3 (Growth Class)",
"Mackenzie Founders Fund",
"MSP 2007 Resource LP",
"Series 4 (R.O.C. Yield)",
"Series 4 (Growth Class)",
"Series 5 (R.O.C. Yield)",
"Series 5 (Growth Class)",
"Global Income",
"MSP Maxxum Trust",
"Members",
"Account Types",
"Your Time of Life",
"20's",
"30's",
"40's",
"50's",
"Canada's Top Teen Philanthropist",
"Account Types",
"TFSA",
"RRSP",
"RRIF",
"IPP",
"Saxon",
"RESP",
"Sentinel Strategic Income",
"Search"
);

aIndex =   new Array(
"en/pub/index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"aa_login.shtml",
"index.shtml",
"index.shtml",
"distributions.jsp",
"../products/index.shtml",
"../mutual.shtml",
"companyList.jsp",
"index.shtml",
"../mutual.shtml",
"../../fundnames.jsp",
"index.shtml",
"help.shtml",
"about_ia.shtml",
"disclaimer.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"performance.jsp",
"fundprices.jsp",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"library_search.jsp",
"index.shtml",
"index.shtml",
"note.shtml",
"note.shtml",
"note.shtml",
"note.shtml",
"note.shtml",
"note.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"invest_diff_times.shtml",
"index.shtml",
"resp_intro.shtml",
"retire.shtml",
"investing_intro.shtml",
"index.shtml",
"index.shtml",
"tax_guide.shtml",
"../index.shtml",
"terms.shtml",
"terms.shtml",
"index.shtml",
"terms.shtml",
"index.shtml",
"index.shtml",
"terms.shtml",
"terms.shtml",
"index.shtml",
"index.shtml",
"terms.shtml",
"terms.shtml",
"terms.shtml",
"terms.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"life_so_far.shtml",
"life_so_far.shtml",
"life_so_far.shtml",
"life_so_far.shtml",
"index.shtml",
"index.shtml",
"index.shtml",
"investing_intro.shtml",
"investing_intro.shtml",
"index.shtml",
"index.shtml",
"resp_about.shtml",
"index.shtml",
"../index.shtml"
);

function breadCrumbs($home_directory, $divider,$cStyle, $tStyle, $dStyle, $new_line)
{

    $location = window.location.toString();
    // $subString = $location.substr($location.indexOf($home_directory) + $home_directory.length + 1).split("/");
    
    $subString = $location.substr($location.indexOf($home_directory) + $home_directory.length + 1);
    // alert( "test: " +  $subString.indexOf(".") );
    var len = $subString.indexOf(".");
    // alert ( "len=" + len );
    $subString = $subString.slice( 0, len );
    // alert( $subString );
    $subString = $subString.split("/");
    // alert( $subString );

    document.write("<a href=\"" + getLoc($subString.length - 1)+ "\" class=\"breadcrumbs\">Home</a>  " + "<span class=\"" + $dStyle + "\">" + $divider + "</span> ");

    $a = ($location.indexOf() == -1) ? 1 : 2;

    for (i = 0; i < $subString.length - $a; i++)
    {
     $subString[i] = makeCaps(unescape($subString[i]));
     document.write("<a href=\"" + getLoc($subString.length - i - 2) + "\" class=\"breadcrumbs\">" + sText + "</a>  " + "<span class=\"" + $dStyle + "\">" + $divider + "</span> ");
    }

    if ($new_line == 1)
    {
        document.write("<br>");
    }
    var docTitle = document.title 
    docTitle = docTitle.replace("Mackenzie | ","");
    document.write("<span class=\"breadcrumbs\">" + docTitle + "</span>");
}

function makeCaps($a) { 
	$sub_dir_name = $a.split(" ");
    for (l = 0; l <  $sub_dir_name.length; l++) {
         $sub_dir_name[l] =  $sub_dir_name[l].toUpperCase().slice(0, 1) +  $sub_dir_name[l].slice(1);
    }
    return  $sub_dir_name.join(" ");
}

function getLoc($num) {
    var path 
  	var sDir
		sDir = $location
//		alert (sDir);
		var sDirStrt = $location.indexOf ("://");
//		alert (sDirStrt);
		sDir = sDir.substr(sDir.indexOf("/", sDirStrt + 4));
//		alert ("sdir=" + sDir);
		sDir = sDir.substring(0,sDir.lastIndexOf("."));		
		var i
	for (i=0;i<=$num;i++)
		{
			//sDir = sDir.substring(0,sDir.lastIndexOf("/"));
//					alert ("sdir2a=" + sDir);
			sDir = sDir.substring(0,sDir.lastIndexOf("/"));
//					alert ("sdir2b=" + sDir);
		}
	var reTest
		reTest = new RegExp
			mainloop:
				for (i=0; i<aDir.length; i++)
					{
						reTest.compile("^" + aDir[i] + "$")
					if (reTest.test(sDir))
					{
						sText=aEnglish[i]
						path = sDir + "/" + aIndex[i]
					break mainloop
					}
		}
    return path;
}


function getNewLoc()
{
    $subString = $location.substr($location.indexOf($home_directory) + $home_directory.length + 1);
    // alert( "test: " +  $subString.indexOf(".") );
    var len = $subString.indexOf(".");
    // alert ( "len=" + len );
    $subString = $subString.slice( 0, len );
    // alert( $subString );
    $subString = $subString.split("/");
    alert( $subString );
}

breadCrumbs("/en/pub",">","dir","file","divider","0");

