// JavaScript Document
var total_order_cost   = 0;
    var total_order_weight = 0;
    var call_found         = false;
    var order_converged    = false;
    var parms_loaded       = true;
    var product_parms      = new Array();
    var items_ordered      = new Array();

    function enterItem(form_obj, element_obj, id, label) {
        if (element_obj == null) {
            var val = null;
        } else {
            // remove accidental spaces
            element_obj.value = element_obj.value.toString().split(' ').join('');
            var val           = element_obj.value;
        }
        if (id != null) {
            if (val == 0 || val == null || val == '' || val.toString().split('-').join('') == '') {
                items_ordered[id] = null;
            } else {
                if (Validate(element_obj, label, 0)) {
                    items_ordered[id] = val;
                } else {
                    return false;
                }
            }
        }
        if (parms_loaded) {
            determineOrderTotal();
            total_order_weight = determineWeightTotal();
        }
        var tmp_vals       = new Array();
        var pagecost       = 0;
        var pageweight     = 0;
        if (form_obj.elements['ID[]'].length > 0) {
            for (i = 0; i < form_obj.elements['ID[]'].length; i++) {
                id          = form_obj.elements['ID[]'][i].value
                val         = items_ordered[id];
                tmp_vals    = determineItemValues(form_obj, val, id, i);
                pagecost   += tmp_vals[0];
                pageweight += tmp_vals[1];
            }
        } else {
            if (id == null) {
                id  = form_obj.elements['ID[]'].value;
                val = items_ordered[id];
            }
            tmp_vals   = determineItemValues(form_obj, val, id);
            pagecost   = tmp_vals[0];
            pageweight = tmp_vals[1];
        }
        if (call_found) {
            pagecost = 'Call';
        }
        if (form_obj.pageweight != null)
            if (isNaN(pageweight)) {
                form_obj.pageweight.value = pageweight;
            } else {
                form_obj.pageweight.value = ShowDecimals(pageweight, 1);
            }
        if (form_obj.pagecost != null)
            if (isNaN(pagecost)) {
                form_obj.pagecost.value   = pagecost;
            } else {
                form_obj.pagecost.value   = ShowDecimals(pagecost, 2);
            }
        if (isNaN(total_order_weight)) {
            form_obj.total_order_weight.value = '*****';
            total_order_weight              = 0;
        } else {
            form_obj.total_order_weight.value = ShowDecimals(total_order_weight, 1);
        }
        if (isNaN(total_order_cost)) {
            form_obj.total_order_cost.value = 'Call**';
            total_order_cost          = 0;
        } else {
            if (order_converged) {
                form_obj.total_order_cost.value = ShowDecimals(total_order_cost, 2);
            } else {
                form_obj.total_order_cost.value = 'Call*';
            }
        }
        return true;
    }

    function determineOrderTotal() {
        var max_iterations       = 9;
        var count                = 0;
        var old_total_order_cost = total_order_cost - 1;
        while (Math.abs(total_order_cost - old_total_order_cost) > 0.004) {
            if (count++ > max_iterations) {
                total_order_cost = Math.min(total_order_cost, old_total_order_cost);
                order_converged  = false;
                break;
            }
            tmp_total_order_cost = 0;
            call_found           = false;
            for (id in items_ordered) {
                tmp_price = determinePrice(id);
                if (tmp_price.indexOf('Call') == -1 && parms_loaded) {
                    tmp_total_order_cost += tmp_price * items_ordered[id];
                } else if (parms_loaded) {
                    tmp_total_order_cost = 'Call';
                    call_found           = true;
                } else {
                    tmp_total_order_cost = '***';
                }
            }
            old_total_order_cost = total_order_cost;
            total_order_cost     = tmp_total_order_cost;
            if (call_found || total_order_cost.toString().indexOf('***') != -1) {
                count           = 2 * max_iterations;
                order_converged = false;
                break;
            }
        }
        if (count <= max_iterations) {
            order_converged = true;
        }
        return;
    }

    function determineWeightTotal() {
        var tmp_weight_total = 0;
        var wgt              = 0;
        for (id in items_ordered) {
            if (product_parms[id] == null) {
                parms_loaded = false;
                wgt          = '***';
                break;
            }
            tmp_weight_total = product_parms[id][0] * items_ordered[id];
            if (!isNaN(tmp_weight_total)) {
                wgt += tmp_weight_total;
            }
        }
        return wgt;
    }

    function determinePrice(id) {
        if (product_parms[id] == null) {
            parms_loaded = false;
            return '***';
        }
        if (total_order_cost < 251) {
            price = product_parms[id][1];
        } else if (total_order_cost < 501) {
            price = product_parms[id][2];
        } else if (total_order_cost < 751) {
            price = product_parms[id][3];
        } else {
            price = product_parms[id][4];
        }
        if (price.indexOf('Call') != -1)
            call_found = true;
        return price;
    }

    function determineItemValues(form_obj, val, id, idx) {
        var item_values = new Array(0, 0);
        if (val == null) {
            if (idx == null) {
                form_obj.elements['quantity[]'].value = '';
                form_obj.totalweight.value = '--';
                form_obj.totalcost.value = '--';
            } else {
                form_obj.elements['quantity[]'][idx].value = '';
                form_obj.totalweight[idx].value = '--';
                form_obj.totalcost[idx].value = '--';
            }
        } else {
            price = determinePrice(id);

            if (product_parms[id] == null) {
                parms_loaded = false;
                wgt            = '***';
            } else {
                item_values[1] = val * product_parms[id][0];
                wgt            = ShowDecimals(item_values[1], 1);
            }
            if (idx == null) {
                form_obj.elements['quantity[]'].value = val;
                form_obj.totalweight.value            = wgt;
            } else {
                form_obj.elements['quantity[]'][idx].value = val;
                form_obj.totalweight[idx].value            = wgt;
            }
            item_values[1] = parseFloat(wgt);
            if (price.indexOf('Call') == -1 && price.indexOf('***') == -1) {
                cst = ShowDecimals(val * price, 2);
                if (idx == null) {
                    form_obj.totalcost.value = cst;
                } else {
                    form_obj.totalcost[idx].value = cst;
                }
                item_values[0] = parseFloat(cst);
            } else {
                if (idx == null) {
                    form_obj.totalcost.value = price;
                } else {
                    form_obj.totalcost[idx].value = price;
                }
                item_values[0] = 0;
            }
        }
        return item_values;
    }

    function ShowOrder() {
        msg = '' +
        '<table width="100%" border="0" cellspacing="1" cellpadding="3">' +
        '   <tr bgcolor="#000000">' +
        '       <td colspan="6" align="center">' +
        '           <font face="Arial, Helvetica, sans-serif" size="2" color="#fecd00">' +
        '           <b>Preview: Current Purchase Order Summary</b>' +
        '           </font>' +
        '           <font size="-2" face="Arial" color="#fecd00">' +
        '           </font>' +
        '       </td>' +
        '   </tr>' +
        '   <tr bgcolor="#ffffee">' +
        '       <td align="center" colspan="2">' +
        '           <font size="-1" face="Arial"><b>Quantity</b></font>' +
        '       </td>' +
        '       <td align="center">' +
        '           <font size="-1" face="Arial"><b>ID</b></font>' +
        '       </td>' +
        '       <td>' +
        '           <font size="-1" face="Arial"><b>Description</b></font>' +
        '       </td>' +
        '       <td align="center">' +
        '           <font size="-1" face="Arial"><b>Weight</b> (lb)</font>' +
        '       </td>' +
        '       <td align="center" nowrap>' +
        '           <font size="-1" face="Arial"><b>Cost</b></font>' +
        '       </td>' +
        '   </tr>';
        for (id in items_ordered) {
            if (items_ordered[id] == null || product_parms[id] == null) continue;
            wgt = product_parms[id][0] * items_ordered[id];
            if (!isNaN(wgt)) {
                wgt = ShowDecimals(wgt, 1);
            }
            totl_itm_cost = determinePrice(id) * items_ordered[id];
            if (isNaN(totl_itm_cost)) {
                totl_itm_cost = 'Call';
            } else {
                totl_itm_cost = '$' + ShowDecimals(totl_itm_cost, 2);
            }
            msg += '' +
        '   <tr bgcolor="#ffffff">' +
        '       <td>' +
        '           <font size="-1" face="Arial">' +
        '           ' + items_ordered[id] +
        '           </font>' +
        '       </td>' +
        '       <td>' +
        '           <font size="-1" face="Arial">' +
        '           ' + product_parms[id][6] +
        '           </font>' +
        '       </td>' +
        '       <td>' +
        '           <font size="-1" face="Arial">' +
        '           ' + id +
        '           </font>' +
        '       </td>' +
        '       <td>' +
        '           <font size="-1" face="Arial">' +
        '           ' + product_parms[id][5] +
        '           </font>' +
        '       </td>' +
        '       <td align="center">' +
        '           <font size="-1" face="Arial">' + wgt + '</font>' +
        '       </td>' +
        '       <td align="right" nowrap>' +
        '           <font size="-1" face="Arial">' + totl_itm_cost + '</font>' +
        '       </td>' +
        '   </tr>';
        }
        if (call_found) {
            totl_cost = 'Call';
        } else if (!order_converged) {
            totl_cost = 'Call**';
        } else {
            totl_cost = '$' + ShowDecimals(total_order_cost, 2);
        }
        msg += '   <tr bgcolor="#ffffee">' +
        '       <td align="right" colspan="4">' +
        '           <font size="-1" face="Arial"><b>Total</b></font>' +
        '       </td>' +
        '       <td align="center" nowrap>' +
        '           <font size="-1" face="Arial"><b>' + ShowDecimals(total_order_weight, 1) + '</b></font>' +
        '       </td>' +
        '       <td align="right" nowrap>' +
        '           <font size="-1" face="Arial"><b>' + totl_cost + '</b></font>' +
        '       </td>' +
        '   </tr>' +
        '   <tr bgcolor="#eeeedd">' +
        '       <td align="right" colspan="4">' +
        '           <font size="-2" face="Arial">Taxes</font>' +
        '       </td>' +
        '       <td align="center" colspan="2">' +
        '           <font size="-2" face="Arial">(to be determined)</font>' +
        '       </td>' +
        '   </tr>' +
        '   <tr bgcolor="#eeeedd">' +
        '       <td align="right" colspan="4">' +
        '           <font size="-2" face="Arial">Shipping</font>' +
        '       </td>' +
        '       <td align="center" colspan="2">' +
        '           <font size="-2" face="Arial">(to be determined)</font>' +
        '       </td>' +
        '   </tr>' +
        '</table>';
        currentOrder = new instructions('currentOrder', '450', '300', msg);
        currentOrder.bgcolor   = "#B0B0B0";
        currentOrder.textcolor = "#000000";
        currentOrder.popWindow();
    }

    function ShowDecimals(val, dec) {
        if (dec == null
            || parseFloat(val).toString().length
                < val.toString().length)
                return val;
        var factr = 1;
        for (var i = 0; i < dec; i++){
            factr *= 10;
        }
        var outputStr = Math.round(factr * val).toString();
        while (outputStr.length - dec < 1){
            outputStr = '0' + outputStr;
        }
        if (dec == 0)
            return outputStr;
        var pos = outputStr.length - dec;
        return outputStr.substring(0, pos) + '.' +
                    outputStr.substring(pos);
    }

    function Validate(obj, label, min_value, max_value, in_out) {
        if (in_out == 'output') {
            alert('"' + label + '" is an output value.');
            obj.value = '';
            return false;
        }
        var val = obj.value;
        //strip out any commas
        var val1 = val.toString().split(',').join('');
        var val2 = val1;
        //remove decimal point(s) -- check if there were too many
        val2 = val1.toString().split('.').join('');
        //get rid of leading signs and zeros
        var val3 = val2;
        if (val3.charAt(0) == '+' || val3.charAt(0) == '-') {
            val3 = val3.substring(1)
        }
        while (val3.charAt(0) == '0'){
            val3 = val3.substring(1)
        }
        if (val1.length - val2.length > 1) {
           alert('The value of ' + label + ' appears to contain more than one decimal point.');
        } else if (isNaN(parseInt(val3)) || parseInt(val3).toString().length
                < val3.toString().length) {
           //check for valid numerical value
           alert('You have entered an invalid value (' + val + ') for "'
                    + label + '."');
        } else if (max_value != null && val > max_value) {
           alert('The value of "' + label
                + '" must not be greater than ' + max_value + '.');
        } else if (min_value != null && val < min_value) {
           alert('The value of "' + label
                + '" must not be less than ' + min_value + '.');
        } else {
            return true;
        }
        obj.focus();
        obj.select();
        return false;
    }

    function PageName(obj) {
        if (obj.location.href.indexOf('/') != -1)
            var returnString = obj.location.href.substring(obj.location.href.lastIndexOf('/') + 1);
        else
            var returnString = obj.location.href.substring(obj.location.href.lastIndexOf('\\') + 1);
       /*  if (obj.location.href.indexOf('#') != -1)
            returnString = returnString.substring(0, returnString.indexOf('#'));
        if (obj.location.href.indexOf('?') != -1)
            returnString = returnString.substring(0, returnString.indexOf('?'));   */
        return returnString;
    }

    /* the following script to create a popup window is derived in part from
        one used on the Netscape home page (http://www.netscape.com) and
        in part from Chapter 2 of "Designing with JavaScript" by Nick Heinle, O'Reilly (1997)*/

    var uCli = ' ';
    var uVer = ' ';
    var agt  = navigator.userAgent;
    if (agt.indexOf("MSIE") != -1){
        uCli = "msie";
    }else{
        if ((agt.indexOf('Mozilla') != -1) && ((agt.indexOf('Spoofer') == -1) && (agt.indexOf('compatible') == -1))) {
            if (agt.indexOf(";Nav") != -1) {
                uCli = "netscape navonly";
            }else{
                uCli = "netscape communicator";
            }
        }
    }
    uVer = navigator.appVersion.substring(0,4);
    var usePopup  = true;
    if ((uCli == "msie") && (parseInt(uVer.charAt(0)) == 2)){
        uVer="3";
        usePopup  = false;
    }
    var popup     = new Array();
    var popupNr   = 0;
    popup[0]      = new Object;
    var popupName = "newPPPWindow";
    var popupUsed = false;

    function popupWindow(popupURL,queryVal) {
        if (queryVal == null) {
            queryVal = "";
        }else{
            queryVal = "?query="+queryVal;
        }
        popupURL += queryVal;
        this.onerror = report_error;
        if (usePopup){
            if (uCli == "msie"){
                var focusAvailable = false;
                if (popupUsed){
                    if (popup[popupNr] != null){
                        popup[popupNr].close(popupName);
                        popup[popupNr] = null;
                    }
                    popup[++popupNr] = new Object;
                    popupName = "PPP" + popupNr;
                }
            }else{
                var focusAvailable = true;
            }
            if (!popupUsed){
                alert('Some links on this site are displayed in "pop-up" windows.\n\nPop-up windows are a new browser window which comes up in reduced size on top of the page you are reading.  The pop-up window allows you to navigate to the links we reference wihout losing the text from which we link.  This window can be moved or resized as you wish.\n\nWe hope you find this convenient.');
                popupUsed = true;
            }
            if (popup[popupNr] == null){
                popup[popupNr] = new Object;
                popupName = "PPP" + popupNr;
            }
            popup[popupNr] = window.open(popupURL,popupName,"toolbar=yes,location=yes,menubar=no,scrollbars=yes,resizable=yes,width=550,height=250");
            if (focusAvailable){
                popup[popupNr].location.href = popupURL;
                popup[popupNr].focus();
            }
        }else{
            window.location.href = popupURL;
        }
    }

    /*   The following bit of code has been adapted from JavaScript: The Definitive Guide, 3rd Edition.
         That book and this code were Written by David Flanagan.
         They are Copyright (c) 1996, 1997, 1998 O'Reilly & Associates.
         This code is provided WITHOUT WARRANTY either expressed or implied.
         You may study, use, modify, and distribute it for any purpose,
         as long as this notice is retained.                                   */

    // A variable we use to ensure that each error window we create is unique.
    var error_count = 0;

    // Set this variable to your email address.
    var email = "webmaster@pppcatalog.com";

    // Define the error handler. It generates an HTML form so
    // the user can report the error to the author.
    function report_error(msg, url, line)
    {
       var w = window.open("",                    // URL (none specified)
                           "error"+error_count++, // Name (force it to be unique)
                           "resizable,status,width=500,height=300"); // Features
       var d = w.document;    // We use this variable to save typing!

       // Output an HTML document, including a form, into the new window.
       d.write('<BODY BGCOLOR="#FFFFEE" TEXT="#666633">');
       d.write('<DIV align=center>');
       d.write('<FONT SIZE=4 FACE="Arial" COLOR="#FF0000"><B>');
       d.write('Oooops.... A JavaScript Error Has Occurred!');
       d.write('</B></FONT><BR><HR WIDTH="80%">');
       d.write('<FORM ACTION="mailto:' + email + '" METHOD=post');
       d.write(' ENCTYPE="text/plain">');
       d.write('<FONT SIZE=3 FACE="Arial">');
       d.write('<B><I>Click the "Report Error" button to send a bug report.  We would like to fix this as soon as possible.  Then to close this dialog box click "Dismiss."Thank you!</I></B><BR>');
       d.write('</DIV><DIV align=left>');
       d.write('</FONT><FONT SIZE=2 FACE="Arial">');
       d.write('<BLOCKQUOTE>Your email address<I>(optional)</I>: ');
       d.write('<INPUT SIZE=50 NAME="emailAddress" VALUE="\@">');
       d.write('</FONT><FONT SIZE=1 FACE="Arial">');
       d.write('<P>Error Message: ' + msg);
       d.write('<BR>Document: ' + url);
       d.write('<BR>Line Number: ' + line);
       d.write('<BR>Browser Version: ' + navigator.userAgent);
       d.write('</P></BLOCKQUOTE><INPUT TYPE="hidden" NAME="message" VALUE="' + msg  + '">');
       d.write('<INPUT TYPE="hidden" NAME="url"     VALUE="' + url  + '">');
       d.write('<INPUT TYPE="hidden" NAME="line"    VALUE="' + line + '">');
       d.write('<INPUT TYPE="hidden" NAME="version" VALUE="' + navigator.userAgent + '">');
       d.write('</DIV><DIV align=center>');
       d.write('</FONT><FONT SIZE=2 FACE="Arial">');
       d.write('<INPUT TYPE="submit" VALUE="Report Error">');
       d.write('<INPUT TYPE="button" VALUE="Dismiss" onClick="self.close()">');
       d.write('</DIV></FONT>');
       d.write('</FORM>');
       d.write('</BODY>');
       // Remember to close the document when we're done.
       d.close();

       // Return true from this error handler, so that JavaScript does not
       // display its own error dialog.
       return true;
    }

    self.onerror = report_error;

    function instructions(name, width, height, msg){
        this.onerror   = report_error;
        this.count     = 0;
        this.msg       = msg;
//       this.name   = new Array();
        this.name      = name;
        this.width     = width;
        this.height    = height;
        this.bgcolor   = "#ffffcc";
        this.textcolor = "#003300";
        this.popWd     = new Array();
        this.popWdNr   = 0;
        this.popWd[0]  = null;
        this.popWindow = popWindow;
    }

    function popWindow(){
        if (usePopup){
            if (uCli == "msie"){
                var focusAvailable = false;
                if (this.popWd[this.popWdNr] != null){
                    if (this.popWdName != null) this.popWd[this.popWdNr].close(this.popWdName)
                    this.popWd[this.popWdNr] = null;
                }
                this.popWd[++this.popWdNr] = new Object;
                this.popWdName = this.name + this.popWdNr;
            }else{
                var focusAvailable = true;
            }
            if (this.popWd[this.popWdNr] == null){
                this.popWd[this.popWdNr] = new Object;
                this.popWdName = this.name + this.popWdNr;
            }
            if (this.width  == null){this.width  = "350"}
            if (this.height == null){this.height = "150"}
            this.popWd[this.popWdNr] = window.open("",this.popWdName,"scrollbars=yes,resizable=yes,width=" + this.width + ",height=" + this.height);
            if (focusAvailable){
                this.popWd[this.popWdNr].focus();
            }
        }else{
            this.popWd[this.popWdNr] = new window;
        }
        this.popWd[this.popWdNr].onerror = report_error;
        if (this.popWd[this.popWdNr].document.open('text/html') != null) {
            this.popWd[this.popWdNr].document.write(
                '<html><body bgcolor="' + this.bgcolor + '" text="' + this.textcolor + '">' +
                '   <div align=left>' +
                '   <font size=2 face="Arial">' +
                        this.msg +
                '   </font></div><div align=center>' +
                '   <font size=2 face="Arial">' +
                '       <form action="JavaScript:nullFunction()" method="post">' +
                '           <input type="button" value="Dismiss" onClick="self.close();">' +
                '       </form>' +
                '   </font></div>' +
                '</body></html>');
            this.popWd[this.popWdNr].document.close();
        }
    }

    howToSearch = new instructions('toSearch', '300', '200',
        '<TABLE WIDTH="100%">' +
        '   <tr>' +
        '       <td align="center" bgcolor="#006600">' +
        '           <font face="Arial, Helvetica, sans-serif" size="2" color="#ffff00">' +
        '           <b>How to Search for a Product</b>' +
        '           </font>' +
        '       </td>' +
        '   </tr>' +
        '   <TR>' +
        '       <td>' +
        '           <FONT SIZE="-1" FACE="Arial">' +
        '           To search for a product from any place on the site, type a word, or words, from the product name in the box above the &quot;Search Catalog&quot; button in the navigation panel on the left, then click on the button.' +
        '           </FONT>' +
        '       </td>' +
        '   </TR>' +
        '</TABLE>');

    howToOrder = new instructions('toOrder', '200', '200',
        '<TABLE WIDTH="100%">' +
        '   <tr>' +
        '       <td align="center" bgcolor="#006600">' +
        '           <font face="Arial, Helvetica, sans-serif" size="2" color="#ffff00">' +
        '           <b>How to Create an On-line Purchase Order</b>' +
        '           </font>' +
        '       </td>' +
        '   </tr>' +
        '   <TR>' +
        '       <td>' +
        '           <FONT SIZE="-1" FACE="Arial">(this function is under construction)' +
        '           <ol>' +
        '               <li type="1"></li>' +
        '               <li type="1"></li>' +
        '           </ol>' +
        '           </FONT>' +
        '       </td>' +
        '   </TR>' +
        '</TABLE>');

    userProfiles = new instructions('toOrder', '420', '430',
        '<TABLE WIDTH="100%">' +
        '   <tr>' +
        '       <td align="center" bgcolor="#006600">' +
        '           <font face="Arial, Helvetica, sans-serif" size="2" color="#ffff00">' +
        '           <b>PPPCatalog Customer Keys</b>' +
        '           </font>' +
        '       </td>' +
        '   </tr>' +
        '   <TR>' +
        '       <td>' +
        '           <FONT SIZE="-1" FACE="Arial">' +
        '           A PPPCatalog Customer Key enables you to:' +
        '           <UL>' +
        '               <LI>submit ads to the Contractor Contactor,' +
        '               <LI>have your user profile stored -- each time you return and log in your site customization is automatically activated,' +
        '               <LI>enter your shipping and billing information only once -- it is saved for your use any time you return to the site and log in, and' +
        '               <LI>(when online ordering has been activated) be able to interrupt your work online and return to it later without losing what you have already entered.' +
        '           </UL>' +
        '           <p>To apply for your PPPCatalog Customer Key click on "Sign Up" in the navigation panel to the left, enter, and submit the information in form, and click on "Submit."  The Username and Password you enter are effective immediately and may be used each time you return to the site to active your user profile and any work in progress.</p>' +
        '           </FONT>' +
        '           <p><font face="Arial" size=1><EM><STRONG>' +
        '           We do not sell, trade or rent your personal information to any outside organizations.' +
        '           </STRONG></EM> ' +
        '           For more information on how we handle the information you enter online check out our <a href="who_are_we.phtml#Privacy">privacy policy</A>.</p>' +
        '           </font>' +
        '       </td>' +
        '   </TR>' +
        '</TABLE>');

    /*   End of code from JavaScript: The Definitive Guide, 3rd Edition.   */

    /* this script is derived from an article, "Creating a JavaScript site map,"
        by Martin Webb (January 1, 1998), published by EarthWeb, Inc. at
        http://www.developer.com/news/techworkshop/010198_jsmapframe.html */

    function Tab(name, fileName, description, tabWidth, target, open, Style, ClosedBGColor, OpenBGColor) {
        this.name         = name;           // the name of the file to appear in the tab
        this.fileName     = fileName;       // the name of the file
        this.description  = description;    // description to appear in status bar
        this.parentsRef   = '';             // reference to the parent of object
        this.orderNr      = 0;
        if (open == null)
            this.open     = false;
        else
            this.open     = open;
        this.openBefore   = false;
        this.lastTab      = true;
        if (tabWidth == null)
            this.tabWidth = 65;
        else
            this.tabWidth = tabWidth;
        if (target == null)
            target = window.homeFrame.frames[0];
        this.target       = target;     // target for displayed page
        this.marginWidth  = 0;
        this.navWidth     = 0;
        if (OpenBGColor == null)
            this.OpenBGColor  = '';
        else
            this.OpenBGColor  = OpenBGColor;
        if (ClosedBGColor == null)
            this.ClosedBGColor  = '#000000';
        else
            this.ClosedBGColor  = ClosedBGColor;
        if (this.OpenBGColor == '')
           this.OpenBackground = ''
        else
           this.OpenBackground = ' bgcolor="' + this.OpenBGColor + '"';
        if (this.ClosedBGColor == '')
           this.ClosedBackground = ''
        else
           this.ClosedBackground = ' bgcolor="' + this.ClosedBGColor + '"';
        this.OpenMargin   = '';
        this.ClosedMargin = '';
        if (Style == null)
            this.Style  = '';
        else
            this.Style  = 'style="' + Style + '" ';
        this.ShowTab      = ShowTab;
        this.OpenPage     = OpenPage;
    }

    function ShowTab(afterOpen) {
      //  var anchor = '<A HREF="javascript:parent.' + this.parentsRef + '.Contents[' + this.orderNr + '].OpenPage()" onMouseover="window.status=\'' + this.description + '\'">';
        var anchor = '<A HREF="' + this.fileName + '" target="' + this.target + '" ' + this.Style + 'onMouseover="window.status=\'' + this.description + '\'">';
        if (this.orderNr == 0){
            var tabMargin = 'FirstEdge.gif';
        }else if(this.lastTab){
            var tabMargin = 'LastEdge.gif';
        }else{
            var tabMargin = 'TabEdge.gif';
        }
        this.openBefore = this.open;
        if (this.open){
            var cellBG = this.OpenBackground
            var MargBG = this.OpenMargin;
            if (this.orderNr > 0){
                tabMargin  = 'LeadingEdge.gif';
            }
            this.open = false;
        }else{
            var cellBG = this.ClosedBackground
            var MargBG = this.ClosedMargin;
            if (afterOpen){
                MargBG    = this.OpenMargin;
                tabMargin = 'TrailingEdge.gif';
            }
        }
        var output = '\n\t\t<td valign=top' + MargBG + '>\n\t\t\t<img src="images/' + tabMargin + '" border="0" height="' + this.navWidth + '" width="' + this.marginWidth + '" align="top">\n\t\t</td>\n\t\t<td align="center" valign="top" width=' + this.tabWidth + cellBG + '>\n\t\t\t';
        output += '<font face="arial" size=2>' + anchor + this.name + '</a></font>\n\t\t</TD>';
        return output;
    }

    function OpenPage() {
        this.open = true;
        window.homeFrame.frames[1].location.href = window.homeFrame.frames[1].location.href;
        window.homeFrame.frames[0].location.href = this.fileName;
    }

    function OpenTOCPage(fileName) {
        if (this.NameObjCorl[fileName]) {
            obj = new Object();
            obj = this.NameObjCorl[fileName];
            obj.open = true;
            window.homeFrame.frames[1].location.href = window.homeFrame.frames[1].location.href;
        }
    }

    function TOC(ref, marginWidth, navWidth, OpenBGColor, ClosedBGColor){
        this.ref   = ref;
        this.index = 0;
        if (marginWidth == null)
            this.marginWidth = 8;
        else
            this.marginWidth = marginWidth;
        if (navWidth == null)
            this.navWidth = 45;
        else
            this.navWidth = navWidth;
        if (OpenBGColor == null)
            this.OpenBGColor = '';
        else
            this.OpenBGColor = OpenBGColor;
        if (this.ClosedBGColor == null)
            this.ClosedBGColor = '#000000';
        else
            this.ClosedBGColor = ClosedBGColor;
        if (this.OpenBGColor == '')
           this.OpenMargin = ''
        else
           this.OpenMargin = ' bgcolor="' + this.OpenBGColor + '"';
        if (this.ClosedBGColor == '')
           this.ClosedMargin = ''
        else
           this.ClosedMargin = ' bgcolor="' + this.ClosedBGColor + '"';
        this.OpenMargin   += ' width="' + this.marginWidth + '"';
        this.ClosedMargin += ' width="' + this.marginWidth + '"';
        this.Contents     = new Object();
        this.NameObjCorl  = new Object();
        this.AddTOC       = AddTOC;
        this.ShowTOC      = ShowTOC;
    }

    function AddTOC(obj) {
        obj.parentsRef   = this.ref;
        obj.marginWidth  = this.marginWidth;
        obj.navWidth     = this.navWidth;
        obj.OpenBGColor  = this.OpenBGColor;
        obj.OpenMargin   = this.OpenMargin;
        obj.ClosedMargin = this.ClosedMargin;
        obj.orderNr      = this.index;
     //   if (this.index == 0)
     //       obj.open = true;
        obj.lastTab = false;
        this.Contents[this.index++] = obj;
        this.NameObjCorl[obj.fileName] = obj;
        this.OpenTOCPage = OpenTOCPage;
    }

    function ShowTOC() {
        var output = '<TABLE ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=0>\n\t<TR>';
        for(var i=0; i<this.index; i++){
            if (i > 0)
                var objprevOpen = this.Contents[i-1].openBefore;
            else
                var objprevOpen = false;
            output += this.Contents[i].ShowTab(objprevOpen);
        }
        if (this.Contents[this.index-1].openBefore){
            var MargBG = this.OpenMargin;
        }else{
            var MargBG = this.ClosedMargin;
        }
        output += '\n\t\t<TD VALIGN="top"' + MargBG + '>\n\t\t\t<IMG SRC="images/LastEdge.gif" BORDER=0 HEIGHT=' + this.navWidth + ' WIDTH=' + this.marginWidth + ' ALIGN=top>\n\t\t</TD>'
                + '\n\t\t<TD VALIGN="top">\n\t\t\t</TD>\n\t</TR>\n</TABLE>';
        return output;
    }

