/* 
Note: This represents the TOC code.  A data .js file must be created with the image objects for each button formatted as follows:

    homeon=new Image(125,25);
    homeon.src="img/home_on.jpg";
    homeoff=new Image(125,25);
    homeoff.src="img/home_off.jpg";
    homeclick=new Image(125,25);
    homeclick.src="img/home_click.jpg";
    homedis=new Image(125,25);
    homedis.src="img/home_dis.jpg";

*/
            Clicked = 0;
            DisabledButton1 = "";
            DisabledButton2 = "";

            function click(imgName, link)
            {
                if ((DisabledButton2 != imgName) && (DisabledButton1 != imgName))
                {
                    document.location = link;
                }
            }

            function img_act(imgName)
            {
                if ((Clicked == 0) || ((DisabledButton2 != imgName) && (DisabledButton1 != imgName)))
                {
                        imgOn=eval(imgName + "on.src");
                        document [imgName].src=imgOn;
                }
            }

            function img_inact(imgName)
            {
                if ((Clicked == 0) || ((DisabledButton2 != imgName) && (DisabledButton1 != imgName)))
                {
                        imgOff=eval(imgName + "off.src");
                        document [imgName].src=imgOff;
                }
            }

            function img_click(imgName)
            {
                if ((Clicked == 0) || ((DisabledButton2 != imgName) && (DisabledButton1 != imgName)))
                {
                    imgClick=eval(imgName + "click.src");
                        document [imgName].src=imgClick;
                    Clicked = 1;
                }
            }

            function img_dis(imgName)
            {
                DisabledButton1 = imgName;
                if (Clicked == 0)
                {
                    imgClick=eval(imgName + "dis.src");
                        document [imgName].src=imgClick;
                    Clicked = 1;
                }
            }

            function imgs_dis(imgName1, imgName2)
            {
                DisabledButton1 = imgName1;
                DisabledButton2 = imgName2;
                if (Clicked == 0)
                {
                    imgClick=eval(imgName1 + "dis.src");
                        document [imgName1].src=imgClick;
                    imgClick=eval(imgName2 + "dis.src");
                        document [imgName2].src=imgClick;
                    Clicked = 1;
                }
            }

            function writeBanner(buttonName)
            {
                document.writeln("<TR><TD><IMG SRC=\"" + buttonName + "\" BORDER=0></TD></TR>");
            }

            function writeAd(buttonName, rollover, link)
            {
                document.writeln("<TR><TD><A HREF=\"" + link + "\" TARGET=_AD onMouseover=\"window.status='" + rollover + "';return true;\" onMouseout=\"window.status='Document Done.';return true;\"><IMG SRC=\"" + buttonName + "\" ALT=\"" + rollover + "\" BORDER=0></A></TD></TR>");
            }

            function writeTOCItem(imgDir, buttonName, rollover, link)
            {
                document.writeln("<TR><TD><A HREF=\"javascript:click('" + buttonName + "', '" + link + "')\" onMouseDown=\"img_click('" + buttonName + "');return true;\" onMouseover=\"img_act('" + buttonName + "');window.status='" + rollover + "';return true;\" onMouseout=\"img_inact('" + buttonName + "');window.status='Document Done.';return true;\"><IMG SRC=\"" + imgDir + buttonName + "_off.jpg\" NAME=\"" + buttonName + "\" ALT=\"" + rollover + "\" BORDER=0></A></TD></TR>");
            }

            function writeTOCTableHeader(clr, cols)
            {
                cols += 2;
                if (clr != "")
                {
                    document.writeln("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD ROWSPAN=" + cols + " BGCOLOR=" + clr + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD><TD BGCOLOR=" + clr + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD><TD ROWSPAN=" + cols + " BGCOLOR=" + clr + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR>");
                }
                else
                {
                    document.writeln("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>");
                }
            }

            function writeTOCTableFooter(clr)
            {
                if (clr != "")
                {
                    document.writeln("<TR><TD BGCOLOR=" + clr + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR></TABLE>");
                }
                else
                {
                    document.writeln("</TABLE>");
                }
            }

            function writeHTOCItem(imgDir, buttonName, rollover, link)
            {
                document.writeln("<TD NOWRAP><A HREF=\"javascript:click('" + buttonName + "', '" + link + "')\" onMouseDown=\"img_click('" + buttonName + "');return true;\" onMouseover=\"img_act('" + buttonName + "');window.status='" + rollover + "';return true;\" onMouseout=\"img_inact('" + buttonName + "');window.status='Document Done.';return true;\"><IMG SRC=\"" + imgDir + buttonName + "_off.jpg\" NAME=\"" + buttonName + "\" ALT=\"" + rollover + "\" BORDER=0></A></TD>");
            }

            function writeHTOCTableHeader(clr, cols, rows)
            {
                rows += 1;
                cols += 2;
                if (clr != "")
                {
                    document.writeln("<TABLE NOWRAP BORDER=0 CELLSPACING=0 CELLPADDING=0><TR NOWRAP><TD NOWRAP BGCOLOR=" + clr + " COLSPAN=" + cols + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR><TR NOWRAP><TD ROWSPAN=" + rows + " NOWRAP BGCOLOR=" + clr + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD>");
                }
                else
                {
                    document.writeln("<TABLE NOWRAP BORDER=0 CELLSPACING=0 CELLPADDING=0><TR NOWRAP><TD NOWRAP COLSPAN=" + cols + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR><TR NOWRAP><TD ROWSPAN=" + rows + " NOWRAP><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD>");
                }
            }

            function writeHTOCBreak(clr, rows)
            {
                rows++;
                if (clr != "")
                {
                    document.writeln("<TD ROWSPAN=" + rows + " NOWRAP BGCOLOR=" + clr + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR><TR NOWRAP>");
                }
                else
                {
                    document.writeln("<TD ROWSPAN=" + rows + " NOWRAP><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR><TR NOWRAP>");
                }
            }

            function writeHTOCTableFooter(clr, cols, rows)
            {
                cols += 1;
                if (rows > 1)
                {
                    if (clr != "")
                    {
                        document.writeln("</TR><TR NOWRAP><TD NOWRAP BGCOLOR=" + clr + " COLSPAN=" + cols + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR></TABLE>");
                    }
                    else
                    {
                        document.writeln("</TR><TR NOWRAP><TD NOWRAP COLSPAN=" + cols + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR></TABLE>");
                    }
                }
                else
                {
                    if (clr != "")
                    {
                        document.writeln("<TD NOWRAP BGCOLOR=" + clr + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR><TR NOWRAP><TD NOWRAP BGCOLOR=" + clr + " COLSPAN=" + cols + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR></TABLE>");
                    }
                    else
                    {
                        document.writeln("<TD NOWRAP><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR><TR NOWRAP><TD NOWRAP COLSPAN=" + cols + "><IMG SRC=/img/spacer.gif WIDTH=4 HEIGHT=4></TD></TR></TABLE>");
                    }
                }
            }
