jQuery(document).ready(function($){
	/*search box interaction*/
	// set to the default text for the search box
	var searchval="Search WVU ...";
	// select #search2 element, set value, set focus and blur behaviors
	$("#search2")
		.val(searchval)
		.focus(function(){if($(this).val()==searchval){$(this).val("")}})
		.blur(function(){if($(this).val()==""){$(this).val(searchval)}})

	//flyout nav menu
	/* ADJUST FOR EACH SITE:
	 *   - set navwidth to desired subnav widths,
	 *     or leave it to the default of #nav width
	 *   - adjust line 34 css background url for mouseover bg */
	var navwidth=$("#nav").css("width");
	$("#nav ul li ul li").each(function(){
		/** iterate through sub nav ul's by
		identifying subnav li's. set properties of
		selected parent ul's then top level li's */
		$(this).parent("ul")
			.css("margin-left",navwidth)
			.css("width",navwidth)
		.parent('li')
			.addClass("arrow")
			.bind("mouseover",function(){
				$(this).children("ul").css("display","block").css("visibility","visible");
			})
			.bind("mouseout",function(){
				$(this).children("ul").css("display","none").css("visibility","visible");
			})
			.children("a")
				.bind("mouseover",function(){
					$(this).css("background","url('http://ext.wvu.edu/themes/wvu_extension/images/arrow-over.gif') no-repeat right center #fff");
				})
				.bind("mouseout",function(){
					$(this).css("background","transparent");
				});
	});
});
