<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// //show add/edit controls - not sure we need this one either???
// $(document).on("click","#edit-facility",function(){
// 	$("div.error").hide();
// 	//window.location.replace("https://coremarketplace.org/?rridadd=1");
// 	window.location.replace("https://website.vgn.w3.uvm.edu/?rridadd=1");
// });

//change menu link colors
	$(".menu li a").hover(
		function() {
			$(this).css("color", "#88B183");
		}, function() {
			$(this).css("color", "#333");
	});

	 $(document).ready(function() { 
		 //controls menu in mobile layout
		$(".mobile-menu").click(function(){
			$(".fullscreen-menu").toggle();
		});
		
	
	});
	
//for sidebar on listings
	$(document).on("click",".sidebar-ctl-link",function() {
		var mySection = $(this).attr('id');
		
		$(".sidebar-ctl-link").removeClass("active");
		$(this).addClass("active");
		
		$(".edit-section").hide();
		$("." + mySection).show();
		
		if($(".fullscreen-menu").css("display")!=="none"){
			$(".fullscreen-menu").hide();
		}
		
	});


	


	
	//submit actions
	$("#SearchForm").submit(function() {
		$("#Search").hide();
		//$(".Search-Collapsed").show();
	});
	
	
//user menu
$(document).on("click","html",function(){
	if( $("div#usermenu").is(":visible") ){
		$("div#usermenu").slideUp(300);
	}	
});

$(document).on("click","span#menuicon",function(event){
	event.stopPropagation();
	$("div#usermenu").slideToggle(300);
	
});


$(document).on("click","span#menuitem p",function(){
	var item = $(this).attr("id");
	
	$("div#usermenu").slideToggle(300);
	
	$.ajax({
		url: "ajax/html.ajax.php",
		type: "POST",
		data: { MenuItem: item},
		success: function(data){
			window.location.href = data;
		},
		error: function(jqXHR, textStatus, errorThrown){
			//alert("error handler!");
			//response('');                        
		},
	  dataType: 'text'
	});	
});

