/*
Title: Vertical slide navigation.
Description: jQuery vertical slide navigation on an unordered list.
Author: Anthony Booth
Date: 05-10-2009
Version: 1.0

Free to use and manipulate but reference me.

Copyright 2009 by Anthony Booth

web: http://www.misterbooth.co.uk
email: anthony@misterbooth.co.uk

html example:
Change #vertical_navigation, .menu and .menu_parent to suit you.

<ul class="menu">
	<li class="home"><a href="http://somewhere.dev/" title="Home Page">Home</a> </li>
	<li class="about-us"><a href="http://somewhere.dev/about-us" title="About Us">About Us</a> </li>
	<li class="demo-section-header menu_active menu_parent"><a class="menu_active menu_parent">Demo Section Header</a>
		<ul>
			<li class="demo-page-one"><a href="http://somewhere.dev/demo-section-header/demo-page-one">Demo Page One</a></li>
			<li class="demo-page-two menu_parent"><a href="http://somewhere.dev/demo-section-header/demo-page-two" class="menu_parent">Demo Page Two</a>
				<ul>
					<li class="demo-page-three"><a href="http://somewhere.dev/demo-section-header/demo-page-one">Demo Page Three</a></li>
				</ul>
			</li>
		</ul>
	</li>
	<li class="contact-us"><span></span><a href="http://somewhere.dev/contact-us" title="Contact Us">Contact Us</a> </li>
</ul>

Note: If the navigation links under
a menu_parent have a title attribute
it will cause problems with mouseleave
closing prematurely.
Plese let me know if you have a fix.
*/
$(document).ready(function(){
						   
	$('#vertical_navigation ul.menu ul').hide();
	
	$('#vertical_navigation ul.menu li.menu_parent').bind("mouseenter",function(){
      if($(this).children('ul').is(':hidden')) {
				$(this).addClass('over')
				.children('ul').slideDown('normal');
			}
    }).bind("mouseleave",function(){
      if($(this).children('ul').is(':visible')) {
				$(this).children('ul').slideUp('slow')
				.removeClass('over');
			}
    });

});
