//---------------------------------------------------------------------------
// This script is based on the work of Dieter Bungers - http://www.infovation.de
// The original example for the "Cross Browser Expanding and Collapsing TOC"
// was published on http://www.siteexperts.com/tips/techniques/ts03/index.htm
//---------------------------------------------------------------------------

var tocTab = new Array();var ir=0;
tocTab[ir++] = new Array ("1", "ACT", "immigrationandrefugeeprotec.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("1.1", "PART 1 - (1-10) INTRODUCTION TO IRPA", "1_10.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.2", "PART 1 - (11-14) DIVISION 1 - REQUIREMENTS BEFORE ENTERING CANADA AND SELECTION", "division1_requirementsbefo.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.3", "PART 1 - (15-17) DIVISION 2 - EXAMINATION", "division2_examination.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.4", "PART 1 - (18-32) DIVISION 3 - ENTERING AND REMAINING IN CANADA", "division3_enteringandrema.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.5", "PART 1 - (33-43) DIVISION 4 - INADMISSIBILITY", "division4_inadmissibility.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.6", "PART 1 - (44-53) DIVISION 5 - LOSS OF STATUS AND REMOVAL", "division5_lossofstatusan.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.7", "PART 1 - (54-61) DIVISION 6 - DETENTION AND RELEASE", "division6_detentionandrel.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.8", "PART 1 - (62-71) DIVISION 7 - RIGHT OF APPEAL", "division7_rightofappeal.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.9", "PART 1 - (72-75) DIVISION 8 - JUDICIAL REVIEW", "division8_judicialreview.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.10", "PART 1 - (76-87) DIVISION 9 - PROTECTION OF INFORMATION", "division9_protectionofinf.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.11", "PART 1 - (88- 94) DIVISION 10 - GENERAL PROVISIONS", "division10_generalprovisio.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.12", "PART 2 - (95-98) DIVISION 1 - REFUGEE PROTECTION, CONVENTION REFUGEES AND PERSONS IN NEED OF PROTECTION", "division1_refugeeprotectio.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.13", "PART 2 - (99-111) DIVISION 2 - CONVENTION REFUGEES AND PERSONS IN NEED OF PROTECTION", "division2_conventionrefuge.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.14", "PART 2 - (112-116) DIVISION 3 - PRE-REMOVAL RISK ASSESSMENT", "division3_pre_removalrisk.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.15", "PART 3 -  (117-150) PART 3 - ENFORCEMENT- Human Smuggling and Trafficking", "humansmugglingandtraffickin.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.16", "PART 4 -  (151-186) PART 4 - IMMIGRATION AND REFUGEE BOARD", "part4_immigrationandrefug.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("1.17", "PART 5 -  (187-275) PART 5 - TRANSITIONAL PROVISIONS, CONSEQUENTIAL AND RELATED AMENDMENTS, COORDINATING AMENDMENTS, REPEALS AND COMING INTO FORCE", "part5_transitionalprovisio.htm", "", "cicon14.gif", "cicon14.gif");
tocTab[ir++] = new Array ("2", "REGULATIONS - 21 PARTS", "irparegulations.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("2.1", "PART 1 (1-5) INTERPRETATION AND APPLICATION", "part1(1_5)interpretationan2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.2", "PART 2 (6-13) GENERAL REQUIREMENTS", "part2(6_13)generalrequirem2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.3", "PART 3 (14-24) INADMISSIBILITY", "part3(14_24)inadmissibility2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4", "PART 4 (25 -52) PROCEDURES", "part4(25_52)procedures2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.5", "PART 5 (53-72) PERMANENT RESIDENTS", "part5(53_72)permanentresid2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.6", "PART 5 (53-72) PERMANENT RESIDENTS", "part5(53_72)permanentresid3.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.7", "PART 6 (73-115) ECONOMIC CLASSES", "part6(73_115)economicclass2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.8", "PART 7 (116-137) FAMILY CLASSES", "part7(116_137)familyclasse2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.9", "PART 8 (138-178) REFUGEE CLASSES", "part8(138_178)refugeeclass2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.10", "PART 9 (179-190) TEMPORARY RESIDENTS", "part9(179_190)temporaryres2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.11", "PART 10 (191-193) VISITORS", "part10(191_193)visitors2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.12", "PART 11 (194-209) WORKERS", "part11(194_209)workers2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.13", "PART 12 (210-222) STUDENTS", "part12(210_222)students2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.14", "PART 13 (223-243) REMOVAL", "part13(223_243)removal2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.15", "PART 14 (244-250) DETENTION AND RELEASE", "part14(244_250)detentionan2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.16", "PART 15 (251) THE IMMIGRATION APPEAL DIVISION", "part15(251)theimmigration2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.17", "PART 16 (252-258) SEIZURE", "part16(252_258)seizure2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.18", "PART 17 (259-287) TRANSPORTATION", "part17(259_287)transportati2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.19", "PART 18 (288-293) LOANS", "part18(288_293)loans2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.20", "PART 19 (294-315) FEES", "part19(294_315)fees2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.21", "PART 20 (316-363) TRANSITIONAL PROVISIONS", "part20(316_363)transitional2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.22", "PART 21 (364-365) REPEALS AND COMING INTO FORCE REPEALS", "part21(364_365)repealsand2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("3", "RELATED REGULATIONS", "relatedregulations.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("3.1", "Adjudication Division Rules (1-30) ", "adjudicationdivisionrules.htm", "", "cicon22.gif", "cicon22.gif");
tocTab[ir++] = new Array ("3.2", "Convention Refugee Determination Division Rules (1-24) ", "conventionrefugeedeterminati.htm", "", "cicon22.gif", "cicon22.gif");
tocTab[ir++] = new Array ("3.3", "Refugee Protection Division Rules (1-71) ", "refugeeprotectiondivisionru.htm", "", "cicon22.gif", "cicon22.gif");
tocTab[ir++] = new Array ("3.4", "Federal Court IRP - Rules (1-24)", "federalcourtimmigrationand.htm", "", "cicon22.gif", "cicon22.gif");
tocTab[ir++] = new Array ("3.5", "Immigration Division Rules (1-52)", "immigrationdivisionrules.htm", "", "cicon22.gif", "cicon22.gif");
tocTab[ir++] = new Array ("3.6", "Immigration Appeal Division Rules (1-60)", "immigrationappealdivisionru.htm", "", "cicon22.gif", "cicon22.gif");
isContent = true,
isIndex = false,
showNumbers = false,
textSizes = new Array(1, 1, 0.7, 0.7),
tocBehaviour = new Array(1,1),
tocScroll=false,
tocLinks = new Array(1,0);
var isIE = navigator.appName.toLowerCase().indexOf("explorer") > -1;
var mdi = (isIE) ? textSizes[1]:textSizes[3];
var sml = (isIE) ? textSizes[2]:textSizes[4];
var oldCurrentNumber = "", oldLastVisitNumber = "";
var toDisplay = new Array();
for (ir=0; ir<tocTab.length; ir++) {
toDisplay[ir] = tocTab[ir][0].split(".").length==1;
}
function reDisplay(currentNumber,tocChange,noLink,e) {
if (isIndex && (toc.location.href.substring(toc.location.href.lastIndexOf("/")+1,toc.location.href.length) != "acts1_kwindex.htm")) { isIndex=false; isContent=true; }
if (currentNumber == "navIndex") { isContent=false; }
if (currentNumber == "navContent") { isIndex=false; isContent=true; }
if (e) {
ctrlKeyDown = (isIE) ? e.ctrlKey : (e.modifiers==2);
if (tocChange && ctrlKeyDown) tocChange = 2;
}
var currentNumArray = currentNumber.split(".");
var currentLevel = currentNumArray.length-1;
var currentIndex = 0;
var scrollY=0, addScroll=tocScroll;
if (currentNumber == "") currentNumber = top.location.href.substring(top.location.href.lastIndexOf("?")+1,top.location.href.length);
for (i=0; i<tocTab.length; i++) {
if ((tocTab[i][0] == currentNumber) || (tocTab[i][2] == currentNumber && tocTab[i][2] != "")) {
currentIndex = i;
currentNumber = tocTab[i][0];
currentNumArray = currentNumber.split(".");
currentLevel = currentNumArray.length-1;
break;
}
}
if (currentIndex < tocTab.length-1) {
nextLevel = tocTab[currentIndex+1][0].split(".").length-1;
currentIsExpanded = nextLevel > currentLevel && toDisplay[currentIndex+1];
}
else currentIsExpanded = false;
theHref = (noLink) ? "" : tocTab[currentIndex][2];
theTarget = tocTab[currentIndex][3];
for (i=1; i<tocTab.length; i++) {
if (tocChange) {
thisNumber = tocTab[i][0];
thisNumArray = thisNumber.split(".");
thisLevel = thisNumArray.length-1;
isOnPath = true;
if (thisLevel > 0) {
for (j=0; j<thisLevel; j++) {
isOnPath = (j>currentLevel) ? false : isOnPath && (thisNumArray[j] == currentNumArray[j]);
}
}
toDisplay[i] = (tocChange == 1) ? isOnPath : (isOnPath || toDisplay[i]);
if (thisNumber.indexOf(currentNumber+".")==0 && thisLevel > currentLevel) {
if (currentIsExpanded) toDisplay[i] = false;
else toDisplay[i] = (thisLevel == currentLevel+1);
}
}
}
if (!isContent && !isIndex) {
toc.location.href = "acts1_kwindex.htm";
isIndex = true;
}
if (isContent) {
toc.document.write("<html>\n\r<head></head>\n\r<style type=\"text/css\">\n\r       SPAN.heading1 { font-family: Arial,Helvetica; font-weight: normal; font-size: 10pt; color: #000000; text-decoration: none }\n\r       SPAN.heading2 { font-family: Arial,Helvetica; font-weight: normal; font-size: 9pt; color: #000000; text-decoration: none }\n\r       SPAN.heading3 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading4 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading5 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading6 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r\n\r       SPAN.hilight1 { font-family: Arial,Helvetica; font-weight: normal; font-size: 10pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight2 { font-family: Arial,Helvetica; font-weight: normal; font-size: 9pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight3 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight4 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight5 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight6 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r</style>\n\r<body bgcolor=\"#FFFFFF\">\n\r<font face=\"Arial,Helvetica\" size=\"4\"><b>IRPA - CANADA</b></font><br>\n\r<font face=\"Arial,Helvetica\" size=\"2\">\n\r<a href=\"javaScript:parent.reDisplay(\'navIndex\',0,0);\">Keyword Index</a>\n\r</font><br><br><br>\n\r\n\r  <!-- Place holder for the TOC, do not delete the line below -->\n\r  ");}
for (i=0; i<tocTab.length; i++) {
if (toDisplay[i]) {
thisNumber = tocTab[i][0];
thisNumArray = thisNumber.split(".");
thisLevel = thisNumArray.length-1;
isCurrent = (i == currentIndex);
if (i < tocTab.length-1) {
nextLevel = tocTab[i+1][0].split(".").length-1;
img = (thisLevel >= nextLevel) ? tocTab[i][4] : ((toDisplay[i+1]) ? tocTab[i][5] : tocTab[i][4]);
}
else img = tocTab[i][4];
if (isContent) {
thisTextClass = ((thisNumber==currentNumber)?("hilight"):("heading"));
if (addScroll) scrollY+=((thisLevel<2)?mdi:sml)*25;
if (isCurrent) addScroll=false;
toc.document.write("<table border=0 cellspacing=0 cellpadding=2>");
toc.document.write("<tr><td width=" + ((thisLevel+1) * 20) + " align=right valign=top>");
toc.document.write("<a href=\"javaScript:history.go(0)\" onMouseDown=\"parent.reDisplay('" + thisNumber + "'," + tocBehaviour[0] + "," + tocLinks[0] + ",event)\">");
toc.document.write("<img src=\"" + img + "\" border=0></a>");
toc.document.write("</td><td align=left>");
toc.document.write("<a href=\"javaScript:history.go(0)\" onMouseDown=\"parent.reDisplay('" + thisNumber + "'," + tocBehaviour[1] + "," + tocLinks[1] + ",event)\">");
toc.document.write("<span class=\""  + thisTextClass + ((thisLevel>5) ? 6 : thisLevel+1) + "\">");
toc.document.write( ((showNumbers)?(thisNumber+" "):"") + tocTab[i][1]);
toc.document.write("</span></a>");
toc.document.writeln("</td></tr></table>");
} //isContent
}
}
if (!noLink) {
oldLastVisitNumber = oldCurrentNumber;
oldCurrentNumber = currentNumber;
}
if (isContent) {
toc.document.write("\n\r\n\r<hr><font face=\"Arial,Helvetica\" size=\"1\">&copy; &lt;2003&gt; ... CanAm Global Immigration Services</font>\n\r</body>\n\r</html>\n\r");
toc.document.close();
if (tocScroll) toc.scroll(0,scrollY);
}
if (theHref)
if (theTarget=="top") top.location.href = theHref;
else if (theTarget=="parent") parent.location.href = theHref;
else if (theTarget=="blank") open(theHref,"");
else content.location.href = theHref;
}
