function mainMenu(strDirectory, strSection)
{
    document.writeln ("<div id=\"idMenu\">");
    document.writeln ("    <ul class=\"clsLevel1\">");
    if((strSection == "")||(strSection==null))
    {
        document.writeln ("        <li><a href=\"" + strDirectory + "index.htm\" id=\"idHome\"><img src=\"" + strDirectory + "images/mnu_home_r.gif\" border=\"0\" /></a></li>");
    }
    else
    {
        document.writeln ("        <li><a href=\"" + strDirectory + "index.htm\" id=\"idHome\"><img src=\"" + strDirectory + "images/spacer.gif\" border=\"0\" /></a></li>");
    }
    document.writeln ("        <li><img src=\"" + strDirectory + "images/mnu_divider.gif\" border=\"0\" /></li>");
    document.writeln ("        <li>");
    if(strSection == "aboutus")
    {
        document.writeln ("            <a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idAbout\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/mnu_aboutus_r.gif\" border=\"0\" /></a>");
    }
    else
    {
        document.writeln ("            <a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idAbout\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/spacer.gif\" border=\"0\" /></a>");
    }
    document.writeln ("            <ul class=\"clsLevel2\">");
    document.writeln ("                <li class=\"clsMenuText\">");
    document.writeln ("                    <a href=\"" + strDirectory + "aboutus/whytsi.htm\">Why TSI</a>");
    document.writeln ("                    <a href=\"" + strDirectory + "aboutus/management.htm\">Leadership</a>");
    document.writeln ("                    <a href=\"" + strDirectory + "aboutus/contactus.htm\">Contact Us</a>");
    document.writeln ("                    <a href=\"" + strDirectory + "aboutus/clientindustries.htm\">Clients/Businesses/Industries</a> ");
    document.writeln ("                </li>");
    document.writeln ("            </ul>");
    document.writeln ("        </li>");
    document.writeln ("        <li><img src=\"" + strDirectory + "images/mnu_divider.gif\" border=\"0\" /></li>");
    document.writeln ("        <li>");
    if(strSection == "environmental")
    {
        document.writeln ("            <a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idEnvironmental\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/mnu_environmental_r.gif\" border=\"0\" /></a>");
    }
    else
    {
        document.writeln ("            <a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idEnvironmental\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/spacer.gif\" border=\"0\" /></a>");
    }
    document.writeln ("            <ul class=\"clsLevel2\">");
    document.writeln ("                <li class=\"clsMenuText\">");
    document.writeln ("                    <a href=\"" + strDirectory + "environmentalservices/overview.htm\">Overview</a>");
    document.writeln ("                    <a href=\"" + strDirectory + "environmentalservices/esa.htm\">Environmental Site Assessments (ESAs)</a>");
    document.writeln ("                    <a href=\"" + strDirectory + "environmentalservices/siteclosure.htm\">Site Closure and Specialized Services</a>");
    document.writeln ("                </li>");
    document.writeln ("            </ul>");
    document.writeln ("        </li>");
    document.writeln ("        <li><img src=\"" + strDirectory + "images/mnu_divider.gif\" border=\"0\" /></li>");
    document.writeln ("        <li>");
    if(strSection == "geological")
    {
        document.writeln ("            <a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idGeological\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/mnu_geological_r.gif\" border=\"0\" /></a>");
    }
    else
    {
        document.writeln ("            <a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idGeological\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/spacer.gif\" border=\"0\" /></a>");
    }    
    document.writeln ("            <ul class=\"clsLevel2\">");
    document.writeln ("                <li class=\"clsMenuText\"> ");
    document.writeln ("                    <a href=\"" + strDirectory + "geologicalservices/overview.htm\">Overview</a> ");
    document.writeln ("                    <a href=\"" + strDirectory + "geologicalservices/faultstudies.htm\">Fault Studies</a> ");
    document.writeln ("                    <a href=\"" + strDirectory + "geologicalservices/othergeologicalservices.htm\">Other Geological Services</a>");
    document.writeln ("                </li>");
    document.writeln ("            </ul>");
    document.writeln ("        </li>");
    document.writeln ("        <li><img src=\"" + strDirectory + "images/mnu_divider.gif\" border=\"0\" /></li>");
    if(strSection == "land")
    {
        document.writeln ("        <li><a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idLand\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/mnu_land_r.gif\" border=\"0\" /></a>");
    }
    else
    {
        document.writeln ("        <li><a href=\"\" onmouseover=\"this.style.cursor='default';\" id=\"idLand\" onclick=\"return false;\"><img src=\"" + strDirectory + "images/spacer.gif\" border=\"0\" /></a>");
    }
    document.writeln ("            <ul class=\"clsLevel2\">");
    document.writeln ("                <li class=\"clsMenuText\">");
    document.writeln ("                    <a href=\"" + strDirectory + "landdevelopmentservices/overview.htm\">Overview</a> ");
    document.writeln ("                </li>");
    document.writeln ("            </ul>");
    document.writeln ("        </li>");
    document.writeln ("        <li><img src=\"" + strDirectory + "images/mnu_divider.gif\" border=\"0\" /></li>");
    if(strSection == "info")
    {
        document.writeln ("        <li><a href=\"" + strDirectory + "infocenter\" id=\"idCenter\"><img src=\"" + strDirectory + "images/mnu_center_r.gif\" border=\"0\" /></a></li>");
    }
    else
    {
        document.writeln ("        <li><a href=\"" + strDirectory + "infocenter\" id=\"idCenter\"><img src=\"" + strDirectory + "images/spacer.gif\" border=\"0\" /></a></li>");
    }
    document.writeln ("    </ul");
    document.writeln ("</div>");
}

function mainFooter(strDirectory)
{
    document.writeln ("<div class=\"clsFooter\">");
    document.writeln (" <p class=\"clsLeftFooter\">");
    //document.writeln ("     <a href=\"" + strDirectory + "termsofuse.htm\">Terms of Use</a>");
    //document.writeln ("     &nbsp;&nbsp;|&nbsp;&nbsp;");
    //document.writeln ("     <a href=\"" + strDirectory + "privacypolicy.htm\">Privacy Policy</a>");
    //document.writeln ("     &nbsp;&nbsp;|&nbsp;&nbsp;");
    document.writeln ("     <a href=\"mailto:office@terrainsolutionsinc.com&subject=Web Inquiry\" target=\"_blank\">Email Us</a>");
    document.writeln (" </p>");
    document.writeln (" <p class=\"clsRightFooter\">©2006 Terrain Solutions, Inc. All Rights Reserved.</p>");
    document.writeln ("</div>");
}

var message="Function not available!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

function initFncs() {

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("window.status=message;return false")

}