Jquery Plugin not available inside a function?
<p>I am trying to load longitude and latitude data into cookies using the following code:</p>

<pre><code>$.cookie('test', 'test');
var test = true;

function PageLoaded() {
    if (test) {
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(success_handler, error_handler, {
                enableHighAccuracy: true
            });
            test = false;
        }
    }
}

function success_handler(position) {
    latitude = position.coords.latitude;
    longitude = position.coords.longitude;
    accuracy = position.coords.accuracy;
    document.getElementById("tbLat").value = latitude;
    document.getElementById("tbLon").value = longitude;
    $.cookie('Latitude', latitude);
    $.cookie('Longitude', longitude);

}

function error_handler() {
    document.write('This browser does not support location awareness or you have declined to allow it to view your location.');
}
</code></pre>

<p>I am loading the JQuery.Cookie.js plugin. 
The first cookie "test" loads properly but the second two "Latitude &amp; Longitude" throw an error that </p>

<blockquote>
  <p>Object doesn't support property or method 'cookie'</p>
</blockquote>

<p>Why is this?</p>
