\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{nccindex}
         [2005/12/24 v1.01 Multicolumn index for NCC class (NCC)]
%
% \changes{v1.00}{2005/03/24}{This version is uploaded to CTAN}
% \changes{v1.01}{2005/12/24}{Do package independent on ncc class}
%
% The package redefines index on the base of multicol
% package. Some index control commands are specified here.
%
\RequirePackage{topsection}
\RequirePackage{multicol}
\def\NCC@index#1{%
  \if@twocolumn \onecolumn \fi
  \topsection{#1}%
  \columnseprule\z@ \columnsep 2em
  \parindent\z@ \parskip\z@ \@plus .3\p@
  \NCC@index@
  \NCC@indexstart
}
\def\endNCC@index{\end{multicols}}
\renewenvironment{theindex}{\NCC@index\indexname}{\endNCC@index}
%
% \indexparameters{columns}{indexspace}{margin1}{margin2}{margin3}{style}
%
\newcommand*\indexparameters[6]{%
  \def\NCC@index@{#6\begin{multicols}{#1}%
    \def\indexspace{\par\addvspace{#2}}%
    \def\@idxitem{\par\hangindent #5\relax}%
    \def\item{\@idxitem\pagebreak[0]\leavevmode\nopagebreak\ignorespaces}%
    \def\subitem{\@idxitem \hspace*{#3}}%
    \def\subsubitem{\@idxitem \hspace*{#4}}%
  }%
}
\indexparameters{2}{4ex \@plus 1ex \@minus .5ex}{2em}{4em}{5em}{\small}
%
% \startindexwith{text}
%
\newcommand\startindexwith{\long\def\NCC@indexstart}
\startindexwith{}
\endinput
