1) document.location should be changed to document.location.href. Actually both variants now working(thanks to browsers) but first one is incorrect as we actually changing the adress but assigning to the whole location js object.
2) remove view parameters. Them not used so could confuse. Sometimes them firing conversion errors(causes unnesessary processing invocations).