// Use the first block of definitions for the hosted web site.  Use the second
// block of definitions for the local web site.

gt = 'http://www.geometrictools.com/';
gtsrc = gt;

//gt = 'file:///C:/Users/eberly/GeometricTools/Website/';
//gtsrc = 'file:///C:/Users/eberly/GeometricTools/Source/WildMagic4/';

beginA = '<a href="';
beginATrgBlank = '<a target="_blank" href="';
beginATrgTop = '<a target="_top" href="';
beginATrgParent = '<a target="_parent" href="';
endA = '</a>';

appIcon   = '<img src = "'+gt+'Images/IconAPP.png"   alt="" style="width: 16px; height: 16px; border: none"/>';
bookIcon  = '<img src = "'+gt+'Images/IconBOOK.png"  alt="" style="width: 16px; height: 16px; border: none"/>';
cgIcon    = '<img src = "'+gt+'Images/IconCG.png"    alt="" style="width: 16px; height: 16px; border: none"/>';
nosrcIcon = '<img src = "'+gt+'Images/IconNOSRC.png" alt="" style="width: 16px; height: 16px; border: none"/>';
pdfIcon   = '<img src = "'+gt+'Images/IconPDF.png"   alt="" style="width: 16px; height: 16px; border: none"/>';
srcIcon   = '<img src = "'+gt+'Images/IconSRC.png"   alt="" style="width: 16px; height: 16px; border: none"/>';
textIcon  = '<img src = "'+gt+'Images/IconTXT.png"   alt="" style="width: 16px; height: 16px; border: none"/>';
webIcon   = '<img src = "'+gt+'Images/IconWEB.png"   alt="" style="width: 16px; height: 16px; border: none"/>';

