




document.write("<STYLE> " +
    "A:link{color:#303048} " +
    "A:visited{color:#303048} " +
    "A:hover{color:#000000} " +
    ".alight:link{color:#B0B0B0} " +
    ".alight:visited{color:#B0B0B0} " +
    ".alight:hover{color:#555555} " +
    ".imgborder        { border: 1px solid #ffffff } " +
    ".imgborderblack   { border: 1px solid #000000 } " +
    "body,td,table,div,span { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000 } " +
    ".whitetext { color: #ffffff } " +
    ".smallwhitetext { color: #ffffff; font-size: 9px} " +
    ".whitetext { color: #ffffff; font-weight: bold; } " +
    ".bigwhitetext { color: #ffffff; font-size:13px; font-weight: bold; } " +
    ".titletext { font-size: 13px; font-weight: bold } " +
    ".mediumtext { font-size: 11px; font-weight: bold } " +
    ".strongtext { font-weight: bold } " +
    ".minitext { font-size: 9px; } " +
    ".hugetext { font-size: 72px; font-weight: bold; color: #6C7B9C } " +
    ".justify { text-align:justify } " +
    "ul { padding-left:0; margin-left:20; list-style-type:disc } " +
    "body { background-color: #ffffff; } " +
    "</STYLE>");




function newImage(arg) {
    if (document.images) {
        rslt = new Image();
        rslt.src = arg;
        return rslt;
    }
}

function changeImages() {
    if (document.images && (preloadFlag == true)) {
        for (var i=0; i<changeImages.arguments.length; i+=2) {
            document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
        }
    }
}

var preloadFlag = false;
function preloadImages() {
    if (document.images) {
        mainmmenu1_over = newImage("image/main/mainmmenu1-over.gif");
        mainmmenu2_over = newImage("image/main/mainmmenu2-over.gif");
        mainmmenu3_over = newImage("image/main/mainmmenu3-over.gif");
        mainmmenu4_over = newImage("image/main/mainmmenu4-over.gif");
        mainmmenu5_over = newImage("image/main/mainmmenu5-over.gif");
        mainmmenu6_over = newImage("image/main/mainmmenu6-over.gif");
        mainmmenu7_over = newImage("image/main/mainmmenu7-over.gif");
        preloadFlag = true;
    }
}


tophangwidth=162;
bottomhangwidth=280;


