anchor.diff:  	var/title
   	var/category = "Any"
   	var/author
  -	var/SQLquery
  +	var/search_page = 0
   
   /obj/machinery/computer/libraryconsole/ui_interact(mob/user)
   	. = ..()
  -	var/dat = "" // <META HTTP-EQUIV='Refresh' CONTENT='10'>
  +	var/list/dat = list() // <META HTTP-EQUIV='Refresh' CONTENT='10'>
   	switch(screenstate)
   		if(0)
   			dat += "<h2>Search Settings</h2><br>"
  
positive.code: 			title = sanitize(newtitle)
  		else
  			title = null
  		title = sanitizeSQL(title)
  	if(href_list["setcategory"])
  		var/newcategory = input("Choose a category to search for:") in list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
  		if(newcategory)
  			category = sanitize(newcategory)
  		else
  			category = "Any"
  		category = sanitizeSQL(category)
  	if(href_list["setauthor"])
  		var/newauthor = input("Enter an author to search for:") as text|null
  		if(newauthor)
  			author = sanitize(newauthor)
  		else
  			author = null
  		author = sanitizeSQL(author)
  	if(href_list["search"])
  		SQLquery = "SELECT author, title, category, id FROM [format_table_name("library")] WHERE isnull(deleted) AND "
  		if(category == "Any")
  			SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%'"
  		else
  			SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%' AND category='[category]'"
  		screenstate = 1
  
  	if(href_list["back"])
  		screenstate = 0
  
negative.code: 				dat += "</table><BR>"
  			dat += "<A href='?src=[REF(src)];back=1'>\[Go Back\]</A><BR>"
  	var/datum/browser/popup = new(user, "publiclibrary", name, 600, 400)
  	popup.set_content(jointext(dat, ""))
  	popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
  	popup.open()
  
  