/*
    if (window.location.href.indexOf('/') != -1)
        var baseHREF = window.location.href.substring(0,window.location.href.lastIndexOf('/'));
    else
        var baseHREF = window.location.href.substring(0,window.location.href.lastIndexOf('\\'));
*/
    var baseHREF      = '';
    var lastActiveObj = '';
    var pageOpened    = true;

    function File(name, description, ref, fileName, target, CustomizedMarkets) {
        this.name     = name;       // the name of the file to appear in the site map
        this.description = description; //description to appear on status bar
        this.fileName = fileName;   // the name of the file
        this.ref      = ref;        // reference to the object being constructed
        this.type     = 'text';
        if (fileName.indexOf('http://') == -1)
            this.path = baseHREF;   // initial path, to be built up when adding nested objects
        else
            this.path = '';
            CustomizedMarkets = '';
        if (target == null)
            target = 'homeFrame';
        this.target   = target;     // target for displayed page
        this.level    = 1;          // level in directory structure (-1 = another site)
        this.active   = false;      // active screen or branch
        this.activeBG = '';
    }

    function Menu(name, description, ref, open, activeBG) {
        this.name = name;              // the name of the file/menu to appear in the site map
        this.description = description; //description to appear on status bar
        this.type = 'menu';
        this.path = baseHREF;          // initial path, to be built up when adding nested objects
        this.ref  = ref;               // reference to the object being constructed
        if (!open)                     // optional value indicating if the object is open or closed
            this.open = false;
        else
            this.open = true;
        if (activeBG == null)
            this.activeBG = '';
        else
            this.activeBG = ' BGCOLOR="#' + activeBG + '"';
        this.index        = 0;             // initial number of items in Contents
        this.Add          = Add;           // Add is a Menu method e.g. Menu.Add()
        this.Replace      = Replace;       // Replace is a Menu method e.g. Menu.Replace()
        this.Contents     = new Object();  // adds an empty built-in JavaScript Object
        this.NameObjCorl  = new Object();
        this.OpenMenuPage = OpenMenuPage;
    }

    function Add(obj) {
        if (lastActiveObj == ''){
            lastActiveObj = 'rootMenu';
            obj.active = true;
        }
        this.Contents[this.index++] = obj;
        this.NameObjCorl[obj.fileName] = obj;
        obj.path    += obj.fileName;
        obj.activeBG = this.activeBG;
    }

    function Replace(old_obj, new_obj) {
        var obj_found = false;
        for (var i = 0; i < this.index; i++) {
            if (this.Contents[i].ref == old_obj.ref) {
                obj_found = true;
                break;
            }
        }
        if (obj_found) {
            this.Contents[i] = new_obj;
            this.NameObjCorl[new_obj.fileName] = new_obj;
            new_obj.path  = baseHREF + new_obj.fileName;
            new_obj.activeBG = this.activeBG;
        }
    }

    function OpenPageTop(obj) {
        var target = obj.target;
        pageOpened = true;
        obj.open   = true;
        obj.active = true;
        if (obj.path.indexOf('?') == -1){
            window.homeFrame.location.href = obj.path + '?zip=' + CurrentCustomer.zip;
        }else{
            window.homeFrame.location.href = obj.path + '&zip=' + CurrentCustomer.zip;
        }
        window.menuFrame.location.href = window.menuFrame.location.href;
    }

    function OpenMenuPage(fileName) {
        if (this.NameObjCorl[fileName]) {
            obj = new Object();
            obj = this.NameObjCorl[fileName];
            pageOpened = true;
            obj.open   = true;
            obj.active = true;
            window.menuFrame.location.href = window.menuFrame.location.href;
        }
    }

    function OpenMenu(obj) {
        pageOpened = false;
        obj.open = !obj.open;
        window.menuFrame.location.href = window.menuFrame.location.href;
    }

    function ShowMenu() {
        if (lastActiveObj == 'rootMenu'){
            lastActiveObj = rootMenu.Contents[0].ref;
            //window.homeFrame.location.href = rootMenu.Contents[0].fileName;
        }
        return Show(rootMenu);
    }

    function Show(obj) {
        var anchorEnd = 'title="' + obj.description + '"';
        anchorEnd    += ' onMouseover="window.status=\'' + obj.description + '\'; return true"'
                      + ' onMouseout="window.status=\'\'; return true" class=';
        if (obj.ref == 'rootMenu'){
            var output = '\n<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">';
        }else{
            var anchor = '<a href="';
            var buttonStyle = ' class=';
            if (obj.type == 'menu'){
                if (obj.open){
                    buttonStyle += '"down"';
                    anchorEnd   += '"down">';
                }else{
                    buttonStyle += '"up"';
                    anchorEnd   += '"up">';
                }
                anchor  += 'javascript:top.OpenMenu(top.' + obj.ref + ')"' + anchorEnd;
            }else{
                if (!pageOpened && lastActiveObj == obj.ref)
                    obj.active = true;
                if (obj.active){
                    lastActiveObj = obj.ref;
                    obj.active    = false;
                    buttonStyle  += '"down"';
                    anchorEnd    += '"down">';
                }else{
                    buttonStyle  += '"up"';
                    anchorEnd    += '"up">';
                }
                if (obj.target != 'homeFrame')
                    anchor += obj.path + '" target="' + obj.target + '"' + anchorEnd;
                else
                    anchor += 'javascript:top.OpenPageTop(top.' + obj.ref + ')" ' + anchorEnd;
            }
            var output = '\n\t<tr width="100%">' +
                         '\n\t\t<td width="100%"' +
                         buttonStyle + '>\n\t\t\t' + anchor + obj.name + '</a>';
        }
        if (obj.open)
       //     for(var i in obj.Contents)
            for (var i = 0; i < obj.index; i++)
                output += Show(obj.Contents[i]);

        if (obj.ref == 'rootMenu')
            output += '<tr width="100%">' +
                         '\n\t\t<td width="100%">' +
                         '\n\t\t\t<img src="images/Transparent.gif" height="1" width="103">' +
                         '\n\t\t</td>' +
                         '\n\t</tr>' +
                         '\n</table>'
        else
            output += '\n\t\t</td>\n\t</tr>';

        return output;
    }

    rootMenu = new Menu('Home', 'Home', 'rootMenu', true);
        SiteHome = new File('Home', 'Professional Pavement Products, Inc.', 'SiteHome', '/home.phtml');
            rootMenu.Add(SiteHome);
        ProductsHome = new File('Catalog', 'Index of products', 'ProductsHome', '/products.phtml');
            rootMenu.Add(ProductsHome);
 /*       PowerPurchaseHome = new File('Power<br>Purchase', 'Power Purchase.', 'PowerPurchaseHome', '/power_purchase.phtml');
            rootMenu.Add(PowerPurchaseHome);
        ContractorContactorHome = new File('Contractor<br>Contactor', 'Contractor Contactor.', 'ContractorContactorHome', '/contractor_contactor.phtml');
            rootMenu.Add(ContractorContactorHome);*/
        InnovativeProductsHome = new File('Innovative<br>Product&nbsp;Line', 'Innovative Products Line.', 'InnovativeProductsHome', '/innovative_products/index.php');
            rootMenu.Add(InnovativeProductsHome);
        CustomizeHome = new File('Customize', 'Customize your browsing or searching.', 'CustomizeHome', 'customize.phtml');
            rootMenu.Add(CustomizeHome);
        ActivateHome = new File('Sign In', 'Activate your user profile.', 'ActivateHome', '/activate.phtml?app_type=customer&activate=yes');
            rootMenu.Add(ActivateHome);
        ApplyHome = new File('Sign Up', 'Set up your user profile.', 'ApplyHome', '/apply.phtml?app_type=customer');
            rootMenu.Add(ApplyHome);
        ContactHome = new File('Contact Us', 'How to contact us or order a catalog or pricelist.', 'ContactHome', '/how_to_contact.phtml');
            rootMenu.Add(ContactHome);
        AboutHome = new File('Who are we?', 'Who are we? Our Faith, Our Goals, Our Services, Our Conditions, Our Privacy Policy.', 'AboutHome', '/who_are_we.phtml');
            rootMenu.Add(AboutHome);
        QuienesSomosHome = new File('&#191;Quienes somos?', '&#191;Quienes somos? Nuestras metas, Nuestro servicio, Condiciones de compra', 'QuienesSomosHome', '/quienes_somos.php');
            rootMenu.Add(QuienesSomosHome);

        UpdateHome = new File('Update Profile', 'Update your user profile.', 'UpdateHome', '/apply.phtml?app_type=update');
        LogoutHome = new File('Log Out', 'De-activate your user profile.', 'LogoutHome', '/activate.phtml?app_type=customer&cancel_auth=yes');

        function nullFunction() {
           // return;
        }

        function customer (zip){
            this.zip = zip;
        }
        CurrentCustomer = new customer('');

        function weatherWidget(val) {
            CurrentCustomer.zip = escape(val);
            popupWindow('http://www.wunderground.com/cgi-bin/findweather/getForecast', CurrentCustomer.zip);
        }
        function searchWidget(val) {
            window.homeFrame.location.href = 'products.phtml?GroupName=Search%20Results&SearchString=' + escape(val) + '&zip=' + CurrentCustomer.zip;
//            window.homeFrame.location.href = 'products.phtml?GroupName=Search%20Results&SearchString=' + escape(val) + '&zip=' + CurrentCustomer.zip + ProductsHome.CustomizedMarkets;
        }
		
		function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function mmLoadMenus() {
  if (window.mm_menu_0119161215_0) return;
  window.mm_menu_0119161215_0 = new Menu("root",360,18,"Verdana, Arial, Helvetica, sans-serif",12,"#CCCCCC","#000000","#4B4B4B","#FECE00","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0119161215_0.addMenuItem("Asphalt&nbsp;Pavement&nbsp;Sealers","location='http://www.pppcatalog.com/store/product.php?productid=101&cat=252&page=1'");
  mm_menu_0119161215_0.addMenuItem("Asphalt&nbsp;Sealer&nbsp;Additives&nbsp;&&nbsp;Aggregates","location='http://www.pppcatalog.com/store/home.php?cat=253'");
  mm_menu_0119161215_0.addMenuItem("Asphalt&nbsp;Primers&nbsp;&&nbsp;Tack","location='http://www.pppcatalog.com/store/home.php?cat=299'");
  mm_menu_0119161215_0.addMenuItem("Pavement&nbsp;Repair&nbsp;Materials","location='http://www.pppcatalog.com/store/home.php?cat=257'");
  mm_menu_0119161215_0.addMenuItem("Pavement&nbsp;Maintenance&nbsp;&&nbsp;Construction&nbsp;Tools","location='http://www.pppcatalog.com/store/home.php?cat=256'");
  mm_menu_0119161215_0.addMenuItem("Pavement&nbsp;Maintenance&nbsp;&&nbsp;Construction&nbsp;Equipment","location='http://www.pppcatalog.com/store/home.php?cat=254'");
  mm_menu_0119161215_0.addMenuItem("Personal&nbsp;Protection","location='http://www.pppcatalog.com/store/product.php?productid=10601&cat=255&page=1'");
  mm_menu_0119161215_0.addMenuItem("Tennis&nbsp;Court&nbsp;Surface&nbsp;Products","location='http://www.pppcatalog.com/store/product.php?productid=106&cat=298&page=1'");
  mm_menu_0119161215_0.addMenuItem("Detectable&nbsp;Warning&nbsp;Surface&nbsp;Products","location='http://www.pppcatalog.com/store/home.php?cat=259'");
   mm_menu_0119161215_0.fontWeight="bold";
   mm_menu_0119161215_0.hideOnMouseOut=true;
   mm_menu_0119161215_0.bgColor='#555555';
   mm_menu_0119161215_0.menuBorder=1;
   mm_menu_0119161215_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0119161215_0.menuBorderBgColor='#777777';

  window.mm_menu_0119161813_0 = new Menu("root",280,18,"Verdana, Arial, Helvetica, sans-serif",12,"#CCCCCC","#000000","#4B4B4B","#FECE00","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0119161813_0.addMenuItem("Traffic&nbsp;Paints","location='http://www.pppcatalog.com/store/home.php?cat=268'");
  mm_menu_0119161813_0.addMenuItem("Traffic&nbsp;Paint&nbsp;Equipment","location='http://www.pppcatalog.com/store/home.php?cat=262'");
  mm_menu_0119161813_0.addMenuItem("Stencils","location='http://www.pppcatalog.com/store/home.php?cat=263'");
  mm_menu_0119161813_0.addMenuItem("Thermoplastic","location='http://www.pppcatalog.com/store/home.php?cat=266'");
  mm_menu_0119161813_0.addMenuItem("Preformed&nbsp;Thermoplastic","location='http://www.pppcatalog.com/store/product.php?productid=20304&cat=301&page=1'");
  mm_menu_0119161813_0.addMenuItem("Thermoplastic&nbsp;Equipment","location='http://www.pppcatalog.com/store/home.php?cat=300'");
  mm_menu_0119161813_0.addMenuItem("Pavement&nbsp;Marking&nbsp;Retroreflectometer&nbsp;","location='http://www.pppcatalog.com/store/product.php?productid=20907&cat=302&page=1'");
  mm_menu_0119161813_0.addMenuItem("Pavement&nbsp;Marking&nbsp;Tape","location='http://www.pppcatalog.com/store/home.php?cat=264'");
  mm_menu_0119161813_0.addMenuItem("Pavement&nbsp;Markers&nbsp;&&nbsp;Delineators","location='http://www.pppcatalog.com/store/home.php?cat=304'");
  mm_menu_0119161813_0.addMenuItem("Epoxies&nbsp;&&nbsp;Adhesives","location='http://www.pppcatalog.com/store/home.php?cat=260'"); 
  mm_menu_0119161813_0.addMenuItem("Traffic&nbsp;Calming&nbsp;Products","location='http://www.pppcatalog.com/store/home.php?cat=267'");
  mm_menu_0119161813_0.addMenuItem("Wheel&nbsp;Stops","location='http://www.pppcatalog.com/store/home.php?cat=269'");
  mm_menu_0119161813_0.addMenuItem("Layout&nbsp;and&nbsp;Measuring&nbsp;Products","location='http://www.pppcatalog.com/store/home.php?cat=261'");
   mm_menu_0119161813_0.fontWeight="bold";
   mm_menu_0119161813_0.hideOnMouseOut=true;
   mm_menu_0119161813_0.bgColor='#555555';
   mm_menu_0119161813_0.menuBorder=1;
   mm_menu_0119161813_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0119161813_0.menuBorderBgColor='#777777';

  window.mm_menu_0119162212_0 = new Menu("root",240,18,"Verdana, Arial, Helvetica, sans-serif",12,"#CCCCCC","#000000","#4B4B4B","#FECE00","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0119162212_0.addMenuItem("Traffic&nbsp;Control&nbsp;&&nbsp;Parking&nbsp;Lot&nbsp;Signs","location='http://www.pppcatalog.com/store/home.php?cat=273'");
  mm_menu_0119162212_0.addMenuItem("Sign&nbsp;Posts","location='http://www.pppcatalog.com/store/product.php?productid=302&cat=271&page=1'");
  mm_menu_0119162212_0.addMenuItem("Sign&nbsp;Hardware","location='http://www.pppcatalog.com/store/product.php?productid=303&cat=270&page=1'");
  mm_menu_0119162212_0.addMenuItem("Sign&nbsp;Retroreflectometer","location='http://www.pppcatalog.com/store/product.php?productid=307&cat=272&page=1'");
   mm_menu_0119162212_0.fontWeight="bold";
   mm_menu_0119162212_0.hideOnMouseOut=true;
   mm_menu_0119162212_0.bgColor='#555555';
   mm_menu_0119162212_0.menuBorder=1;
   mm_menu_0119162212_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0119162212_0.menuBorderBgColor='#777777';
   
     window.mm_menu_0119162214_0 = new Menu("root",225,18,"Verdana, Arial, Helvetica, sans-serif",12,"#CCCCCC","#000000","#4B4B4B","#FECE00","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0119162214_0.addMenuItem("Vests&nbsp;and&nbsp;Flags","location='http://www.pppcatalog.com/store/product.php?productid=501&cat=278&page=1'");
  mm_menu_0119162214_0.addMenuItem("Cool&nbsp;Products","location='http://www.pppcatalog.com/store/product.php?productid=5012&cat=279&page=1'");
  mm_menu_0119162214_0.addMenuItem("Traffic&nbsp;Cones","location='http://www.pppcatalog.com/store/product.php?productid=503&cat=280&page=1'");
  mm_menu_0119162214_0.addMenuItem("Traffic&nbsp;Ribbon&nbsp;and&nbsp;String","location='http://www.pppcatalog.com/store/product.php?productid=506&cat=281&page=1'");
  mm_menu_0119162214_0.addMenuItem("Workzone&nbsp;Marker&nbsp;Posts","location='http://www.pppcatalog.com/store/product.php?productid=50305&cat=282&page=1'");
  mm_menu_0119162214_0.addMenuItem("Barricades&nbsp;and&nbsp;Warning&nbsp;Lights","location='http://www.pppcatalog.com/store/home.php?cat=283'");
  mm_menu_0119162214_0.addMenuItem("Warning&nbsp;Signs","location='http://www.pppcatalog.com/store/home.php?cat=284'");
   mm_menu_0119162214_0.fontWeight="bold";
   mm_menu_0119162214_0.hideOnMouseOut=true;
   mm_menu_0119162214_0.bgColor='#555555';
   mm_menu_0119162214_0.menuBorder=1;
   mm_menu_0119162214_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0119162214_0.menuBorderBgColor='#777777';

mm_menu_0119162212_0.writeMenus();
}

// Featured Products Rotation

var theImages = new Array()

theImages[0] = 'images/medallion-copy.jpg'
theImages[1] = 'images/DAF.gif'
theImages[2] = 'images/redimat.jpg'
theImages[3] = '../www/images/retro-featured.gif'

var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
if(whichImage==0){
document.write('<p><a href ="http://www.pppcatalog.com/medallion/index.html" class=text><span class=subhead>Medallion Maintenance and Marking Product Line</span><img src="'+theImages[whichImage]+'" border=0 width=211 height=139><br /><strong>Premium line of products for longer lasting pavement and pavement markings</strong></a></p>');
}
else if(whichImage==1){
document.write('<p><a href ="http://www.pppcatalog.com/daf-scale/" class=text><span class=subhead>The DAF Weather Scale</span><img src="'+theImages[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>A weather indicator scale that will increase your productivity and decrease your losses</strong></a></p>');
}
else if(whichImage==2){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=2010&cat=259&page=1" class=text><span class=subhead>RediMat <br />Detectable Warnings</span><img src="'+theImages[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Meet ADA compliance in minutes</strong></a></p>');
}
else if(whichImage==3){
document.write('<p><a href ="http://www.pppcatalog.com/922" class=text><span class=subhead>922 Sign Retroreflectometer</span><img src="'+theImages[whichImage]+'" border=0 width=211 height=139><strong>Measure and manage sign inventories for the MUTCD mandate</strong></a></p>');
}
}



var theImagesB = new Array()

theImagesB[0] = 'images/Featured/3M_reflective-pavement-markers.jpg'
theImagesB[1] = 'images/Featured/traffic-control-delineator-curb.jpg'
theImagesB[2] = 'images/Featured/stripemaster-2.jpg'
theImagesB[3] = 'images/Featured/ez-tile.jpg'

var j = 0
var b = theImagesB.length;
var preBuffer = new Array()

for (i = 0; i < b; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImagesB[i]
}
var whichImage = Math.round(Math.random()*(b-1));

function showImageB(){
if(whichImage==0){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=20603&cat=304&page=1" class=text><span class=subhead>3-M Reflective<br />Pavement Markers</span><img src="'+theImagesB[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>The ultimate all weather lane delineation</strong></a></p>');
}
else if(whichImage==1){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=20110314&cat=304&page=1" class=text><span class=subhead>Interstate Curb System</span><img src="'+theImagesB[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Safely and economically channelize traffic</strong></a></p>');
}
else if(whichImage==2){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=20907&cat=302&page=1" class=text><span class=subhead>Stripemaster 2 Pavement Marking Retroreflectometer</span><img src="'+theImagesB[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Measure and manage pavement marking retroreflectivity</strong></a></p>');
}
else if(whichImage==3){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=201005&cat=259&page=1" class=text><span class=subhead>EZ Set<br />Detectable Warnings</span><img src="'+theImagesB[whichImage]+'" border=0 width=211 height=139><strong>ADA Compliance with this cast-in-place Detectable warning</strong></a></p>');
}
}




var theImagesC = new Array()

theImagesC[0] = 'images/Featured/weissker-glass-beads.jpg'
theImagesC[1] = 'images/Featured/traficop.jpg'
theImagesC[2] = 'images/Featured/pavement-grinder.jpg'
theImagesC[3] = 'images/Featured/prostripemx-traffic-paint.jpg'

var j = 0
var b = theImagesB.length;
var preBuffer = new Array()

for (i = 0; i < b; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImagesC[i]
}
var whichImage = Math.round(Math.random()*(b-1));

function showImageC(){
if(whichImage==0){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=20501&cat=266&page=1" class=text><span class=subhead>Reflective Glass Beads</span><img src="'+theImagesC[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>The CLEAR choice for retroreflective pavement markings</strong></a></p>');
}
else if(whichImage==1){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=208010&cat=267&page=1" class=text><span class=subhead>Traffic Calming Speed Cusion</span><img src="'+theImagesC[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Reduce motorist speeds but not emergency vehicles</strong></a></p>');
}
else if(whichImage==2){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=20110316&cat=300&page=1" class=text><span class=subhead>SPS10 Surface Preparator</span><img src="'+theImagesC[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Erase traffic markings quickly & easily, without grooving</strong></a></p>');
}
else if(whichImage==3){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=2010409&cat=268&page=1" class=text><span class=subhead>ProstripeMX Traffic Paint</span><img src="'+theImagesC[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Bright, resilient, flexible, durable pavement markings</strong></a></p>');
}
}




