<P>One of the nicer effects available on web pages is to be able to click on an embedded image and be redirected to a different web page depending on where you click. This is achieved with a process called <I>Imagemapping</I>.</P>
<P>To use imagemapping the creator of a web page includes an image reference similar to the following in their document:</P>
<P><PRE>
<A HREF="/cgi-bin/imagemap/example">
<IMG SRC="images/netplex" ISMAP>
</A>
</PRE></P>
<P>You would initially expect that this would simply provide a link to an object called '/cgi-bin/imagemap/example'. However, note the ISMAP directive, this tells the web browser that the specified image is an imagemap and when the user clicks on it, it should append the x and y coordinates of the <I>click-point</I> as a query string to the URL and then perform a GET request on the specified object. So when the user clicks on the image, the browser requests a URL similar to this :</P>
<P>As /cgi-bin/imagemap is a CGI program, when the client requests the above URL it will dynamically produce a response to the client, causing it to jump to a particular page depending on where the click-point was.</P>
<P>You may have noticed that the example URL is somewhat unusual, it points to a valid file '/cgi-bin/imagemap' but then has '/example' after it. What it is actually doing is passing the string 'example' (no leading slash) as a parameter to the imagemap program. This parameter specifies the <I>name</I> of the map that the server should look in to determine which page to jump to.</P>
<A NAME="setup"><H2>Setting Up Imagemaps</H2></A>
<P>Netplex implements imagemapping as a small CGI program (cgi-bin.imagemap) which will be invoked when someone clicks on an image after being set up as that outlined above. The imagemap program reads the name passed to it, finds the associated map file, sees which URL the click-point refers to and then sends the client a relocate message so that it will automatically jump to the correct page.</P>
<A NAME="cfg-imagemaps"></A>
<P>Before using any imagemaps you must create a <A HREF="10-confi">Configuration file</A> which details the mapping between the name passed (e.g. 'example') and the actual filename of the map. This Configuration file must be placed in the root web page directory and called 'Imagemaps'. An example of this is :</P>
<P><PRE>
# Example Imagemap Configuration file
#
# The format is <name of map>:<filename of map>
#
Imagemaps
example:<Netplex$WebPagesDir>.imagemap.example
</PRE></P>
<P>So when the client asks for '/cgi-bin/imagemap/example', the name 'example' is looked up in this file and the imagemap program then uses the file <Netplex$WebPagesDir>.imagemap.example as the map.</P>
<P>The next file you must make is the map itself. This is the actual file which details which parts of the image link to which URLs. It takes the following form :</P>
<P><PRE>
# Image Map produced by Gerph's Imagen 1.44 (18 Oct 1996)
#
default http://localhost/imagemap/default
circle http://localhost/imagemap/world 35,37 57,64
circle http://localhost/imagemap/world 297,83 319,110
<P>Map files define, in terms of <I>circle</I>s, <I>rect</I>angles and <I>poly</I>gons, which areas in the image lead to other URLs. Although you can create them by hand it's a better bet to get a copy of <A HREF="http://users.essex.ac.uk/users/jrflet/">Justin Fletcher's</A> excellent <I>Imagen</I> map editor which allows you to interactively create and edit map files. Note that Netplex uses NCSA format map files (as opposed to CERN format maps). The Netplex imagemapper will also accept URLs in relative-to-root form, e.g. '/imagemap/world'.</P>
<A NAME="example"><H2>Example</H2></A>
<P>You can try out the imagemapping support for yourself by copying the example Configuration file called 'Imagemaps' from the !Netplex.!Help.HTML.imagemap directory into the root web page directory. After you have done this, clicking on different parts of the picture below will yeild an appropriate response from the imagemapper.</P>