/*
    This file is part of JonDesign's SmoothSlideshow v2.0.

    JonDesign's SmoothSlideshow is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    JonDesign's SmoothSlideshow is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Main Developer: Jonathan Schemoul (JonDesign: http://www.jondesign.net/)
    Contributed code by:
    - Christian Ehret (bugfix)
    - Simon Willison (addLoadEvent)
*/

// declaring the class
var menuBar = Class.create();

// implementing the class
menuBar.prototype = {
	initialize: function(element, selectedMenuItem) {		

		var countArticle = 0;
		var myMenuItems = new Array();

		myMenuItems[countArticle++] = new Array(
			'Go to Home Page',
			'index.html',
			'Home'
			);

		myMenuItems[countArticle++] = new Array(
			'Wedding Photographs',
			'weddings.html',
			'Weddings'
			);

		myMenuItems[countArticle++] = new Array(
			'Children And Families',
			'children.html',
			'Children'
			);

		myMenuItems[countArticle++] = new Array(
			'Sports And Team Photographs',
			'#',
			'Sports'
			);

		for(i=0;i<myMenuItems.length;i++)
		{
			var listItemElem = document.createElement('li');
			
			var linkElem = document.createElement('a');

			if (i==selectedMenuItem)
			{
				linkElem.setAttribute('class', 'here');
			}
			else
			{
				linkElem.setAttribute("title", myMenuItems[i][0]);
				linkElem.setAttribute("href", myMenuItems[i][1]);
			}
			linkElem.appendChild(document.createTextNode(myMenuItems[i][2]));

			listItemElem.appendChild(linkElem);
			element.appendChild(listItemElem);
		}
	}
};

function startMenuBar(){
	var menu = new menuBar($('myMenuBar'), selectedPage);
}