var theImagesD = new Array()

theImagesD[0] = 'images/Featured/zoomflex-sealer-additive.jpg'
theImagesD[1] = 'images/Featured/bright-ideas.jpg'
theImagesD[2] = 'images/Titan9900-featured.gif'
theImagesD[3] = 'images/Featured/sealcoat-rig.jpg'

var j = 0
var b = theImagesD.length;
var preBuffer = new Array()

for (i = 0; i < b; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImagesC[i]
}
var whichImage = Math.round(Math.random()*(b-1));

function showImageD(){
if(whichImage==0){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=102041&cat=253&page=1" class=text><span class=subhead>ZoomFlex Sealer Additive</span><img src="'+theImagesD[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Much more than just the fastest drying additive on the market</strong></a></p>');
}
else if(whichImage==1){
document.write('<p><br />&nbsp;<a href ="http://www.pppcatalog.com/email/bright_ideas.html" class=text><span class=subhead>Bright Ideas</span><img src="'+theImagesD[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>Bright ideas for retroreflectivity & roadway safety</strong></a></p>');
}
else if(whichImage==2){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=20906&cat=262&page=1" class=text><span class=subhead>Titan Airless Striper</span><img src="'+theImagesD[whichImage]+'" border=0 width=211 height=139 align=center><br><strong>The ultimate industrial quality striper</strong></a></p>');
}
else if(whichImage==3){
document.write('<p><a href ="http://www.pppcatalog.com/store/product.php?productid=20110315&cat=254&page=1" class=text><span class=subhead>300 gal sealcoat rig</span><img src="'+theImagesD[whichImage]+'" border=0 width=211 height=139><strong>Fully self contained seal rig designed for your pickup</strong></a><p>');
}
}