//----------------------------------------------------------------------------
function NavigationMain ()
{
    document.write(
        '<map id="navigation0" name="navigation0">' +
        '<area shape="rect" alt="" coords="1,  1,98, 15" href="' + gt + 'index.html"/>' +
        '<area shape="rect" alt="" coords="1, 17,98, 31" href="' + gt + 'Services/Services.html"/>' +
        '<area shape="rect" alt="" coords="1, 33,98, 47" href="' + gt + 'ContactInformation/ContactInformation.html"/>' +
        '<area shape="rect" alt="" coords="1, 49,98, 63" href="' + gt + 'PrivacyStatement/PrivacyStatement.html"/>' +
        '<area shape="rect" alt="" coords="1, 81,98, 95" href="' + gt + 'Books/Books.html"/>' +
        '<area shape="rect" alt="" coords="1, 97,98,111" href="' + gt + 'Downloads/Downloads.html"/>' +
        '<area shape="rect" alt="" coords="1,113,98,143" href="' + gt + 'Documentation/Documentation.html"/>' +
        '<area shape="rect" alt="" coords="1,161,98,175" href="' + gt + 'LibFoundation/LibFoundation.html"/>' +
        '<area shape="rect" alt="" coords="1,177,98,191" href="' + gt + 'LibGraphics/LibGraphics.html"/>' +
        '<area shape="rect" alt="" coords="1,193,98,207" href="' + gt + 'LibImagics/LibImagics.html"/>' +
        '<area shape="rect" alt="" coords="1,209,98,223" href="' + gt + 'LibPhysics/LibPhysics.html"/>' +
        '<area shape="rect" alt="" coords="1,225,98,239" href="' + gt + 'LibRenderers/LibRenderers.html"/>' +
        '<area shape="rect" alt="" coords="1,241,98,255" href="' + gt + 'LibApplications/LibApplications.html"/>' +
        '<area shape="rect" alt="" coords="1,289,98,303" href="' + gt + 'SampleFoundation/SampleFoundation.html"/>' +
        '<area shape="rect" alt="" coords="1,305,98,319" href="' + gt + 'SampleGraphics/SampleGraphics.html"/>' +
        '<area shape="rect" alt="" coords="1,321,98,335" href="' + gt + 'SampleImagics/SampleImagics.html"/>' +
        '<area shape="rect" alt="" coords="1,337,98,351" href="' + gt + 'SamplePhysics/SamplePhysics.html"/>' +
        '<area shape="rect" alt="" coords="1,385,98,399" href="' + gt + 'ToolUtility/ToolUtility.html"/>' +
        '<area shape="rect" alt="" coords="1,401,98,415" href="' + gt + 'ToolImportExport/ToolImportExport.html"/>' +
        '<area shape="rect" alt="" coords="1,433,98,447" href="' + gt + 'Resources/Resources.html"/>' +
        '</map>'
    );
}
//----------------------------------------------------------------------------
function NavigationLibF ()
{
    var gtlibf = gt + 'LibFoundation/';

    document.write(
        '<map id="navigation1" name="navigation1">' +
        '<area shape="rect" alt="" coords="1,  1,122, 15" href="'+gtlibf+'Approximation/Approximation.html"/>' +
        '<area shape="rect" alt="" coords="1, 17,122, 31" href="'+gtlibf+'ComputationalGeometry/ComputationalGeometry.html"/>' +
        '<area shape="rect" alt="" coords="1, 33,122, 47" href="'+gtlibf+'Containment/Containment.html"/>' +
        '<area shape="rect" alt="" coords="1, 49,122, 63" href="'+gtlibf+'Curves/Curves.html"/>' +
        '<area shape="rect" alt="" coords="1, 65,122, 79" href="'+gtlibf+'Distance/Distance.html"/>' +
        '<area shape="rect" alt="" coords="1, 81,122, 95" href="'+gtlibf+'Interpolation/Interpolation.html"/>' +
        '<area shape="rect" alt="" coords="1, 97,122,111" href="'+gtlibf+'Intersection/Intersection.html"/>' +
        '<area shape="rect" alt="" coords="1,113,122,127" href="'+gtlibf+'Mathematics/Mathematics.html"/>' +
        '<area shape="rect" alt="" coords="1,129,122,143" href="'+gtlibf+'Meshes/Meshes.html"/>' +
        '<area shape="rect" alt="" coords="1,145,122,159" href="'+gtlibf+'Miscellaneous/Miscellaneous.html"/>' +
        '<area shape="rect" alt="" coords="1,161,122,175" href="'+gtlibf+'NumericalAnalysis/NumericalAnalysis.html"/>' +
        '<area shape="rect" alt="" coords="1,177,122,191" href="'+gtlibf+'Surfaces/Surfaces.html"/>' +
        '<area shape="rect" alt="" coords="1,193,122,207" href="'+gtlibf+'System/System.html"/>' +
        '</map>'
    );
}
//----------------------------------------------------------------------------
function NavigationLibG ()
{
    var gtlibg = gt + 'LibGraphics/';

    document.write(
        '<map id="navigation1" name="navigation1">' +
        '<area shape="rect" alt="" coords="1,  1,122, 15" href="'+gtlibg+'Collision/Collision.html"/>' +
        '<area shape="rect" alt="" coords="1, 17,122, 31" href="'+gtlibg+'Controllers/Controllers.html"/>' +
        '<area shape="rect" alt="" coords="1, 33,122, 47" href="'+gtlibg+'Curves/Curves.html"/>' +
        '<area shape="rect" alt="" coords="1, 49,122, 63" href="'+gtlibg+'Detail/Detail.html"/>' +
        '<area shape="rect" alt="" coords="1, 65,122, 79" href="'+gtlibg+'Effects/Effects.html"/>' +
        '<area shape="rect" alt="" coords="1, 81,122, 95" href="'+gtlibg+'ObjectSystem/ObjectSystem.html"/>' +
        '<area shape="rect" alt="" coords="1, 97,122,111" href="'+gtlibg+'Rendering/Rendering.html"/>' +
        '<area shape="rect" alt="" coords="1,113,122,127" href="'+gtlibg+'SceneGraph/SceneGraph.html"/>' +
        '<area shape="rect" alt="" coords="1,129,122,143" href="'+gtlibg+'Shaders/Shaders.html"/>' +
        '<area shape="rect" alt="" coords="1,145,122,159" href="'+gtlibg+'SharedArrays/SharedArrays.html"/>' +
        '<area shape="rect" alt="" coords="1,161,122,175" href="'+gtlibg+'Sorting/Sorting.html"/>' +
        '<area shape="rect" alt="" coords="1,177,122,191" href="'+gtlibg+'Surfaces/Surfaces.html"/>' +
        '<area shape="rect" alt="" coords="1,193,122,207" href="'+gtlibg+'Terrain/Terrain.html"/>' +
        '</map>'
    );
}
//----------------------------------------------------------------------------
function NavigationLibI ()
{
    var gtlibi = gt + 'LibImagics/';

    document.write(
        '<map id="navigation1" name="navigation1">' +
        '<area shape="rect" alt="" coords="1,  1,122, 15" href="'+gtlibi+'BinaryOperations/BinaryOperations.html"/>' +
        '<area shape="rect" alt="" coords="1, 17,122, 31" href="'+gtlibi+'Extraction/Extraction.html"/>' +
        '<area shape="rect" alt="" coords="1, 33,122, 47" href="'+gtlibi+'Filters/Filters.html"/>' +
        '<area shape="rect" alt="" coords="1, 49,122, 63" href="'+gtlibi+'Images/Images.html"/>' +
        '<area shape="rect" alt="" coords="1, 65,122, 79" href="'+gtlibi+'RasterDrawing/RasterDrawing.html"/>' +
        '<area shape="rect" alt="" coords="1, 81,122, 95" href="'+gtlibi+'Segmenters/Segmenters.html"/>' +
        '</map>'
    );
}
//----------------------------------------------------------------------------
function NavigationLibP ()
{
    var gtlibp = gt + 'LibPhysics/';

    document.write(
        '<map id="navigation1" name="navigation1">' +
        '<area shape="rect" alt="" coords="1,  1,122, 15" href="'+gtlibp+'Intersection/Intersection.html"/>' +
        '<area shape="rect" alt="" coords="1, 17,122, 31" href="'+gtlibp+'LCPSolver/LCPSolver.html"/>' +
        '<area shape="rect" alt="" coords="1, 33,122, 47" href="'+gtlibp+'ParticleSystem/ParticleSystem.html"/>' +
        '<area shape="rect" alt="" coords="1, 49,122, 63" href="'+gtlibp+'RigidBody/RigidBody.html"/>' +
        '</map>'
    );
}
//----------------------------------------------------------------------------
function NavigationLibR ()
{
    var gtlibr = gt + 'LibRenderers/';

    document.write(
        '<map id="navigation1" name="navigation1">' +
        '<area shape="rect" alt="" coords="1,  1,122, 15" href="'+gtlibr+'Dx9Renderer/Dx9Renderer.html"/>' +
        '<area shape="rect" alt="" coords="1, 17,122, 31" href="'+gtlibr+'OpenGLRenderer/OpenGLRenderer.html"/>' +
        '<area shape="rect" alt="" coords="1, 33,122, 47" href="'+gtlibr+'SoftRenderer/SoftRenderer.html"/>' +
        '</map>'
    );
}
//----------------------------------------------------------------------------
function NavigationLibA ()
{
    var gtliba = gt + 'LibApplications/';

    document.write(
        '<map id="navigation1" name="navigation1">' +
        '<area shape="rect" alt="" coords="1,  1,122, 15" href="'+gtliba+'Dx9Application/Dx9Application.html"/>' +
        '<area shape="rect" alt="" coords="1, 17,122, 31" href="'+gtliba+'OpenGLApplication/OpenGLApplication.html"/>' +
        '<area shape="rect" alt="" coords="1, 33,122, 47" href="'+gtliba+'SoftApplication/SoftApplication.html"/>' +
        '</map>'
    );
}
//----------------------------------------------------------------------------
function AppItem (sampleType, sampleName, comment)
{
    var linkName = gt + 'Sample' + sampleType + '/' + sampleName + '/' +
        sampleName + 'Body.html';
        
    document.write(
        '<tr>' +
            '<td>' +
                appIcon +
            '</td>' +
            '<td style="width: 4px">' +
            '</td>' +
            '<td>' +
                beginA + linkName + '">' + 'Sample: ' + sampleName + endA +
                '&nbsp;&nbsp;&nbsp;' + comment +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function BookItem (title, unit, description)
{
    document.write(
        '<tr>' +
            '<td>' +
                bookIcon +
            '</td>' +
            '<td style="width: 4px">' +
            '</td>' +
            '<td style="color: Olive">' +
                '<i>' + title + '</i>, ' + unit + ': ' +
                description +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function CgItem (name, comment)
{
    var fullName = name + '.cg';

    document.write(
        '<tr>' +
            '<td>' +
                beginATrgBlank + fullName + '">' + cgIcon + endA +
            '</td>' +
            '<td style="width: 4px">' +
            '</td>' +
            '<td>' +
                beginA + fullName + '">' + fullName + endA +
                '&nbsp;&nbsp;&nbsp;' + comment +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function PdfItem (name, title)
{
    var fullName = gt + 'Documentation/' + name + '.pdf';

    document.write(
        '<tr>' +
            '<td>' +
                beginATrgBlank + fullName + '">' + pdfIcon + endA +
            '</td>' +
            '<td style="width: 4px">' +
            '</td>' +
            '<td>' +
                beginATrgBlank + fullName + '"><i>' + title + '</i>' + endA +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function SrcItem (path, name, ext)
{
    var fullName = name + '.' + ext;
    var linkName = gtsrc + path + fullName;

    document.write(
        '<tr>' +
            '<td>' +
                beginATrgBlank + linkName + '">' + srcIcon + endA +
            '</td>' +
            '<td style="width: 4px">' +
            '</td>' +
            '<td>' +
                beginA + linkName + '">' + fullName + endA +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function TextItem (path, name, ext)
{
    var fullName = name + '.' + ext;
    var linkName = gtsrc + path + fullName;

    document.write(
        '<tr>' +
            '<td>' +
                beginATrgBlank + linkName + '">' + textIcon + endA +
            '</td>' +
            '<td style="width: 4px">' +
            '</td>' +
            '<td>' +
                beginA + linkName + '">' + fullName + endA +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function TextRowBegin ()
{
    document.write('<tr>');
}
//----------------------------------------------------------------------------
function TextRowEnd ()
{
    document.write('</tr>');
}
//----------------------------------------------------------------------------
function TextColItem (name, ext)
{
    var fullName = name + '.' + ext;

    document.write(
        '<td>' +
        beginATrgBlank + fullName + '">' + textIcon + endA +
        '</td>' +
        '<td style="width: 4px"></td>' +
        '<td>' +
        beginA + fullName + '">' + fullName + endA +
        '</td>'
    );
}
//----------------------------------------------------------------------------
function TextColSpace (width)
{
    document.write(
        '<td style="width: ' + width + 'px"></td>'
    );
}
//----------------------------------------------------------------------------
function BeginItems ()
{
    document.write('<table>');
}
//----------------------------------------------------------------------------
function EndItems ()
{
    document.write('</table><br/>');
}
//----------------------------------------------------------------------------
function AppEntry (sampleName, comment)
{
    document.write(
        '<tr>' +
            '<td>&#149;</td>' +
            '<td>' +
                '<a target="_top" href="' + sampleName + '/' +
                sampleName + '.html">' + sampleName + '</a>' +
            '</td>' +
            '<td style="width: 8px"></td>' +
            '<td>' + comment +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function BeginNavMap ()
{
    document.write('<table cellpadding="0" cellspacing="0"><tr>');
}
//----------------------------------------------------------------------------
function EndNavMap ()
{
    document.write('</tr></table>');
}
//----------------------------------------------------------------------------
function NavMap0 (image)
{
    document.write(
        '<td valign="top">' +
        '<img src="' + gt + 'Images/' + image + '.png" alt="" style="width: 100px; height: 512px; border-width: 0px" usemap="#navigation0"/>' +
        '</td>'
    );
}
//----------------------------------------------------------------------------
function NavMap1 (image)
{
    document.write(
        '<td valign="top">' +
        '<img src="' + gt + 'Images/' + image + '.png" alt="" style="width: 124px; height: 512px; border-width: 0px" usemap="#navigation1"/>' +
        '</td>'
    );
}
//----------------------------------------------------------------------------
function IFrame0 (name)
{
    document.write(
        '<td>' +
        '<iframe src="' + name + 'Body.html" width="812" height="512" frameborder="0">' +
        'Your browser does not support inline frames.' +
        'Try the <a href="' + name + '.html">source page</a> directly.' +
        '</iframe>' +
        '</td>'
    );
}
//----------------------------------------------------------------------------
function IFrame1 (name)
{
    document.write(
        '<td>' +
        '<iframe src="' + name + 'Body.html" width="688" height="512" frameborder="0">' +
        'Your browser does not support inline frames.' +
        'Try the <a href="' + name + '.html">source page</a> directly.' +
        '</iframe>' +
        '</td>'
    );
}
//----------------------------------------------------------------------------
function DisplayIcon (type, description)
{
    document.write(
        '<tr>' +
            '<td>' +
                '<img src = "'+gt+'Images/Icon' + type + '.png"  alt="" style="width: 16px; height: 16px; border: none"/>' +
            '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>' +
                description +
            '</td>' +
        '</tr>'
    );
}
//----------------------------------------------------------------------------
function IconDescription ()
{
    document.write(
        '<table>' +
        '<tr><td>' +
        'Each source code page has links to various files, applications, and' +
        'references.  Source code files are displayed as HTML files to allow syntax' +
        'highlighting.  Documentation files are in PDF format.  Shader programs, data' +
        'sets, and similar files are displayed as plain text.  Chapter, section, and' +
        'page references are provided for the books advertised at the Books page.' +
        'Hyperlinks to sample applications are provided when relevant.  Web references' +
        'of interest are listed at the end of each page.  Icons are used to identify' +
        'the type of link or reference:' +
        '<br/><br/>' +
        '<table>' +
        '<tr>' +
            '<td>' + srcIcon + '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>source code file</td>' +
        '</tr>' +
        '<tr>' +
            '<td>' + pdfIcon + '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>documentation file</td>' +
        '</tr>' +
        '<tr>' +
            '<td>' + textIcon + '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>text file</td>' +
        '</tr>' +
        '<tr>' +
            '<td>' + cgIcon + '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>Cg shader program</td>' +
        '</tr>' +
        '<tr>' +
            '<td>' + bookIcon + '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>book reference</td>' +
        '</tr>' +
        '<tr>' +
            '<td>' + appIcon + '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>link to sample application</td>' +
        '</tr>' +
        '<tr>' +
            '<td>' + webIcon + '</td>' +
            '<td style="width: 4px"></td>' +
            '<td>link to web reference</td>' +
        '</tr>' +
        '</table>' +
        '<br/>' +
        'Source code files have a version number of the form ' +
        '<code style="color: Blue">4.minor.revision</code>.  The number ' +
        '<code style="color: Blue">minor</code> is the minor version of ' +
        'Wild Magic in which the file was created. The number ' +
        '<code style="color: Blue">revision</code> is the revision number, ' +
        'initially zero, corresponding to changes made to the file.  The ' +
        'files that shipped with the WM4.0 CDROM do not have version numbers, ' +
        'so those files are implicitly labeled with 4.0.0.'
    );
}
//----------------------------------------------------------------------------
