#!/bin/csh -f

set path0 = $0
set path1 = $path0:h
set path2 = $path1:h
set path3 = $path2:h
set cgidir0 = $path3:t

#echo $* >> /tmp/imagemap.log
#echo $path1 >> /tmp/imagemap.log
#echo $path2 >> /tmp/imagemap.log
#echo $path3 >> /tmp/imagemap.log
#echo $cgidir0 >> /tmp/imagemap.log

if ( $cgidir0 == "cgi-bin" ) then
	setenv SCRIPT_NAME $path3/htimage
	chdir $path3
	exec $path3/htimage $*
else 
	echo "context-type: text/plain"
	echo ""
	echo "Can not locate htimage binary"
endif
