/*********************
//* 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={
	grey_active:['/s/toolbar2/grey_arrow_active.gif'],
	grey_deactive:['/s/toolbar2/grey_arrow_deactive.gif'],
	active:['/s/toolbar2/tab_arrow_active.gif'],
	deactive:['/s/toolbar2/tab_arrow_deactive.gif']
	}

var jquerycssmenu={

fadesettings: {overduration: 10, outduration: 10}, //duration of fade in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
	jQuery(document).ready(function($){
		var $mainmenu=$("#"+menuid+">ul")
		var $headers=$mainmenu.find("ul").parent()
		$headers.each(function(i){
			var $curobj=$(this)
			var $subul=$(this).find('ul:eq(0)')
			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
			$subul.css({top: this._dimensions.h+"px" })
			
			$curobj.hover(
				function(e){
					var $targetul=$curobj.children("ul:eq(0)")					
					var $thearrow=$(this).find("img:eq(0)") // the arrow image
                    var $theli=$(this) // $thelink should $theli to be more accurate description
                    this._offsets={left:$(this).offset().left, top:$(this).offset().top}
                    var menuleft=this.istopheader? 0 : this._dimensions.w
                    menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
                    if ($thearrow.parent().attr("class") == 'downarrowmenutab'){
                    	$thearrow.attr({ src: arrowsvar.grey_active[0]})
                    }else{
                    	$thearrow.attr({ src: arrowsvar.active[0]})
                    }
					if ($targetul.queue().length<=1) //if 1 or less queued animations
                        $thearrow.click(function(){
                            var $theli = $(this).parent().parent()
                            var $targetul=$theli.children("ul:eq(0)")
                            $targetul.css({left:"-10px",top:"25px",opacity:"0.90",padding:"2px 0px 2px 0px"}).fadeIn(jquerycssmenu.fadesettings.overduration)                                                        
                        })                    
					
				},
				function(e){
					var $thearrow=$(this).find("img:eq(0)")
					$(this).children("ul:eq(0)").fadeOut(jquerycssmenu.fadesettings.outduration)
                    if ($thearrow.parent().attr("class") == 'downarrowmenutab'){
                    	$thearrow.attr({ src: arrowsvar.grey_deactive[0]})
                    }else{
                    	$thearrow.attr({ src: arrowsvar.deactive[0]})
                    }
				}
			) //end hover

			
		}) //end $headers.each()
		$mainmenu.find("ul").css({display:'none', visibility:'visible'})		
		
	}) //end document.ready
}
}

//build menu with ID="myjquerymenu" on page:
jquerycssmenu.buildmenu("myjquerymenu", arrowimages);

jQuery(document).ready(function(){
	jQuery('#coach').slideDown("normal")
	jQuery('#payforsite2').slideDown("normal");	
});