#! /bin/csh -f
#Tag 0x1037
#
#	systemtour -  Startup script the Indigo Magic system tour.
#
#
#
rm -rf /tmp/.end*  >& /dev/null
if(! $?DISPLAY) then
	setenv DISPLAY :0
endif
apanel -nodisplay -outlevels 100 -outrate 16000 >& /dev/null
#
if (-x /usr/sbin/showcase) then
	setenv TOURDIR /usr/lib/tour
	setenv TOURBIN $TOURDIR/bin
	setenv PATH ${TOURBIN}:$PATH
	cd $TOURDIR
	audiocheck 
	rehash
#
	xrset -get -current > /tmp/.end_junk
	awk '{if (1 == NR) {print $2}}' < /tmp/.end_junk > /tmp/.end_junk2
	set start_room = `sed -e 's/\"//g' < /tmp/.end_junk2`
	rm -rf /tmp/.end_junk /tmp/.end_junk2 >& /dev/null
	set room = Tour
	xrset -switch -create $room
	cd pages
#
	showcase -fbnv mainmenu.sc31  &
	echo kill $child > /tmp/.endtour 
	echo xrset -switch $start_room >> /tmp/.endtour 
	echo rm -rf /tmp/.end\* >> /tmp/.endtour
	chmod 755 /tmp/.endtour
	PlayHigh $TOURDIR/sounds/intromusic.aifc  >& /dev/null
	start.sound main-0.aifc
else
	xconfirm -header "Sorry..." -b OK \
	-t  "You must have Showcase installed to run the Tour" > /dev/null
endif

