
// Add extra items to the main menu

function menuitem(url, text) {
    var li = document.createElement("li");
    var a = document.createElement("a");
    var span = document.createElement("span");

    span.innerHTML = text;
    a.appendChild(span);
    a.setAttribute("href", url);

    li.appendChild(a);

    return li;
}

// Add winch mounting plate menu link
if (typeof ($$('li.nav-winch-mounting-plates ul')[0]) != "undefined") {
    var winchplatewizarditem = menuitem("/winch-plate-wizard", "Winch Plate Wizard");
    Element.insert($$('li.nav-winch-mounting-plates ul')[0].firstChild, { before: winchplatewizarditem });
}

/*
// Add simple snowplow mounting plate link
if (typeof ($$('li.nav-atv-utv-snow-plows-snow-plow-mounts ul')[0]) != "undefined") {
    var plowwizarditem = menuitem("/snow-plow-plate-wizard", "Snow Plow Plate Wizard");
    Element.insert($$('li.nav-atv-utv-snow-plows-snow-plow-mounts ul')[0].firstChild, { before: plowwizarditem });
}

// Add snowplow system wizard link
if (typeof ($$('li.nav-atv-utv-snow-plow-parts ul')[0]) != "undefined") {
    var winchplatewizarditem = menuitem("/atv-utv-snow-plows/build-your-system", "Build Your Plow System");
    Element.insert($$('li.nav-atv-utv-snow-plow-parts ul')[0].firstChild, { before: winchplatewizarditem });
}
*/
