var sPageName = new Array();
    sPageName[0]="Racks";
    sPageName[1]="Tutorial";
    sPageName[2]="Who are we ...";
    sPageName[3]="What's Covered";
    sPageName[4]="The PFEP Process";
    sPageName[5]="Case Study: The Lear Corporation";
    sPageName[6]="PFEP Spreadsheets";
    sPageName[7]="Glossary";
    sPageName[8]="Links";
    sPageName[9]="Parts";
    sPageName[10]="Material";
    sPageName[11]="Containers";
    sPageName[12]="Delivery Methods";
    sPageName[13]="Places";
    sPageName[14]="Supermarket";
    sPageName[15]="Warehouse";
    sPageName[16]="Marketplace";
    sPageName[17]="Factory";
    sPageName[18]="Assembly Line";
    sPageName[19]="WorkCenter";
    sPageName[20]="Point-of-Use";
    sPageName[21]="Racks";
    sPageName[22]="Tutorial";

var sURL = new Array();
    sURL[0]="racks.html";
    sURL[1]="tutorial.html";
    sURL[2]="who-are-we-to-be-presenting-a-pfep-tutorial.html";
    sURL[3]="whats-covered.html";
    sURL[4]="the-pfep-process.html";
    sURL[5]="case-study-the-lear-corporation.html";
    sURL[6]="pfep-spreadsheets.html"
    sURL[7]="glossary.html";
    sURL[8]="links.html";
    sURL[9]="parts.html";
    sURL[10]="material.html";
    sURL[11]="containers.html";
    sURL[12]="delivery-methods.html";
    sURL[13]="places.html";
    sURL[14]="supermarket.html";
    sURL[15]="warehouse.html";
    sURL[16]="marketplace.html";
    sURL[17]="factory.html";
    sURL[18]="assembly-line.html";
    sURL[19]="workcenter.html";
    sURL[20]="point-of-use.html";
    sURL[21]="racks.html";
    sURL[22]="tutorial.html";

function TutorialTest( sMessage ) {
document.writeln( sMessage );
}

iPage = 0;

function GetPage() { return iPage; }

function Tutorial( iNewPage ) {

  iPage = iNewPage;

           if (iPage != 0 ) {
        
document.writeln( '                   <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="125px"> ' );
document.writeln( '                   <param name="source" value="files/theme/TutorialNB.xap"/> ' );
document.writeln( '                   <param name="onError" value="onSilverlightError" /> ' );
document.writeln( '                   <param name="background" value="transparent" /> '     );
document.writeln( '                   <param name="windowless" value="true" /> '            );
document.writeln( '                   <param name="initParams" value="' );
document.write  (                      iPage                              );
document.write  (                      ','                                );
document.write  (                      iPage                              );
document.writeln(                                                        '" /> ' );
document.writeln( '                   <param name="minRuntimeVersion" value="3.0.40818.0" /> ' );
document.writeln( '                               <param name="autoUpgrade" value="true" /> ' );

document.writeln( '<table width="100%" align="center" border="0" border-collapse="collapse"  > ')
document.writeln( '  <tr>                                       ' );

document.write  ( '<td width="45%"> <form method="post" action="' );
document.write  ( sURL[iPage-1]                                   );
document.write  ( '" style="float:right;"><input style="padding: 10px 0px 10px 0px; font-weight:bold"; title="Press Alt-P for the Previous page"; type="submit"; accesskey="P" value="Previous - ' );
document.write  ( sPageName[iPage-1]                              );
document.writeln( '"> </form> </td>                             ' );

document.writeln( '    <td width="10%" ><font face="Arial" size="5"><strong>Tutorial</strong></font></td>  ' );

document.write  ( '<td width="45%"> <form method="post" action="' );
document.write  ( sURL[iPage+1]                                   );
document.write  ( '" style="float:left;"><input style="padding: 10px 0px 10px 0px; font-weight:bold"; title="Press Alt-N for the Next page"; type="submit"; accesskey="N" value="Next - ' );
document.write  ( sPageName[iPage+1]                              );
document.writeln( '"> </form> </td>                             ' );

document.writeln( '  </tr>                                      ' );
document.writeln( '</table>                                     ' );
document.writeln( '  <br />                                     ' );
document.writeln( '                     <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style="text-decoration:none"> ' );
document.writeln( '                               <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/></a> ' );
document.writeln( '                               </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>  ' );

// Will this fix the font?
document.writeln(' <div  class="paragraph editable-text" style=" text-align: left; display: block; "> ');
      }

  if (1==2) {  
document.writeln( '<font face="Arial" color="black">' );
  //document.writeln( '<table border="0" width="96%" height="15px" bgcolor=rgb(165,199,226) style="margin: 10px 10px 0px 10px; border-collapse:collapse; padding: 5px;" > ')
  //document.writeln( '</table>                                     ' );
document.writeln( '<table border="0" width="96%" bgcolor=rgb(165,199,226) style="margin: 10px 10px 0px 10px; border-collapse:collapse; padding: 5px;" > ')
document.writeln( '  <tr>                                       ' );
document.writeln( '    <td width=2%"></td> ' );
document.writeln( '    <td width="25%"              ><font face="Arial" size="5"><strong>Tutorial</strong></font></td>  ' );
document.writeln( '    <td width="25%" align="right"><font face="Arial" size="3">Any questions?</font></td> ' );
document.writeln( '    <td width="43%" align="right"><font face="Arial" size="3"><br /><strong> ' );
document.writeln( '      Call us at (586) ASK-PFEP<br /> ' );
document.writeln( '      eMail us at <a href="mailto:PFEP.Info@GMail.com">PFEP.Info@GMail.com</a></strong><br />' );
document.writeln( '      Fill out the <a href="http://www.pfep.info/ask-a-question.html">Ask a Question</a> form</font></td> ' );
document.writeln( '    <td width=2%"></td> ' );
document.writeln( '  </tr>                                      ' );
document.writeln( '</table>                                     ' );

document.writeln( '<table border="0" width="96%" bgcolor=rgb(165,199,226) style="margin: 0px 10px 10px 10px; border-collapse:collapse" cellpadding="5"> ')
document.writeln( '  <tr>                                       ' );

document.write  ( '<td> <form method="post" action="' );
document.write  ( sURL[iPage-1]                              );
document.write  ( '" style="float:left; margin:10px"><input style="padding: 10px 0px 10px 0px; font-weight:bold"; title="Press Alt-P for the Previous page"; type="submit"; accesskey="P" value="Previous - ' );
document.write  ( sPageName[iPage-1]                              );
document.writeln( '"> </form> </td>                             ' );

document.write  ( '<td> <form method="post" action="' );
document.write  ( sURL[iPage+1]                              );
document.write  ( '" style="float:right; margin:10px"><input style="padding: 10px 0px 10px 0px; font-weight:bold"; title="Press Alt-N for the Next page"; type="submit"; accesskey="N" value="Next - ' );
document.write  ( sPageName[iPage+1]                              );
document.writeln( '"> </form> </td>                             ' );

document.writeln( '  </tr>                                      ' );
document.writeln( '</table>                                     ' );

document.writeln( '</font>' );
  }
    
}

        function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
              appSource = sender.getHost().Source;
            }
            
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;

            if (errorType == "ImageError" || errorType == "MediaError") {
              return;
            }

            var errMsg = "Unhandled Error in Silverlight Application " +  appSource + "\n" ;

            errMsg += "Code: "+ iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {           
                if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " +  args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }

            throw new Error(errMsg);
        }

