Replace links on page based on location.host and a cookie
<p>I'm using jquery to rewrite a list of links on the page. If the location.host is NOT the vendor location.host AND the cookie isn't set to a specific value then it locates the links and rewrites them to the alternate values. The code I'm using works great in FF but not in IE7. Please help!</p>

<pre><code>&lt;script type="text/javascript"&gt; 
    // link hider       
    var hostadd = location.host;
    var vendor = '172.29.132.34';
    var localaccess = 'internal.na.internal.com';
    var unlock = 'http://internal.na.internal.com/Learning/Customer_Care/navigation/newhire.html';



    // link rewriter                            
    $(document).ready (
        function style_switcher(){ 
            //if not a vendor or not accessing from lms reroute user to lms
            if (hostadd != vendor &amp;&amp; $.cookie("unlockCookie") != unlock){
                var linkData = {
                "https://www.somesite.com":             "https://internalsite.com/something",'../Compliance/something/index.html':'../somethingelse.html'

            };
            $("a").each(function() {
                 var link = this.getAttribute("href");  // use getAttribute to get what was actualy in the page, perhaps not fully qualified
                if (linkData[link]) {
                this.href = linkData[link];
            }
            });
        }
    });     
&lt;/script&gt;
</code></pre>
