Event.observe(document,"dom:loaded",function(){

	$$("#mainnav .submenu").each(function(element){
		var menuDimensions = element.getDimensions();
		var width = menuDimensions.width+15;
		var height = menuDimensions.height+15;
		
		element.select("div.dropdownbackground, li.item").invoke("hide");
		
		element.observe("mouseover",function(e){
			element.select("div.dropdownbackground, li.item").invoke("show");
		});
		element.observe("mouseout",function(e){
			element.select("div.dropdownbackground, li.item").invoke("hide");
		});
		
		var backdropDiv = element.select("div.dropdownbackground")[0];
		if ( backdropDiv ) {
			backdropDiv.setStyle({
				width: Math.floor(width)+"px",
				height: Math.floor(height)+"px"
			});
			if ( Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6 ) {
				backdropDiv.setStyle({
						filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.txstate.edu/imagehandler/roundedtransparentbox/menubackground.png?width="+width+"&height="+height+"&color="+escape(wittliffPageBackgroundColor)+"', sizingMethod='crop')"
				});
				backdropDiv.alphaloaded = true;
			} else {
				backdropDiv.setStyle({
					backgroundImage: "url(http://www.txstate.edu/imagehandler/roundedtransparentbox/menubackground.png?width="+width+"&height="+height+"&color="+escape(wittliffPageBackgroundColor)+")"
				});
			}
		}
	});
	
	
	// Remove sample text when user clicks in search field
	var originalSearchFieldText = $F("q");
	Event.observe( "q", "focus", function() {
		if ( $F("q") == originalSearchFieldText ) $('q').value = "";
	});
	
	$$(".txst-photogallery-image > a > img").invoke('show');
	
});


