function ExpandedCookie( name, value ) {
    /* ------------------------------------------------------------ */
    /* Private variables                                            */
    /* ------------------------------------------------------------ */
    var ec_name = "";       //the cookie's name (string)
    var ec_value = "";      //the cookie's value (string)
    var ec_expiration = ""; //the cookie's expiration date (GMT string)
    var ec_domain = "";     //the cookie's domain (string)
    var ec_path = "";       //the cookie's path (string)

    /* ------------------------------------------------------------ */
    /* Constructor                                                  */
    /* ------------------------------------------------------------ */
    var dom;

    setName( name );
    setValue( value );
    setExpirationDays( 7 );
    setPath( "/" );

    dom = document.location.href;
    dom = dom.substring( dom.indexOf( "://" ) + 3, dom.indexOf( "/", dom.indexOf( "://" ) + 4 ) );
    setDomain( dom );

    /* ------------------------------------------------------------ */
    /* Private Methods                                              */
    /* ------------------------------------------------------------ */
    function getName() {
        return ec_name;
    }

    function getValue() {
        return ec_value;
    }

    function getExpiration() {
        return ec_expiration;
    }

    function getDomain() {
        return ec_domain;
    }

    function getPath() {
        return ec_path;
    }

    function setName( name ) {
        ec_name = name;
        updateCookie();
    }

    function setValue( val ) {
        ec_value = val;
        updateCookie();
    }

    function setExpiration( exp ) {
        ec_expiration = exp;
        updateCookie();
    }

    function setExpirationDays( days ) {
        var d = new Date();

        d.setTime( d.getTime() + ( days * 24 * 60 * 60 * 1000 ) );
        setExpiration( d.toGMTString() );
    }

    function setDomain( dom ) {
        ec_domain = dom;
        updateCookie();
    }

    function setPath( p ) {
        ec_path = p;
        updateCookie();
    }

    function updateCookie() {
        if( getName() != "" && getValue() != "" && getExpiration() != "" && getPath() != "" ) {
            var contents = getName() + "=" + getValue() + "; expires=" + getExpiration() + "; path=";

            if( getDomain() != "" ) {
                contents += getDomain();
            }

            contents += getPath();

            document.cookie = contents;
        }
    }

    function remove() {
        setExpirationDays( -1 );
    }

    /* ------------------------------------------------------------ */
    /* Public Methods                                               */
    /* ------------------------------------------------------------ */
    this.getName = getName;
    this.getValue = getValue;
    this.getExpiration = getExpiration;
    this.getDomain = getDomain;
    this.getPath = getPath;

    this.setName = setName;
    this.setValue = setValue;
    this.setExpiration = setExpiration;
    this.setExpirationDays = setExpirationDays;
    this.setDomain = setDomain;
    this.setPath = setPath;

    this.remove = remove;
}