Preserving Referrer through a javascript redirect

On the landing page that might use a javscript redirect, place this bit of code:

<script type="text/javascript">var monitus=monitus||{};[[monitus store ID]];</script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">try{;}catch(e){}</script>
[[...actual redirect script...]]
<script type="text/javascript">try{;}catch(e){}</script>

Then, on the redirected page, we need to grab the referrer back before we use it. In this example, we use the out-of-the-box GA code on the redirected page:

<script type="text/javascript" src=""></script>
<script type="text/javascript">>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX-1']);
var overridenRef = jMUI.utilities.cookie_value("_mrrf", null);
if(overridenRef) _gaq.push(['_setReferrerOverride', overridenRef]);;
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('http:' == document.location.protocol ? 'http://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

Note: If the code is placed on a secure page (https), then the jMUI URL changes from "" to ""