here is a sample script posted at kforg... maybe you can use it:

http://www.kixforms.org/forum/viewtopic.php?t=1505
_________________________