Fixed bug with search_cgi noreask
Moved copy-and-pasted parts to an external file