% print script to send ps image to www site
%
% function pps(filn,ornt)
%
% filn = file name
% ornt = orientation string variable (optional)
%
function pps(filn,ornt)

if nargin>1;
  eval(['orient ',ornt]);
end;

direc=questdlg('Where do you want it?',...

          'model',...
          'specify',...
          'rtda  ',...

          'extr');

       

cp=computer;

       
if cp(1:3)=='SGI';
  if direc(1:5)=='rtda ';
    direc='/home3/ocn/jmanning/public_html/rtda/';
  elseif direc(1:5)=='model';
    direc='/home3/ocn/jmanning/public_html/model/';
  elseif direc(1:5)=='speci';
    direc=input('Enter directory below public_html: ','s');
    direc=['/home3/ocn/jmanning/public_html/',direc,'/'];
   end;

elseif cp(1:3)=='PCW';

  if direc(1:5)=='rtda ';
    direc='e:\public_html\rtda\';
  elseif direc(1:5)=='model';
    direc='e:\public_html\model\';
  elseif direc(1:5)=='speci';
    direc=input('Enter directory below public_html: ','s');
    direc=['e:\public_html\',direc,'\'];
   end;

end;

% if name ends in "bw" then make it black & white
if filn(length(filn)-1:length(filn))=='BW';
  dev='';
else;
  dev='c';
end;

pr=menu('print?','b&w','color','neither');

eval(['print -dps',dev,' ',direc,filn]);
disp(['plot file made in ',direc,filn,'.ps'])
if cp(1:3)=='SGI';
    % also make a gif file
    eval(['print -dgif8 ',direc,filn]);
    disp(['plot file also made in ',direc,filn,'.gif'])

end;

if pr<3;
  if dev=='c';
    if pr==1;
      prnt='-h ';
    else;
      prnt='-Pfoi_hp2c ';
    end;
  else;
    prnt='-h ';
  end;
  % now send file to printer

  if cp(1:3)=='SGI';
    eval(['!lpr ',prnt,direc,filn,'.ps']);
 else;

     print -dpsc

     % also make a tif file
     eval(['print -dtiff ',direc,filn]);
     disp(['plot file also made in ',direc,filn,'.tif'])

  end;   


end;


