function WM_readCookie(name) {
    if(document.cookie == '') { // there's no cookie, so go no further
        return '';
    } else { // there is a cookie
        var firstChar, lastChar;
        var theBigCookie = document.cookie;
        firstChar = theBigCookie.indexOf(name); // find the start of 'name'
        var NN2Hack = firstChar + name.length;
        if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
            firstChar += name.length + 1; // skip 'name' and '='
            lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
            if(lastChar == -1) lastChar = theBigCookie.length;
            return unescape(theBigCookie.substring(firstChar, lastChar));
        } else { // If there was no cookie of that name, return ''.
            return '';
        }
    }
} // WM_readCookie

/* COOLjsMenu style + structure file */

//styles
var color = {border:"#666666", shadow:"#DBD8D1", bgON:"#0066CC", bgOVER:"green"};
var css = {ON:"clsCMOn", OVER:"clsCMOver"};
var STYLE = {border:1,
             shadow:2, color:color,
             css:css, valign:"center",
             size:[ '+maxItem', '+self' ],
             itemoff:[ 0, '+previousItem-1px' ],
             leveloff:[ '+parentItem-1px', 0 ]}

//items and formats
var MENU_ITEMS_F =
[
  {pos:"relative", style:STYLE},
  {code:"English", url:"index_e.html"},
  {code:"Accueil", url:"index.html"},
  {code:"Compagnie",
    sub:[
      {itemoff:[21,0], leveloff:[25,0], size:[ '+maxItem', '+maxItem' ]},
      {code:"Heures d'affaires", "url":"business_hours_f.html"},
      {code:"Histoire", "url":"history_f.html"},
      {code:"Opportunités d'emploi", "url":"employment_f.html"},
      {code:"Carte", "url":"map_f.html"},
    ]
  },
  {code:"Excavation",
    sub:[
      {itemoff:[21,0], leveloff:[25,0], size:[ '+maxItem', '+maxItem' ]},
      {code:"Excavation", "url":"excavation_f.html"},
      {code:"Septique", "url":"septic_f.html"},
      {code:"Sable Gravier Terre", "url":"aggregates_f.html"},
    ]
  },
  {code:"Pièces &amp; Service",
    sub:[
      {itemoff:[21,0], leveloff:[25,0], size:[ '+maxItem', '+parentItem' ]},
      {code:"Pièces", "url":"parts_f.html"},
      {code:"Outils Stihl", "url":"stihl_f.html"},
      {code:"Service", "url":"service_f.html"},
    ]
  },
  {code:"Agricole", url:"agricultural_f.html"},
  {code:"Vente de terrains", url:"residential_f.html"},
  {code:"Nous rejoindre", url:"contact_us_f.html"}
];

var menu = new COOLjsMenuPRO("menu", MENU_ITEMS_F);
menu.initTop();