function writeTop(section, title, links) {
    document.write("" +
        "<BODY ONLOAD='preloadImages();'> " +
        "<table align=center width='100%' height='100%' cellpadding=0 cellspacing=0 border=0> " +
        "<tr><td valign=middle align=center> " +
        "<TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0> " +
        "    <TR> " +
        "        <TD WIDTH=714 HEIGHT=70> " +
        "            <TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0> " +
        "                <TR> " +
        "                    <TD valign=bottom><IMG SRC='image/main/mainttbacon.gif' WIDTH=555 HEIGHT=70></TD> " +
        "                    <TD WIDTH=159 HEIGHT=70 NOWRAP></TD> " +
        "                </TR> " +
        "            </TABLE> " +
        "        </TD> " +
        "    </TR> " +
        "    <TR> " +
        "        <TD WIDTH=714 HEIGHT=88> " +
        "            <TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0> " +
        "                <TR> " +
        "                    <TD valign=top><a href='index.html'><IMG SRC='image/main/mainttitle.gif' WIDTH=515 HEIGHT=88 border=0></a></TD> " +
        "                    <TD background='image/main/maintsignup.gif' WIDTH=167 HEIGHT=88 valign=middle>")

    writeSignup();
        
    document.write(         "</TD></form>" +
        "                    <TD><a href='legal.html'><IMG SRC='image/main/maintcopyright.gif' WIDTH=32 HEIGHT=88 border=0></a></TD> " +
        "                </TR> " +
        "            </TABLE> " +
        "        </TD> " +
        "    </TR> " +
        "    <TR> ");
    if (section==0) {
        document.write("<TD WIDTH=714 HEIGHT=452>");
    } else {
        document.write("<TD WIDTH=714>");
        document.write("<TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0>" +
            "<TR><TD WIDTH=714>" +
                "<TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0>" +
                    "<TR>" +
                        "<TD WIDTH=12 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=18 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH="+tophangwidth+" HEIGHT=1 BGCOLOR=#6C7B9C NOWRAP></TD>" +
                        "<TD WIDTH=1 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH="+(644-tophangwidth-1)+" HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=8 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=32 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                    "</TR>" +
                    "<TR>" +
                        "<TD WIDTH=12 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=18 BGCOLOR=#FFFFFF NOWRAP></TD>");
        if (title) {
            document.write("<TD WIDTH="+tophangwidth+" BGCOLOR=#6C7B9C valign=middle>" +
                                "<table width=100% cellpadding=0 cellspacing=5 border=0><tr><td class='bigwhitetext' align=right valign=middle>" +
                                    title+ "&nbsp;</td></tr></table>");
        } else {
            document.write("<TD WIDTH="+tophangwidth+" BGCOLOR=#6C7B9C nowrap>");
        }
        document.write(     "</TD>" +
                        "<TD WIDTH=1 BGCOLOR=#FFFFFF NOWRAP></TD>");
        if (links) {
            document.write("<TD WIDTH="+(644-tophangwidth-1)+" BGCOLOR=#94AAD6 valign=bottom>" +
                                "<table width=100% cellpadding=0 cellspacing=5 border=0><tr><td align=left valign=bottom>" +
                                    links+ "&nbsp;</td></tr></table>"); 
        } else {
            document.write("<TD WIDTH="+(644-tophangwidth-1)+" BGCOLOR=#94AAD6 nowrap>");
        }
        document.write(     "</TD>" +
                        "<TD WIDTH=8 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=32 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                    "</TR>" +
                    "<TR>" +
                        "<TD WIDTH=12 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=18 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH="+tophangwidth+" HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=1 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH="+(644-tophangwidth-1)+" HEIGHT=1 BGCOLOR=#94AAD6 NOWRAP></TD>" +
                        "<TD WIDTH=8 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=32 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                    "</TR>" +
                "</TABLE>" +

            "</TD></TR>" +
            "<TR><TD WIDTH=714>" +
                "<TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>" +
                    "<TD WIDTH=12 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                    "<TD WIDTH=680 BGCOLOR=#94AAD6>");

    }
}


        

function writeMenuCells() {
    document.write(""+
        "<TD WIDTH=30 HEIGHT=23 NOWRAP></TD> " +
        "<TD BGCOLOR=#6C7B9C><A HREF='index.html' " +
        "        ONMOUSEOVER='changeImages(\"mainmmenu1\", \"image/main/mainmmenu1-over.gif\"); return true;' " +
        "        ONMOUSEOUT='changeImages(\"mainmmenu1\", \"image/main/mainmmenu1.gif\"); return true;'> " +
        "        <IMG NAME='mainmmenu1' SRC='image/main/mainmmenu1.gif' WIDTH=48 HEIGHT=23 BORDER=0></A></TD> " +
        "<TD BGCOLOR=#6C7B9C><A HREF='news.html' " +
        "        ONMOUSEOVER='changeImages(\"mainmmenu2\", \"image/main/mainmmenu2-over.gif\"); return true;' " +
        "        ONMOUSEOUT='changeImages(\"mainmmenu2\", \"image/main/mainmmenu2.gif\"); return true;'> " +
        "        <IMG NAME='mainmmenu2' SRC='image/main/mainmmenu2.gif' WIDTH=89 HEIGHT=23 BORDER=0></A></TD> " +
        "<TD BGCOLOR=#6C7B9C><A HREF='howitworks.html' " +
        "        ONMOUSEOVER='changeImages(\"mainmmenu3\", \"image/main/mainmmenu3-over.gif\"); return true;' " +
        "        ONMOUSEOUT='changeImages(\"mainmmenu3\", \"image/main/mainmmenu3.gif\"); return true;'> " +
        "        <IMG NAME='mainmmenu3' SRC='image/main/mainmmenu3.gif' WIDTH=94 HEIGHT=23 BORDER=0></A></TD> " +
        "<TD BGCOLOR=#6C7B9C><A HREF='menu.html' " +
        "        ONMOUSEOVER='changeImages(\"mainmmenu4\", \"image/main/mainmmenu4-over.gif\"); return true;' " +
        "        ONMOUSEOUT='changeImages(\"mainmmenu4\", \"image/main/mainmmenu4.gif\"); return true;'> " +
        "        <IMG NAME='mainmmenu4' SRC='image/main/mainmmenu4.gif' WIDTH=46 HEIGHT=23 BORDER=0></A></TD> " +
        "<TD BGCOLOR=#6C7B9C><A HREF='signup.html' " +
        "        ONMOUSEOVER='changeImages(\"mainmmenu5\", \"image/main/mainmmenu5-over.gif\"); return true;' " +
        "        ONMOUSEOUT='changeImages(\"mainmmenu5\", \"image/main/mainmmenu5.gif\"); return true;'> " +
        "        <IMG NAME='mainmmenu5' SRC='image/main/mainmmenu5.gif' WIDTH=60 HEIGHT=23 BORDER=0></A></TD> " +
        "<TD BGCOLOR=#6C7B9C><A HREF='bacon.html' " +
        "        ONMOUSEOVER='changeImages(\"mainmmenu6\", \"image/main/mainmmenu6-over.gif\"); return true;' " +
        "        ONMOUSEOUT='changeImages(\"mainmmenu6\", \"image/main/mainmmenu6.gif\"); return true;'> " +
        "        <IMG NAME='mainmmenu6' SRC='image/main/mainmmenu6.gif' WIDTH=89 HEIGHT=23 BORDER=0></A></TD> " +
        "<TD BGCOLOR=#6C7B9C><A HREF='company.html' " +
        "        ONMOUSEOVER='changeImages(\"mainmmenu7\", \"image/main/mainmmenu7-over.gif\"); return true;' " +
        "        ONMOUSEOUT='changeImages(\"mainmmenu7\", \"image/main/mainmmenu7.gif\"); return true;'> " +
        "        <IMG NAME='mainmmenu7' SRC='image/main/mainmmenu7.gif' WIDTH=125 HEIGHT=23 BORDER=0></A></TD> ");

}


function writeBottom(section, leftside, rightside) {

    if (section!=0) {
        document.write("</TD>" +
                    "<TD WIDTH=40 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                "</TR></TABLE>" +
            "</TD></TR>" +
            "<TR><TD WIDTH=714>" +
                "<TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0>" +
                    "<TR>" +
                        "<TD WIDTH=12 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=18 HEIGHT=1 BGCOLOR=#94AAD6 NOWRAP></TD>" +
                        "<TD WIDTH="+bottomhangwidth+" HEIGHT=1 BGCOLOR=#94AAD6 NOWRAP></TD>" +
                        "<TD WIDTH=1 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH="+(644-bottomhangwidth-1)+" HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=8 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=32 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                    "</TR>" +
                    "<TR>" +
                        "<TD WIDTH=12 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=18 BGCOLOR=#94AAD6 NOWRAP></TD>");
        if (leftside) {
            document.write("<TD WIDTH="+bottomhangwidth+" BGCOLOR=#94AAD6 valign=top>" +
                            "<table width=97% align=left cellpadding=0 cellspacing=0 border=0><tr><td height=6 nowrap></td></tr><tr><td>");
            document.write(leftside);                        
            document.write("</td></tr><tr><td height=5 nowrap></td></tr></table>");
        } else {
            document.write("<TD WIDTH="+bottomhangwidth+" BGCOLOR=#94AAD6 nowrap>");
        }
        document.write("    </TD>" +
                        "<TD WIDTH=1 BGCOLOR=#FFFFFF NOWRAP></TD>");
        if (rightside) {
            document.write("<TD WIDTH="+(644-bottomhangwidth-1)+" BGCOLOR=#6C7B9C valign=top>" +
                            "<table width=97% align=center cellpadding=0 cellspacing=0 border=0><tr><td height=5 nowrap></td></tr><tr><td>");
            document.write(rightside);                        
            document.write("</td></tr><tr><td height=6 nowrap></td></tr></table>");
        } else {
            document.write("<TD WIDTH="+(644-bottomhangwidth-1)+" BGCOLOR=#6C7B9C nowrap>");
        }
        document.write("    </TD>" +
                        "<TD WIDTH=8 BGCOLOR=#6C7B9C NOWRAP></TD>" +
                        "<TD WIDTH=32 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                    "</TR>" +
                    "<TR>" +
                        "<TD WIDTH=12 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=18 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH="+bottomhangwidth+" HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH=1 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                        "<TD WIDTH="+(644-bottomhangwidth-1)+" HEIGHT=1 BGCOLOR=#6C7B9C NOWRAP></TD>" +
                        "<TD WIDTH=8 HEIGHT=1 BGCOLOR=#6C7B9C NOWRAP></TD>" +
                        "<TD WIDTH=32 HEIGHT=1 BGCOLOR=#FFFFFF NOWRAP></TD>" +
                    "</TR>" +
                "</TABLE>" +

            "</TD></TR>" +
            "</TABLE>");


        document.write("</TD></TR><TR><TD WIDTH=714 HEIGHT=23>" +
            "<TABLE WIDTH=714 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>");

        writeMenuCells();

        document.write("<TD WIDTH=101 HEIGHT=23 bgcolor=#6C7B9C NOWRAP> </TD><TD WIDTH=32 HEIGHT=23 bgcolor=#FFFFFF NOWRAP></TD>"+
            "</TR></TABLE>");
    }
    document.write("</TD></TR></TABLE></td></tr></table>");
    
    if (section!=0) {
        document.write("<br><br>");
    }

    document.write("</BODY>");
}



function getFormObj(form, name)
{
    return document.forms[form].elements[name];
}


function CheckZip(val) {
    if (val == "" || isNaN(parseInt(val)) || val.length!=5) {
        alert("Zip code error.  Please try again.");
        return false;
    }
    return true;
}


function writeSignup() {


    document.write("<form style='margin-bottom:0;' method='get' id='signup' name='signup' action='signup.html' onSubmit='return CheckZip(document.signup.zip.value);'>" +
        "<div align=center class='bigwhitetext'>Make an Appointment</div><center>Enter a zip code to find out if BaconRobots is in your area<br>" +
        "<span class='mediumtext'>Zip:</span> <input size=5 id='zip' name='zip' maxlength=5> <input align=left type='submit' value='Submit'></center>");
}