$("span#menuitem p").hover(function(){
	$(this).css("background-color","#1c75bc");
	$(this).css("color","white");
	$(this).children().css("color","white");
},
function(){
	$(this).css("background-color","white");
	$(this).css("color","#1c75bc");
	$(this).children().css("color","#1c75bc");
});


	//not sure what this is but looks recent
	
	$('.sidebar-fac-select').on("change", function() {
		var url = $(this).val();
 		window.location.replace("?FacilityID="+url);
		
		if($(".fullscreen-menu").css("display")!=="none"){
			$(".fullscreen-menu").hide();
		}
	});
	
	

	
	$(document).on("submit", "form#SearchForm", function() {
		$("div.Search").hide();
		$("input#search-terms-box").blur();
		$("div.searchProgress").show();
	});
	
	
	/*
	$("#show-hide-map").click(function(){
		$(".CoreDetails #MappedResults").slideToggle("slow");
		$(this).hide();
		$("#hide-show-map").show();
	});
	
	$("#hide-show-map").click(function(){
		$(".CoreDetails #MappedResults").slideToggle("slow");
		$(this).hide();
		$("#show-hide-map").show();
	});*/
	
	$("input#submit-button").click(function(){
		$("form#editfacility").submit();
		
		if($(".fullscreen-menu").css("display")!=="none"){
			$(".fullscreen-menu").hide();
		}
	});
	

	//search field - tab controls
	$( function() {
		$( "#searchtabs" ).tabs({
		});
	  } );
	
	//for search field -- autocompleting equipment and services categories
	 $(document).ready(function() {  
		if($('#search-terms-box').length){
	 		
			$( function() {
			$.widget( "custom.catcomplete", $.ui.autocomplete, {
			  _create: function() {
				this._super();
				this.widget().menu( "option", "items", "&gt; :not(.ui-autocomplete-category)" );
			  },
			  _renderMenu: function( ul, items ) {
				var that = this,
				  currentCategory = "";
				$.each( items, function( index, item ) {
				  var li;
				  if ( item.category != currentCategory ) {
					ul.append( "&lt;li class='ui-autocomplete-category'&gt;" + item.category + "&lt;/li&gt;" );
					currentCategory = item.category;
				  }
				  li = that._renderItemData( ul, item );
				  if ( item.category ) {
					li.attr( "aria-label", item.category + " : " + item.label );
				  }
				});
			  }
			 
			});
	 
	 
		
			$('#search-terms-box').catcomplete({
			  source: function( request, response ) {
					$.ajax({
						url: "ajax/html.ajax.php",
						type: "POST",
						data: { SearchAutocomplete: request.term},
						success: function(data){
							response(data);
						},
						error: function(jqXHR, textStatus, errorThrown){
							//alert("error handler!");
							response('');                        
						},
					  dataType: 'json'
					});			
			 },
			 select: function(event,ui) {
			 	//alert(ui.item.category);
			 	$("#search-terms-category").val(ui.item.category);
			 }
			})
	
			/*.each(function(idx,ele){
				$(ele).data("ui-autocomplete")._renderItem = function( ul, item ) {
						let txt = String(item.label).replace(new RegExp(this.term, "gi"),"&lt;span class=autocomplete-highlight&gt;$&amp;&lt;/span&gt;");
						return $("&lt;li&gt;&lt;/li&gt;")
							.data("ui-autocomplete-item", item)
							.append("&lt;div&gt;" + txt + "&lt;/div&gt;")
							.appendTo(ul);
					}
				});*/
		
			});
		
		}
	});
	
	//for institute search field
	
	 if($('#search-institute-box').length){
		 $('#search-institute-box').autocomplete({
		  source: function( request, response ) {
				$.ajax({
					url: "ajax/edit.ajax.php",
					type: "POST",
					data: { InstituteAutoComplete: request.term},
					success: function(data){
						response(data);
					},
					error: function(jqXHR, textStatus, errorThrown, data){
						//alert("error handler!");
					},
				  dataType: 'json'
				});
		 },
		 
		 select: function(event, ui) {
			$("#search-institute-box").val(ui.item.label);
			$("#search-institution-name").val(ui.item.value);
			return false;
			}, 
			focus: function(event, ui){
				$("#search-institution-name").val(ui.item.label);
				return false;
			}
		 
		})
		
		.each(function(idx,ele){
		$(ele).data("ui-autocomplete")._renderItem = function( ul, item ) {
				let txt = String(item.label).replace(new RegExp(this.term, "gi"),"&lt;span class=autocomplete-highlight&gt;$&amp;&lt;/span&gt;");
				return $("&lt;li&gt;&lt;/li&gt;")
					.data("ui-autocomplete-item", item)
					.append("&lt;div&gt;" + txt + "&lt;/div&gt;")
					.appendTo(ul);
		}
		});
	
	}
	
	$(document).on("click", "div.oops", function (){
		$("body").append("&lt;div id='inst-dialog-message' title='What Is This?'&gt;&lt;p&gt;This header looking too slender? We could not contact ror.org and therefore supplied an alternate institution header.&lt;/p&gt;&lt;/div&gt;");
		$( function() {
			$( "#inst-dialog-message" ).dialog({
		  	modal: true,
		  	classes: {"ui-dialog": "cm-header"},
		  	buttons: {
				Ok: function() {
			  	$( this ).dialog( "close" );
				}
		  	}
			});
		});
	});
	
	$( function() {
		$( "#accordion" ).accordion({
		heightStyle: "content",
		collapsible: true,
		active: false
		// icons: { "header": "ui-icon-plus", "activeHeader": "ui-icon-minus" }
		});
	} );
	
	//institute search results - tabs
	$( function() {
		$( "div#inst-subhead-tabs" ).tabs({
			active:0
		});
		} );
		

</pre></body></html>