    $(document).ready(function(){
        // Superfish menuhover
        $("#nav-bar")
        .superfish({
	        animation : { opacity:"show",height:"show"},
	        speed     : "fast",
	        delay		: 300
        })
        .find(">li:has(ul)") /* .find(">li[ul]") in jQuery less than v1.2 */
	        .mouseover(function(){
		        $("ul", this).bgIframe({opacity:false});
	        })
	        .find("a")
		        .focus(function(){
			        $("ul", $("#nav-bar>li:has(ul)")).bgIframe({opacity:false});
			        /* $("ul", $(".nav>li[ul]")).bgIframe({opacity:false});
			           in jQuery less than v1.2*/
		        });
        
        
        // Add class 'currentURL' to the active menu link
        $.each($("#nav-bar > li"), function() {
            var found = false;
            var qs = document.location.href.indexOf('?');
            
            if(qs >= 1) {
                var length = qs;
            } else {
                var length = document.location.href.length;
            }
            
            url = document.location.href.substring(0, length);
            for(var i = 0; i <= $("a", this).length-1; ++i) {
                if($("a", this)[i].href == url) {
                    found = true;
                }
            }
            if(found) {
                $("a:first", this).addClass("currentUrl");
            }
        });
        
        //Add class 'top' to the 2nd dropdown list item
        $("li:first", "#nav-bar li ul li ul").addClass("top");
        
        //Add class 'bottom' to the last dropdown list item
        $("li:last", "#nav-bar li ul").addClass("bottom");
        

        // Sets the search box value to "" when search box has focus
        $("#search_query").focus(
            function() {
                if(this.value=="Search") {
                    this.value = "";
                }
            }
        );
    });
