/*********************
//* jQuery Multi Level CSS Menu (horizontal)- By Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//* Menu instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//* Last modified: Sept 6th, 08'. Usage Terms: http://www.dynamicdrive.com/style/csslibrary/tos/
*********************/

//Specify full URL to down and right arrow images (25 is padding-right to add to top level LIs with drop downs):
var arrowimages={down:['downarrowclass', 'arrow-down.gif', 25], right:['rightarrowclass', 'arrow-right.gif']}

var jquerycssmenu={

fadesettings: {overduration: 350, outduration: 100}, //duration of fade in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
	var margintop;
	$(document).ready(function () {
		$('#' + menuid).find('span').hover(function () {
			
			if ($(this).hasClass('cssmenu')) {
				$(this).children('div').css({'top': ($(this).height()), 'left': $(this).position().left}).fadeIn(350);
			} else {
				$(this).children('div').css({'top': ($(this).position().top), 'left': ($(this).position().left + $(this).width())}).fadeIn(350);
			}
			
			if ($(this).children('div').hasClass('submenu') && !$(this).hasClass('cssmenu')) {
				$(this).css("background-color","red");
			}
		}, function () {

			$(this).children('div').fadeOut(100);
		});

		
		
	});

	$('#menuto').find('span').each(function() {
		if ($(this).children('div').hasClass('submenu') && !$(this).hasClass('cssmenu')) {
			$(this).css("background-color","red");
		}
	});
  }
}
//build menu with ID="myjquerymenu" on page:
jquerycssmenu.buildmenu("menuto", arrowimages);

