/* Copyright (C) Cantara Consulting 2000.  All rights reserved. */

var stretchContents = 0;
var eightBit = 0;
var fancyButtons = 0;
var layerSupport = 0;

/***************************************************************************
 *
 *  Determine capabilities based on browser config.
 *
 ***************************************************************************/

/*
 * Stretching relies on support for image widths in terms of percentages.
 * Opera and Netscape 3 don't do this correctly.  It can be done using
 * table backgrounds also, but they don't support this either.  I have
 * tested it successfully on IE 3 through 5, and Netscape 4.x, on Linux and
 * Windows {9[58],NT}.  
 */

if (window.location.href.indexOf("/Stretch/") != -1)
    stretchContents = 1;
else if (window.location.href.indexOf("/NoStretch/") != -1)
    stretchContents = 0;
else if (agentMozilla || ((agentIE || agentNetscape) && appVersion > 3))
    stretchContents = 1;
else
    stretchContents = 0;

/*
 * Go for higher resolution images?
 */

if (appVersion < 4)
    eightBit = 1;
else if (window.location.href.indexOf("8bit") != -1)
    eightBit = 1;
else if (window.location.href.indexOf("16bit") != -1)
    eightBit = 0;
else if ((agentIE && screen.colorDepth > 8)
         || ((agentNetscape || agentMozilla) && screen.pixelDepth > 8))
    eightBit = 0;
else
    eightBit = 1;

/*
 * Use fancy JavaScript enabled buttons with mouseOvers?
 */

if ((agentNetscape && appVersion >= 3)
    || (agentIE && appVersion >= 4)
    || agentMozilla)
{
    fancyButtons = 1;

    home1=new Image(50,13);
    home1.src="images/home1.gif";
    home2=new Image(50,13);
    home2.src="images/home2.gif";

    about1=new Image(53,13);
    about1.src="images/about1.gif";
    about2=new Image(53,13);
    about2.src="images/about2.gif";

    resume1=new Image(66,13);
    resume1.src="images/resume1.gif";
    resume2=new Image(66,13);
    resume2.src="images/resume2.gif";

    contact1=new Image(66,13);
    contact1.src="images/contact1.gif";
    contact2=new Image(66,13);
    contact2.src="images/contact2.gif";
}

/*
 * Use layer for wa background if possible.
 */

if (!eightBit
    && ((agentNetscape && document.layers)
        || agentMozilla
        || (agentIE && document.all && appVersion >= 4)))
{
   layerSupport = 1;
}

/*
 * Set the font style.  Don't do it on Netscape on Unix (X Window System)
 * because Netscape won't obey the user settings for font size if you set
 * the font with a CSS style.  It almost works if you set font-size to
 * 100%, except that on Windows it makes the font be larger, and it also
 * can cause some weird scaling problems on Unix.
 */

if (!(agentNetscape && (appVersion == 3 || navigator.appVersion.indexOf(" (X11; ") != -1)))
{
    document.writeln("<style type='text/css'>");
    document.writeln("<!--");
    document.writeln(".normal, .big, .small, .fixedsmall");
    document.writeln("{");
    document.writeln("  font-family: 'lucidabright', 'book antiqua', 'palatino', 'serif';");
    document.writeln("}");
    document.writeln("-->");
    document.writeln("</style>");
}

function writeConfig()
{
    document.writeln("navigator.appName=`" + navigator.appName + "'\<br\>");
    document.writeln("navigator.appVersion=`" + navigator.appVersion + "'\<br\>");
    document.writeln("eightBit=`" + eightBit + "'\<br\>");
    document.writeln("agentNetscape=`" + agentNetscape + "'\<br\>");
    document.writeln("agentMozilla=`" + agentMozilla + "'\<br\>");
    document.writeln("agentIE=`" + agentIE + "'\<br\>");
    document.writeln("appVersion=`" + appVersion + "'\<br\>");
    document.writeln("layerSupport=`" + layerSupport + "'\<br\>");
    document.writeln("stretchContents=`" + stretchContents + "'\<br\>");
    document.writeln("fancyButtons=`" + fancyButtons + "'\<br\>");
}

function magic(user, domain1, domain2)
{
    location="mailto:" + user + "@" + domain1 + "." + domain2;
}
