﻿// Setup:
// 1. add script in to the web page's <header> section:
//    <script type="text/javascript" src="menu.js">      // this file contains the javascript code and the menu definition
// 2. add style sheet to the web page's <header> section:
//    <link rel="stylesheet"  type="text/css" href="shan5.css" />   // this file contains the css for the menu
// 3. add to the <body> section to initialize the gallery
//    Syntax: new shan5Menu(menuarray, "selectionMenuEntry", vertical)

var homeMenuItems=new Array()
homeMenuItems[0] = ["Home", "index.htm"]
homeMenuItems[1] = ["Recent Works", "recent.htm"]
homeMenuItems[2] = ["Watercolor", "watercolor.htm"]
homeMenuItems[3] = ["Acrylic", "acrylic.htm"]
homeMenuItems[4] = ["Digital", "digital.htm"]
homeMenuItems[5] = ["Pottery", "pottery.htm"]
homeMenuItems[6] = ["Shan's Arts", "http://shan.shan5.com"]


var jenMenuItems = new Array()
jenMenuItems[0] = ["Home", "index.htm"]
jenMenuItems[1] = ["Recent Works", "recent.htm"]
jenMenuItems[2] = ["Watercolor", "watercolor.htm"]
jenMenuItems[3] = ["Acrylic", "acrylic.htm"]
jenMenuItems[4] = ["Digital", "digital.htm"]
jenMenuItems[5] = ["Pottery", "pottery.htm"]
jenMenuItems[6] = ["Bio", "statement.jw.htm"]

// Menu.js
function shan5Menu(menuarray, selected, vertical)
{
    document.write('<div>'); 	
	for (var item=0; item<menuarray.length; item++)
	{
	    document.write('<font face="Symbol" size="3"> · </font>');
	    document.write('<font face="Century Gothic" size="2">');
		if (typeof(selected) == 'string' && selected == menuarray[item][0])
		{
			document.write('<a name="selected" class="selected" onmouseover="javascript:MMenuOver(this);" onmouseout="javascript:MMenuOut(this);" href="' + menuarray[item][1] + '">' + menuarray[item][0] + '</a>');
		}
		else
		{
	    	document.write('<a class="unselected" onmouseover="javascript:MMenuOver(this);" onmouseout="javascript:MMenuOut(this);" href="' + menuarray[item][1] + '">' + menuarray[item][0] + '</a>');
	    }
	    document.write("</font>");
	    if (typeof(vertical) == 'boolean' && vertical)
		{
			document.write('<br/>');
		}
	}
	document.write('</div>');
}

function MMenuOver(item)
{
    if (item.name == "selected")
    {
        item.className = "mouseover_selected";
    }
    else
    {
        item.className = "mouseover_unselected";
    }
}

function MMenuOut(item)
{
    if (item.name == "selected")
    {
        item.className = "selected";
    }
    else
    {
        item.className = "unselected";
    }
}

