Another options is to use the search method as follow:
if (referrer.search(new RegExp("Ral", "i")) == -1) { ...
It looks more elegant then converting the whole string to lower case and it may be more efficient.
With toLowerCase()
the code have two pass over the string, one pass is on the entire string to convert it to lower case and another is to look for the desired index.
With RegExp
the code have one pass over the string which it looks to match the desired index.
Therefore, on long strings I recommend to use the RegExp
version (I guess that on short strings this efficiency comes on the account of creating the RegExp
object though)