Revision 3 (by ahitrov@rambler.ru, 2010/03/24 15:19:32) The CORE
<%DOC>

	���������� �������� ������ � ���������� ��� � ����������.

</%DOC>
<%ARGS>

	$doc

</%ARGS>
<%INIT>

	return  unless ref($doc);

	my @properties = $doc->structure();
	my $images = {};
        for (0..$#properties)
	{
		my $prop = $properties[$_];
		my $name = $prop->{attr};
		if ($prop->{type} eq 'image')
		{
			my $IMAGE = undef;
			if (length($doc->{ $name }) > 8)
			{
				$IMAGE = eval ('use vars qw($VAR1); '.$doc->{ $name });
				if (ref($IMAGE) ne 'HASH') {  $IMAGE = {} };
			}
			$images->{$name} = $IMAGE;
		}
		elsif ( $prop->{type} =~ /^images/ )
		{
			my $IMAGES = {};
			if (length($doc->{ $name }) > 10)
			{
				$IMAGES = eval ('use vars qw($VAR1); '.$doc->{ $prop->{attr} });
				if (ref($IMAGES) ne 'HASH')
				{
					$IMAGES = {};
					$IMAGES->{maxnumber} = 0;
				};
			}
			foreach my $li (keys(%{ $IMAGES }))
			{
				if ($li =~ /^image_(\d+)/)
				{
					$images->{$name.'_'.$1} = $IMAGES->{$li};
				}
			}
		}
	}
        return $images;

</%INIT>