Search toilet

Fixed several bugs and beautified the js file.