Ripped first version from the HideNSeek plugin.