function o_function( $id, $action, $options = '' )
    {
        if ( $action != 'new' )
        {
            $o =& $this->objects[$id];
        }

        switch ( $action )
        {
            case 'new':
            {
                $this->objects[$id] = array ( 't' => 'function',
                                              'info' => array() );

                if ( isset( $options['type'] ) ) // Set function type
                {
                    $this->objects[$id]['info']['type'] = $options['type'];
                }
                else
                {
                    $this->objects[$id]['info']['type'] = '2';
                }

                if ( isset( $options['Domain'] ) ) // Set function Domain
                {
                    $this->objects[$id]['info']['Domain'] = $options['Domain'];
                }
                else
                {
                    $this->objects[$id]['info']['Domain'] = '[0.0 1.0]';
                }

                if ( $this->objects[$id]['info']['type'] == '2' ) // set start and en values
                {
                    if ( isset( $options['C0'] ) ) // Set values0
                    {
                        $this->objects[$id]['info']['C0'] = $options['C0'];
                    }

                    if ( isset( $options['C1'] ) ) // Set values1
                    {
                        $this->objects[$id]['info']['C1'] = $options['C1'];
                    }

                    if ( isset( $options['N'] ) ) // set exponent
                    {
                        $this->objects[$id]['info']['N'] = $options['N'];
                    }
                    else
                    {
                        $this->objects[$id]['info']['N'] = '1.0';
                    }
                }

            } break;

            case 'out':
            {
                $res = "\n" . $id . " 0 obj\n<< ";
                $res.= "/FunctionType " . $o['info']['type'] . "\n";
                $res.= "/Domain " . $o['info']['Domain'] . "\n";
                if ( isset ( $o['info']['C0'] ) )
                    $res.= "/C0 " . $o['info']['C0'] . "\n";
                if ( isset ( $o['info']['C1'] ) )
                    $res.= "/C1 " . $o['info']['C1'] . "\n";
                $res.= "/N " . $o['info']['N'] . "\n";
                $res.= ">>\nendobject";
                return $res;
            } break;
        }
    }