function idText=linkid(m,object,type)
%LINKID returns a DocBook link ID
%   ID=LINKID(ZSLMETHODS,OBJECTHANDLE);
%   ID=LINKID(ZSLMETHODS,OBJECTHANDLE,OBJECTTYPE);
%
%   ID is of the form 'link-SL-type-handle'
%
%   OBJECTHANDLE is the handle to a model, system, block, or signal
%   OBJECTTYPE is 'mdl','sys','blk',or 'sig' respectively

%   Copyright (c) 1997-2000 by The MathWorks, Inc.
%   $Revision: 1.4 $  $Date: 2000/03/23 19:38:22 $

if iscell(object)
   object=object{1};
end

if ischar(object)
   try
      object=get_param(object,'Handle');
   catch
      object=[];
   end
end

if nargin<3
   try
      type=get_param(object,'type');
   catch
      type='';
   end
end

switch type
case {'mdl' 'blk' 'sig' 'sys'}
   %do nothing 
case {'Model' 'block_diagram'}
   type='mdl';
case {'System' 'system'}
   type='sys';
case {'Signal' 'signal' 'port'}
   type='sig';
case {'Block' 'block'}
   type='blk';
otherwise
   type='';
end

idText=sprintf('link-SL-%s-%0.14f',type,object);