/* Left Vertical Menu         */
/* Written by Robert LaMunyon */
/* robert.lamunyon@gm.com     */
/* June 22, 2003              */

document.close()
document.open("text/plain")

var menuFont="Tahoma";
var menuFontSize= 11;
var offBgColor="#005826"; // dark blue
var offFontColor="#FFFFFF";
var onBgColor="#A3D39C"; // Light Green
var onFontColor="#000000";
var borderColor="#999 #333 #333 #999";

var menuWidth=156; // adjust for the menu-width you desire
var menuHeight="auto"; // use numbers if you want a fixed height
var textIndent=6;

var newLineChar = String.fromCharCode(10);
var tabChar = String.fromCharCode(9);
var dblQuote = String.fromCharCode(34);
var zIndex = 1000;
var spacer=1;

htmlStr = newLineChar;
htmlStr += "<SPAN ID='LEFT_VMENU' STYLE='top:0px; left:0px; position:relative'>";

MenuBar("Menu1", "Home Page", "Home Page", "index.html", false);
MenuBar("Menu2", "Pasture Fed Beef Price List", "100% Pasture Fed Beef Prices", "products.html", false);
MenuBar("Menu3", "Free-Range Chicken", "Free-Range Chicken", "chicken.html", false);
MenuBar("Menu4", "Order", "Place an Order", "order.php", false);
MenuBar("Menu5", "Farmers Market", "Royal Oak Farmers Market", "market.html", false);
MenuBar("Menu6", "Processing", "Weltins Meat Processing", "processing.html", false);
MenuBar("Menu7", "About Us", "About Us", "about-us.html", false);

htmlStr += newLineChar;
htmlStr += newLineChar + "</SPAN>";

// un-comment the next line to see generated html string in the browser window
// htmlStr="<XMP>" + htmlStr + "</XMP>";

document.write(htmlStr);

function MenuBar(idStr, displayStr, helpStr, urlStr, subMenus){
idStr=idStr.toUpperCase();
htmlStr += newLineChar;
htmlStr += "<DIV ID='" + idStr + "' ";
htmlStr += "STYLE='z-index:" + zIndex + "; border:1px solid " + borderColor + "; background-color:" + offBgColor + "; position:relative; width:" + menuWidth + "px; cursor:auto; height:" + menuHeight + "px;'";
if (helpStr != ""){
htmlStr += "TITLE='" + helpStr + "'";
}
htmlStr += " onmouseout=" + dblQuote + "SwapStyles('out','" + idStr + "'); HideMenu('" + idStr + "');" + dblQuote;
htmlStr += " onmouseover=" + dblQuote + "SwapStyles('over','" + idStr + "'); ShowMenu('" + idStr + "');" + dblQuote + ">";
htmlStr += newLineChar + tabChar;
htmlStr += "<DIV ID='" + idStr + "_TEXT' ";
htmlStr += "STYLE='left:" + textIndent + "px; position:relative; width:" + (menuWidth-textIndent-15) + "px; padding:2px 0px 3px 0px'>";
// menuwidth is reduced by 15 to allow space for pointer on the end
htmlStr += newLineChar + tabChar;
htmlStr += "<A ID='" + idStr + "_LINK' ";
htmlStr += "STYLE='text-decoration:none; color:" + offFontColor + "; width:" + (menuWidth-textIndent-15) + "px; font-family:" + menuFont + "; font-size:" + menuFontSize + "' ";
if (urlStr != ""){
htmlStr += "TARGET='_top' HREF='" + urlStr + "'>";
htmlStr += displayStr + "</A></DIV>";
}
htmlStr += newLineChar;
if(subMenus){
htmlStr += tabChar;
htmlStr += "<DIV ID='" + idStr + "_POINTER' STYLE='text-align:left; top:1px; left:" + (menuWidth-15) + "px; position:absolute; font-family:webdings; color:" + offFontColor + "; font-size:" + (menuFontSize-1) + "'>4</DIV>";
htmlStr += newLineChar + tabChar;
htmlStr += "<SPAN ID='" + idStr + "_SUBGROUP' ";
htmlStr += "STYLE='position:absolute; top:2px; left:" + (menuWidth-5) + "px; display:none;'>";
htmlStr += newLineChar + tabChar;
}
else{
htmlStr += "</DIV>";
htmlStr += newLineChar;
}
zIndex--;
}

function SwapStyles(eventId, idStr){
isMouseout = (eventId.toUpperCase().indexOf("OUT") != -1);
if (isMouseout){
bgc = offBgColor;
fc = offFontColor;
}
else {
bgc = onBgColor;
fc = onFontColor;
}
document.getElementById(idStr).style.backgroundColor = bgc;
document.getElementById(idStr + "_TEXT").style.backgroundColor = bgc;
document.getElementById(idStr + "_LINK").style.color = fc;
if (document.getElementById(idStr + "_POINTER") != null) {
document.getElementById(idStr + "_POINTER").style.color = fc;
}
return true;
}

function ShowMenu(idStr){
var menuToShow = document.getElementById(idStr + "_SUBGROUP");
if (menuToShow == null) return false;
menuToShow.style.display = 'block';
return true;
}

function HideMenu(idStr){
var menuToHide = document.getElementById(idStr + "_SUBGROUP");
if (menuToHide == null) return false;
menuToHide.style.display = 'none';
return true;
}

