{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 /**\par
 * Cookie plugin\par
 *\par
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)\par
 * Dual licensed under the MIT and GPL licenses:\par
 * http://www.opensource.org/licenses/mit-license.php\par
 * http://www.gnu.org/licenses/gpl.html\par
 *\par
 */\par
\par
/**\par
 * Create a cookie with the given name and value and other optional parameters.\par
 *\par
 * @example $.cookie('the_cookie', 'the_value');\par
 * @desc Set the value of a cookie.\par
 * @example $.cookie('the_cookie', 'the_value', \{ expires: 7, path: '/', domain: 'jquery.com', secure: true \});\par
 * @desc Create a cookie with all available options.\par
 * @example $.cookie('the_cookie', 'the_value');\par
 * @desc Create a session cookie.\par
 * @example $.cookie('the_cookie', null);\par
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain\par
 *       used when the cookie was set.\par
 *\par
 * @param String name The name of the cookie.\par
 * @param String value The value of the cookie.\par
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.\par
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.\par
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.\par
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained\par
 *                             when the the browser exits.\par
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).\par
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).\par
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will\par
 *                        require a secure protocol (like HTTPS).\par
 * @type undefined\par
 *\par
 * @name $.cookie\par
 * @cat Plugins/Cookie\par
 * @author Klaus Hartl/klaus.hartl@stilbuero.de\par
 */\par
\par
/**\par
 * Get the value of a cookie with the given name.\par
 *\par
 * @example $.cookie('the_cookie');\par
 * @desc Get the value of a cookie.\par
 *\par
 * @param String name The name of the cookie.\par
 * @return The value of the cookie.\par
 * @type String\par
 *\par
 * @name $.cookie\par
 * @cat Plugins/Cookie\par
 * @author Klaus Hartl/klaus.hartl@stilbuero.de\par
 */\par
jQuery.cookie = function(name, value, options) \{\par
    if (typeof value != 'undefined') \{ // name and value given, set cookie\par
        options = options || \{\};\par
        if (value === null) \{\par
            value = '';\par
            options.expires = -1;\par
        \}\par
        var expires = '';\par
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) \{\par
            var date;\par
            if (typeof options.expires == 'number') \{\par
                date = new Date();\par
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));\par
            \} else \{\par
                date = options.expires;\par
            \}\par
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE\par
        \}\par
        // CAUTION: Needed to parenthesize options.path and options.domain\par
        // in the following expressions, otherwise they evaluate to undefined\par
        // in the packed version for some reason...\par
        var path = options.path ? '; path=' + (options.path) : '';\par
        var domain = options.domain ? '; domain=' + (options.domain) : '';\par
        var secure = options.secure ? '; secure' : '';\par
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');\par
    \} else \{ // only name given, get cookie\par
        var cookieValue = null;\par
        if (document.cookie && document.cookie != '') \{\par
            var cookies = document.cookie.split(';');\par
            for (var i = 0; i < cookies.length; i++) \{\par
                var cookie = jQuery.trim(cookies[i]);\par
                // Does this cookie string begin with the name we want?\par
                if (cookie.substring(0, name.length + 1) == (name + '=')) \{\par
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\par
                    break;\par
                \}\par
            \}\par
        \}\par
        return cookieValue;\par
    \}\par
\};\par
}
 