/*********************
//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
//* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/

//Update: April 12th, 10: Fixed compat issue with jquery 1.4x

//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):
var arrowimages={down:['downarrowclass', '_images/menu-arrow-down.gif', 32], right:['rightarrowclass', '_images/menu-arrow.gif', 0]}

var jqueryslidemenu={

animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
   jQuery(document).ready(function($){
      var $mainmenu=jQuery("#"+menuid);
      var $headers=$mainmenu.find("li");
		
      $headers.each(function(i){

			var $curobj=jQuery(this);
			
			this.istopheader=$curobj.children("div").length > 0 ? true : false;

			if(this.istopheader) {
	      	
				$curobj.hover(
	            function(e){
	               //var $targetdiv=jQuery(this).children("div:eq(0)");
						jQuery(this).addClass('open');
	            },
	            function(e){
	               jQuery(this).removeClass('open');
	            }
	         ) //end hover
				
				if(arrowsvar.down[2] > 0) {
					$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
		            '<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
		            +'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
		            + '" style="border:0;" />'
		         );
				}
         }
						
		}) //end $headers.each()
   }) //end document.ready
}
}
