/*
Title: Vertical/Horizontal pop down navigation.
Description: jQuery pop down navigation on an unordered list.
			 This is mainly for ie 6 only so that hover works on a html tag 'li' other than an 'a'
Author: Anthony Booth
Date: 05-10-2009
Version: 1.0

Free to use and manipulate but reference me.

Copyright 2010 by Anthony Booth

web: http://www.misterbooth.co.uk
email: anthony@misterbooth.co.uk
*/
$(document).ready(function(){
	
	if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 6){
		
		/* add class to ul so we can independently talk to it in our css */
		$('#vertical-navigation ul').addClass('ie-6'); 
		$('#horizontal-navigation ul').addClass('ie-6');
		
		var thisclass;
		var newclass;
	
		$('ul.menu li').bind("mouseenter",function(){
			if ($(this).attr('class') != '') {	
				thisclass = $(this).attr('class');
				newclass = thisclass + 'h';	
				$(this).addClass(newclass);
			} else {	
				$(this).addClass('menu-parenth');
			}
		});
		
		$('ul.menu li').bind("mouseleave",function() {
			if ($(this).hasClass('menu-parenth')) {
				$(this).removeClass('menu-parenth');
			} else {
				$(this).removeClass(newclass);
			}
		});
	}
	
});
