indexOf and Date.now don't exist in IE8 - added some backward compatibility so IE8 works too.