function initSearch(){
    $("#line3h").val("Search");
    $("#line3f").val("Search");
    
    $("#line3h").focus(function(){
        $(this).val("");
    });
    $("#line3h").blur(function(){
        if($(this).val() == ""){
            $(this).val("Search");
        }
    });
    $("#line3f").focus(function(){
        $(this).val("");
    });
    $("#line3f").blur(function(){
        if($(this).val() == ""){
            $(this).val("Search");
        }
    });
}
function initMenu(elem) {
    $("ul.topnav.no_script").removeClass("no_script");
	if ($("div.subnav").parent().html().indexOf("<span></span>") == -1)
	{
		$("div.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after div.subnav*)
	}
	
    //  open subnav
    $("ul.topnav li.item span").click(function() { //When trigger is clicked...
        if(!$(this).hasClass("active")) {
            //  if a subnav is open, close it
            $("ul.topnav li.item.active").find("div.subnav.active").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
            $("ul.topnav").find("li.item span.active").removeClass("active");
            $("ul.topnav").find("li.item.active").removeClass("active");

            //show activated drop down trigger and highlight activated menu item
            $(this).parent().addClass("active");
            $(this).addClass("active");
            
            //Following events are applied to the subnav itself (moving subnav up and down)
            
            //  show subnav
            $(this).parent().find("div.subnav").slideDown('fast').show(); //Drop down the subnav on click
            $(this).parent().find("div.subnav").addClass("active");

            //use this to make subnav close on hover out
            //$(this).parent().hover(function() {
              //  }, function(){
                //$(this).parent().find("div.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
                //$(this).parent().find("li.item span").removeClass("active");
               // $(this).removeClass("active");
            //});
			
			$(this).parent().find("div.subnav").css("z-index", 10000);

            //use this to make the subnav close when outside of the subnav is clicked
            $('html').click(function() {
                $(this).find("div.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
                $(this).find("li.item span.active").removeClass("active");
                $(this).find("li.item.active").removeClass("active");
            });
            $(this).parent().click(function(event) {
             event.stopPropagation();
            });
        }else{  // this menu item is active, close this menu item's subnav
            $("ul.topnav li.item.active").find("div.subnav.active").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
            $("ul.topnav").find("li.item span.active").removeClass("active");
            $("ul.topnav").find("li.item.active").removeClass("active");
        }
        
    //Following events are applied to the trigger (Hover events for the trigger)
    }).hover(function() {
            $(this).addClass("subhover"); //On hover over, add class "subhover"
        }, function() {	//On Hover Out
            $(this).removeClass("subhover"); //On hover out, remove class "subhover"
    });
}

