aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin/adjutant/functions.php161
-rw-r--r--admin/adjutant/index.php58
-rw-r--r--admin/adjutant/style.css13
-rw-r--r--admin/admin_functions.php169
-rw-r--r--admin/admins/functions.php329
-rw-r--r--admin/admins/index.php54
-rw-r--r--admin/announcements/functions.php67
-rw-r--r--admin/announcements/index.php34
-rw-r--r--admin/blocks/functions.php198
-rw-r--r--admin/blocks/index.php60
-rw-r--r--admin/calendar/functions.php446
-rw-r--r--admin/calendar/index.php90
-rw-r--r--admin/functions.php563
-rw-r--r--admin/header.php81
-rw-r--r--admin/images/accepted.pngbin0 -> 5251 bytes
-rw-r--r--admin/images/add.gifbin0 -> 59 bytes
-rw-r--r--admin/images/add.pngbin0 -> 3302 bytes
-rw-r--r--admin/images/addnewarticle.pngbin0 -> 6420 bytes
-rw-r--r--admin/images/addnewpage.pngbin0 -> 7511 bytes
-rw-r--r--admin/images/adjutant.pngbin0 -> 6496 bytes
-rw-r--r--admin/images/announcement.pngbin0 -> 2361 bytes
-rw-r--r--admin/images/bayonet_logo.jpgbin0 -> 38851 bytes
-rw-r--r--admin/images/blocks.pngbin0 -> 2534 bytes
-rw-r--r--admin/images/box.pngbin0 -> 5299 bytes
-rw-r--r--admin/images/box_download.pngbin0 -> 5888 bytes
-rw-r--r--admin/images/box_upload.pngbin0 -> 5895 bytes
-rw-r--r--admin/images/calendar.pngbin0 -> 4825 bytes
-rw-r--r--admin/images/cancel.pngbin0 -> 3327 bytes
-rw-r--r--admin/images/cmsadminlogo.pngbin0 -> 8718 bytes
-rw-r--r--admin/images/cmsadminlogo2.pngbin0 -> 11469 bytes
-rw-r--r--admin/images/delete.gifbin0 -> 60 bytes
-rw-r--r--admin/images/editfiles.pngbin0 -> 7336 bytes
-rw-r--r--admin/images/editpage.pngbin0 -> 5125 bytes
-rw-r--r--admin/images/file_doc.pngbin0 -> 6993 bytes
-rw-r--r--admin/images/file_pdf.pngbin0 -> 7336 bytes
-rw-r--r--admin/images/file_rtf.pngbin0 -> 6958 bytes
-rw-r--r--admin/images/file_word.pngbin0 -> 9196 bytes
-rw-r--r--admin/images/image.pngbin0 -> 4733 bytes
-rw-r--r--admin/images/modules.pngbin0 -> 4319 bytes
-rw-r--r--admin/images/navigation.pngbin0 -> 3382 bytes
-rw-r--r--admin/images/news.pngbin0 -> 5401 bytes
-rw-r--r--admin/images/options.pngbin0 -> 3989 bytes
-rw-r--r--admin/images/page.pngbin0 -> 3316 bytes
-rw-r--r--admin/images/pencil.pngbin0 -> 3325 bytes
-rw-r--r--admin/images/photogallery.pngbin0 -> 9687 bytes
-rw-r--r--admin/images/rejected.pngbin0 -> 5316 bytes
-rw-r--r--admin/images/rudi.pngbin0 -> 4068 bytes
-rw-r--r--admin/images/user.pngbin0 -> 4942 bytes
-rw-r--r--admin/images/user_add.pngbin0 -> 5265 bytes
-rw-r--r--admin/images/user_delete.pngbin0 -> 5270 bytes
-rw-r--r--admin/images/user_two_delete.pngbin0 -> 6207 bytes
-rw-r--r--admin/images/user_warning.pngbin0 -> 5317 bytes
-rw-r--r--admin/images/users_two.pngbin0 -> 5927 bytes
-rw-r--r--admin/images/users_two_add.pngbin0 -> 6164 bytes
-rw-r--r--admin/images/users_two_warning.pngbin0 -> 6206 bytes
-rw-r--r--admin/images/view.gifbin0 -> 61 bytes
-rw-r--r--admin/images/view.pngbin0 -> 3423 bytes
-rw-r--r--admin/index.php137
-rw-r--r--admin/modules/functions.php171
-rw-r--r--admin/modules/index.php59
-rw-r--r--admin/navigation/functions.php91
-rw-r--r--admin/navigation/index.php54
-rw-r--r--admin/news/functions.php135
-rw-r--r--admin/news/index.php47
-rw-r--r--admin/newsreel/functions.php160
-rw-r--r--admin/newsreel/index.php46
-rw-r--r--admin/newsreel/updateDB.php40
-rw-r--r--admin/operation.php53
-rw-r--r--admin/pages/functions.php193
-rw-r--r--admin/pages/index.php64
-rw-r--r--admin/rudi/functions.php71
-rw-r--r--admin/rudi/includes/functions.awards.php20
-rw-r--r--admin/rudi/includes/functions.members.php262
-rw-r--r--admin/rudi/index.php59
-rw-r--r--admin/rudi/views/view.awards.edit.php27
-rw-r--r--admin/rudi/views/view.awards.php40
-rw-r--r--admin/rudi/views/view.members.award.php19
-rw-r--r--admin/rudi/views/view.members.php49
-rw-r--r--admin/rudi/views/view.members.profile.php197
-rw-r--r--admin/rudi/views/view.members.service.php19
-rw-r--r--admin/rudi/views/view.units.php22
-rw-r--r--admin/scripts/jquery-1.3.2.min.js19
-rw-r--r--admin/scripts/jquery-ui-1.7.1.custom.min.js54
-rw-r--r--admin/scripts/jquery.js19
-rw-r--r--admin/scripts/markitup/images/body.pngbin0 -> 29187 bytes
-rw-r--r--admin/scripts/markitup/images/jaysalvat.pngbin0 -> 27603 bytes
-rw-r--r--admin/scripts/markitup/images/markitup.pngbin0 -> 11751 bytes
-rw-r--r--admin/scripts/markitup/images/style.css27
-rw-r--r--admin/scripts/markitup/index.html65
-rw-r--r--admin/scripts/markitup/jquery.pack.js11
-rw-r--r--admin/scripts/markitup/markitup/jquery.markitup.js553
-rw-r--r--admin/scripts/markitup/markitup/jquery.markitup.pack.js9
-rw-r--r--admin/scripts/markitup/markitup/readme.txt62
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/bold.pngbin0 -> 304 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/clean.pngbin0 -> 667 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/code.pngbin0 -> 859 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/fonts.pngbin0 -> 567 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/italic.pngbin0 -> 223 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/link.pngbin0 -> 343 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/list-bullet.pngbin0 -> 344 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/list-item.pngbin0 -> 248 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/list-numeric.pngbin0 -> 357 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/picture.pngbin0 -> 606 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/preview.pngbin0 -> 537 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/quotes.pngbin0 -> 743 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/stroke.pngbin0 -> 269 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/images/underline.pngbin0 -> 273 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/readme.txt11
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/set.js39
-rw-r--r--admin/scripts/markitup/markitup/sets/bbcode/style.css47
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/bold.pngbin0 -> 304 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/clean.pngbin0 -> 667 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/image.pngbin0 -> 516 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/italic.pngbin0 -> 223 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/link.pngbin0 -> 343 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/picture.pngbin0 -> 606 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/preview.pngbin0 -> 537 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/images/stroke.pngbin0 -> 269 bytes
-rw-r--r--admin/scripts/markitup/markitup/sets/default/set.js27
-rw-r--r--admin/scripts/markitup/markitup/sets/default/style.css27
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-container.pngbin0 -> 28455 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-bbcode.pngbin0 -> 1642 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-dotclear.pngbin0 -> 1682 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-html.pngbin0 -> 1534 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-json.pngbin0 -> 1529 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-markdown.pngbin0 -> 1783 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-textile.pngbin0 -> 1659 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-wiki.pngbin0 -> 1488 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-xml.pngbin0 -> 1495 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/bg-editor.pngbin0 -> 1745 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/handle.pngbin0 -> 258 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/menu.pngbin0 -> 27151 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/images/submenu.pngbin0 -> 240 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/markitup/style.css148
-rw-r--r--admin/scripts/markitup/markitup/skins/simple/images/handle.pngbin0 -> 258 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/simple/images/menu.pngbin0 -> 27151 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/simple/images/submenu.pngbin0 -> 240 bytes
-rw-r--r--admin/scripts/markitup/markitup/skins/simple/style.css118
-rw-r--r--admin/scripts/markitup/markitup/templates/preview.css5
-rw-r--r--admin/scripts/markitup/markitup/templates/preview.html11
-rw-r--r--admin/scripts/mocha.js156
-rw-r--r--admin/settings/functions.php77
-rw-r--r--admin/settings/index.php53
-rw-r--r--admin/settings/style.css64
-rw-r--r--admin/style.css143
-rw-r--r--blocks/announcements/index.php8
-rw-r--r--blocks/donations/index.php7
-rw-r--r--blocks/forum_login/index.php44
-rw-r--r--blocks/mini_calendar/functions.php195
-rw-r--r--blocks/mini_calendar/index.php3
-rw-r--r--blocks/mini_calendar/scripts.js0
-rw-r--r--blocks/mini_calendar/style.css114
-rw-r--r--blocks/rss_agw/index.php107
-rw-r--r--blocks/rss_agw/style.css17
-rw-r--r--blocks/rudi/index.php6
-rw-r--r--blocks/server_monitor/index.php16
-rw-r--r--blocks/soldier_info/index.php66
-rw-r--r--blocks/tsviewer/index.php12
-rw-r--r--docs/COPYING674
-rw-r--r--images/3rdbanner.pngbin0 -> 334841 bytes
-rw-r--r--images/3rdidtext.pngbin0 -> 20398 bytes
-rw-r--r--images/add.gifbin0 -> 59 bytes
-rw-r--r--images/addnewarticle.pngbin0 -> 6420 bytes
-rw-r--r--images/addnewpage.pngbin0 -> 7511 bytes
-rw-r--r--images/annoucement.pngbin0 -> 9409 bytes
-rw-r--r--images/announcement.pngbin0 -> 9409 bytes
-rw-r--r--images/arrowleft.pngbin0 -> 2861 bytes
-rw-r--r--images/arrowright.pngbin0 -> 2867 bytes
-rw-r--r--images/bayonetLogo.pngbin0 -> 15516 bytes
-rw-r--r--images/blockbackground.jpgbin0 -> 12055 bytes
-rw-r--r--images/calendar.pngbin0 -> 10174 bytes
-rw-r--r--images/delete.gifbin0 -> 60 bytes
-rw-r--r--images/dicon.pngbin0 -> 3431 bytes
-rw-r--r--images/dlaxlogo.pngbin0 -> 34718 bytes
-rw-r--r--images/editfiles.pngbin0 -> 7336 bytes
-rw-r--r--images/editpage.pngbin0 -> 7775 bytes
-rw-r--r--images/error.gifbin0 -> 1083 bytes
-rw-r--r--images/error.pngbin0 -> 3746 bytes
-rw-r--r--images/favicon.icobin0 -> 1406 bytes
-rw-r--r--images/file_doc.pngbin0 -> 6993 bytes
-rw-r--r--images/file_pdf.pngbin0 -> 7336 bytes
-rw-r--r--images/file_rtf.pngbin0 -> 6958 bytes
-rw-r--r--images/file_word.pngbin0 -> 9196 bytes
-rw-r--r--images/hgrad.pngbin0 -> 109 bytes
-rw-r--r--images/larrow.pngbin0 -> 3596 bytes
-rw-r--r--images/leftshadow.pngbin0 -> 3146 bytes
-rw-r--r--images/limericklax.pngbin0 -> 5497 bytes
-rw-r--r--images/logo.jpgbin0 -> 83085 bytes
-rw-r--r--images/lvgrad.pngbin0 -> 627 bytes
-rw-r--r--images/navbackground.jpgbin0 -> 11901 bytes
-rw-r--r--images/navbg.pngbin0 -> 2880 bytes
-rw-r--r--images/navigation.pngbin0 -> 11330 bytes
-rw-r--r--images/navspacer.pngbin0 -> 2810 bytes
-rw-r--r--images/news_header.pngbin0 -> 3558 bytes
-rw-r--r--images/nvgrad.pngbin0 -> 860 bytes
-rw-r--r--images/photogallery.pngbin0 -> 9687 bytes
-rw-r--r--images/photoleft.pngbin0 -> 2917 bytes
-rw-r--r--images/photoright.pngbin0 -> 2918 bytes
-rw-r--r--images/rarrow.pngbin0 -> 3581 bytes
-rw-r--r--images/rightshadow.pngbin0 -> 3155 bytes
-rw-r--r--images/sandbackground.jpgbin0 -> 523597 bytes
-rw-r--r--images/spacer.pngbin0 -> 2904 bytes
-rw-r--r--images/vgrad.pngbin0 -> 110 bytes
-rw-r--r--images/view.gifbin0 -> 61 bytes
-rw-r--r--images/xoma_logo.jpgbin0 -> 33996 bytes
-rw-r--r--include/classes.php238
-rw-r--r--include/debug.php225
-rw-r--r--include/functions.php615
-rw-r--r--include/sql.class.php167
-rw-r--r--index.php19
-rw-r--r--logs/error.log0
-rw-r--r--logs/hacks.log0
-rw-r--r--logs/info.log0
-rw-r--r--modules.php122
-rw-r--r--modules/admin/admin_functions.php152
-rw-r--r--modules/admin/blocks/functions.php173
-rw-r--r--modules/admin/blocks/index.php59
-rw-r--r--modules/admin/images/addnewarticle.pngbin0 -> 6420 bytes
-rw-r--r--modules/admin/images/addnewpage.pngbin0 -> 7511 bytes
-rw-r--r--modules/admin/images/announcement.pngbin0 -> 9409 bytes
-rw-r--r--modules/admin/images/calendar.pngbin0 -> 10174 bytes
-rw-r--r--modules/admin/images/editfiles.pngbin0 -> 7336 bytes
-rw-r--r--modules/admin/images/editpage.pngbin0 -> 7775 bytes
-rw-r--r--modules/admin/images/file_doc.pngbin0 -> 6993 bytes
-rw-r--r--modules/admin/images/file_pdf.pngbin0 -> 7336 bytes
-rw-r--r--modules/admin/images/file_rtf.pngbin0 -> 6958 bytes
-rw-r--r--modules/admin/images/file_word.pngbin0 -> 9196 bytes
-rw-r--r--modules/admin/images/photogallery.pngbin0 -> 9687 bytes
-rw-r--r--modules/admin/index.php73
-rw-r--r--modules/admin/operation.php53
-rw-r--r--modules/admin/pages/functions.php227
-rw-r--r--modules/admin/pages/index.php68
-rw-r--r--modules/download/index.php134
-rw-r--r--modules/index/index.php36
-rw-r--r--modules/news/categories/3rdIDnews.pngbin0 -> 50631 bytes
-rw-r--r--modules/news/categories/marnemessenger.pngbin0 -> 20793 bytes
-rw-r--r--modules/news/functions.php259
-rw-r--r--modules/news/images/avatar.pngbin0 -> 6617 bytes
-rw-r--r--modules/news/images/comment_arrow.pngbin0 -> 264 bytes
-rw-r--r--modules/news/index.php84
-rw-r--r--modules/news/style.css234
-rw-r--r--modules/newsreel/images/slidenavbg.pngbin0 -> 3152 bytes
-rw-r--r--modules/newsreel/images/slidenavbg2.pngbin0 -> 2898 bytes
-rw-r--r--modules/newsreel/images/slidenavbg3.pngbin0 -> 2885 bytes
-rw-r--r--modules/newsreel/index.php113
-rw-r--r--modules/newsreel/slides/arma2move.pngbin0 -> 409863 bytes
-rw-r--r--modules/newsreel/slides/newsite.pngbin0 -> 251441 bytes
-rw-r--r--modules/newsreel/slides/recruitmentGT.pngbin0 -> 277092 bytes
-rw-r--r--modules/newsreel/slides/teamwork.pngbin0 -> 83906 bytes
-rw-r--r--modules/newsreel/style.css25
-rw-r--r--modules/page/index.php96
-rw-r--r--modules/rudi/admin/includes/admin.class.php121
-rw-r--r--modules/rudi/admin/index.php21
-rw-r--r--modules/rudi/admin/views/view.addsoldier.php3
-rw-r--r--modules/rudi/admin/views/view.admin.php20
-rw-r--r--modules/rudi/admin/views/view.deletesoldier.php3
-rw-r--r--modules/rudi/admin/views/view.modifysoldier.php35
-rw-r--r--modules/rudi/footer.php8
-rw-r--r--modules/rudi/header.php6
-rw-r--r--modules/rudi/images/flags/australia.gifbin0 -> 655 bytes
-rw-r--r--modules/rudi/images/flags/canada.gifbin0 -> 1940 bytes
-rw-r--r--modules/rudi/images/flags/canada1.gifbin0 -> 1005 bytes
-rw-r--r--modules/rudi/images/flags/germany.gifbin0 -> 162 bytes
-rw-r--r--modules/rudi/images/flags/index.html0
-rw-r--r--modules/rudi/images/flags/israel.gifbin0 -> 237 bytes
-rw-r--r--modules/rudi/images/flags/japan.gifbin0 -> 224 bytes
-rw-r--r--modules/rudi/images/flags/korea.gifbin0 -> 674 bytes
-rw-r--r--modules/rudi/images/flags/mexico.gifbin0 -> 983 bytes
-rw-r--r--modules/rudi/images/flags/russia.gifbin0 -> 257 bytes
-rw-r--r--modules/rudi/images/flags/uk.gifbin0 -> 1119 bytes
-rw-r--r--modules/rudi/images/flags/usa.gifbin0 -> 1533 bytes
-rw-r--r--modules/rudi/images/medals/3IDESM.jpgbin0 -> 12629 bytes
-rw-r--r--modules/rudi/images/medals/ACM.jpgbin0 -> 12028 bytes
-rw-r--r--modules/rudi/images/medals/ADSM.jpgbin0 -> 12639 bytes
-rw-r--r--modules/rudi/images/medals/AE-AMCM.jpgbin0 -> 14193 bytes
-rw-r--r--modules/rudi/images/medals/AGCM.jpgbin0 -> 12108 bytes
-rw-r--r--modules/rudi/images/medals/BS.jpgbin0 -> 12344 bytes
-rw-r--r--modules/rudi/images/medals/DSC.jpgbin0 -> 19490 bytes
-rw-r--r--modules/rudi/images/medals/EAM.jpgbin0 -> 11842 bytes
-rw-r--r--modules/rudi/images/medals/EAMECM.jpgbin0 -> 13003 bytes
-rw-r--r--modules/rudi/images/medals/LOM.jpgbin0 -> 10799 bytes
-rw-r--r--modules/rudi/images/medals/MUC.jpgbin0 -> 26501 bytes
-rw-r--r--modules/rudi/images/medals/PH.jpgbin0 -> 10743 bytes
-rw-r--r--modules/rudi/images/medals/SM.jpgbin0 -> 12488 bytes
-rw-r--r--modules/rudi/images/medals/SS.jpgbin0 -> 13053 bytes
-rw-r--r--modules/rudi/images/medals/WWIIAOM.jpgbin0 -> 10647 bytes
-rw-r--r--modules/rudi/images/medals/WWIIVM.jpgbin0 -> 13154 bytes
-rw-r--r--modules/rudi/images/medals/armedforcesservice.jpgbin0 -> 19029 bytes
-rw-r--r--modules/rudi/images/medals/armyachievement.jpgbin0 -> 17037 bytes
-rw-r--r--modules/rudi/images/medals/armycommendation.jpgbin0 -> 16781 bytes
-rw-r--r--modules/rudi/images/medals/armyservice.jpgbin0 -> 17708 bytes
-rw-r--r--modules/rudi/images/medals/bronzestar.jpgbin0 -> 17801 bytes
-rw-r--r--modules/rudi/images/medals/cib1.gifbin0 -> 4135 bytes
-rw-r--r--modules/rudi/images/medals/cib2.gifbin0 -> 4719 bytes
-rw-r--r--modules/rudi/images/medals/cib3.gifbin0 -> 5002 bytes
-rw-r--r--modules/rudi/images/medals/cib4.gifbin0 -> 4357 bytes
-rw-r--r--modules/rudi/images/medals/cod2duc.jpgbin0 -> 17220 bytes
-rw-r--r--modules/rudi/images/medals/cod4duc.jpgbin0 -> 18868 bytes
-rw-r--r--modules/rudi/images/medals/codduc.jpgbin0 -> 26590 bytes
-rw-r--r--modules/rudi/images/medals/drill_instructor_badge.gifbin0 -> 4746 bytes
-rw-r--r--modules/rudi/images/medals/dsm.jpgbin0 -> 18088 bytes
-rw-r--r--modules/rudi/images/medals/esm.jpgbin0 -> 18453 bytes
-rw-r--r--modules/rudi/images/medals/exempattendance.jpgbin0 -> 14790 bytes
-rw-r--r--modules/rudi/images/medals/goodconduct.jpgbin0 -> 17653 bytes
-rw-r--r--modules/rudi/images/medals/gwotem.jpgbin0 -> 18528 bytes
-rw-r--r--modules/rudi/images/medals/gwotsm.jpgbin0 -> 17209 bytes
-rw-r--r--modules/rudi/images/medals/index.html-old0
-rw-r--r--modules/rudi/images/medals/legionofmerit.jpgbin0 -> 17265 bytes
-rw-r--r--modules/rudi/images/medals/nationaldefense.jpgbin0 -> 18323 bytes
-rw-r--r--modules/rudi/images/medals/ncoprofdev.jpgbin0 -> 18456 bytes
-rw-r--r--modules/rudi/images/medals/oak_leaf_clusters.jpgbin0 -> 12575 bytes
-rw-r--r--modules/rudi/images/medals/purpleheart.jpgbin0 -> 16352 bytes
-rw-r--r--modules/rudi/images/medals/silverstar.jpgbin0 -> 19028 bytes
-rw-r--r--modules/rudi/images/medals/soldiers.jpgbin0 -> 18626 bytes
-rw-r--r--modules/rudi/images/medals/valor_device.pngbin0 -> 6257 bytes
-rw-r--r--modules/rudi/images/ranks/large/1LT.pngbin0 -> 4093 bytes
-rw-r--r--modules/rudi/images/ranks/large/1SG.pngbin0 -> 16484 bytes
-rw-r--r--modules/rudi/images/ranks/large/1stLT.gifbin0 -> 1661 bytes
-rw-r--r--modules/rudi/images/ranks/large/2LT.pngbin0 -> 4663 bytes
-rw-r--r--modules/rudi/images/ranks/large/2ndLT.gifbin0 -> 1836 bytes
-rw-r--r--modules/rudi/images/ranks/large/CPL.pngbin0 -> 8911 bytes
-rw-r--r--modules/rudi/images/ranks/large/CPT.pngbin0 -> 6166 bytes
-rw-r--r--modules/rudi/images/ranks/large/CSM.pngbin0 -> 17079 bytes
-rw-r--r--modules/rudi/images/ranks/large/General.gifbin0 -> 2273 bytes
-rw-r--r--modules/rudi/images/ranks/large/LTGeneral.gifbin0 -> 2470 bytes
-rw-r--r--modules/rudi/images/ranks/large/MSG.pngbin0 -> 15886 bytes
-rw-r--r--modules/rudi/images/ranks/large/MajorGeneral.gifbin0 -> 2916 bytes
-rw-r--r--modules/rudi/images/ranks/large/PFC.pngbin0 -> 8658 bytes
-rw-r--r--modules/rudi/images/ranks/large/PV2.pngbin0 -> 6713 bytes
-rw-r--r--modules/rudi/images/ranks/large/PVT.gifbin0 -> 163 bytes
-rw-r--r--modules/rudi/images/ranks/large/SFC.pngbin0 -> 14884 bytes
-rw-r--r--modules/rudi/images/ranks/large/SGT.pngbin0 -> 10469 bytes
-rw-r--r--modules/rudi/images/ranks/large/SMG.pngbin0 -> 16852 bytes
-rw-r--r--modules/rudi/images/ranks/large/SPC.pngbin0 -> 8416 bytes
-rw-r--r--modules/rudi/images/ranks/large/SSG.pngbin0 -> 12772 bytes
-rw-r--r--modules/rudi/images/ranks/large/brigadier.gifbin0 -> 3494 bytes
-rw-r--r--modules/rudi/images/ranks/large/captain.gifbin0 -> 2908 bytes
-rw-r--r--modules/rudi/images/ranks/large/colonel.gifbin0 -> 4565 bytes
-rw-r--r--modules/rudi/images/ranks/large/index.html0
-rw-r--r--modules/rudi/images/ranks/large/ltc.gifbin0 -> 3767 bytes
-rw-r--r--modules/rudi/images/ranks/large/major.gifbin0 -> 3674 bytes
-rw-r--r--modules/rudi/images/ranks/small/1LT.pngbin0 -> 3330 bytes
-rw-r--r--modules/rudi/images/ranks/small/1SG.pngbin0 -> 6368 bytes
-rw-r--r--modules/rudi/images/ranks/small/2LT.pngbin0 -> 3425 bytes
-rw-r--r--modules/rudi/images/ranks/small/CPL.pngbin0 -> 4421 bytes
-rw-r--r--modules/rudi/images/ranks/small/CPT.pngbin0 -> 4232 bytes
-rw-r--r--modules/rudi/images/ranks/small/CSM.pngbin0 -> 6456 bytes
-rw-r--r--modules/rudi/images/ranks/small/General.gifbin0 -> 2273 bytes
-rw-r--r--modules/rudi/images/ranks/small/LtGeneral.gifbin0 -> 2395 bytes
-rw-r--r--modules/rudi/images/ranks/small/MSG.pngbin0 -> 6292 bytes
-rw-r--r--modules/rudi/images/ranks/small/MajorGeneral.gifbin0 -> 1668 bytes
-rw-r--r--modules/rudi/images/ranks/small/PFC.pngbin0 -> 4372 bytes
-rw-r--r--modules/rudi/images/ranks/small/PV2.pngbin0 -> 3882 bytes
-rw-r--r--modules/rudi/images/ranks/small/SFC.pngbin0 -> 5939 bytes
-rw-r--r--modules/rudi/images/ranks/small/SGT.pngbin0 -> 4870 bytes
-rw-r--r--modules/rudi/images/ranks/small/SMG.pngbin0 -> 6336 bytes
-rw-r--r--modules/rudi/images/ranks/small/SPC.pngbin0 -> 4312 bytes
-rw-r--r--modules/rudi/images/ranks/small/SSG.pngbin0 -> 5457 bytes
-rw-r--r--modules/rudi/images/ranks/small/brigadier.gifbin0 -> 1259 bytes
-rw-r--r--modules/rudi/images/ranks/small/index.html0
-rw-r--r--modules/rudi/images/ranks/small/pvt.gifbin0 -> 78 bytes
-rw-r--r--modules/rudi/images/ranks/small/rank-1stlieutenant.gifbin0 -> 1151 bytes
-rw-r--r--modules/rudi/images/ranks/small/rank-2ndlieutenant.gifbin0 -> 1081 bytes
-rw-r--r--modules/rudi/images/ranks/small/rank-captain.gifbin0 -> 799 bytes
-rw-r--r--modules/rudi/images/ranks/small/rank-colonel.gifbin0 -> 1654 bytes
-rw-r--r--modules/rudi/images/ranks/small/rank-ltcolonel.gifbin0 -> 1560 bytes
-rw-r--r--modules/rudi/images/ranks/small/rank-major.gifbin0 -> 1546 bytes
-rw-r--r--modules/rudi/images/ranks/small/rank-private.gifbin0 -> 163 bytes
-rw-r--r--modules/rudi/images/uniform/ACoia.pngbin0 -> 287047 bytes
-rw-r--r--modules/rudi/images/uniform/BBell.pngbin0 -> 295153 bytes
-rw-r--r--modules/rudi/images/uniform/BChu.pngbin0 -> 304564 bytes
-rw-r--r--modules/rudi/images/uniform/BLevine.pngbin0 -> 298243 bytes
-rw-r--r--modules/rudi/images/uniform/BSegal.pngbin0 -> 303105 bytes
-rw-r--r--modules/rudi/images/uniform/DHolson.pngbin0 -> 291465 bytes
-rw-r--r--modules/rudi/images/uniform/EOConnell.pngbin0 -> 304203 bytes
-rw-r--r--modules/rudi/images/uniform/GTownsend.pngbin0 -> 305424 bytes
-rw-r--r--modules/rudi/images/uniform/IBailey.pngbin0 -> 303549 bytes
-rw-r--r--modules/rudi/images/uniform/JBottheim.pngbin0 -> 296613 bytes
-rw-r--r--modules/rudi/images/uniform/JHunkeler.pngbin0 -> 309740 bytes
-rw-r--r--modules/rudi/images/uniform/JMelnyk.pngbin0 -> 287114 bytes
-rw-r--r--modules/rudi/images/uniform/JRobinson.pngbin0 -> 292311 bytes
-rw-r--r--modules/rudi/images/uniform/KGrimes.pngbin0 -> 301461 bytes
-rw-r--r--modules/rudi/images/uniform/KJohnson.pngbin0 -> 288935 bytes
-rw-r--r--modules/rudi/images/uniform/LTrimble.pngbin0 -> 302003 bytes
-rw-r--r--modules/rudi/images/uniform/MLula.pngbin0 -> 311178 bytes
-rw-r--r--modules/rudi/images/uniform/MMark.pngbin0 -> 301887 bytes
-rw-r--r--modules/rudi/images/uniform/MMcClellan.pngbin0 -> 302019 bytes
-rw-r--r--modules/rudi/images/uniform/NGiroux.pngbin0 -> 305035 bytes
-rw-r--r--modules/rudi/images/uniform/NMartini.pngbin0 -> 305571 bytes
-rw-r--r--modules/rudi/images/uniform/NPuckett.pngbin0 -> 299669 bytes
-rw-r--r--modules/rudi/images/uniform/PBurris.pngbin0 -> 303770 bytes
-rw-r--r--modules/rudi/images/uniform/PPederson.pngbin0 -> 289002 bytes
-rw-r--r--modules/rudi/images/uniform/RLeahy.pngbin0 -> 308970 bytes
-rw-r--r--modules/rudi/images/uniform/RThomas.pngbin0 -> 300869 bytes
-rw-r--r--modules/rudi/images/uniform/SCorsaro.pngbin0 -> 300741 bytes
-rw-r--r--modules/rudi/images/uniform/ZBarrett.pngbin0 -> 304753 bytes
-rw-r--r--modules/rudi/images/uniform/bailey.jpgbin0 -> 60466 bytes
-rw-r--r--modules/rudi/images/uniform/barrett.jpgbin0 -> 70034 bytes
-rw-r--r--modules/rudi/images/uniform/bell.jpgbin0 -> 89556 bytes
-rw-r--r--modules/rudi/images/uniform/blackburn.jpgbin0 -> 127799 bytes
-rw-r--r--modules/rudi/images/uniform/blanchette.jpgbin0 -> 176352 bytes
-rw-r--r--modules/rudi/images/uniform/bottheim.jpgbin0 -> 122813 bytes
-rw-r--r--modules/rudi/images/uniform/brooks.jpgbin0 -> 139006 bytes
-rw-r--r--modules/rudi/images/uniform/brown.jpgbin0 -> 209348 bytes
-rw-r--r--modules/rudi/images/uniform/burris copy.jpgbin0 -> 128430 bytes
-rw-r--r--modules/rudi/images/uniform/burris.jpgbin0 -> 170023 bytes
-rw-r--r--modules/rudi/images/uniform/bursik.jpgbin0 -> 52778 bytes
-rw-r--r--modules/rudi/images/uniform/chu.jpgbin0 -> 169405 bytes
-rw-r--r--modules/rudi/images/uniform/clark.jpgbin0 -> 60546 bytes
-rw-r--r--modules/rudi/images/uniform/clayton.jpgbin0 -> 129211 bytes
-rw-r--r--modules/rudi/images/uniform/cooke.jpgbin0 -> 139618 bytes
-rw-r--r--modules/rudi/images/uniform/corsaro.jpgbin0 -> 136146 bytes
-rw-r--r--modules/rudi/images/uniform/cpl.jpgbin0 -> 207981 bytes
-rw-r--r--modules/rudi/images/uniform/dalia.jpgbin0 -> 200603 bytes
-rw-r--r--modules/rudi/images/uniform/ditzel.jpgbin0 -> 90225 bytes
-rw-r--r--modules/rudi/images/uniform/donovan.jpgbin0 -> 55378 bytes
-rw-r--r--modules/rudi/images/uniform/dubin.jpgbin0 -> 120375 bytes
-rw-r--r--modules/rudi/images/uniform/duvall.jpgbin0 -> 115170 bytes
-rw-r--r--modules/rudi/images/uniform/enlisted.jpgbin0 -> 155373 bytes
-rw-r--r--modules/rudi/images/uniform/freeman.jpgbin0 -> 122388 bytes
-rw-r--r--modules/rudi/images/uniform/frey.jpgbin0 -> 70129 bytes
-rw-r--r--modules/rudi/images/uniform/fsgt.jpgbin0 -> 211080 bytes
-rw-r--r--modules/rudi/images/uniform/gaskin.jpgbin0 -> 168069 bytes
-rw-r--r--modules/rudi/images/uniform/geary.jpgbin0 -> 61536 bytes
-rw-r--r--modules/rudi/images/uniform/giles.jpgbin0 -> 167319 bytes
-rw-r--r--modules/rudi/images/uniform/giroux.jpgbin0 -> 165155 bytes
-rw-r--r--modules/rudi/images/uniform/goodrich.jpgbin0 -> 213503 bytes
-rw-r--r--modules/rudi/images/uniform/gwizdala.jpgbin0 -> 57733 bytes
-rw-r--r--modules/rudi/images/uniform/hallock.jpgbin0 -> 205399 bytes
-rw-r--r--modules/rudi/images/uniform/higgins.jpgbin0 -> 137833 bytes
-rw-r--r--modules/rudi/images/uniform/holson.jpgbin0 -> 208445 bytes
-rw-r--r--modules/rudi/images/uniform/hornung.jpgbin0 -> 216193 bytes
-rw-r--r--modules/rudi/images/uniform/hunkeler.jpgbin0 -> 139385 bytes
-rw-r--r--modules/rudi/images/uniform/index.html0
-rw-r--r--modules/rudi/images/uniform/jimenez.jpgbin0 -> 60891 bytes
-rw-r--r--modules/rudi/images/uniform/kenkel.jpgbin0 -> 139392 bytes
-rw-r--r--modules/rudi/images/uniform/killian.jpgbin0 -> 119028 bytes
-rw-r--r--modules/rudi/images/uniform/leahy.jpgbin0 -> 147709 bytes
-rw-r--r--modules/rudi/images/uniform/levine.jpgbin0 -> 90020 bytes
-rw-r--r--modules/rudi/images/uniform/litton.jpgbin0 -> 164532 bytes
-rw-r--r--modules/rudi/images/uniform/luker.jpgbin0 -> 209352 bytes
-rw-r--r--modules/rudi/images/uniform/lula.jpgbin0 -> 113012 bytes
-rw-r--r--modules/rudi/images/uniform/madden.jpgbin0 -> 137781 bytes
-rw-r--r--modules/rudi/images/uniform/manary.jpgbin0 -> 122837 bytes
-rw-r--r--modules/rudi/images/uniform/mark.jpgbin0 -> 209527 bytes
-rw-r--r--modules/rudi/images/uniform/mcclellan.jpgbin0 -> 127886 bytes
-rw-r--r--modules/rudi/images/uniform/mirman.jpgbin0 -> 206348 bytes
-rw-r--r--modules/rudi/images/uniform/moncayo.jpgbin0 -> 211235 bytes
-rw-r--r--modules/rudi/images/uniform/nowlan.jpgbin0 -> 163725 bytes
-rw-r--r--modules/rudi/images/uniform/oconnell.jpgbin0 -> 90383 bytes
-rw-r--r--modules/rudi/images/uniform/officer.jpgbin0 -> 222067 bytes
-rw-r--r--modules/rudi/images/uniform/officer1.jpgbin0 -> 172545 bytes
-rw-r--r--modules/rudi/images/uniform/papp.jpgbin0 -> 215683 bytes
-rw-r--r--modules/rudi/images/uniform/patterson.jpgbin0 -> 210126 bytes
-rw-r--r--modules/rudi/images/uniform/pfc.jpgbin0 -> 58556 bytes
-rw-r--r--modules/rudi/images/uniform/pfc3service copy.jpgbin0 -> 109070 bytes
-rw-r--r--modules/rudi/images/uniform/poole.jpgbin0 -> 209348 bytes
-rw-r--r--modules/rudi/images/uniform/puckett.jpgbin0 -> 119529 bytes
-rw-r--r--modules/rudi/images/uniform/pvt.jpgbin0 -> 205709 bytes
-rw-r--r--modules/rudi/images/uniform/schneider.jpgbin0 -> 209348 bytes
-rw-r--r--modules/rudi/images/uniform/scott.jpgbin0 -> 52769 bytes
-rw-r--r--modules/rudi/images/uniform/segal.jpgbin0 -> 210897 bytes
-rw-r--r--modules/rudi/images/uniform/severyns.jpgbin0 -> 124894 bytes
-rw-r--r--modules/rudi/images/uniform/sgt.jpgbin0 -> 208875 bytes
-rw-r--r--modules/rudi/images/uniform/sokolowski.jpgbin0 -> 214274 bytes
-rw-r--r--modules/rudi/images/uniform/sosa.jpgbin0 -> 110679 bytes
-rw-r--r--modules/rudi/images/uniform/ssgt.jpgbin0 -> 209565 bytes
-rw-r--r--modules/rudi/images/uniform/test.gifbin0 -> 86068 bytes
-rw-r--r--modules/rudi/images/uniform/test_enlisted.jpgbin0 -> 56855 bytes
-rw-r--r--modules/rudi/images/uniform/thomas.jpgbin0 -> 134105 bytes
-rw-r--r--modules/rudi/images/uniform/townsend.jpgbin0 -> 93443 bytes
-rw-r--r--modules/rudi/images/uniform/townsend_OLD.jpgbin0 -> 101441 bytes
-rw-r--r--modules/rudi/images/uniform/trimble.jpgbin0 -> 140085 bytes
-rw-r--r--modules/rudi/images/uniform/whiting.jpgbin0 -> 172716 bytes
-rw-r--r--modules/rudi/images/uniform/williams.jpgbin0 -> 43310 bytes
-rw-r--r--modules/rudi/images/uniform/wubbena.jpgbin0 -> 195067 bytes
-rw-r--r--modules/rudi/images/uniform/young.jpgbin0 -> 205423 bytes
-rw-r--r--modules/rudi/images/units/2ndPlatoon.gifbin0 -> 21561 bytes
-rw-r--r--modules/rudi/images/units/BCT.jpgbin0 -> 67560 bytes
-rw-r--r--modules/rudi/images/units/HQ.gifbin0 -> 22251 bytes
-rw-r--r--modules/rudi/images/units/index.html0
-rw-r--r--modules/rudi/images/units/rocky.gifbin0 -> 11614 bytes
-rw-r--r--modules/rudi/images/weapons/M16a4.jpgbin0 -> 10601 bytes
-rw-r--r--modules/rudi/images/weapons/M203-1.jpgbin0 -> 49023 bytes
-rw-r--r--modules/rudi/images/weapons/M21.jpgbin0 -> 5114 bytes
-rw-r--r--modules/rudi/images/weapons/M249.jpgbin0 -> 45857 bytes
-rw-r--r--modules/rudi/images/weapons/M9.jpgbin0 -> 32248 bytes
-rw-r--r--modules/rudi/images/weapons/USP.jpgbin0 -> 29611 bytes
-rw-r--r--modules/rudi/images/weapons/index.html0
-rw-r--r--modules/rudi/images/weapons/m14.jpgbin0 -> 12745 bytes
-rw-r--r--modules/rudi/images/weapons/m40a3.jpgbin0 -> 47209 bytes
-rw-r--r--modules/rudi/images/weapons/m4a1.jpgbin0 -> 9504 bytes
-rw-r--r--modules/rudi/images/weapons/m67-grenade.jpgbin0 -> 15227 bytes
-rw-r--r--modules/rudi/images/weapons/m84.jpgbin0 -> 24936 bytes
-rw-r--r--modules/rudi/includes/common.class.php927
-rw-r--r--modules/rudi/includes/debug.php80
-rw-r--r--modules/rudi/includes/index.html0
-rw-r--r--modules/rudi/includes/information.class.php34
-rw-r--r--modules/rudi/includes/rudi.css71
-rw-r--r--modules/rudi/includes/sql.class.php90
-rw-r--r--modules/rudi/index.php106
-rw-r--r--modules/rudi/views/view.awards.php81
-rw-r--r--modules/rudi/views/view.drills.php122
-rw-r--r--modules/rudi/views/view.information.php20
-rw-r--r--modules/rudi/views/view.platoon.php22
-rw-r--r--modules/rudi/views/view.profile.php175
-rw-r--r--modules/rudi/views/view.ranks.php37
-rw-r--r--modules/rudi/views/view.roster.php23
-rw-r--r--modules/rudi/views/view.unit.php22
-rw-r--r--modules/tsviewer/index.php46
-rw-r--r--themes/default/footer.php53
-rw-r--r--themes/default/header.php40
-rw-r--r--themes/default/include/primary.css256
-rw-r--r--themes/default/include/style_bbcode.css71
-rw-r--r--themes/default/include/theme.ini2
-rw-r--r--themes/default/index.php61
-rw-r--r--themes/default/navigation.php24
517 files changed, 13124 insertions, 0 deletions
diff --git a/admin/adjutant/functions.php b/admin/adjutant/functions.php
new file mode 100644
index 0000000..57e9fe8
--- /dev/null
+++ b/admin/adjutant/functions.php
@@ -0,0 +1,161 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ function EditPoints(){
+
+ global $db;
+
+ $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id != 4 AND rudi_unit_members.status_id != 5 ORDER BY rudi_ranks.weight DESC , rudi_unit_members.date_promotion ASC , rudi_unit_members.date_enlisted ASC");
+ $row = $db->Fetch($result);
+
+ if(isset($_POST['processed'])){
+ echo "Updating data... Please wait.";
+ foreach($row as $soldier){
+ $mID = $soldier['member_id'];
+ $missed = $_POST[$mID.'missed'];
+ $points = $_POST[$mID.'points'];
+
+ if($missed !="" && $points != ""){
+ $db->Query("UPDATE `rudi_unit_members` SET `points` = $points, `drillcount` = $missed WHERE `member_id` = $mID LIMIT 1");
+ }else{
+ ReportError("Error updating points for soldier id# '$mID'. Please contact administrator.");
+ }
+ }
+ PageRedirect(1,"?op=adjutant&edit=points");
+ return;
+ }
+?>
+ <form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
+ <table style="text-align:center;" width="100%">
+ <?php //OpenTable(); ?>
+ <tr><th>Rank</th><th>Soldier</th><th>Status</th><th>Points</th><th>Drills Missed</th></tr>
+<?php
+ foreach($row as $soldier){
+ $memberID = $soldier['member_id'];
+ if($soldier['status_id'] != 1)
+ echo "<tr class=\"inactive\">";
+ else
+ echo "<tr>";
+ echo "<td>{$soldier['shortname']}</td>
+ <td>{$soldier['first_name']} {$soldier['last_name']}</td>
+ <td>".getStatus($soldier['status_id'])."</td>
+ <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['points']}\" name=\"{$memberID}points\" size=\"1\" maxlength=\"3\" />/100</td>
+ <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['drillcount']}\" name=\"{$memberID}missed\" size=\"1\" maxlength=\"1\" />/3</td>";
+
+
+ echo "<input type=\"hidden\" value=\"{$memberID}\" name=\"{$memberID}id\" />\n";
+ }
+ CloseTable();
+ echo "<input type=\"submit\" name=\"processed\" value=\"Update Points\" /></form>";
+
+ }
+
+ function EditLOAs($status_id = 1){
+
+ global $db;
+
+ $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id = '$status_id' ORDER BY rudi_ranks.weight DESC , rudi_unit_members.date_promotion ASC , rudi_unit_members.date_enlisted ASC");
+ $row = $db->Fetch($result);
+?>
+ <script type="text/javascript">
+
+ function switchOption(id)
+ {
+ var op = document.getElementById(id).value;
+ location.href="?op=adjutant&edit=loas&id="+op+"";
+ }
+ </script>
+<?php
+
+ $opArr = Array();
+ $opArr[1] = "Active Soldiers";
+ $opArr[2] = "Soldiers on Leave";
+ $opArr[3] = "Soldiers on Extended Leave";
+
+ echo 'Viewing: <select id="option" name="option" onchange="switchOption(this.id)">';
+ for($x=1; $x<4; $x++){
+ if($status_id == $x)
+ echo '<option value="'.$x.'" selected>'.$opArr[$x].'</option>';
+ else
+ echo '<option value="'.$x.'">'.$opArr[$x].'</option>';
+ }
+ echo '</select>';
+
+?>
+ <table style="text-align:center;" width="100%">
+ <tr><th>Rank</th><th>Soldier</th><th>Status</th></tr>
+<?php
+$num = 1;
+ foreach($row as $member){
+ if($num %2 == 0)
+ echo "<tr style=\"background-color:#c6c6c6;\">";
+ else
+ echo "<tr>";
+ echo "<td>{$member['shortname']}</td><td>{$member['first_name']} {$member['last_name']}</td><td><a href=\"?op=adjutant&edit=loas&member={$member['member_id']}\">Edit</a></td></tr>";
+ $num++;
+ }
+ CloseTable();
+ }
+
+ function EditStatus($member_id){
+ global $db;
+
+ $form = new BayonetForm("", "POST");
+ if($form->VerifySubmit('processed')){
+ echo "Please wait while your information is being processed...";
+ $status_id = $form->request['status'];
+ $db->query("UPDATE `rudi_unit_members` SET `status_id` = '$status_id' WHERE `member_id` = '$member_id' LIMIT 1");
+ PageRedirect(1, "?op=adjutant&edit=loas&member={$member_id}");
+ return;
+ }
+
+ $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE `member_id` = '$member_id' LIMIT 1");
+ $row = $db->FetchRow($result);
+?>
+ <center>
+ <table width="50%" style="text-align:center;">
+ <tr><th>Rank</th><th>Soldier</th><th>Status</th></tr>
+ <tr>
+ <td><?php echo $row['shortname']; ?></td>
+ <td><?php echo $row['first_name']." ".$row['last_name']; ?></td>
+ <td style="text-align:left;">
+ <?php $form->radioButton('status', 1, $row['status_id'] == 1 ? true : false); ?>Active<br />
+ <?php $form->radioButton('status', 2, $row['status_id'] == 2 ? true : false); ?>On Leave<br />
+ <?php $form->radioButton('status', 3, $row['status_id'] == 3 ? true : false); ?>On Extended Leave
+ </td>
+ </tr>
+ <tr><td colspan="3"><?php $form->submitButton('processed'); ?></td></tr>
+ </table>
+ </center>
+<?php
+
+ $form->__destruct();
+
+ }
+
+ function getStatus($sID){
+ global $db;
+ $gStatusName = "N/A";
+
+ $result = $db->Query("SELECT `name` FROM `rudi_statuses` WHERE `status_id` = $sID LIMIT 1");
+ $row = $db->FetchRow($result);
+
+ return $row['name'];
+ }
+ ?> \ No newline at end of file
diff --git a/admin/adjutant/index.php b/admin/adjutant/index.php
new file mode 100644
index 0000000..5149c28
--- /dev/null
+++ b/admin/adjutant/index.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ ?>
+ <link rel="stylesheet" type="text/css" href="adjutant/style.css" media="screen"/>
+ <div style="text-align:left;"><h2>- Adjutant Control Panel</h2></div>
+ <a href="?op=adjutant&edit=points">Edit Points</a>&nbsp;&nbsp;
+ <a href="?op=adjutant&edit=loas">Edit LOAs</a>
+ <table class="panel" width="100%">
+ <tr><td style="text-align:center; vertical-align:top;">
+ <?php
+ if(!defined("ADMIN_FILE"))
+ {
+ die("Access denied.");
+ }
+
+ include $basedir.'adjutant/functions.php';
+
+ //chek to see if the person is indeed an adjutant
+
+ if(isset($_GET['edit'])){
+ if($_GET['edit'] == "points"){
+ echo "<h3>Edit Points</h3>";
+ EditPoints();
+ }
+ if($_GET['edit'] == "loas"){
+ echo "<h3>Edit LOAs</h3>";
+ if(isset($_GET['member'])){
+ $member_id = $_GET['member'];
+ EditStatus($member_id);
+ }else{
+ if(isset($_GET['id']))
+ $status_id = $_GET['id'];
+ else
+ $status_id = 1;
+ EditLOAs($status_id);
+ }
+ }
+ }
+ ?>
+ </td></tr>
+ </table> \ No newline at end of file
diff --git a/admin/adjutant/style.css b/admin/adjutant/style.css
new file mode 100644
index 0000000..24a3eb8
--- /dev/null
+++ b/admin/adjutant/style.css
@@ -0,0 +1,13 @@
+ input.lrg {
+ font-size:14px;
+ font-weight:bold;
+ text-align:center;
+ font-family: Arial, Sans-Serif;
+ }
+
+ tr.inactive {
+ background-color:#dfdfdf;
+ }
+ tr.inactive td {
+ color:#a2a2a2;
+ } \ No newline at end of file
diff --git a/admin/admin_functions.php b/admin/admin_functions.php
new file mode 100644
index 0000000..46572e5
--- /dev/null
+++ b/admin/admin_functions.php
@@ -0,0 +1,169 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+function is_loggedin()
+{
+ $id = session_id();
+ if($id == "")
+ {
+ header("location: index.php");
+ return false;
+ }
+ return true;
+}
+
+function login()
+{
+ global $db;
+
+ if(isset($_SESSION['username']) || isset($_SESSION['password']))
+ {
+ return true;
+ }
+
+ if(isset($_POST['processed']))
+ {
+ $username = addslashes($_POST['username']);
+ $password = addslashes($_POST['password']);
+ $password = crypt(md5($password),'iamnotadirtywhorebitch');
+ $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password' LIMIT 1");
+ $rows = $db->Rows($result);
+ $row = $db->FetchRow($result);
+
+ if($rows > 0)
+ {
+ $_SESSION['username'] = stripslashes($username);
+ $_SESSION['password'] = stripslashes($password);
+ $_SESSION['level'] = $row['level'];
+ return true;
+ }
+ else
+ {
+ ReportError("Login incorrect.");
+
+ //NOT CORRECT LOGIN, DEFAULT TO LOGIN PAGE
+ //echo "<meta http-equiv=\"Refresh\" content=\"1;url=index.php\">";
+ PageRedirect(1, "index.php");
+
+ return false;
+ }
+
+ }
+ else
+ {
+ echo "<form action=\"\" method=\"post\">\n";
+ //OpenTable();
+ echo "<table style=\"width:100%; height:600px;\">";
+ echo "<tr><td><table width=\"450px\" style=\"background-color:white;\" align=\"center\">\n
+ <tr><td colspan=\"2\" style=\"text-align:center;\"><img src=\"images/bayonet_logo.jpg\" /></td></tr>\n
+ <tr><th colspan=\"2\">Administrative Login</th></tr>\n
+ <tr><th style=\"text-align:right;\">Username</th><td><input size=\"20\" type=\"text\" name=\"username\"></td></tr>\n
+ <tr><th style=\"text-align:right;\">Password</th><td><input size=\"20\" type=\"password\" name=\"password\"></td></tr>\n
+ <tr><th colspan=\"2\" align=\"center\"><input type=\"Submit\" name=\"processed\" value=\"Login\"></th></tr></td></tr>\n
+ </table>\n";
+ //CloseTable();
+ echo "</table>";
+ echo "</form>\n";
+ return false;
+ }
+}
+
+function logout()
+{
+ session_unset();
+ session_destroy();
+
+ echo "<script>location.href=\"index.php\";</script>";
+}
+
+/**
+ * CompileAdmin()
+ *
+ * because we want to have a horizontal display of options, we need to have
+ * the data separated by arrays. the data is processed into single tables, and is
+ * echoed in realtime. we checked to make sure they were arrays, but there is no
+ * checking to make sure the data passed is not malicious in nature.
+ *
+ * @param mixed $head
+ * @param mixed $body
+ * @return
+ */
+function CompileAdmin($head,$body)
+{
+ /*if we were not passed arrays, then say goodbye*/
+ if(!is_array($head) || !is_array($body))
+ {
+ echo "must be array\n";
+ return;
+ }
+
+ echo "<table class=\"cleartable\" width=\"100%\">";
+
+$num = 1;
+ foreach($body as $td)
+ {
+ if($num==1){
+ echo "<tr style=\"text-align:center; height:90px;\">";
+ }
+ echo "<td class=\"center\" style=\"width:12%;\">$td</td>\n";
+ if($num%8 == 0){
+ echo "</tr>";
+ $num=0;
+ }
+ $num++;
+ }
+
+ if($num == 1)
+ echo "</table>\n";
+ else
+ echo "</tr></table>\n";
+}
+
+/**
+ * OpenTable()
+ *
+ * The administration OpenTable() function requires an argument to define
+ * the header title. It may be wise to replace the standard OpenTable() function
+ * with this one... that's alot of code to unfuck though.
+ *
+ * @param mixed $title
+ * @return
+ */
+function OpenTable_Ex($title)
+{
+ echo "<table align=\"center\"><tr><th>{$title}</th></tr><tr><td>";
+}
+
+/**
+ * CloseTable()
+ *
+ * @return
+ */
+function CloseTable_Ex()
+{
+ echo "</td></tr></table>";
+}
+
+?> \ No newline at end of file
diff --git a/admin/admins/functions.php b/admin/admins/functions.php
new file mode 100644
index 0000000..d28ff7d
--- /dev/null
+++ b/admin/admins/functions.php
@@ -0,0 +1,329 @@
+<script type="text/javascript">
+ $(document).ready(function(){
+ $(".flip").click(function(){
+ $(".slidepanel").slideToggle("slow");
+ });
+ });
+</script>
+
+<style type="text/css">
+ p.flip
+ {
+ margin:0px;
+ padding:5px;
+ text-align:center;
+ background: #5b8dda;
+ border:solid 1px #848484;
+ color:white;
+ }
+ div.slidepanel
+ {
+ height:75px;
+ display:none;
+ }
+</style>
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ function ListAdmins()
+ {
+ global $db;
+ $result = $db->Query("SELECT `user_id`, `username`, `level` FROM `bayonet_users` ORDER BY `level` DESC, `username` ASC");
+ $admins = $db->fetch($result);
+
+ $num = 1;
+ OpenTable("300px");
+ echo "<tr><th></th><th style=\"text-align:left;\">Username</th><th style=\"text-align:left;\">Level</th></tr>";
+ foreach($admins as $admin)
+ {
+ if($admin['level'] != $level){
+ $level = $admin['level'];
+ echo "<tr><td colspan=\"3\"><hr /></td></tr>";
+ }
+ echo "<tr><td>{$num}.</td><td><a href=\"?op=admins&edit={$admin['user_id']}\">{$admin['username']}</a></td><td>{$admin['level']}</td></tr>";
+ $num++;
+ }
+ CloseTable();
+ }
+
+ function NewAdmin()
+ {
+
+ global $db;
+ $maxLevel = $_SESSION['level'];
+
+ if(isset($_POST['processed'])){
+
+ $username = addslashes($_POST['username']);
+ $email = addslashes($_POST['email']);
+ $first = addslashes($_POST['first']);
+ $last = addslashes($_POST['last']);
+
+ $level = $_POST['level'];
+ $all = $_POST['all'];
+ $squadleader = $_POST['squadleader'];
+ $adjutant = $_POST['adjutant'];
+ $quartermaster = $_POST['quartermaster'];
+
+ $level = (int)$level;
+ $all = (int)$all;
+ $squadleader = (int)$squadleader;
+ $adjutant = (int)$adjutant;
+ $quartermaster = (int)$quartermaster;
+
+ $password = GeneratePassword(8);
+ $cryptpassword = crypt(md5($password),'iamnotadirtywhorebitch');
+
+ if(empty($username))
+ {
+ ReportError("This user must have a username to continue.");
+ return;
+ }
+
+ $result = $db->Query("SELECT `level` FROM `bayonet_users` WHERE `username` = '$username' OR `email` = '$email'");
+ if($db->Rows($result) > 0){
+ ReportError("The email and or username you entered is already in use.");
+ return;
+ }
+
+
+ $Name = "Rocky the Marne Dog";
+ $subject = "3rd ID Admin Password";
+ $header = "From: ". $Name . " < DO NOT RESPOND >\r\n"; //optional headerfields
+ $mail_body = "Do not respond to this email.\n\n------------------------------\nUsername: ".$username."\nPassword: ".$password."\n------------------------------\n\nTo login click on this link. http://testbed.3rd-infantry-division.org/cms/admin/ \n\nIt is recommended that you change your password once you login. To do so, click on Account Settings>Change Password.";
+
+ $sent = mail($email, $subject, $mail_body, $header);
+ if(!$sent){
+ ReportError("Error validating email. This user was not saved.");
+ return;
+ }
+
+ $db->Query("INSERT INTO `bayonet_users` (`user_id` ,`username` ,`password` ,`lastname` ,`firstname` ,`email` ,`joined` ,`level` ,`all` ,`squadleader` ,`adjutant` ,`quartermaster`) VALUES (NULL, '$username', '$cryptpassword', '$last', '$first', '$email', CURRENT_TIMESTAMP, $level, $all, $squadleader, $adjutant, $quartermaster)");
+
+ echo "Admin, '$username' level '$level' has been added. An email has been sent to him with his username and password.\n <br /><br />
+ Please wait while you are redirected. <br /><br />
+ <a href=\"?op=admins\">Click here if you don't feel like waiting.</a>";
+
+ // 3 second redirect to go back to the edit page
+ PageRedirect(2, "?op=admins");
+ return;
+ }
+?>
+<div style="text-align:right"><img src="images/cancel.png" />Cancel</div>
+<center>
+ <form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
+ <table>
+ <tr><th>Username:</th><td><input type="text" value="" name="username" />*</td></tr>
+ <tr><th>First Name:</th><td><input type="text" value="" name="first" /></td></tr>
+ <tr><th>Last Name:</th><td><input type="text" value="" name="last" /></td></tr>
+ <tr><th>Email Address:</th><td><input type="text" value="" name="email" />*</td></tr>
+ <tr>
+ <th>Level:</th>
+ <td>
+ <select name="level">
+ <?php
+ for($x=$maxLevel; $x>0;$x--){
+ echo "<option value=\"{$x}\">{$x}</option>";
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" style="text-align:center;">
+ <input type="submit" name="processed" value="Submit" />
+ </td>
+ </tr>
+ </table>
+ <br />
+ <?php GetPermissions(); ?>
+ </form>
+</center>
+<?php
+ }
+
+ function GetPermissions($user = NULL)
+ {
+ ?>
+ <div class="slidepanel">
+ <table width="100%" style="text-align:center;">
+ <tr><th>Everything else</th><th>Squad Leader</th><th>Adjutant</th><th>Quartermaster</th></tr>
+ <tr>
+ <td width="25%">
+ <input type="hidden" name="all" value="0" />
+ <?php
+ if(isset($user['all']) && $user['all'] == 1)
+ echo "<input type=\"checkbox\" name=\"all\" value=\"1\" checked/>";
+ else
+ echo "<input type=\"checkbox\" name=\"all\" value=\"1\" />";
+ ?>
+ </td>
+ <td width="25%">
+ <input type="hidden" name="squadleader" value="0" />
+ <?php
+ if(isset($user['squadleader']) && $user['squadleader'] == 1)
+ echo "<input type=\"checkbox\" name=\"squadleader\" value=\"1\" checked/>";
+ else
+ echo "<input type=\"checkbox\" name=\"squadleader\" value=\"1\" />";
+ ?>
+ </td>
+ <td width="25%">
+ <input type="hidden" name="adjutant" value="0" />
+ <?php
+ if(isset($user['adjutant']) && $user['adjutant'] == 1)
+ echo "<input type=\"checkbox\" name=\"adjutant\" value=\"1\" checked/>";
+ else
+ echo "<input type=\"checkbox\" name=\"adjutant\" value=\"1\" />";
+ ?>
+ </td>
+ <td width="25%">
+ <input type="hidden" name="quartermaster" value="0" />
+ <?php
+ if(isset($user['quartermaster']) && $user['quartermaster'] == 1)
+ echo "<input type=\"checkbox\" name=\"quartermaster\" value=\"1\" checked/>";
+ else
+ echo "<input type=\"checkbox\" name=\"quartermaster\" value=\"1\" />";
+ ?>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <p class="flip">Show/Hide Permissions</p>
+ <?php
+ }
+
+ function GeneratePassword($length)
+ {
+ srand(date("s"));
+ $possible_charactors = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ $string = "";
+ while(strlen($string)<$length) {
+ $string .= substr($possible_charactors, rand()%(strlen($possible_charactors)),1);
+ }
+ return($string);
+ }
+
+ function EditAdmin($user_id)
+ {
+ global $db;
+ $maxLevel = $_SESSION['level'];
+
+ if(isset($_POST['processed']))
+ {
+ $username = addslashes($_POST['username']);
+ $level = addslashes($_POST['level']);
+
+ $all = $_POST['all'];
+ $squadleader = $_POST['squadleader'];
+ $adjutant = $_POST['adjutant'];
+ $quartermaster = $_POST['quartermaster'];
+
+ if(empty($username))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ $db->Query("UPDATE `bayonet_users` SET `username` = '$username', `level` = '$level', `all` = '$all', `squadleader` = '$squadleader', `adjutant` = '$adjutant', `quartermaster` = '$quartermaster' WHERE `user_id` = '$user_id' LIMIT 1");
+
+ echo "Admin, '$username' level '$level' has been edited.\n <br /><br />
+ Please wait while you are redirected. <br /><br />
+ <a href=\"?op=admins\">Click here if you don't feel like waiting.</a>";
+
+ // 3 second redirect to go back to the edit page
+ PageRedirect(2, "?op=admins&edit={$user_id}");
+ return;
+ }
+
+ $result = $db->Query("SELECT * FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1");
+ $admin = $db->FetchRow($result);
+
+ if($maxLevel < $admin['level']){
+ ReportError("You do not have permission to access this user.");
+ return;
+ }
+?>
+<center>
+ Edit the attributes of this administrator.<br />
+ <form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
+ <table>
+ <tr><th>Username:</th><td><input type="text" value="<?php echo $admin['username']; ?>" name="username" /></td></tr>
+ <tr>
+ <th>Level:</th>
+ <td>
+ <select name="level">
+ <?php
+ for($x=$maxLevel; $x>0;$x--){
+ if($admin['level'] == $x)
+ echo "<option value=\"{$x}\" selected>{$x}</option>";
+ else
+ echo "<option value=\"{$x}\">{$x}</option>";
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" style="text-align:center;">
+ <input type="submit" name="processed" value="Submit" />
+ <a href="?op=admins&delete=<?php echo $user_id; ?>"><input type="button" value="Delete Admin" /></a>
+ </td>
+ </tr>
+ </table>
+ <br />
+ <?php GetPermissions($admin); ?>
+ </form>
+</center>
+<?php
+ }
+
+ function DeleteAdmin($user_id)
+ {
+ global $db;
+ $maxLevel = $_SESSION['level'];
+
+ $result = $db->Query("SELECT `username` FROM `bayonet_users` WHERE `user_id` = '$user_id'");
+ $admin = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Admin '{$admin['username']}', was deleted.";
+ $db->Query("DELETE FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1");
+ PageRedirect(3,"?op=admins");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of admin: '{$admin['username']}'";
+ PageRedirect(1,"?op=admins");
+ return;
+ }
+ ?>
+ <center>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you SURE you want to delete the administrative user: '<?php echo $admin['username']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ </center>
+ <?php
+ }
+ ?> \ No newline at end of file
diff --git a/admin/admins/index.php b/admin/admins/index.php
new file mode 100644
index 0000000..1223d3a
--- /dev/null
+++ b/admin/admins/index.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+?>
+ <div style="text-align:left;"><h2>- Edit Admins</h2></div>
+<?php
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'admins/functions.php';
+?>
+
+<table class="panel" width="100%" cellspacing="0">
+ <tr>
+ <td class="panel-none">
+ <table align="center" width="200px">
+ <tr><th><?php echo LinkInternal('<img src="images/add.png" />Add New Admin','?op=admins&create=true'); ?></th></tr>
+ </table>
+ <?php ListAdmins(); ?>
+ </td>
+ <td class="panel-box">
+<?php
+if(isset($_GET['edit'])){
+ $user_id = $_GET['edit'];
+ EditAdmin($user_id);
+}
+else if(isset($_GET['delete'])){
+ $user_id = $_GET['delete'];
+ DeleteAdmin($user_id);
+}
+else if(isset($_GET['create'])){
+ NewAdmin();
+}
+?>
+ </td>
+ </tr>
+</table>
diff --git a/admin/announcements/functions.php b/admin/announcements/functions.php
new file mode 100644
index 0000000..f45a7e3
--- /dev/null
+++ b/admin/announcements/functions.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function EditAnnouncements()
+{
+ global $db;
+
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_announcements SET title = '$title', text = '$text' WHERE announcement_id = 0");
+ echo "Announcement, '$title', has been edited.\n <br /><br /> Please wait while you are redirected. <br /><br />
+ <a href=\"?op=announcements\">Click here if you don't feel like waiting.</a>";
+
+ // 3 second redirect to go back to the edit page
+ PageRedirect(2, "?op=announcements");
+
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+
+ //Grab the page from the database according to the $article_id passed to the function.
+ $result = $db->Query("SELECT title,text FROM bayonet_announcements WHERE announcement_id = 0");
+ $announcement = $db->FetchRow($result);
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
+ <table>
+ <tr><td>Announcement Title: <input type="text" name="title" value="<?php echo $announcement['title'] ?>" maxlength="50" size="30" /> </td></tr>
+ <tr><td> <textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $announcement['text'] ?></textarea> </td></tr>
+ <tr><td> <input type="submit" name="processed" value="Submit Changes" /> </td></tr>
+ </table>
+ </form>
+ <?php
+}
+?> \ No newline at end of file
diff --git a/admin/announcements/index.php b/admin/announcements/index.php
new file mode 100644
index 0000000..6b0874e
--- /dev/null
+++ b/admin/announcements/index.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Edit Announcements</h2></div>
+
+ <?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'announcements/functions.php';
+?>
+<table class="panel" width="100%">
+ <tr><td><?php EditAnnouncements(); ?></td></tr>
+</table> \ No newline at end of file
diff --git a/admin/blocks/functions.php b/admin/blocks/functions.php
new file mode 100644
index 0000000..84c20b5
--- /dev/null
+++ b/admin/blocks/functions.php
@@ -0,0 +1,198 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+function ListBlocks()
+{
+ global $db;
+ $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY `position`, `active` DESC, `weight` ASC");
+ $blocks = $db->Fetch($result);
+
+
+ echo "<table style=\"text-align:left;\" width=\"75%\">
+ <tr><th colspan=\"6\" style=\"text-align:center;\">Existing Blocks</th></tr>";
+ echo "<tr><th>Weight</th><th>Position</th><th>Name</th><th>Active</th><th></th><th></th></tr>";
+ foreach($blocks as $block)
+ {
+ echo "<tr><td>{$block['weight']}</td><td>";
+ if($block['position'])
+ echo "Right";
+ else
+ echo "Left";
+ echo "</td><td>{$block['title']}</td><td>{$block['active']}</td><td><a href=\"?load=admin&op=blocks&edit={$block['block_id']}\">Edit</a></td><td><a href=\"?load=admin&op=blocks&delete={$block['block_id']}\">Delete</a></td></tr>";
+ }
+ echo "</table>";
+}
+
+function NewBlock()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+ $title = addslashes($_POST['title']);
+
+ if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ //Update the database with the new data.
+ $db->Query("INSERT INTO `bayonet_blocks` SET `weight` = '$weight', `dir_name` = '$dir_name', `title` = '$title', `position` = '$position', `active` = '$active'");
+ //die, because we have completed what we wanted to do.
+ echo "New block, '$dir_name', at position '$weight' added.\n";
+ return;
+ }
+
+ ?>
+ You are currently adding a new block<br /><br />
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $block['title'] ?>" /></td></tr>
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>" /></td></tr>
+ <tr><th>Position</th><td><?php GetPosition(); ?></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>" /></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /><?php echo LinkInternal('<input type="button" value="Cancel" />', "?op=blocks"); ?></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function GetActive($block_id, &$active)
+{
+ $options = array(1 => 'Yes',0 => 'No');
+ foreach($options as $option => $value)
+ {
+ $selected = NULL;
+ if($active == $option)
+ {
+ $selected = "selected";
+ }
+ echo "<option " . $selected . " value=\"". $option ."\">" . $value . "</option>\n";
+ }
+
+
+}
+
+function EditBlock($block_id)
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = (int) addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = (int) addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+ $title = addslashes($_POST['title']);
+
+ if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_blocks SET title = '$title', weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'");
+ //$isActive = $active ? "IS" : "IS NOT";
+ echo "Block, '$dir_name', at position '$weight'(order) has been edited.\n";
+ PageRedirect(3, "?op=blocks");
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ //Grab the page from the database according to the $page_id passed to the function.
+ $result = $db->Query("SELECT weight,dir_name,position,active,title FROM bayonet_blocks WHERE block_id = '$block_id'");
+ $block = $db->FetchRow($result);
+
+ ?>
+ You are currently editing the '<?php echo $block['title']; ?>' block<br /><br />
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $block['title'] ?>" /></td></tr>
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>" /></td></tr>
+ <tr><th>Position</th><td><?php GetPosition($block['position']); ?></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>" /></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <?php GetActive($block_id, $block['active']) ?>
+ </select>
+ </td>
+
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /><?php echo LinkInternal('<input type="button" value="Cancel" />', "?op=blocks"); ?></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function DeleteBlock($block_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT dir_name FROM bayonet_blocks WHERE block_id = '$block_id'");
+ $block = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Block '{$block['dir_name']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_blocks WHERE block_id = '$block_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$block['dir_name']}'";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table align="center">
+ <th>Are you SURE you want to delete the block titled: '<?php echo $block['dir_name']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+/**
+ * GetPosition($value)
+ * -prints a drop down menu for positions defaulting the right pos.
+ */
+function GetPosition($value = 0){
+
+ echo "<select name=\"position\">";
+ if(!$value){
+ echo "<option value=\"0\" selected>Left</option>";
+ echo "<option value=\"1\">Right</option>";
+ }else{
+ echo "<option value=\"0\">Left</option>";
+ echo "<option value=\"1\" selected>Right</option>";
+ }
+ echo "</select>";
+}
+
+?> \ No newline at end of file
diff --git a/admin/blocks/index.php b/admin/blocks/index.php
new file mode 100644
index 0000000..fb10441
--- /dev/null
+++ b/admin/blocks/index.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+ <div style="text-align:left;"><h2>- Manage Blocks</h2></div>
+ <table class="panel" width="100%">
+ <tr><td class="panel"><center>
+ <?php
+
+/**
+ * This file administers the site blocks.
+ *
+ * -weight
+ * -directory name
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'blocks/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $block_id = $_GET['edit'];
+ EditBlock($block_id);
+}
+else if(isset($_GET['delete']))
+{
+ $block_id = $_GET['delete'];
+ DeleteBlock($block_id);
+}
+else if(isset($_GET['create']))
+{
+ NewBlock();
+}
+else{
+ echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('<img src="images/add.png" />Create a Block','?op=blocks&create=true')."</th></tr></table>";
+
+ ListBlocks();
+}
+?>
+</center></td></tr>
+</table> \ No newline at end of file
diff --git a/admin/calendar/functions.php b/admin/calendar/functions.php
new file mode 100644
index 0000000..76922cc
--- /dev/null
+++ b/admin/calendar/functions.php
@@ -0,0 +1,446 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+ /**
+ * SelectDate($date)
+ * Function for outputing an html form for selecting a month day and year
+ * @param date - formatted date string yyyy-mm-dd (optional)
+ */
+ function SelectDate($date = NULL){
+
+ //function for adding to the db in sql 'datetime' format
+ //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009));
+ //$date = "2009-11-2";
+ //echo $date."<br />";
+ //function for parsing our date format into an array
+ //echo "<pre>";
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+ //print_r($date_arr);
+ //echo "</pre>";
+ //echo $date_arr['year']." ".$date_arr['month']." ".$date_arr['day']."<br />";;
+
+ //List Months
+ echo '<select name="month">';
+ for($m = 1;$m <= 12; $m++){
+ $month = date("F", mktime(0, 0, 0, $m));
+ if($date_arr['month'] == $m)
+ echo "<option value='$m' selected=\"selected\">$month</option>";
+ else
+ echo "<option value='$m'>$month</option>";
+ }
+ echo "</select>";
+
+ //List Days
+ echo '<select name="day">';
+ for($d = 1;$d <= 31; $d++){
+ if($date_arr['day'] == $d)
+ echo "<option value='$d' selected=\"selected\">$d</option>";
+ else
+ echo "<option value='$d'>$d</option>";
+ }
+ echo "</select>";
+
+ //List Years [CurYear, CurYear+5]
+ echo '<select name="year">';
+ $y = date('Y', time());
+ $max = $y+5;
+ for(;$y<$max; $y++){
+ if($date_arr['year'] == $y)
+ echo "<option value='$y' selected=\"selected\">$y</option>";
+ else
+ echo "<option value='$y'>$y</option>";
+ }
+ echo "</select>";
+
+ }
+
+ function ListEvents($date){
+
+ global $db;
+
+?>
+ <table width="100%"><tr><td>
+ <h3>Events for: <?php echo date_format(date_create($date),'F jS, Y'); ?></h3>
+ </td><td align="right">
+ <a href="?op=calendar&create=true&date=<?php echo $date; ?>"><img src="images/add.png" /> Add New Event</a>
+ </td></tr></table>
+<?php
+
+ echo "<table width=\"100%\">";
+
+ $result = $db->Query("SELECT * FROM bayonet_events WHERE `date` = '$date' ORDER BY `time`");
+ $row = $db->Fetch($result);
+ foreach($row as $event)
+ {
+ $tmp = true;
+
+ $datetime = date_create($date.' '.$event['time']);
+ $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm
+?>
+
+<tr>
+ <td><strong><?php echo $time." - ".$event['title']; ?></strong></td>
+ <td><span style="border:1px solid black;background-color:<?php echo $event['color'];?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td>
+ <a href="?op=calendar&month=<?php echo $_GET['month']; ?>&year=<?php echo $_GET['year']; ?>&edit=<?php echo $event['event_id'];?>">Edit</a>
+ &nbsp;|&nbsp;
+ <a href="?op=calendar&delete=<?php echo $event['event_id']; ?>">Delete</a>
+ </td>
+</tr>
+<tr>
+ <td><?php echo bbcode_format($event['text']); ?><br /><br /></td>
+</tr>
+
+<tr>
+ <td colspan="2" style="border-top:1px solid black;"><br /></td>
+</tr>
+<?php
+ }
+ if(!isset($tmp))
+ echo "<tr><td>There are no events posted for this day.</td></tr>";
+
+ echo "</table>";
+
+ }
+
+ function EditEvent($event_id){
+
+ //function for adding to the db in sql 'datetime' format
+ //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009));
+ /*
+ echo $date."<br />";
+
+ //function for parsing our date format into an array
+ echo "<pre>";
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+ print_r($date_arr);
+ echo "</pre>";
+
+ echo $date_arr['year']; */
+
+ global $db;
+
+ if(isset($_POST['processed'])){
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ $year = addslashes($_POST['year']);
+ $month = addslashes($_POST['month']);
+ $day = addslashes($_POST['day']);
+ $time = addslashes($_POST['time']);
+ $color = addslashes($_POST['color']);
+
+ $date = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
+
+$db->Query("UPDATE `bayonet_events` SET `title` = '$title', `text` = '$text', `color` = '$color', `date` = '$date', `time` = '$time' WHERE `event_id` ='$event_id' LIMIT 1");
+
+ }
+
+ $result = $db->Query("SELECT * FROM `bayonet_events` WHERE `event_id` = $event_id LIMIT 1");
+ $event = $db->FetchRow($result);
+ ?>
+ <h3>Edit Event</h3>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $event['title']; ?>" /></td></tr>
+ <tr><th>Color</th><td><input type="text" name="color" value="<?php echo $event['color']; ?>" /></td></tr>
+ <tr><th>Date</th><td><?php SelectDate($event['date']); ?></td></tr>
+ <tr><th>Time</th><td><input type="text" name="time" value="<?php echo substr($event['time'],0,-3); ?>" maxlength="5" size="5" /></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $event['text']; ?></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+ }
+
+ function NewEvent(){
+
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ $year = addslashes($_POST['year']);
+ $month = addslashes($_POST['month']);
+ $day = addslashes($_POST['day']);
+ $time = addslashes($_POST['time']);
+ $color = addslashes($_POST['color']);
+
+ $date = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
+
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ $sent = false;
+
+ //Update the database with the new data.
+ if(!$sent){
+ $sent = true;
+ $db->Query("INSERT INTO `bayonet_events` (`event_id` ,`date` ,`time` ,`title` ,`text` ,`color`)VALUES (NULL , '$date', '$time', '$title', '$text', '$color')");
+
+ //echo '<script>location.href="?op=calendar&list='.$date.'";</script>';
+ }
+
+
+ echo "New event, '$title', has been added.\n";
+ PageRedirect(2,"?op=calendar");
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ ?>
+ <h3>Add New Event</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Title</th><td><input type="text" name="title" value="" /></td></tr>
+ <tr><th>Color</th><td><input type="text" name="color" value="" /></td></tr>
+ <tr><th>Date</th><td><?php SelectDate($_GET['date']); ?></td></tr>
+ <tr><th>Time</th><td><input type="text" name="time" value="12:00" maxlength="5" size="5" /></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+ }
+
+ function DeleteEvent($event_id = 0){
+
+ global $db;
+
+ $result = $db->Query("SELECT title FROM bayonet_events WHERE event_id = '$event_id'");
+ $event = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Event '{$event['title']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_events WHERE event_id = '$event_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of event: '{$event['title']}'";
+ return;
+ }
+ if($event_id <= 0 || !is_numeric($event_id)) {
+ echo "Invalid request to delete this event.";
+ return;
+ }
+ ?>
+
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you SURE you want to delete the event titled: '<?php echo $event['title']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+ }
+
+ /**
+ * PrintCalendar() - prints the calendar with events
+ */
+ function PrintCalendar(){
+
+ $date = time();
+ date_default_timezone_set("America/New_York"); //EASTERN TIME ZONE
+
+ //GET values for month and year
+ $month = $_GET['month'];
+ $year = $_GET['year'];
+
+ $useCurDate = true;
+
+ //check to makes sure month and year are in the desired ranges
+ if(!empty($month) && !empty($year) && $month > 0 && $month < 13 && $year > 1990){
+ $useCurDate = false;
+ }
+ //check to see if the get variables are for todays month
+ if($month == date('n', $date) && $year == date('Y', $date)){
+ $useCurDate = true;
+ }
+
+ //use current date unless GET values are set
+ if($useCurDate)
+ {
+ $day = date('d', $date);
+ $today = date('j', $date);
+ $month = date('m', $date);
+ $monthNum = date('n', $date);
+ $year = date('Y', $date);
+ }
+ else
+ {
+ $monthNum = $month;
+ //if GET values are equal to curdate, set $today
+ if($year == date('Y', $date) && $monthNum == date('n', $date))
+ $today = date('j', $date);
+ else
+ $today = 0;
+ }
+
+ /* Accounts for the last couple days from the previous months */
+ $first_day = mktime(0,0,0,$monthNum, 1, $year);
+
+ $title = date('F', $first_day);
+
+ $day_of_week = date('D', $first_day);
+
+ switch($day_of_week){
+ case "Sun": $blank = 0; break;
+ case "Mon": $blank = 1; break;
+ case "Tue": $blank = 2; break;
+ case "Wed": $blank = 3; break;
+ case "Thu": $blank = 4; break;
+ case "Fri": $blank = 5; break;
+ case "Sat": $blank = 6; break;
+ }
+
+ /* calculates the days in the current month */
+ $days_in_month = cal_days_in_month(0, $monthNum, $year);
+
+ //makes sure that previous year is not year 0
+ if($monthNum == 1){
+ $previous_month = 12;
+ $previous_year = $year-1;
+ }else{
+ $previous_month = $monthNum-1;
+ $previous_year = $year;
+ }
+ //makes sure the next year is not year 13
+ if($monthNum == 12){
+ $next_month = 1;
+ $next_year = $year+1;
+ }else{
+ $next_month = $monthNum+1;
+ $next_year = $year;
+ }
+ ?>
+ <center>
+ <table class="calendar" style="background-color:white;" cellspacing="1" cellpadding="0">
+ <tr style="background-color:#999999; height:27px;">
+ <td colspan="50" style="vertical-align:middle; text-align:center;">
+ <a href="?op=calendar&month=<?php echo $previous_month.'&year='.$previous_year; ?>"><<</a>
+ <!-- Month Name and Year -->
+ &nbsp;&nbsp;<span class="monthTitle"><?php echo strtoupper($title).' '.$year; ?></span>&nbsp;&nbsp;
+ <a href="?op=calendar&month=<?php echo $next_month.'&year='.$next_year; ?>">>></a>
+ </td>
+ </tr>
+
+ <tr>
+ <th class="weekday">Sun</th><th class="weekday">Mon</th><th class="weekday">Tue</th><th class="weekday">Wed</th>
+ <th class="weekday">Thu</th><th class="weekday">Fri</th><th class="weekday">Sat</th>
+ </tr>
+
+ <tr>
+ <?php
+
+ $day_count = 1; //holds the current day of the week 1-7
+ $day_num = 1; //holds the current day of the month 1-31
+
+ $days_monthbefore = cal_days_in_month(0, $previous_month, $year);
+ //prints the numbers of days for the previous month
+ while($blank > 0){
+ $blank = $blank-1;
+ $days_before = $days_monthbefore-$blank;
+ echo '<td class="cal_notmonth">'.$days_before.'</td>'; //'.$days_before.'</td>';
+ $day_count++;
+ }
+
+$events = GetEventsOnInterval("{$year}-{$monthNum}-01","{$year}-{$monthNum}-{$days_in_month}");
+
+ //loop printing each day of the CURRENT month ONLY
+ while($day_num <= $days_in_month){
+
+ if($day_count==1 || $day_count==7){
+ echo '<td class="cal_weekend">'; //weekends
+ }else{
+ echo '<td class="cal_weekday">'; //weekdays
+ }
+
+ $sqlDate = date("Y-m-d", mktime(0, 0, 0, $monthNum, $day_num, $year));
+
+ //checks to see if the current day has events
+ $isEvent=false;
+ foreach($events as $event){
+ if($event['date'] == $sqlDate){
+ $isEvent = true;
+ }
+
+ }
+
+ if($useCurDate)
+ echo "<a href=\"?op=calendar&list={$year}-{$monthNum}-{$day_num}\">";
+ else
+ echo "<a href=\"?op=calendar&month={$monthNum}&year={$year}&list={$year}-{$monthNum}-{$day_num}\">";
+
+ if($day_num == $today && $isEvent==true){
+ echo '<div class="eventtoday">'.$day_num.'</div>';
+ }else if($day_num == $today && $isEvent==false){
+ echo '<div class="monthtoday">'.$day_num.'</div>';
+ }else if($day_num != $today && $isEvent==true){
+ echo '<div class="event" id="event'.$day_num.'" onmouseover="highlightEvent(this.id)" onmouseout="normEvent(this.id)">';
+ echo $day_num;
+ echo '</div>';
+ }else{
+ echo $day_num;
+ }
+ echo "</a>";
+
+ echo '</td>';
+
+ $day_num++;
+ $day_count++;
+
+ if($day_count > 7){
+ echo '</tr><tr>';
+ $day_count = 1;
+ }
+ }
+
+ $days_after = 1;
+ //loop for printing the days for the next month
+ while($day_count > 1 && $day_count <=7){
+ echo '<td class="cal_notmonth">'.$days_after.'</td>'; //'.$days_after.'</td>';
+ $days_after++;
+ $day_count++;
+ }
+
+ ?>
+
+ </tr>
+ </table>
+ </center>
+<?php
+
+ }
+
+function GetEventsOnInterval($start,$end){
+ global $db;
+ $result = $db->Query("SELECT `event_id`, `title`, `color`, `date`, `time` FROM `bayonet_events` WHERE `date` BETWEEN '$start' AND '$end' ORDER BY `time` ASC");
+ $events = $db->Fetch($result);
+ return $events;
+}
+ ?> \ No newline at end of file
diff --git a/admin/calendar/index.php b/admin/calendar/index.php
new file mode 100644
index 0000000..2b631d8
--- /dev/null
+++ b/admin/calendar/index.php
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+ <link rel="stylesheet" type="text/css" href="calendar/style.css" media="screen"/>
+ <div style="text-align:left;"><h2>- Manage Calendar & Events</h2></div>
+<?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'calendar/functions.php';
+
+
+?>
+
+<!--
+<hr />
+ <table width="100%" style="text-align:center;">
+ <tr>
+ <td>
+ <?php echo LinkInternal('Add Events','?op=calendar&create=true'); ?>
+ </td>
+ <td>
+ <?php echo LinkInternal('Edit Events','?op=calendar&edit='); ?>
+ </td>
+ <td>
+ <?php echo LinkInternal('Delete Events','?op=calendar&delete='); ?>
+ </td>
+ </tr>
+ </table> -->
+
+ <table class="panel" width="100%">
+ <tr>
+ <td style="width:325px; vertical-align:top; text-align:center;">
+ <a href="?op=calendar&create=true"><img src="images/add.png" /> Add New Event</a><br /><br />
+ <?php PrintCalendar(); ?>
+ Click on a day to add/edit/delete events
+ </td>
+ <td class="panel-box">
+ <?php
+ if(isset($_GET['list']))
+ {
+ $eventDate = $_GET['list'];
+ ListEvents($eventDate);
+ //return;
+ }
+ else if(isset($_GET['edit']))
+ {
+ $event_id = $_GET['edit'];
+ EditEvent($event_id);
+ //return;
+ }
+ else if(isset($_GET['delete']))
+ {
+ $event_id = $_GET['delete'];
+ DeleteEvent($event_id);
+ //return;
+ }
+ else if(isset($_GET['create']))
+ {
+ $create = $_GET['create'];
+ if($create)
+ {
+ NewEvent();
+ //return;
+ }
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
+
diff --git a/admin/functions.php b/admin/functions.php
new file mode 100644
index 0000000..9b950c4
--- /dev/null
+++ b/admin/functions.php
@@ -0,0 +1,563 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * bbcode_format()
+ *
+ * Modified public domain code from www.phpit.net
+ *
+ * @param mixed $str
+ * @return
+ */
+function bbcode_format ($str)
+{
+ $str = htmlentities($str);
+ $str = strip_tags($str);
+ $str = wordwrap($str,100,"\n",true);
+
+ $simple_search = array(
+ '/\[b\](.*?)\[\/b\]/is',
+ '/\[i\](.*?)\[\/i\]/is',
+ '/\[u\](.*?)\[\/u\]/is',
+ '/\[hr\]/is',
+ '/\[pi\](.*?)\[\/pi\]/is',
+ '/\[center\](.*?)\[\/center\]/is',
+ '/\[title\](.*?)\[\/title\]/is',
+ '/\[article\](.*?)\[\/article\]/is',
+ '/\[section\](.*?)\[\/section\]/is',
+ '/\[code\](.*?)\[\/code\]/is',
+ '/\[quote\](.*?)\[\/quote\]/is',
+ '/\[quote\=(.*?)\](.*?)\[\/quote\]/is',
+ '/\[url\=(.*?)\](.*?)\[\/url\]/is',
+ '/\[align\=(.*?)\](.*?)\[\/align\]/is',
+ '/\[size\=(.*?)\](.*?)\[\/size\]/is',
+ '/\[img\=(.*?)\](.*?)\[\/img\]/is'
+ );
+
+ $simple_replace = array(
+ '<strong>$1</strong>',
+ '<em>$1</em>',
+ '<u>$1</u>',
+ '<hr>',
+ '<p style="text-indent:3em;">$1</p>',
+ '<center>$1</center>',
+ '<h2>$1</h2>',
+ '<h3>$1</h3>',
+ '<h4>$1</h4>',
+ '<blockquote><pre>$1</pre></blockquote>',
+ '<blockquote>$1</blockquote>',
+ '<i>$1 wrote:</i><br/><blockquote>$2</blockquote>',
+ '<a href="$1">$2</a>',
+ '<align="$1">$2</align>',
+ '<font style="font-size:$1px;">$2</font>',
+ '<img src="$1" alt="$2"/>'
+ );
+
+ $order = array("\r\n", "\n", "\r");
+ $replace = "\n<br/>";
+
+ $str = preg_replace ($simple_search, $simple_replace, $str);
+ $str = str_ireplace($order,$replace,$str);
+ return $str;
+}
+
+ //BBcode 2 HTML was written by WAY2WEB.net
+
+ function BBCode($Text)
+ {
+ // Replace any html brackets with HTML Entities to prevent executing HTML or script
+ // Don't use strip_tags here because it breaks [url] search by replacing & with amp
+ $Text = str_replace("<", "&lt;", $Text);
+ $Text = str_replace(">", "&gt;", $Text);
+
+ // Convert new line chars to html <br /> tags
+ $Text = nl2br($Text);
+
+ // Set up the parameters for a URL search string
+ $URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'";
+ // Set up the parameters for a MAIL search string
+ $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@";
+
+ // Perform URL Search
+ $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" target="_blank">$1</a>', $Text);
+ $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+ //$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+
+ // Perform MAIL Search
+ $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text);
+ $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);
+
+ // Check for bold text
+ $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<span class="bold">$1</span>',$Text);
+
+ // Check for Italics text
+ $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<span class="italics">$1</span>',$Text);
+
+ // Check for Underline text
+ $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'<span class="underline">$1</span>',$Text);
+
+ // Check for strike-through text
+ $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'<span class="strikethrough">$1</span>',$Text);
+
+ // Check for over-line text
+ $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
+
+ // Check for colored text
+ $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text);
+
+ // Check for sized text
+ $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text);
+
+ // Check for list text
+ $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '<ul class="listlowerroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text);
+ $Text = str_replace("[*]", "<li>", $Text);
+
+ // Check for font change text
+ $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text);
+
+ // Declare the format for [code] layout
+ $CodeLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [code] text
+ $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text);
+ // Declare the format for [php] layout
+ $phpLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [php] text
+ $Text = preg_replace("/\[php\](.+?)\[\/php\]/is",$phpLayout, $Text);
+
+ // Declare the format for [quote] layout
+ $QuoteLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Quote:</td>
+ </tr>
+ <tr>
+ <td class="quotebody">$1</td>
+ </tr>
+ </table>';
+
+ // Check for [quote] text
+ $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text);
+
+ // Images
+ // [img]pathtoimage[/img]
+ $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1">', $Text);
+
+ //[img=align]image source[/img]
+ $Text = preg_replace("(\[img align\=(.+?)\](.+?)\[\/img\])is","<img src=\"$2\" align=\"$1\" />",$Text);
+
+ // [img=widthxheight]image source[/img]
+ $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1">', $Text);
+
+ // Alignment
+ // [align=type]text[/align]
+ $Text = preg_replace("(\[align=(.+?)\](.+?)\[\/align\])is","<div style=\"text-align: $1\">$2</div>",$Text);
+
+ return $Text;
+ }
+
+function articleHeading($text){
+
+ // Set the content-type
+ header('Content-type: image/png');
+
+ //$text = $_GET['text'];
+
+ $im = imagecreatefrompng('images/news_header.png'); // open image
+ imagealphablending($im, true); // setting alpha blending on
+ imagesavealpha($im, true); // save alphablending setting (important)
+
+ // Create some colors
+ $black = imagecolorallocate($im, 0, 0, 0);
+
+
+ // Replace path by your own font path
+ //$font = 'TrajanPro-Regular.otf';
+ //$font = 'TrajanPro-Bold.otf';
+ $font = 'BrushScriptStd.otf';
+ //$font = 'TRATS__.TTF';
+ //$text = strtoupper($text);
+
+ // Add the text
+ imagettftext($im, 18, 0, 0, 17, $black, $font, $text);
+
+ // Using imagepng() results in clearer text compared with imagejpeg()
+ imagepng($im);
+ imagedestroy($im);
+}
+
+function LinkList($array)
+{
+ if(!is_array($array))
+ {
+ ReportError("List was not an array");
+ return;
+ }
+
+ echo "<ul class=\"block\">";
+ foreach($array as $text => $link)
+ {
+ echo "<li><a href=\"$link\">$text</a></li>";
+ }
+ echo "</ul>";
+}
+
+/**
+ * LinkModule()
+ *
+ * Helper function to link to Bayonet modules.
+ *
+ * @param mixed $module_name
+ * @param mixed $link_name
+ * @return
+ */
+function LinkModule($module_name,$args = NULL,$link_name)
+{
+ return "<a href=\"?load={$module_name}{$args}\">{$link_name}</a>";
+}
+
+/**
+ * LinkPage()
+ *
+ * Helper function to link to Bayonet pages.
+ *
+ * @param mixed $page_id
+ * @param mixed $page_name
+ * @return
+ */
+function LinkPage($page_id,$page_name)
+{
+ return "<a href=\"?load=page&amp;id={$page_id}\">{$page_name}</a>";
+}
+
+/**
+ * LinkInternal()
+ *
+ * Helper function to link to a relative Bayonet path.
+ *
+ * @param mixed $name
+ * @param string $rel_path
+ * @param string $file
+ * @return
+ */
+function LinkInternal($name,$file,$rel_path = "./")
+{
+ return "<a href=\"{$rel_path}{$file}\">{$name}</a>";
+}
+
+if(!defined("CALLED_FROM_ADMIN"))
+{
+ /**
+ * OpenTable()
+ *
+ * Begins a Bayonet site table.
+ *
+ * @return
+ */
+ function OpenTable($width = "100%")
+ {
+ //width="100%" is important. Otherwise all of our tables will be text width.
+ echo "<table width=\"{$width}\" align=\"center\" class=\"cleartable\">\n";
+ }
+
+ /**
+ * CloseTable()
+ *
+ * Closes a Bayonet site table.
+ *
+ * @return
+ */
+ function CloseTable()
+ {
+ echo "</table>";
+ }
+}
+
+function OpenBlock($title = 'New Block')
+{
+ OpenTable();
+ echo "<div class=\"contentHeading\">{$title}</div>";
+ echo "<div class=\"content\">";
+}
+
+function CloseBlock()
+{
+ echo "</div>";
+ CloseTable();
+}
+/**
+ * ReportError()
+ *
+ * This function should be called in the event that an error has occured.
+ *
+ * @param mixed $message - automatically logged
+ * @return
+ */
+function ReportError($message)
+{
+ //WriteLog($message,BAYONET_LOG_ERROR);
+ OpenTable();
+ echo "<tr><th>Error Message</th></tr><tr><td style=\"text-align:center;\">{$message}</td></tr>";
+ CloseTable();
+}
+
+/**
+ * ReportHack()
+ *
+ * This function should be called in the event that we are confirming
+ * a hacking attempt.
+ *
+ * @param mixed $message - automatically logged
+ * @return void
+ */
+function ReportHack($message)
+{
+ //WriteLog($message,BAYONET_LOG_HACK);
+ OpenTable();
+ echo "<tr><th>Hack Attempt</th></tr><tr><td style=\"text-align:center;\">{$message}</td></tr>";
+ CloseTable();
+}
+
+
+/**
+ * array_dump()
+ *
+ * Useful against $_POST and $_GET variables, for dumping data to
+ * a log file, or to stdout. The return value is a single string,
+ * with each array key => value pair delimited by a character.
+ * The default character is a pipe -> '|'. It is assumed that if
+ * wanted to have a newline character inserted, just replace $spacer
+ * with '\n'.
+ *
+ * @param mixed $array
+ * @param string $spacer
+ * @return
+ */
+function array_dump($array, $spacer = '|')
+{
+ $retval = NULL;
+ foreach($array as $challenge => $answer)
+ {
+ $retval .= " $challenge => $answer " . $spacer;
+ }
+
+ return $retval;
+}
+
+/**
+ * WriteLog()
+ *
+ * This function can be accessed directly, however, anything that is
+ * passed to ReportError() or ReportHack(), or decho() will be logged in their
+ * appropriate log file.
+ *
+ * Change made: added checks to see if the log files exist before opening
+ *
+ * @param mixed $message
+ * @param mixed $flag
+ * @return
+ */
+define('BAYONET_LOG_HACK','bayonet_log_hack');
+define('BAYONET_LOG_ERROR','bayonet_log_error');
+define('BAYONET_LOG_WARN','bayonet_log_warn');
+define('BAYONET_LOG_INFO','bayonet_log_info');
+
+function WriteLog($message,$flag)
+{
+ global $config;
+ $enabled = $config['logs']['enabled'];
+
+ if(!$enabled)
+ {
+ return false;
+ }
+
+ $dir = $config['logs']['dir'];
+ date_default_timezone_set($config['logs']['timezone']);
+ $varstr = array_dump($_GET);
+ $type = NULL;
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $hostname = gethostbyaddr($ip);
+ $executed = $_SERVER['PHP_SELF'];
+ $timestamp = date('Y-M-d H:i:s T');
+
+
+ $message = str_replace("\n",'',$message);
+ $message = str_replace("<br>",'',$message);
+
+ switch($flag)
+ {
+ case BAYONET_LOG_HACK:
+ if(!file_exists($dir.'hacks.log')){
+ break;
+ }
+ $fp = fopen($dir.'hacks.log','a');
+ $type = 'HACK';
+ $full_message = "TIMESTAMP: {$timestamp}\n\t\tIP: {$ip}\n\t\tHOSTNAME: {$hostname}\n\t\tACTION: {$type} of {$executed}\n\t\tDEFERRAL: {$message}\n\t\tVAR: ({$varstr})\n\n";
+ break;
+ case BAYONET_LOG_ERROR:
+ if(!file_exists($dir.'error.log')){
+ break;
+ }
+ $fp = fopen($dir.'error.log','a');
+ $type = 'ERROR';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_WARN:
+ if(!file_exists($dir.'warn.log')){
+ break;
+ }
+ $fp = fopen($dir.'warn.log','a');
+ $type = 'WARN';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_INFO:
+ if(!file_exists($dir.'info.log')){
+ break;
+ }
+ $fp = fopen($dir.'info.log','a');
+ $type = 'INFO';
+ $full_message = "({$timestamp}) - {$type} - {$message}\n";
+ break;
+ default:
+ echo 'To log something, you need to define a log to write to.<br>';
+ return;
+ }
+ if(file_exists($fp)){
+ fwrite($fp,$full_message);
+ fclose($fp);
+ }else{
+ //echo "could not write to file because file does not exist.<br />";
+ }
+}
+
+/**
+ * UnderConstruction()
+ *
+ * Displays a site-wide message across the page header.
+ *
+ * @param mixed $message
+ * @param mixed $flag Acceptable flags are BAYONET_SITE, and BAYONET_SECTION
+ * @return
+ */
+define('BAYONET_SITE','bayonet_site');
+define('BAYONET_SECTION','bayonet_section');
+function UnderConstruction($message = NULL, $flag = BAYONET_SITE)
+{
+ $timestamp = date("Y-M-d h:m:s");
+ OpenTable();
+ switch($flag)
+ {
+ case BAYONET_SITE:
+ echo "<tr><th>Site is currently under construction : $timestamp</th></tr>";
+ break;
+ case BAYONET_SECTION:
+ echo "<tr><th>Section currently under construction : $timestamp</th></tr>";
+ }
+
+ if(!is_null($message))
+ {
+ echo "<tr><td><i>$message</i></td></tr>";
+ }
+
+ CloseTable();
+ echo "<br>";
+}
+
+/**
+ * GetBlocks()
+ *
+ * Includes all directories listed in blocks/ and uses the bayonet_blocks
+ * MySQL table to determine the order of the blocks displayed.
+ *
+ * @return
+ */
+
+define('BLOCK_LEFT',false);
+define('BLOCK_RIGHT',false);
+
+function GetBlocks($position = BLOCK_LEFT)
+{
+ global $config;
+ /**
+ * I had to reconnect to the database for some fucking reason at this point.
+ * I have no idea why, but I was recieving errors telling me that $db was no longer
+ * an object. This is/was bullshit.
+ */
+ $db = new Bayonet_SQL();
+ $db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+ $db->Select_db($config['sql']['database']);
+
+ $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position");
+ $blocks = $db->Fetch($result);
+
+ foreach($blocks as $block)
+ {
+ if($block['position'] == $position && $block['active'] == true)
+ {
+ $load = 'blocks/'.$block['dir_name'].'/index.php';
+ if(file_exists($load))
+ {
+ OpenBlock($block['title']);
+ include $load;
+ CloseBlock();
+ }
+ else
+ {
+ ReportError("Failed to load block, '{$block['dir_name']}'. Check block config.");
+ }
+ if($config['blocks']['spacer']) echo "<br />";
+ }
+ }
+}
+
+/**
+ * PageRedirect()
+ *
+ * performs an http redirect
+ *
+ * @param $delay
+ * @param $link
+ */
+function PageRedirect($delay, $link)
+{
+ echo "<meta http-equiv=\"Refresh\" content=\"{$delay};url={$link}\">";
+}
+?> \ No newline at end of file
diff --git a/admin/header.php b/admin/header.php
new file mode 100644
index 0000000..61c19fa
--- /dev/null
+++ b/admin/header.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ob_start();
+$starttime = explode(' ', microtime());
+$starttime = $starttime[1] + $starttime[0];
+?>
+
+<html>
+
+<head>
+<title>Bayonet CMS Admin Tools</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
+<link rel="stylesheet" type="text/css" href="../style_bbcode.css" media="screen"/>
+
+<!-- jQuery 1.3.2 -->
+<script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
+<!-- PASSWORD CHECK
+<script type="text/javascript" src="../functions.js"></script> -->
+
+<!-- markItUp! -->
+<script type="text/javascript" src="scripts/markitup/markitup/jquery.markitup.pack.js"></script>
+<!-- markItUp! toolbar settings -->
+<script type="text/javascript" src="scripts/markitup/markitup/sets/bbcode/set.js"></script>
+<!-- markItUp! skin -->
+<link rel="stylesheet" type="text/css" href="scripts/markitup/markitup/skins/markitup/style.css" />
+<!-- markItUp! toolbar skin -->
+<link rel="stylesheet" type="text/css" href="scripts/markitup/markitup/sets/bbcode/style.css" />
+<script type="text/javascript">
+<!--
+$(document).ready(function() {
+ // Add markItUp! to your textarea in one line
+ // $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
+ $('#markItUp').markItUp(mySettings);
+
+ // You can add content from anywhere in your page
+ // $.markItUp( { Settings } );
+ $('.add').click(function() {
+ $.markItUp( { openWith:'<opening tag>',
+ closeWith:'<\/closing tag>',
+ placeHolder:"New content"
+ }
+ );
+ return false;
+ });
+
+ // And you can add/remove markItUp! whenever you want
+ // $(textarea).markItUpRemove();
+ $('.toggle').click(function() {
+ if ($("#markItUp.markItUpEditor").length === 1) {
+ $("#markItUp").markItUpRemove();
+ $("span", this).text("get markItUp! back");
+ } else {
+ $('#markItUp').markItUp(mySettings);
+ $("span", this).text("remove markItUp!");
+ }
+ return false;
+ });
+});
+-->
+</script>
+</head>
+
+<body> \ No newline at end of file
diff --git a/admin/images/accepted.png b/admin/images/accepted.png
new file mode 100644
index 0000000..5cd0557
--- /dev/null
+++ b/admin/images/accepted.png
Binary files differ
diff --git a/admin/images/add.gif b/admin/images/add.gif
new file mode 100644
index 0000000..e665474
--- /dev/null
+++ b/admin/images/add.gif
Binary files differ
diff --git a/admin/images/add.png b/admin/images/add.png
new file mode 100644
index 0000000..249350d
--- /dev/null
+++ b/admin/images/add.png
Binary files differ
diff --git a/admin/images/addnewarticle.png b/admin/images/addnewarticle.png
new file mode 100644
index 0000000..0e29960
--- /dev/null
+++ b/admin/images/addnewarticle.png
Binary files differ
diff --git a/admin/images/addnewpage.png b/admin/images/addnewpage.png
new file mode 100644
index 0000000..c60c68c
--- /dev/null
+++ b/admin/images/addnewpage.png
Binary files differ
diff --git a/admin/images/adjutant.png b/admin/images/adjutant.png
new file mode 100644
index 0000000..e0dc701
--- /dev/null
+++ b/admin/images/adjutant.png
Binary files differ
diff --git a/admin/images/announcement.png b/admin/images/announcement.png
new file mode 100644
index 0000000..4521309
--- /dev/null
+++ b/admin/images/announcement.png
Binary files differ
diff --git a/admin/images/bayonet_logo.jpg b/admin/images/bayonet_logo.jpg
new file mode 100644
index 0000000..5127ad2
--- /dev/null
+++ b/admin/images/bayonet_logo.jpg
Binary files differ
diff --git a/admin/images/blocks.png b/admin/images/blocks.png
new file mode 100644
index 0000000..628eba2
--- /dev/null
+++ b/admin/images/blocks.png
Binary files differ
diff --git a/admin/images/box.png b/admin/images/box.png
new file mode 100644
index 0000000..4c4bf0f
--- /dev/null
+++ b/admin/images/box.png
Binary files differ
diff --git a/admin/images/box_download.png b/admin/images/box_download.png
new file mode 100644
index 0000000..d1bcb2f
--- /dev/null
+++ b/admin/images/box_download.png
Binary files differ
diff --git a/admin/images/box_upload.png b/admin/images/box_upload.png
new file mode 100644
index 0000000..8a453c2
--- /dev/null
+++ b/admin/images/box_upload.png
Binary files differ
diff --git a/admin/images/calendar.png b/admin/images/calendar.png
new file mode 100644
index 0000000..6e7de1c
--- /dev/null
+++ b/admin/images/calendar.png
Binary files differ
diff --git a/admin/images/cancel.png b/admin/images/cancel.png
new file mode 100644
index 0000000..c2c7c10
--- /dev/null
+++ b/admin/images/cancel.png
Binary files differ
diff --git a/admin/images/cmsadminlogo.png b/admin/images/cmsadminlogo.png
new file mode 100644
index 0000000..23ee961
--- /dev/null
+++ b/admin/images/cmsadminlogo.png
Binary files differ
diff --git a/admin/images/cmsadminlogo2.png b/admin/images/cmsadminlogo2.png
new file mode 100644
index 0000000..ad54960
--- /dev/null
+++ b/admin/images/cmsadminlogo2.png
Binary files differ
diff --git a/admin/images/delete.gif b/admin/images/delete.gif
new file mode 100644
index 0000000..2095ca8
--- /dev/null
+++ b/admin/images/delete.gif
Binary files differ
diff --git a/admin/images/editfiles.png b/admin/images/editfiles.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/admin/images/editfiles.png
Binary files differ
diff --git a/admin/images/editpage.png b/admin/images/editpage.png
new file mode 100644
index 0000000..42b2728
--- /dev/null
+++ b/admin/images/editpage.png
Binary files differ
diff --git a/admin/images/file_doc.png b/admin/images/file_doc.png
new file mode 100644
index 0000000..b1da1ef
--- /dev/null
+++ b/admin/images/file_doc.png
Binary files differ
diff --git a/admin/images/file_pdf.png b/admin/images/file_pdf.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/admin/images/file_pdf.png
Binary files differ
diff --git a/admin/images/file_rtf.png b/admin/images/file_rtf.png
new file mode 100644
index 0000000..39304c1
--- /dev/null
+++ b/admin/images/file_rtf.png
Binary files differ
diff --git a/admin/images/file_word.png b/admin/images/file_word.png
new file mode 100644
index 0000000..3011f00
--- /dev/null
+++ b/admin/images/file_word.png
Binary files differ
diff --git a/admin/images/image.png b/admin/images/image.png
new file mode 100644
index 0000000..865b923
--- /dev/null
+++ b/admin/images/image.png
Binary files differ
diff --git a/admin/images/modules.png b/admin/images/modules.png
new file mode 100644
index 0000000..fd9c45d
--- /dev/null
+++ b/admin/images/modules.png
Binary files differ
diff --git a/admin/images/navigation.png b/admin/images/navigation.png
new file mode 100644
index 0000000..f4a64ed
--- /dev/null
+++ b/admin/images/navigation.png
Binary files differ
diff --git a/admin/images/news.png b/admin/images/news.png
new file mode 100644
index 0000000..4955c3a
--- /dev/null
+++ b/admin/images/news.png
Binary files differ
diff --git a/admin/images/options.png b/admin/images/options.png
new file mode 100644
index 0000000..b561965
--- /dev/null
+++ b/admin/images/options.png
Binary files differ
diff --git a/admin/images/page.png b/admin/images/page.png
new file mode 100644
index 0000000..fca5225
--- /dev/null
+++ b/admin/images/page.png
Binary files differ
diff --git a/admin/images/pencil.png b/admin/images/pencil.png
new file mode 100644
index 0000000..a5b5ec0
--- /dev/null
+++ b/admin/images/pencil.png
Binary files differ
diff --git a/admin/images/photogallery.png b/admin/images/photogallery.png
new file mode 100644
index 0000000..a161a55
--- /dev/null
+++ b/admin/images/photogallery.png
Binary files differ
diff --git a/admin/images/rejected.png b/admin/images/rejected.png
new file mode 100644
index 0000000..8d7ff6f
--- /dev/null
+++ b/admin/images/rejected.png
Binary files differ
diff --git a/admin/images/rudi.png b/admin/images/rudi.png
new file mode 100644
index 0000000..fbaf180
--- /dev/null
+++ b/admin/images/rudi.png
Binary files differ
diff --git a/admin/images/user.png b/admin/images/user.png
new file mode 100644
index 0000000..55bf586
--- /dev/null
+++ b/admin/images/user.png
Binary files differ
diff --git a/admin/images/user_add.png b/admin/images/user_add.png
new file mode 100644
index 0000000..534ced9
--- /dev/null
+++ b/admin/images/user_add.png
Binary files differ
diff --git a/admin/images/user_delete.png b/admin/images/user_delete.png
new file mode 100644
index 0000000..4fa8551
--- /dev/null
+++ b/admin/images/user_delete.png
Binary files differ
diff --git a/admin/images/user_two_delete.png b/admin/images/user_two_delete.png
new file mode 100644
index 0000000..36d61a0
--- /dev/null
+++ b/admin/images/user_two_delete.png
Binary files differ
diff --git a/admin/images/user_warning.png b/admin/images/user_warning.png
new file mode 100644
index 0000000..334bdbf
--- /dev/null
+++ b/admin/images/user_warning.png
Binary files differ
diff --git a/admin/images/users_two.png b/admin/images/users_two.png
new file mode 100644
index 0000000..b5cbbd3
--- /dev/null
+++ b/admin/images/users_two.png
Binary files differ
diff --git a/admin/images/users_two_add.png b/admin/images/users_two_add.png
new file mode 100644
index 0000000..a211177
--- /dev/null
+++ b/admin/images/users_two_add.png
Binary files differ
diff --git a/admin/images/users_two_warning.png b/admin/images/users_two_warning.png
new file mode 100644
index 0000000..f7cc071
--- /dev/null
+++ b/admin/images/users_two_warning.png
Binary files differ
diff --git a/admin/images/view.gif b/admin/images/view.gif
new file mode 100644
index 0000000..52cbddb
--- /dev/null
+++ b/admin/images/view.gif
Binary files differ
diff --git a/admin/images/view.png b/admin/images/view.png
new file mode 100644
index 0000000..43c9975
--- /dev/null
+++ b/admin/images/view.png
Binary files differ
diff --git a/admin/index.php b/admin/index.php
new file mode 100644
index 0000000..da8e92d
--- /dev/null
+++ b/admin/index.php
@@ -0,0 +1,137 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+session_start();
+
+include '../include/debug.php';
+include '../include/config.php';
+include '../include/sql.class.php';
+include '../include/functions.php';
+
+$db = new Bayonet_SQL();
+$db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+$db->Select_db($config['sql']['database']);
+
+//$config['logs']['dir'] = "../logs/";
+
+include 'header.php';
+
+
+ if(!defined("MODULE_FILE"))
+ {
+ //die("Access denied.");
+ }
+
+ define("ADMIN_FILE",'admin_file');
+ include 'admin_functions.php';
+
+ if(isset($_GET['op']) && $_GET['op'] == 'logout')
+ {
+ logout();
+ }
+
+ if(login())
+ {
+ //this is so dirty... sigh.
+ if(is_loggedin())
+ {
+ ?>
+
+ <center>
+ <div class="wrapper">
+
+<table width="100%">
+ <tr>
+ <td><a href="index.php"><img src="images/bayonet_logo.jpg" alt="bayonet online web admin" /></a></td>
+ <td style="text-align:right">
+ <a href="?op=settings">Account Settings</a> &nbsp;|&nbsp;
+ <a href="?op=logout">Logout, <?php echo $_SESSION['username']; ?></a>
+ </td>
+ </tr>
+</table>
+
+<br />
+
+ <fieldset>
+ <legend>Administration Menu:</legend>
+ <?php
+ $th = array('Administration Menu','');
+ $td = array(
+ LinkInternal('<img src="images/modules.png" /><br />Modules','?op=modules'),
+ LinkInternal('<img src="images/blocks.png" /><br />Blocks','?op=blocks'),
+ LinkInternal('<img src="images/navigation.png" /><br />Navigation','?op=navigation'),
+ LinkInternal('<img src="images/users_two.png" /><br />Edit Admins','?op=admins'),
+ LinkInternal('<img src="images/announcement.png" /><br />Announcements','?op=announcements')
+ );
+
+ //render administration table
+ CompileAdmin($th,$td);
+ ?>
+ </fieldset>
+<br />
+ <fieldset>
+ <legend>Module Administration:</legend>
+ <?php
+ $th = array('Module Administration','');
+ $td = array(
+ LinkInternal('<img src="images/editpage.png" /><br />Pages','?op=pages'),
+ LinkInternal('<img src="images/image.png" /><br />News Reel','?op=newsreel'),
+ LinkInternal('<img src="images/news.png" /><br />News','?op=news'),
+ LinkInternal('<img src="images/calendar.png" /><br />Calendar','?op=calendar'),
+ LinkInternal('<img src="images/box_download.png" /><br />Downloads', '?op=downloads'),
+ LinkInternal('<img src="images/rudi.png" /><br />RUDI','?op=rudi'),
+ LinkInternal('<img src="images/adjutant.png" /><br />Adjutant','?op=adjutant')
+ );
+
+ //render administration table
+ CompileAdmin($th,$td);
+ ?>
+ </fieldset>
+
+<br />
+<div style="text-align:center"><?php include 'operation.php' ?></div>
+
+ </div>
+<?php
+$phpversion = preg_replace('/[a-z-]/', '', phpversion());
+$mtime = explode(' ', microtime());
+$totaltime = $mtime[0] + $mtime[1] - $starttime;
+$debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) peak(%.3fmb) | PHP: %s<br/>Queries: %d | Fetches: %d<br/>\n",
+ $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_queries, $db_fetches);
+?>
+ </center>
+
+<br />
+<?php echo $config['product']['name'] . ' ' . $config['product']['version'] . ' ' . $config['product']['release'] ?><br />
+<?php echo $config['product']['copyright']; ?><br />
+<?php if($config['debug']) echo $debug_output ?><br />
+<?php
+ if($config['debug']['enabled']){
+ logQueueFlush();
+ }
+?>
+<?php
+ }
+ }
+
+?> \ No newline at end of file
diff --git a/admin/modules/functions.php b/admin/modules/functions.php
new file mode 100644
index 0000000..3c44b5a
--- /dev/null
+++ b/admin/modules/functions.php
@@ -0,0 +1,171 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+function ListModules()
+{
+ global $db;
+ $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY `active` DESC, `weight` ASC, `position`");
+ $blocks = $db->fetch($result);
+
+ echo "<table align=\"center\"><tr><th colspan=\"3\">Existing Blocks</th></tr>";
+ foreach($blocks as $block)
+ {
+ echo "<tr><td>{$block['weight']} : {$block['dir_name']}</td><td><a href=\"?load=admin&op=blocks&edit={$block['block_id']}\">Edit</a></td><td><a href=\"?load=admin&op=blocks&delete={$block['block_id']}\">Delete</a></td></tr>";
+ }
+ echo "</table>";
+}
+
+function NewModule()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+ $title = addslashes($_POST['title']);
+
+ if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ //Update the database with the new data.
+ $db->Query("INSERT INTO `bayonet_blocks` SET `weight` = '$weight', `dir_name` = '$dir_name', `title` = '$title', `position` = '$position', `active` = '$active'");
+ //die, because we have completed what we wanted to do.
+ echo "New block, '$dir_name', at position '$weight' added.\n";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $block['title'] ?>"></td></tr>
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>"></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>"></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>"></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function GetActive($module_id, &$active)
+{
+ $options = array(1 => 'Yes',0 => 'No');
+ foreach($options as $option => $value)
+ {
+ $selected = NULL;
+ if($active == $option)
+ {
+ $selected = "selected";
+ }
+ echo "<option " . $selected . " value=\"". $option ."\">" . $value . "</option>\n";
+ }
+
+
+}
+
+function EditModule($module_id)
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = (int) addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = (int) addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+ $title = addslashes($_POST['title']);
+
+ if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'");
+ //$isActive = $active ? "IS" : "IS NOT";
+ echo "Block, '$dir_name', at position '$weight' has been edited.\n";
+ PageRedirect(3, "?op=blocks");
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ //Grab the page from the database according to the $page_id passed to the function.
+ $result = $db->Query("SELECT weight,dir_name,position,active,title FROM bayonet_blocks WHERE block_id = '$block_id'");
+ $block = $db->Fetch($result)
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $block['title'] ?>" /></td></tr>
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>" /></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>" /></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>" /></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <?php GetActive($block_id, $block['active']) ?>
+ </select>
+ </td>
+
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function DeleteModule($module_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT dir_name FROM bayonet_blocks WHERE block_id = '$block_id'");
+ $block = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Block '{$block['dir_name']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_blocks WHERE block_id = '$block_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$block['dir_name']}'";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table align="center">
+ <th>Are you SURE you want to delete the block titled: '<?php echo $block['dir_name']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?> \ No newline at end of file
diff --git a/admin/modules/index.php b/admin/modules/index.php
new file mode 100644
index 0000000..94e2814
--- /dev/null
+++ b/admin/modules/index.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * This file administers the site modules.
+ *
+ * -weight
+ * -directory name
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+echo "Do a database for the index modules, thats all this really is anyway.<br />";
+include $basedir.'modules/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $module_id = $_GET['edit'];
+ EditModule($module_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $module_id = $_GET['delete'];
+ DeleteModule($module_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ NewModule();
+ return;
+}
+
+//echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('Create a Module','?load=admin&op=modules&create=true')."</th></tr></table>";
+
+//ListModules();
+
+?> \ No newline at end of file
diff --git a/admin/navigation/functions.php b/admin/navigation/functions.php
new file mode 100644
index 0000000..68ab7c3
--- /dev/null
+++ b/admin/navigation/functions.php
@@ -0,0 +1,91 @@
+<style>
+
+ul {
+ margin: 0;
+}
+
+#contentLeft {
+ width: 400px;
+}
+
+#contentLeft li {
+ list-style: none;
+ margin: 0 0 4px 0;
+ padding: 10px;
+ background-color:#a1a1a1;
+ border: #CCCCCC solid 1px;
+ color:#fff;
+ text-align:center;
+ cursor:move;
+}
+
+</style>
+<script type="text/javascript" src="scripts/jquery-ui-1.7.1.custom.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function(){
+
+ $(function() {
+ $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
+ var order = $(this).sortable("serialize") + '&action=updateOrder';
+ $.post("navigation/updateDB.php", order, function(theResponse){
+ $("#updateStatus").html(theResponse);
+ });
+ }
+ });
+ });
+
+});
+</script>
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function ListNavigation(){
+
+ global $db;
+ $result = $db->Query("SELECT `nav_id`, `title`, `weight` FROM `bayonet_navigation` ORDER BY `weight`");
+ $data = $db->Fetch($result);
+
+ ?>
+ <div id="contentLeft">
+ <table>
+ <tr>
+ <th>News Reel Order</th>
+ <td id="updateStatus"></td>
+ </tr>
+ </table>
+ <ul>
+ <?php
+
+ foreach($data as $nav){
+
+ echo "<li id=\"recordsArray_{$nav['nav_id']}\">{$nav['title']}</li>";
+ }
+ ?>
+ </ul>
+ Click and drag on a slide to change the order. Wait for confirmation indicating the changes have been saved.
+ </div>
+ <?php
+
+}
+?> \ No newline at end of file
diff --git a/admin/navigation/index.php b/admin/navigation/index.php
new file mode 100644
index 0000000..e2179a1
--- /dev/null
+++ b/admin/navigation/index.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Navigation Links</h2></div>
+ -Edit Order, Edit Page, Delete Pages, Add Pages<br />
+
+<?php
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+
+include $basedir.'navigation/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $block_id = $_GET['edit'];
+ EditBlock($block_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $block_id = $_GET['delete'];
+ DeleteBlock($block_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ NewBlock();
+ return;
+}
+
+ ListNavigation();
+?> \ No newline at end of file
diff --git a/admin/news/functions.php b/admin/news/functions.php
new file mode 100644
index 0000000..6feabcf
--- /dev/null
+++ b/admin/news/functions.php
@@ -0,0 +1,135 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+date_default_timezone_set("America/New_York");
+function ListNews(){
+
+ global $db;
+
+ $result = $db->Query("SELECT n.news_id, n.title, n.message, n.date, n.category_id, u.username AS author, c.name AS catname, c.image AS catimage ".
+ "FROM `bayonet_news` AS n ".
+ "INNER JOIN `bayonet_news_categories` AS c ON c.category_id = n.category_id ".
+ "LEFT OUTER JOIN `mybb_users` AS u ON u.uid = n.author_id ORDER BY `date` DESC");
+
+ $row = $db->Fetch($result);
+ foreach($row as $news)
+ {
+ $newsBody = $news['message'];
+ echo "<a href=\"?op=news&edit={$news['news_id']}\">";
+ echo "<span class=\"bold\">{$news['title']}</span>&nbsp;|&nbsp;<span class=\"blue\">{$news['catname']}</span>&nbsp;&nbsp;<img src=\"images/page.png\" /></a><br />";
+ if(($len = strlen($newsBody))>150)
+ echo substr($newsBody, 0, 150)."...";
+ else
+ echo $newsBody;
+ echo '<br />';
+ echo "Posted By: {$news['author']} on ".date('D M j, Y g:i a T', strtotime($news['date']));
+ echo '<br /><br />';
+ }
+
+}
+
+function EditNews($news_id){
+
+ global $db;
+
+ if(isset($_POST['processed'])){
+
+
+ return;
+ }
+
+ $result = $db->Query("SELECT `author_id`, `title`, `message`, `date`, `category_id` FROM `bayonet_news` WHERE `news_id` = '$news_id' LIMIT 1");
+ $row = $db->FetchRow($result);
+
+ ?>
+ <h3>Edit News</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Author</th><td><?php SelectAuthor($row['author_id']); ?></td></tr>
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $row['title']; ?>" /></td></tr>
+ <tr><th>Date</th><td><?php SelectDate($row['date']); ?></td></tr>
+ <tr><th>Time</th><td><input type="text" name="time" value="<?php echo date('G:i', strtotime($row['date'])); ?>" maxlength="5" size="5" /></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $row['message']; ?></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+ /**
+ * SelectDate($date)
+ * Function for outputing an html form for selecting a month day and year
+ * @param date - formatted date string yyyy-mm-dd (optional)
+ */
+ function SelectDate($date = NULL){
+
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+
+ //List Months
+ echo '<select name="month">';
+ for($m = 1;$m <= 12; $m++){
+ $month = date("F", mktime(0, 0, 0, $m));
+ if($date_arr['month'] == $m)
+ echo "<option value='$m' selected=\"selected\">$month</option>";
+ else
+ echo "<option value='$m'>$month</option>";
+ }
+ echo "</select>";
+
+ //List Days
+ echo '<select name="day">';
+ for($d = 1;$d <= 31; $d++){
+ if($date_arr['day'] == $d)
+ echo "<option value='$d' selected=\"selected\">$d</option>";
+ else
+ echo "<option value='$d'>$d</option>";
+ }
+ echo "</select>";
+
+ //List Years [CurYear, CurYear+5]
+ echo '<select name="year">';
+ $y = date('Y', time());
+ $max = $y+5;
+ for(;$y<$max; $y++){
+ if($date_arr['year'] == $y)
+ echo "<option value='$y' selected=\"selected\">$y</option>";
+ else
+ echo "<option value='$y'>$y</option>";
+ }
+ echo "</select>";
+
+ }
+
+ function SelectAuthor($author_id){
+
+ global $db;
+
+ echo "<select name=\"author\">";
+ $result = $db->Query("SELECT `user_id`, `lastname` FROM `bayonet_users` ORDER BY `username` ASC");
+ $row = $db->Fetch($result);
+ foreach($row as $author)
+ {
+ if($author_id == $author['user_id'])
+ echo "<option value=\"{$author['user_id']}\" selected>{$author['lastname']}</option>";
+ else
+ echo "<option value=\"{$author['user_id']}\">{$author['lastname']}</option>";
+ }
+ echo "</select>";
+ }
+
+?> \ No newline at end of file
diff --git a/admin/news/index.php b/admin/news/index.php
new file mode 100644
index 0000000..ec78089
--- /dev/null
+++ b/admin/news/index.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Manage News</h2></div>
+ -Add/Edit(-)/Delete news
+ -Add/Edit/Delete categories
+<?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'news/functions.php';
+
+echo "<table class=\"panel\" width=\"100%\">
+ <tr><td class=\"panel\">";
+
+if(isset($_GET['edit'])){
+ $news_id = $_GET['edit'];
+ EditNews($news_id);
+}
+else{
+ ListNews();
+}
+
+
+
+?>
+ </td></tr></table> \ No newline at end of file
diff --git a/admin/newsreel/functions.php b/admin/newsreel/functions.php
new file mode 100644
index 0000000..6bde17c
--- /dev/null
+++ b/admin/newsreel/functions.php
@@ -0,0 +1,160 @@
+<style>
+
+ul {
+ margin: 0;
+}
+
+#contentLeft {
+ width: 400px;
+}
+
+#contentLeft li {
+ list-style: none;
+ margin: 0 0 4px 0;
+ padding: 10px;
+ background-color:#a1a1a1;
+ border: #CCCCCC solid 1px;
+ color:#fff;
+ text-align:center;
+ cursor:move;
+}
+
+</style>
+<script type="text/javascript" src="scripts/jquery-ui-1.7.1.custom.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function(){
+
+ $(function() {
+
+ $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
+ var order = $(this).sortable("serialize") + '&action=updateReelOrder';
+ $.post("newsreel/updateDB.php", order, function(theResponse){
+ $("#updateStatus").html(theResponse);
+ });
+ }
+ });
+ });
+
+});
+</script>
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ define(MAX_SLIDES, 6);
+
+ function EditOrder(){
+
+ global $db;
+ ?>
+ <div id="contentLeft">
+ <table>
+ <tr>
+ <th>News Reel Order</th>
+ <td id="updateStatus"></td>
+ </tr>
+ </table>
+ <ul>
+ <?php
+ $result = $db->Query("SELECT `title`, `slide_id`, `src` FROM `bayonet_newsreel` WHERE `visible` = 1 ORDER BY `weight` ASC");
+ $row = $db->Fetch($result);
+
+ foreach($row as $slide){
+ echo "<li id=\"recordsArray_{$slide['slide_id']}\">";
+ PrintSlide($slide);
+ echo "<br /><a href=\"?op=newsreel&disable={$slide['slide_id']}\"><input type=\"button\" value=\"Disable\" /></a></li>";
+ }
+?>
+ </ul>
+ Click and drag on a slide to change the order. Wait for confirmation indicating the changes have been saved.
+ </div>
+<?php
+ }
+
+ function EnableSlide($slide_id){
+
+ global $db;
+ $lastspot = GetLastPosition();
+ if($lastspot >= MAX_SLIDES){
+ ReportError("There are already 6 active slides. You must disable one in order to enable another.");
+ PageRedirect(3,"?op=newsreel");
+ return;
+ }
+ $weight = $lastspot+1;
+ $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 1, `weight` = '$weight' WHERE `slide_id` = '$slide_id' LIMIT 1");
+ PageRedirect(0,"?op=newsreel");
+ }
+
+ function DisableSlide($slide_id){
+
+ global $db;
+ $result = $db->Query("SELECT `weight` FROM `bayonet_newsreel` WHERE `slide_id` = '$slide_id' LIMIT 1");
+ $slide = $db->FetchRow($result);
+
+ $oldWeight = $slide['weight'];
+
+ if($oldWeight < MAX_SLIDES){
+ $total = getNumOfActive();
+ for($i=$oldWeight+1; $i<=$total; $i++){
+ //echo "Change Weight:".$i." to ".($i-1)."<br />";
+ $new = $i-1;
+ $db->Query("UPDATE `bayonet_newsreel` SET `weight` = '$new' WHERE `weight` = '$i' LIMIT 1");
+ }
+ }
+
+ $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 0, `weight` = 0 WHERE `slide_id` = '$slide_id' LIMIT 1");
+ PageRedirect(0,"?op=newsreel");
+ }
+
+ function ListInactive(){
+
+ global $db;
+ echo "<h3>Disabled Slides</h3>";
+ $result = $db->Query("SELECT `slide_id`, `title`, `src` FROM `bayonet_newsreel` WHERE `visible` = 0 ORDER BY `slide_id` DESC");
+ $row = $db->Fetch($result);
+
+ foreach($row as $slide){
+ echo PrintSlide($slide);
+ echo "<br /><a href=\"?op=newsreel&enable={$slide['slide_id']}\"><input type=\"button\" value=\"Enable\" /></a><br /><br />";
+ }
+ }
+
+ function PrintSlide($slide){
+ echo "{$slide['title']}";
+ if(file_exists("../modules/newsreel/slides/{$slide['src']}") && $slide['src'] != ""){
+ echo "<br /><img src=\"../modules/newsreel/slides/{$slide['src']}\" width=\"100px\" />";
+ }
+ }
+
+ function GetLastPosition(){
+
+ global $db;
+ $result = $db->Query("SELECT `weight` FROM `bayonet_newsreel` WHERE `visible` = 1 ORDER BY `weight` DESC LIMIT 1");
+ $row = $db->FetchRow($result);
+
+ return $row['weight'];
+ }
+
+ function getNumOfActive(){
+ global $db;
+ $result = $db->Query("SELECT `slide_id` FROM `bayonet_newsreel` WHERE `visible` = 1");
+ return $db->Rows($result);
+ }
+
+
+?> \ No newline at end of file
diff --git a/admin/newsreel/index.php b/admin/newsreel/index.php
new file mode 100644
index 0000000..0b97deb
--- /dev/null
+++ b/admin/newsreel/index.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'newsreel/functions.php';
+?>
+ <div style="text-align:left;"><h2>- Manage News Reel</h2></div>
+ -Add/Edit/Delete needs to be completed.
+ <table class="panel" width="100%">
+ <tr>
+ <td class="panel"><?php EditOrder(); ?></td>
+ <td class="panel-box" width="50%">
+ <?php
+ if(isset($_GET['enable'])){
+ $slide_id = $_GET['enable'];
+ EnableSlide($slide_id);
+ }else if(isset($_GET['disable'])){
+ $slide_id = $_GET['disable'];
+ DisableSlide($slide_id);
+ }else{
+ ListInactive();
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
diff --git a/admin/newsreel/updateDB.php b/admin/newsreel/updateDB.php
new file mode 100644
index 0000000..f4031a2
--- /dev/null
+++ b/admin/newsreel/updateDB.php
@@ -0,0 +1,40 @@
+<?php
+
+include '../../includes/debug.php';
+include '../../includes/config.php';
+include '../../includes/sql.class.php';
+include '../../includes/functions.php';
+
+$action = $_POST['action'];
+$updateRecordsArray = $_POST['recordsArray'];
+
+$db = new Bayonet_SQL();
+$db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+$db->Select_db($config['sql']['database']);
+
+if ($action == "updateReelOrder"){
+
+ $listingCounter = 1;
+ foreach ($updateRecordsArray as $recordIDValue) {
+
+ $db->Query("UPDATE `bayonet_newsreel` SET `weight` = '$listingCounter' WHERE `slide_id` = '$recordIDValue'");
+ $listingCounter = $listingCounter + 1;
+ }
+ echo "<img src=\"images/accepted.png\" />";
+/*
+ echo '<pre>';
+ print_r($updateRecordsArray);
+ echo '</pre>';
+ echo 'If you refresh the page, you will see that records will stay just as you modified.';
+*/
+}
+else{
+ echo "<img src=\"images/rejected.png\" />";
+}
+date_default_timezone_set("America/New_York");
+echo " Updated at ".date("g:i:s a", time());
+?> \ No newline at end of file
diff --git a/admin/operation.php b/admin/operation.php
new file mode 100644
index 0000000..4ba80e4
--- /dev/null
+++ b/admin/operation.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+if(!isset($_GET['op']))
+{
+ echo "<center>No operation selected</center>\n";
+ return;
+}
+
+$op = $_GET['op'];
+$basedir = './';
+
+if(file_exists($basedir))
+{
+ if(file_exists($basedir . $op))
+ {
+ include $basedir . $op . '/index.php';
+ }
+ else
+ {
+ ReportError("Administrative operation '$op' does not exist.");
+ }
+}
+else
+{
+ ReportError("Administrative base directory path does not exist.");
+}
+
+
+
+?> \ No newline at end of file
diff --git a/admin/pages/functions.php b/admin/pages/functions.php
new file mode 100644
index 0000000..8b1f3b6
--- /dev/null
+++ b/admin/pages/functions.php
@@ -0,0 +1,193 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function ListPages($pid = NULL)
+{
+ global $db;
+ $result = $db->Query("SELECT `page_id`,`title` FROM `bayonet_pages`");
+ $pages = $db->Fetch($result);
+
+ echo "<table class=\"panelitems\" width=\"100%\" cellspacing=\"0\">";
+
+ ?>
+ <tr>
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden; background-color:#dfe4df; border-bottom: 1px solid #848484;">
+ <?php echo LinkInternal('<img src="images/add.png" />&nbsp;Create New Page','?op=pages&create=true'); ?>
+ </td>
+ </tr>
+
+ <?php
+
+ if(count($pages)==0)
+ {
+ echo "<tr><td>No Pages Found.<br /></td></tr></table>";
+ return;
+ }
+
+ foreach($pages as $page)
+ {
+ $edit = false;
+ if($_GET['edit'] == $page['page_id']){
+ $edit = true;
+ echo '<tr class="highlight">';
+ }else
+ echo '<tr>';
+ ?>
+
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden;">
+ <a href="?op=pages&edit=<?php echo $page['page_id']?>">
+ <img src="images/page.png" />
+ <?php echo $page['title']; ?>
+ </a>
+ </td>
+ </tr>
+<?php
+ }
+ echo "</table>";
+
+}
+
+function NewPage()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("INSERT INTO `bayonet_pages` (`page_id` ,`author_id` ,`page_created` ,`title` ,`text`)VALUES (NULL , '0',CURRENT_TIMESTAMP , '$title', '$text')");
+
+ echo "New page, '$title', has been added.\n";
+ PageRedirect(2, "?op=pages");
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ ?>
+ <h3>Add New Page</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Title:</th><td><input type="text" name="title" value="" /></td></tr>
+ <tr><th>Text:</th><td><textarea id="markItUp" rows="30" cols="80" name="text"></textarea></td></tr>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function EditPage($page_id)
+{
+ global $db;
+ $page_id = addslashes($page_id);
+ // If the user has submitted, then process their request.
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE `bayonet_pages` SET `title` = '$title', `text` = '$text' WHERE `page_id` = '$page_id'");
+ echo "Page, '$title', has been edited.\n";
+ PageRedirect(2, "?op=pages&edit={$page_id}");
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ //Grab the page from the database according to the $article_id passed to the function.
+ $result = $db->Query("SELECT `title`, `text` FROM `bayonet_pages` WHERE `page_id` = '$page_id' LIMIT 1");
+ $page = $db->FetchRow($result);
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <tr>
+ <td colspan="2">
+ <input type="submit" name="processed" value="Submit Changes" />
+ <?php echo LinkInternal('<img src="images/view.png" />&nbsp;View this Page','../index.php?load=page&id='.$page_id.'" target=\"blank'); ?>
+ <?php echo LinkInternal("<img src=\"images/cancel.png\" /> Delete This Page","?op=pages&delete={$page_id}"); ?>
+ </td>
+ </tr>
+ <tr>
+ <th>Title:</th>
+ <td><input type="text" name="title" value="<?php echo $page['title'] ?>" maxlength="50" size="30" /></td>
+ </tr>
+ <tr>
+ <th>Text:</th>
+ <td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $page['text'] ?></textarea></td>
+ </tr>
+ </table>
+ </form>
+ <?php
+}
+
+function DeletePage($page_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT title FROM bayonet_pages WHERE page_id = '$page_id' LIMIT 1");
+ $page = $db->FetchRow($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Page '{$page['title']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_pages WHERE page_id = '$page_id' LIMIT 1");
+ PageRedirect(2, "?op=pages&edit={$page_id}");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$page['title']}'";
+ PageRedirect(2, "?op=pages&edit={$page_id}");
+ return;
+ }
+ if($page_id == 1){
+ echo "You can not delete the home page.";
+ PageRedirect(2, "?op=pages&edit={$page_id}");
+ return;
+ }
+
+ ?>
+
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you <u>SURE</u> you want to delete the page titled: '<?php echo $page['title'];?>'?<br />All articles attached to this page will be deleted as well.</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?> \ No newline at end of file
diff --git a/admin/pages/index.php b/admin/pages/index.php
new file mode 100644
index 0000000..20eaa3e
--- /dev/null
+++ b/admin/pages/index.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Manage Pages</h2></div>
+<?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'pages/functions.php';
+
+
+
+?>
+
+ <table class="panel" width="100%" cellspacing="0">
+ <tr style="height:435px;">
+ <td class="panel-none">
+ <?php ListPages(0); ?>
+ </td>
+ <td class="panel-box">
+<?php
+ if(isset($_GET['edit']))
+ {
+ $page_id = $_GET['edit'];
+ EditPage($page_id);
+ }
+ else if(isset($_GET['delete']))
+ {
+ $page_id = $_GET['delete'];
+ DeletePage($page_id);
+ }
+ else if(isset($_GET['create']))
+ {
+ $create = $_GET['create'];
+ if($create)
+ {
+ NewPage();
+ }
+ }
+?>
+ </td>
+ </tr>
+ </table>
+
diff --git a/admin/rudi/functions.php b/admin/rudi/functions.php
new file mode 100644
index 0000000..b22468b
--- /dev/null
+++ b/admin/rudi/functions.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ /*
+ include $basedir.'rudi/functions.php';
+
+ //chek to see if the person is indeed an quartermaster
+
+ if(isset($_GET['edit'])){
+
+ if($_GET['edit'] == "profile"){
+ $member_id = $_GET['id'];
+ EditProfile($member_id);
+ return;
+ }
+ if($_GET['edit'] == "service"){
+ if(isset($_GET['var'])){
+ if($_GET['var'] == "add"){
+ $member_id = $_GET['id'];
+ AddServiceRecord($member_id);
+ }
+ if($_GET['var'] == "edit"){
+ $record_id = $_GET['id'];
+ EditServiceRecord($record_id);
+ }
+ if($_GET['var'] == "delete"){
+ $record_id = $_GET['id'];
+ }
+ }else{
+ $member_id = $_GET['id'];
+ ListServiceRecord($member_id);
+ }
+ return;
+ }
+ if($_GET['edit'] == "medals"){
+ if(isset($_GET['var'])){
+ if($_GET['var'] == "add"){
+
+ }
+ if($_GET['var'] == "edit"){
+
+ }
+ if($_GET['var'] == "delete"){
+
+ }
+ }else{
+ $member_id = $_GET['id'];
+ ListMedalRecord($member_id);
+ }
+
+ return;
+ }
+ }
+
+ ListMembers(); */
+ ?> \ No newline at end of file
diff --git a/admin/rudi/includes/functions.awards.php b/admin/rudi/includes/functions.awards.php
new file mode 100644
index 0000000..439f0e1
--- /dev/null
+++ b/admin/rudi/includes/functions.awards.php
@@ -0,0 +1,20 @@
+<?php
+
+ function getAwardClasses(){
+ global $db;
+ $result = $db->Query("SELECT `name`, `class_id` FROM `rudi_award_classes`");
+ return $db->Fetch($result);
+ }
+
+ function getAwardsByClass($class_id){
+ global $db;
+ $result = $db->Query("SELECT `award_id`, `name`, `image`, `description` FROM `rudi_awards` WHERE `class_id` = '$class_id' ORDER BY `name`");
+ return $db->Fetch($result);
+ }
+
+ function getAward($award_id){
+ global $db;
+ $result = $db->Query("SELECT `award_id`, `name`, `image`, `description`, `class_id` FROM `rudi_awards` WHERE `award_id` = '$award_id' LIMIT 1");
+ return $db->FetchRow($result);
+ }
+?> \ No newline at end of file
diff --git a/admin/rudi/includes/functions.members.php b/admin/rudi/includes/functions.members.php
new file mode 100644
index 0000000..6a4970e
--- /dev/null
+++ b/admin/rudi/includes/functions.members.php
@@ -0,0 +1,262 @@
+<?php
+ function selectUnits($previous_unit, $indent, $members_unit){
+ global $db;
+
+ $indent++;
+ $formatting = str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $indent);
+
+ $result = $db->Query("SELECT `unit_id`, `name` FROM `rudi_combat_units` WHERE `detachment` = '$previous_unit'");
+ $row = $db->Fetch($result);
+ foreach($row as $unit){
+ $unit_id = $unit['unit_id'];
+ $unit_name = $unit['name'];
+ if($members_unit==$unit_id)
+ echo '<option value="'.$unit_id.'" selected>'.$formatting.$unit_name.'</option>';
+ else
+ echo '<option value="'.$unit_id.'">'.$formatting.$unit_name.'</option>';
+
+ selectUnits($unit_id, $indent, $members_unit);
+ }
+ }
+
+ function GetMember($member_id){
+
+ global $db;
+ $result = $db->Query("SELECT * FROM `rudi_unit_members` WHERE `member_id` = '$member_id' LIMIT 1");
+ $row = $db->FetchRow($result);
+ return $row;
+ }
+
+ function GetWeapons(){
+ global $db;
+ $result = $db->Query("SELECT * FROM `rudi_weapons` ORDER BY `model` DESC");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function GetMembersRoles($member_id){
+ global $db;
+ $row = NULL;
+ $query = sprintf("SELECT r.role_id, r.name AS role_name FROM rudi_roles AS r LEFT OUTER JOIN rudi_roles_container AS rl USING(role_id) INNER JOIN rudi_unit_members AS rm USING(member_id) WHERE rm.member_id = %d AND r.name IS NOT NULL ORDER BY r.role_id ASC",
+ (int)$member_id);
+
+ $result = $db->Query($query);
+ $row = $db->Fetch($result);
+
+ return $row;
+ }
+
+ function GetRoles(){
+ global $db;
+ $result = $db->Query("SELECT * FROM `rudi_roles`");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function GetCountry(){
+ global $db;
+ $result = $db->Query("SELECT `country_id`, `name` FROM `rudi_countries` ORDER BY `name`");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function GetRanks(){
+ global $db;
+ $result = $db->Query("SELECT * FROM `rudi_ranks` ORDER BY `weight` DESC");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function GetStatuses(){
+ global $db;
+ $result = $db->Query("SELECT * FROM `rudi_statuses`");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function GetServiceRecord($member_id){
+ global $db;
+ $result = $db->Query("SELECT `record_id`, `date_added`, `record_note`, `added_by` FROM `rudi_service_record` WHERE `member_id` = '$member_id'");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function ListServiceRecord($member_id){
+ global $db;
+
+ echo "<a href=\"?op=rudi&show=members&service={$member_id}&add=true\">Add New Record</a>";
+
+ $records = GetServiceRecord($member_id);
+ echo "<table width=\"100%\" style=\"text-align:center;\" >";
+ echo "<tr><th>Record Date</th><th>Record Details</th></tr>";
+ foreach($records as $record){
+ echo "<tr><td>".date("M j Y", strtotime($record['date_added']))." <a href=\"?op=rudi&show=members&service={$member_id}&edit={$record['record_id']}\">Edit</a>&nbsp;<a href=\"?op=rudi&show=members&service={$row['member_id']}&delete={$record['record_id']}\">Delete</a></td><td>{$record['record_note']}</td></tr>";
+ }
+ CloseTable();
+ }
+
+ function EditServiceRecord($record_id){
+ global $db;
+ $result = $db->Query("SELECT `date_added`, `record_note`, `member_id` FROM `rudi_service_record` WHERE `record_id` = '$record_id' LIMIT 1");
+ $row = $db->FetchRow($result);
+
+ $form = new BayonetForm("", "POST");
+ if($form->verifySubmit('processed')){
+ $date = $form->request['date'];
+ $details = $form->request['details'];
+
+ $db->Query("UPDATE `rudi_service_record` SET `date_added` = '$date', `record_note` = '$details' WHERE `record_id` = '$record_id' LIMIT 1");
+ PageRedirect(1, "?op=rudi&show=members&service={$row['member_id']}&edit=".$record_id);
+ return;
+ }
+
+ echo "<a href=\"?op=rudi&show=members&service={$row['member_id']}\">Cancel</a>";
+ OpenTable();
+?>
+ <tr><td>Date:</td><td><?php $form->textField('date', date('Y-m-d', strtotime($row['date_added']))); ?></td></tr>
+ <tr><td>Details:</td><td><?php $form->textArea('details', 10, 30, $row['record_note']); ?></td></tr>
+ <tr><td colspan="2"><?php $form->submitButton('processed', 'Update'); ?></td></tr>
+<?php
+ CloseTable();
+ $form->__destruct();
+
+ }
+
+ function AddServiceRecord($member_id){
+ global $db;
+
+ $form = new BayonetForm("", "POST");
+ if($form->verifySubmit('processed')){
+ $date = $form->request['date'];
+ $details = $form->request['details'];
+ decho($form->request);
+ $db->Query("INSERT INTO `rudi_service_record` SET `member_id` = '$member_id', `date_added` = '$date', `record_note` = '$details', `added_by` = 1");
+ PageRedirect(1, "?op=rudi&show=members&service={$member_id}");
+ return;
+ }
+
+ $result = $db->Query("SELECT `date_added`, `record_note`, `member_id` FROM `rudi_service_record` WHERE `record_id` = '$record_id' LIMIT 1");
+ $row = $db->FetchRow($result);
+ echo "<a href=\"?op=rudi&show=members&service={$member_id}\">Cancel</a>";
+ OpenTable();
+?>
+ <tr><td>Date:</td><td><?php $form->textField('date'); ?></td></tr>
+ <tr><td>Details:</td><td><?php $form->textArea('details', 10, 30); ?></td></tr>
+ <tr><td colspan="2"><?php $form->submitButton('processed', 'Add'); ?></td></tr>
+<?php
+ CloseTable();
+ $form->__destruct();
+ }
+
+ function GetAwardRecord($member_id){
+ global $db;
+ $result = $db->Query("SELECT r.record_id, r.date_added, r.record_note, r.added_by, a.name FROM rudi_award_record AS r LEFT OUTER JOIN rudi_awards AS a ON a.award_id = r.award_id WHERE r.member_id = '$member_id'");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function GetAllAwards(){
+ global $db;
+ $result = $db->Query("SELECT `award_id`, `name` FROM `rudi_awards` ORDER BY `name`");
+ $row = $db->Fetch($result);
+ return $row;
+ }
+
+ function ListAwardRecord($member_id){
+ global $db;
+
+ echo "<a href=\"?op=rudi&show=members&award={$member_id}&add=true\">Add New Record</a>";
+
+ $records = GetAwardRecord($member_id);
+ echo "<table width=\"100%\" style=\"text-align:center;\" >";
+ echo "<tr><th>Award Name</th><th>Record Date</th><th>Record Details</th><td></td><td></td></tr>";
+ foreach($records as $record){
+?>
+ <tr>
+ <td><?php echo $record['name']; ?></td>
+ <td><?php echo date("M j Y", strtotime($record['date_added'])); ?></td>
+ <td><?php echo $record['record_note']; ?></td>
+ <td><a href="?op=rudi&show=members&award=<?php echo $member_id; ?>&edit=<?php echo $record['record_id']; ?>">Edit</a></td>
+ <td><a href="?op=rudi&show=members&award=<?php echo $row['member_id']; ?>&delete=<?php echo $record['record_id']; ?>">Delete</a></td>
+ </tr>
+<?php
+ }
+ CloseTable();
+ }
+
+ function EditAwardRecord($record_id){
+ global $db;
+ $result = $db->Query("SELECT `award_id`, `date_added`, `record_note`, `member_id` FROM `rudi_award_record` WHERE `record_id` = '$record_id' LIMIT 1");
+ $row = $db->FetchRow($result);
+
+ $form = new BayonetForm("", "POST");
+ if($form->verifySubmit('processed')){
+ $date = $form->request['date'];
+ $details = $form->request['details'];
+ $award_id = $_POST['award'];
+
+ $db->Query("UPDATE `rudi_award_record` SET `date_added` = '$date', `award_id` = '$award_id', `record_note` = '$details' WHERE `record_id` = '$record_id' LIMIT 1");
+ PageRedirect(1, "?op=rudi&show=members&award={$row['member_id']}&edit=".$record_id);
+ return;
+ }
+
+ echo "<a href=\"?op=rudi&show=members&award={$row['member_id']}\">Cancel</a>";
+ OpenTable();
+?>
+ <tr><td>Award:</td><td>
+ <select name="award">
+<?php $awards = GetAllAwards();
+ foreach($awards as $award){
+ if($award['award_id'] == $row['award_id'])
+ echo "<option value=\"{$award['award_id']}\" selected>{$award['name']}</option>";
+ else
+ echo "<option value=\"{$award['award_id']}\">{$award['name']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr><td>Date:</td><td><?php $form->textField('date', date('Y-m-d', strtotime($row['date_added']))); ?></td></tr>
+ <tr><td>Details:</td><td><?php $form->textArea('details', 10, 30, $row['record_note']); ?></td></tr>
+ <tr><td colspan="2"><?php $form->submitButton('processed', 'Update'); ?></td></tr>
+<?php
+ CloseTable();
+ $form->__destruct();
+
+ }
+
+ function AddAwardRecord($member_id){
+ global $db;
+
+ $form = new BayonetForm("", "POST");
+ if($form->verifySubmit('processed')){
+ $date = $form->request['date'];
+ $details = $form->request['details'];
+ $award_id = $_POST['award'];
+ decho($form->request);
+ $db->Query("INSERT INTO `rudi_award_record` SET `member_id` = '$member_id', `award_id` = '$award_id', `date_added` = '$date', `record_note` = '$details', `added_by` = 1");
+ PageRedirect(1, "?op=rudi&show=members&award={$member_id}");
+ return;
+ }
+
+ $result = $db->Query("SELECT `date_added`, `record_note`, `member_id` FROM `rudi_service_record` WHERE `record_id` = '$record_id' LIMIT 1");
+ $row = $db->FetchRow($result);
+ echo "<a href=\"?op=rudi&show=members&award={$member_id}\">Cancel</a>";
+ OpenTable();
+?>
+ <tr><td>Award:</td><td>
+ <select name="award">
+<?php $awards = GetAllAwards();
+ foreach($awards as $award){
+ echo "<option value=\"{$award['award_id']}\">{$award['name']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr><td>Date:</td><td><?php $form->textField('date'); ?></td></tr>
+ <tr><td>Details:</td><td><?php $form->textArea('details', 10, 30); ?></td></tr>
+ <tr><td colspan="2"><?php $form->submitButton('processed', 'Add'); ?></td></tr>
+<?php
+ CloseTable();
+ $form->__destruct();
+ }
+?> \ No newline at end of file
diff --git a/admin/rudi/index.php b/admin/rudi/index.php
new file mode 100644
index 0000000..2e4a42a
--- /dev/null
+++ b/admin/rudi/index.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ ?>
+ <link rel="stylesheet" type="text/css" href="rudi/style.css" media="screen"/>
+ <div style="text-align:left;"><h2>- RUDI/Quartermaster Control Panel</h2></div>
+ <?php
+ if(!defined("ADMIN_FILE"))
+ {
+ die("Access denied.");
+ }
+
+ if(isset($_GET['show'])){
+
+ switch($_GET['show']){
+ case 'members':
+ include $basedir.'rudi/views/view.members.php';
+ break;
+ case 'units':
+ include $basedir.'rudi/views/view.units.php';
+ break;
+ case 'awards':
+ include $basedir.'rudi/views/view.awards.php';
+ break;
+ case 'ranks':
+ include $basedir.'rudi/views/view.ranks.php';
+ break;
+ case 'drills':
+ include $basedir.'rudi/views/view.drills.php';
+ break;
+ }
+ }else{
+ $th = array('Rudi Options','');
+ $td = array(
+ LinkInternal('Roster','?op=rudi&show=members'),
+ LinkInternal('Units','?op=rudi&show=units'),
+ LinkInternal('Awards', '?op=rudi&show=awards')
+ );
+
+ //render administration table
+ CompileAdmin($th,$td);
+ }
+ ?> \ No newline at end of file
diff --git a/admin/rudi/views/view.awards.edit.php b/admin/rudi/views/view.awards.edit.php
new file mode 100644
index 0000000..21ec156
--- /dev/null
+++ b/admin/rudi/views/view.awards.edit.php
@@ -0,0 +1,27 @@
+<?php
+ $award = getAward($award_id);
+ $form = new BayonetForm("", "POST");
+ if($form->verifySubmit('processed'))
+ {
+ global $db;
+ $name = $form->request['name'];
+ $text = $form->request['text'];
+ $db->Query("UPDATE `rudi_awards` SET `name` = '$name', `description` = '$text' WHERE `award_id` = '$award_id' LIMIT 1");
+
+ PageRedirect(1, "?op=rudi&show=awards&award={$award_id}");
+ return;
+ }
+ echo LinkInternal("Cancel","?op=rudi&show=awards&cid={$award['class_id']}");
+ OpenTable();
+?>
+
+<tr><th>Name:</th><td><?php $form->textField('name', $award['name'], false, "50"); ?></td><tr>
+<tr><th>Image:</th><td><?php ?></td></tr>
+<tr><th>Text:</th><td><?php $form->textArea('text',10,30,$award['description']); ?></td></tr>
+<tr><td><?php $form->submitButton('processed', 'Update'); ?></td></tr>
+
+<?php
+ CloseTable();
+ $form->__destruct();
+?>
+
diff --git a/admin/rudi/views/view.awards.php b/admin/rudi/views/view.awards.php
new file mode 100644
index 0000000..b4c912f
--- /dev/null
+++ b/admin/rudi/views/view.awards.php
@@ -0,0 +1,40 @@
+<?php
+ include $basedir.'rudi/includes/functions.awards.php';
+ if(isset($_GET['award'])){
+ $award_id = $_GET['award'];
+ include 'view.awards.edit.php';
+ }else if(isset($_GET['add'])){
+ include 'view.awards.add.php';
+ }else if(isset($_GET['delete'])){
+ $award_id = $_GET['delete'];
+ include 'view.awards.delete.php';
+ }else{
+ echo "<h3>Award Classes</h3>";
+ $classes = getAwardClasses();
+ OpenTable();
+ echo "<tr style=\"text-align:center\">";
+ foreach($classes as $class){
+ echo "<td>".LinkInternal($class['name'],'?op=rudi&show=awards&cid='.$class['class_id'])."</td>";
+ }
+ echo "</tr>";
+ CloseTable();
+
+ if(isset($_GET['cid'])){
+ $class_id = $_GET['cid'];
+ $awards = getAwardsByClass($class_id);
+ echo "<h3>Awards</h3>";
+ echo LinkInternal('<img src="images/add.png" />&nbsp;Add New Award','?op=rudi&show=awards&cid={$class_id}&add=true');
+ OpenTable();
+ foreach($awards as $award){
+ echo "<tr><td>".$award['name']."</td>
+ <td><a href=\"?op=rudi&show=awards&award={$award['award_id']}\">Edit</a></td>
+ <td><a href=\"?op=rudi&show=awards&delete={$award['award_id']}\">Delete</a></td></tr>";
+ }
+ CloseTable();
+ //include 'view.members.profile.php';
+ }else if(isset($_GET['aid'])){
+ $award_id = $_GET['aid'];
+ //include 'view.members.service.php';
+ }
+ }
+?> \ No newline at end of file
diff --git a/admin/rudi/views/view.members.award.php b/admin/rudi/views/view.members.award.php
new file mode 100644
index 0000000..cda8595
--- /dev/null
+++ b/admin/rudi/views/view.members.award.php
@@ -0,0 +1,19 @@
+<?php
+ global $db;
+ $result = $db->Query("SELECT `first_name`, `last_name` FROM `rudi_unit_members` WHERE `member_id` = '$member_id' LIMIT 1");
+ $member = $db->FetchRow($result);
+ echo "<h3>Award Record of {$member['first_name']} {$member['last_name']}</h3>";
+
+ if(isset($_GET['edit'])){
+ $record_id = $_GET['edit'];
+ EditAwardRecord($record_id);
+ }else if(isset($_GET['add'])){
+ if($_GET['add']){
+ AddAwardRecord($_GET['award']);
+ }
+ }else{
+
+ echo "<div style=\"text-align:left;\">".LinkInternal('Back to Roster', '?op=rudi&show=members')."</div>";
+ ListAwardRecord($_GET['award']);
+ }
+?> \ No newline at end of file
diff --git a/admin/rudi/views/view.members.php b/admin/rudi/views/view.members.php
new file mode 100644
index 0000000..38929df
--- /dev/null
+++ b/admin/rudi/views/view.members.php
@@ -0,0 +1,49 @@
+<?php
+ include $basedir.'rudi/includes/functions.members.php';
+ if(isset($_GET['profile'])){
+ $member_id = $_GET['profile'];
+ include 'view.members.profile.php';
+ }else if(isset($_GET['service'])){
+ $member_id = $_GET['service'];
+ include 'view.members.service.php';
+ }else if(isset($_GET['award'])){
+ $member_id = $_GET['award'];
+ include 'view.members.award.php';
+ }else{
+
+ global $db;
+
+ echo "<h3>Current Members</h3>";
+ echo "<table width=\"100%\" style=\"text-align:center;\">";
+ echo "<tr><th>Rank</th><th>Soldier</th><th>Main Info</th><th>Service Record</th><th>Medal Record</th></tr>";
+ $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id <= 3 ORDER BY rudi_ranks.weight DESC , rudi_unit_members.date_promotion ASC , rudi_unit_members.date_enlisted ASC");
+ $row = $db->Fetch($result);
+
+ foreach($row as $member){
+ echo "<tr>";
+ echo "<td>{$member['shortname']}</td><td class=\"center\">{$member['first_name']} {$member['last_name']}</td>";
+ echo "<td>".LinkInternal('Edit','?op=rudi&show=members&profile='.$member['member_id'])."</td>";
+ echo "<td>".LinkInternal('Edit','?op=rudi&show=members&service='.$member['member_id'])."</td>";
+ echo "<td>".LinkInternal('Edit','?op=rudi&show=members&award='.$member['member_id'])."</td>";
+ echo "<tr>";
+ }
+ CloseTable();
+
+ echo "<h3>Previous Members</h3>";
+ echo "<table width=\"100%\" style=\"text-align:center;\">";
+ echo "<tr><th>Rank</th><th>Soldier</th><th>Main Info</th><th>Service Record</th><th>Medal Record</th></tr>";
+ $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id > 3 ORDER BY rudi_ranks.weight DESC, rudi_unit_members.date_promotion ASC, rudi_unit_members.date_enlisted ASC");
+ $row = $db->Fetch($result);
+
+ foreach($row as $member){
+ echo "<tr>";
+ echo "<td>{$member['shortname']}</td><td class=\"center\">{$member['first_name']} {$member['last_name']}</td>";
+ echo "<td>".LinkInternal('Edit','?op=rudi&show=members&profile='.$member['member_id'])."</td>";
+ echo "<td>".LinkInternal('Edit','?op=rudi&show=members&service='.$member['member_id'])."</td>";
+ echo "<td>".LinkInternal('Edit','?op=rudi&show=members&award='.$member['member_id'])."</td>";
+ echo "<tr>";
+ }
+ CloseTable();
+ }
+
+?> \ No newline at end of file
diff --git a/admin/rudi/views/view.members.profile.php b/admin/rudi/views/view.members.profile.php
new file mode 100644
index 0000000..bd776d7
--- /dev/null
+++ b/admin/rudi/views/view.members.profile.php
@@ -0,0 +1,197 @@
+<?php
+ global $db;
+
+ if(isset($_POST['processed'])){
+
+ echo "Please wait while the information is processed...";
+
+ $rank_id = $_POST['rank'];
+ $country_id = $_POST['country'];
+ $status_id = $_POST['status'];
+ $role_id = $_POST['role'];
+ $unit_id = $_POST['unit'];
+ $weapon_id = $_POST['weapon'];
+ $first_name = addslashes($_POST['first']);
+ $last_name = addslashes($_POST['last']);
+ $username = addslashes($_POST['username']);
+ $city = addslashes($_POST['city']);
+ $province = addslashes($_POST['province']);
+ $primary_mos = addslashes($_POST['primmos']);
+ $enlisted = addslashes($_POST['enlist']);
+ $promoted = addslashes($_POST['promote']);
+ $discharged = addslashes($_POST['discharge']);
+ $xfire = addslashes($_POST['xfire']);
+ $email = addslashes($_POST['email']);
+ $bio = addslashes($_POST['bio']);
+
+ //$discharged = empty($discharged) ? NULL : "'{$discharged}'";
+
+ $query = "UPDATE `rudi_unit_members` SET"
+ ." `rank_id` = '$rank_id',"
+ ." `country_id` = '$country_id',"
+ ." `status_id` = '$status_id',"
+ ." `cunit_id` = '$unit_id',"
+ ." `weapon_id` = '$weapon_id',"
+ ." `username` = '$username',"
+ ." `email` = '$email',"
+ ." `xfire` = '$xfire',"
+ ." `first_name` = '$first_name',"
+ ." `last_name` = '$last_name',"
+ ." `location_city` = '$city',"
+ ." `location_province` = '$province',"
+ ." `bio` = '$bio',"
+ ." `date_enlisted` = '$enlisted',"
+ ." `date_promotion` = '$promoted',"
+ ." `primary_mos` = '$primary_mos',";
+ if(empty($discharged))
+ $query = $query." `date_discharged` = null";
+ else
+ $query = $query." `date_discharged` = '$discharged'";
+ $query = $query." WHERE `member_id` = '$member_id' LIMIT 1";
+ decho($query);
+ $db->Query($query);
+
+ $db->Query("UPDATE `rudi_roles_container` SET `role_id` = '$role_id' WHERE `member_id` = '$member_id' LIMIT 1");
+
+ /* do the role query as well */
+ PageRedirect(1, "?op=rudi&show=members&profile={$member_id}");
+ return;
+ }
+ $member = GetMember($member_id);
+?>
+ <a href="?op=rudi&show=members">Cancel</a><br />
+ <form method="POST" action="">
+ <table width="100%" style="text-align:center;">
+ <tr><th colspan="2" style="background-color:#c4c4c4;">Personnel File of <?php echo $member['first_name']." ".$member['last_name']; ?></th></tr>
+ <tr><td class="right" width="50%">Rank:</td><td class="left">
+ <select name="rank">
+<?php $ranks = GetRanks();
+ foreach($ranks as $rank){
+ if($rank['rank_id'] == $member['rank_id'])
+ echo "<option value=\"{$rank['rank_id']}\" selected>{$rank['longname']}</option>";
+ else
+ echo "<option value=\"{$rank['rank_id']}\">{$rank['longname']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr><td class="right">Country:</td><td class="left">
+ <select name="country">
+<?php $countries = GetCountry();
+ foreach($countries as $country){
+ if($country['country_id'] == $member['country_id'])
+ echo "<option value=\"{$country['country_id']}\" selected>{$country['name']}</option>";
+ else
+ echo "<option value=\"{$country['country_id']}\">{$country['name']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ </table>
+ <table width="100%" style="text-align:center;">
+ <tr><th colspan="2" style="background-color:#c4c4c4;">Vital Statistics</th></tr>
+ <tr>
+ <td class="right" width="50%">First:</td>
+ <td class="left"><input type="text" name="first" value="<?php echo $member['first_name']; ?>" /></td>
+ </tr>
+ <tr>
+ <td class="right">Last:</td>
+ <td class="left"><input type="text" name="last" value="<?php echo $member['last_name']; ?>" /></td>
+ </tr>
+ <tr><td class="right">Username:</td><td class="left"><input type="text" name="username" value="<?php echo $member['username']; ?>" /></td></tr>
+ <tr><td class="right">City:</td><td class="left"><input type="text" name="city" value="<?php echo $member['location_city']; ?>"/></td></tr>
+ <tr><td class="right">Province:</td><td class="left"><input type="text" name="province" value="<?php echo $member['location_province']; ?>" /></td></tr>
+ <tr><td class="right">Status:</td><td class="left">
+ <select name="status">
+<?php $statuses = GetStatuses();
+ foreach($statuses as $status){
+ if($status['status_id'] == $member['status_id'])
+ echo "<option value=\"{$status['status_id']}\" selected>{$status['name']}</option>";
+ else
+ echo "<option value=\"{$status['status_id']}\">{$status['name']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr><td class="right">Primary MOS:</td><td class="left"><input type="text" name="primmos" value="<?php echo $member['primary_mos']; ?>" /></td></tr>
+ <tr>
+ <td class="right">Role:</td>
+ <td class="left">
+ <select name="role">
+<?php
+ $member_roles = GetMembersRoles($member['member_id']);
+ $roles = GetRoles();
+ foreach($member_roles as $member_role){}
+ foreach($roles as $role){
+ if($role['role_id']==$member_role['role_id'])
+ echo "<option value=\"{$role['role_id']}\" selected>{$role['name']}</option>";
+ else
+ echo "<option value=\"{$role['role_id']}\">{$role['name']}</option>";
+ }
+?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="right" style="font-weight:bold;">Unit:</td>
+ <td class="left">
+ <select name="unit">
+ <option value="0">N/A</option>
+<?php
+ $result = $db->Query("SELECT `unit_id`, `name` FROM `rudi_combat_units` WHERE `detachment` = 0 ");
+ $row = $db->Fetch($result);
+ foreach($row as $unit){
+ $unit_name = $unit['name'];
+ $unit_id = $unit['unit_id'];
+ if($member['cunit_id']==$unit_id)
+ echo '<option value="'.$unit_id.'" selected>'.$unit_name.'</option>';
+ else
+ echo '<option value="'.$unit_id.'">'.$unit_name.'</option>';
+ selectUnits($unit_id, 0, $member['cunit_id']);
+ }
+?>
+ </select>
+ </td>
+ </tr>
+ <tr><td class="right">Weapons:</td><td class="left">
+ <select name="weapon">
+<?php $weapons = GetWeapons();
+ foreach($weapons as $weapon){
+ if($weapon['weapon_id'] == $member['weapon_id'])
+ echo "<option value=\"{$weapon['weapon_id']}\" selected>{$weapon['model']}</option>";
+ else
+ echo "<option value=\"{$weapon['weapon_id']}\">{$weapon['model']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr>
+ <td class="right">Enlisted Date:</td>
+ <td class="left"><input type="text" name="enlist" value="<?php echo !empty($member['date_enlisted']) ? date('Y-m-d', strtotime($member['date_enlisted'])) : ""; ?>" /></td>
+ </tr>
+ <tr>
+ <td class="right">Promotion Date:</td>
+ <td class="left">
+ <input type="text" name="promote" value="<?php echo !empty($member['date_promotion']) ? date('Y-m-d', strtotime($member['date_promotion'])) : ""; ?>" />
+ </td>
+ </tr>
+ <tr>
+ <td class="right">Discharge Date:</td>
+ <td class="left"><input type="text" name="discharge" value="<?php echo !empty($member['date_discharged']) ? date('Y-m-d', strtotime($member['date_discharged'])) : ""; ?>" /></td>
+ </tr>
+ <tr>
+ <td class="right">Xfire:</td>
+ <td class="left"><input type="text" name="xfire" value="<?php echo $member['xfire']; ?>"/></td>
+ </tr>
+ <tr>
+ <td class="right">E-Mail:</td>
+ <td class="left"><input type="text" name="email" value="<?php echo $member['email']; ?>"/></td>
+ </tr>
+ </table>
+ <br />
+ <table width="100%" style="text-align:center;">
+ <tr><th colspan="2" style="background-color:#c4c4c4;">Personal Bio</th></tr>
+ <tr><td><textarea rows="7" name="bio" cols="60"><?php echo $member['bio'];?></textarea></td></tr>
+ <tr><td colspan="2"><input type="submit" value="Submit" name="processed" /></td>
+ </table>
+ </form> \ No newline at end of file
diff --git a/admin/rudi/views/view.members.service.php b/admin/rudi/views/view.members.service.php
new file mode 100644
index 0000000..eaf2233
--- /dev/null
+++ b/admin/rudi/views/view.members.service.php
@@ -0,0 +1,19 @@
+<?php
+ global $db;
+ $result = $db->Query("SELECT `first_name`, `last_name` FROM `rudi_unit_members` WHERE `member_id` = '$member_id' LIMIT 1");
+ $member = $db->FetchRow($result);
+ echo "<h3>Service Record of {$member['first_name']} {$member['last_name']}</h3>";
+
+ if(isset($_GET['edit'])){
+ $record_id = $_GET['edit'];
+ EditServiceRecord($record_id);
+ }else if(isset($_GET['add'])){
+ if($_GET['add']){
+ AddServiceRecord($_GET['service']);
+ }
+ }else{
+
+ echo "<div style=\"text-align:left;\">".LinkInternal('Back to Roster', '?op=rudi&show=members')."</div>";
+ ListServiceRecord($_GET['service']);
+ }
+?> \ No newline at end of file
diff --git a/admin/rudi/views/view.units.php b/admin/rudi/views/view.units.php
new file mode 100644
index 0000000..2ccf35a
--- /dev/null
+++ b/admin/rudi/views/view.units.php
@@ -0,0 +1,22 @@
+<?php
+ include $basedir.'rudi/includes/functions.units.php';
+ if(isset($_GET['unit'])){
+
+ }else{
+ //list units
+ DisplayUnits();
+
+ }
+
+
+?>
+<div style="text-align:left;">
+<img src="images/tree_branch.gif" />&nbsp;Kilo Company<br />
+<img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" />&nbsp;1st Platoon<br />
+<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" />&nbsp;1st Squad<br />
+<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_leaf.gif" /><img src="images/tree_branch.gif" />&nbsp;Fireteam Alpha<br />
+<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_leaf.gif" /><img src="images/tree_branch.gif" />&nbsp;Fireteam Bravo<br />
+<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" />&nbsp;2nd Squad<br />
+<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" />&nbsp;Fireteam Alpha<br />
+<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" />&nbsp;Fireteam Bravo<br />
+</div> \ No newline at end of file
diff --git a/admin/scripts/jquery-1.3.2.min.js b/admin/scripts/jquery-1.3.2.min.js
new file mode 100644
index 0000000..b1ae21d
--- /dev/null
+++ b/admin/scripts/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/admin/scripts/jquery-ui-1.7.1.custom.min.js b/admin/scripts/jquery-ui-1.7.1.custom.min.js
new file mode 100644
index 0000000..1a43387
--- /dev/null
+++ b/admin/scripts/jquery-ui-1.7.1.custom.min.js
@@ -0,0 +1,54 @@
+/*
+ * jQuery UI 1.7.1
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */ jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.1",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
+ * jQuery UI Draggable 1.7.1
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * ui.core.js
+ */ (function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.1",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/*
+ * jQuery UI Droppable 1.7.1
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * ui.core.js
+ * ui.draggable.js
+ */ (function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.1",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);;/*
+ * jQuery UI Selectable 1.7.1
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Selectables
+ *
+ * Depends:
+ * ui.core.js
+ */ (function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.right<d||j.top>g||j.bottom<h))}else{if(e.tolerance=="fit"){k=(j.left>d&&j.right<b&&j.top>h&&j.bottom<g)}}if(k){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",i,{selecting:j.element})}}else{if(j.selecting){if(i.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",i,{unselecting:j.element})}}if(j.selected){if(!i.metaKey&&!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",i,{unselecting:j.element})}}}});return false},_mouseStop:function(d){var b=this;this.dragged=false;var c=this.options;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;b._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;b._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}}));a.extend(a.ui.selectable,{version:"1.7.1",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);;/*
+ * jQuery UI Sortable 1.7.1
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Sortables
+ *
+ * Depends:
+ * ui.core.js
+ */ (function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.1",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);; \ No newline at end of file
diff --git a/admin/scripts/jquery.js b/admin/scripts/jquery.js
new file mode 100644
index 0000000..b1ae21d
--- /dev/null
+++ b/admin/scripts/jquery.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/admin/scripts/markitup/images/body.png b/admin/scripts/markitup/images/body.png
new file mode 100644
index 0000000..cad1bea
--- /dev/null
+++ b/admin/scripts/markitup/images/body.png
Binary files differ
diff --git a/admin/scripts/markitup/images/jaysalvat.png b/admin/scripts/markitup/images/jaysalvat.png
new file mode 100644
index 0000000..83b76fa
--- /dev/null
+++ b/admin/scripts/markitup/images/jaysalvat.png
Binary files differ
diff --git a/admin/scripts/markitup/images/markitup.png b/admin/scripts/markitup/images/markitup.png
new file mode 100644
index 0000000..bb52e89
--- /dev/null
+++ b/admin/scripts/markitup/images/markitup.png
Binary files differ
diff --git a/admin/scripts/markitup/images/style.css b/admin/scripts/markitup/images/style.css
new file mode 100644
index 0000000..b29e3c7
--- /dev/null
+++ b/admin/scripts/markitup/images/style.css
@@ -0,0 +1,27 @@
+body {
+ background:#EEE url(body.png) repeat-x;
+ font: 13px "Trebuchet MS", Arial, Verdana;
+ padding-top:95px;
+}
+a {
+ text-decoration:none;
+ color:#3C769D;
+}
+h1 a,
+p em a {
+ display:block;
+ overflow:hidden;
+ text-indent:-1000px;
+ position:absolute;
+ top:0px; left:0px;
+}
+h1 a {
+ background:#EEE url(markitup.png) no-repeat top left;
+ width:245px; height:85px;
+ top:28px;
+}
+p em a {
+ background:transparent url(jaysalvat.png) no-repeat 10% 50%;
+ width:120px; height:28px;
+ left:30px;
+} \ No newline at end of file
diff --git a/admin/scripts/markitup/index.html b/admin/scripts/markitup/index.html
new file mode 100644
index 0000000..4049448
--- /dev/null
+++ b/admin/scripts/markitup/index.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>markItUp! Universal markup editor</title>
+<link rel="stylesheet" type="text/css" href="images/style.css" />
+<!-- jQuery -->
+<script type="text/javascript" src="jquery.pack.js"></script>
+<!-- markItUp! -->
+<script type="text/javascript" src="markitup/jquery.markitup.pack.js"></script>
+<!-- markItUp! toolbar settings -->
+<script type="text/javascript" src="markitup/sets/default/set.js"></script>
+<!-- markItUp! skin -->
+<link rel="stylesheet" type="text/css" href="markitup/skins/markitup/style.css" />
+<!-- markItUp! toolbar skin -->
+<link rel="stylesheet" type="text/css" href="markitup/sets/default/style.css" />
+</head>
+<body>
+<script type="text/javascript">
+<!--
+$(document).ready(function() {
+ // Add markItUp! to your textarea in one line
+ // $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
+ $('#markItUp').markItUp(mySettings);
+
+ // You can add content from anywhere in your page
+ // $.markItUp( { Settings } );
+ $('.add').click(function() {
+ $.markItUp( { openWith:'<opening tag>',
+ closeWith:'<\/closing tag>',
+ placeHolder:"New content"
+ }
+ );
+ return false;
+ });
+
+ // And you can add/remove markItUp! whenever you want
+ // $(textarea).markItUpRemove();
+ $('.toggle').click(function() {
+ if ($("#markItUp.markItUpEditor").length === 1) {
+ $("#markItUp").markItUpRemove();
+ $("span", this).text("get markItUp! back");
+ } else {
+ $('#markItUp').markItUp(mySettings);
+ $("span", this).text("remove markItUp!");
+ }
+ return false;
+ });
+});
+-->
+</script>
+<h1><a href="http://markitup.jaysalvat.com/">markItUp!</a></h1>
+<p><em><a href="http://www.jaysalvat.com">By Jay Salvat</a></em></p>
+<p>Downloads, examples and documentation at <a href="http://markitup.jaysalvat.com">http://markitup.jaysalvat.com</a>.</p>
+<p>Click <a href="#" class="add">this link to insert content</a> from anywhere in the page or <a href="#" class="toggle">this one to <span>remove markItUp!</span></a></p>
+<p>
+<textarea id="markItUp" cols="80" rows="20">
+&lt;h1&gt;Welcome on markItUp!&lt;/h1&gt;
+
+&lt;p&gt;&lt;strong&gt;markItUp!&lt;/strong&gt; is a JavaScript plugin built on the jQuery library. It allows you to turn any textarea into a markup editor. Html, Textile, Wiki Syntax, Markdown, BBcode or even your own markup system can be easily implemented.&lt;/p&gt;
+</textarea>
+</p>
+<p>Support the projet : <a href="http://markitup.jaysalvat.com/">Donate</a> | <a href="http://markitup.jaysalvat.com/">Contact</a></p>
+</body>
+</html>
diff --git a/admin/scripts/markitup/jquery.pack.js b/admin/scripts/markitup/jquery.pack.js
new file mode 100644
index 0000000..74cdfee
--- /dev/null
+++ b/admin/scripts/markitup/jquery.pack.js
@@ -0,0 +1,11 @@
+/*
+ * jQuery 1.2.3 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
+ * $Rev: 4663 $
+ */
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i<M;i++)7((11=18[i])!=V)Q(L a 1p 11){7(b===11[a])6w;7(5c&&11[a]&&1o 11[a]=="3V"&&b[a]&&!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="3N"+(1B 3v()).3L(),6t=0,5b={};L H=/z-?4X|86-?84|1w|6k|7Z-?1R/i;E.1s({7Y:J(a){1e.$=D;7(a)1e.3N=w;K E},1q:J(a){K!!a&&1o a!="25"&&!a.12&&a.1k!=1M&&/J/i.17(a+"")},3E:J(a){K a.1F&&!a.1h||a.28&&a.2i&&!a.2i.1h},5g:J(a){a=E.3g(a);7(a){L b=T.3S("6f")[0]||T.1F,1m=T.3s("1m");1m.U="1u/4m";7(E.14.1d)1m.1u=a;N 1m.38(T.5r(a));b.38(1m);b.34(1m)}},12:J(b,a){K b.12&&b.12.2E()==a.2E()},1T:{},O:J(c,d,b){c=c==1e?5b:c;L a=c[F];7(!a)a=c[F]=++6t;7(d&&!E.1T[a])E.1T[a]={};7(b!=10)E.1T[a][d]=b;K d?E.1T[a][d]:a},35:J(c,b){c=c==1e?5b:c;L a=c[F];7(b){7(E.1T[a]){2V E.1T[a][b];b="";Q(b 1p E.1T[a])1Q;7(!b)E.35(c)}}N{1S{2V c[F]}1X(e){7(c.52)c.52(F)}2V E.1T[a]}},R:J(c,a,b){7(b){7(c.M==10){Q(L d 1p c)7(a.1i(c[d],b)===S)1Q}N Q(L i=0,M=c.M;i<M;i++)7(a.1i(c[i],b)===S)1Q}N{7(c.M==10){Q(L d 1p c)7(a.1P(c[d],d,c[d])===S)1Q}N Q(L i=0,M=c.M,1A=c[0];i<M&&a.1P(1A,i,1A)!==S;1A=c[++i]){}}K c},1l:J(b,a,c,i,d){7(E.1q(a))a=a.1P(b,i);K a&&a.1k==51&&c=="2o"&&!H.17(d)?a+"2S":a},1t:{1b:J(c,b){E.R((b||"").23(/\\s+/),J(i,a){7(c.15==1&&!E.1t.3Y(c.1t,a))c.1t+=(c.1t?" ":"")+a})},1V:J(c,b){7(c.15==1)c.1t=b!=10?E.3y(c.1t.23(/\\s+/),J(a){K!E.1t.3Y(b,a)}).6a(" "):""},3Y:J(b,a){K E.33(a,(b.1t||b).3X().23(/\\s+/))>-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i<f.M;i++)7(f[i]!=V)2C[i].W.19=f[i]}7(k=="1w"&&d=="")d="1"}N 7(e.4n){L g=k.1r(/\\-(\\w)/g,J(a,b){K b.2E()});d=e.4n[k]||e.4n[g];7(!/^\\d+(2S)?$/i.17(d)&&/^\\d/.17(d)){L l=e.W.26,3K=e.3K.26;e.3K.26=e.4n.26;e.W.26=d||0;d=e.W.7f+"2S";e.W.26=l;e.3K.26=3K}}K d},4a:J(l,h){L k=[];h=h||T;7(1o h.3s==\'10\')h=h.2i||h[0]&&h[0].2i||T;E.R(l,J(i,d){7(!d)K;7(d.1k==51)d=d.3X();7(1o d=="25"){d=d.1r(/(<(\\w+)[^>]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+"></"+c+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>","</2k>"]||!f.1f("<9M")&&[1,"<73>","</73>"]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>","</1O>"]||!f.1f("<4v")&&[2,"<1O><1U>","</1U></1O>"]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>","</4v></1U></1O>"]||!f.1f("<7e")&&[2,"<1O><1U></1U><6V>","</6V></1O>"]||E.14.1d&&[1,"1x<1x>","</1x>"]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i<M;i++)a.1g(b[i]);N a=b.2K(0);K a},33:J(b,a){Q(L i=0,M=a.M;i<M;i++)7(a[i]==b)K i;K-1},37:J(a,b){7(E.14.1d){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1g(b[i])}N Q(L i=0;b[i];i++)a.1g(b[i]);K a},57:J(a){L c=[],2r={};1S{Q(L i=0,M=a.M;i<M;i++){L b=E.O(a[i]);7(!2r[b]){2r[b]=P;c.1g(a[i])}}}1X(e){c=a}K c},3y:J(c,a,d){L b=[];Q(L i=0,M=c.M;i<M;i++)7(!d&&a(c[i],i)||d&&!a(c[i],i))b.1g(c[i]);K b},2c:J(d,a){L c=[];Q(L i=0,M=d.M;i<M;i++){L b=a(d[i],i);7(b!==V&&b!=10){7(b.1k!=1M)b=[b];c=c.71(b)}}K c}});L v=8Y.8W.2h();E.14={5K:(v.1D(/.+(?:8T|8S|8R|8O)[\\/: ]([\\d.]+)/)||[])[1],2d:/77/.17(v),2z:/2z/.17(v),1d:/1d/.17(v)&&!/2z/.17(v),48:/48/.17(v)&&!/(8L|77)/.17(v)};L y=E.14.1d?"6H":"75";E.1s({8I:!E.14.1d||T.6F=="79",46:{"Q":"8F","8E":"1t","4g":y,75:y,6H:y,3d:"3d",1t:"1t",1A:"1A",2Y:"2Y",3k:"3k",8C:"8B",2p:"2p",8A:"8z",3T:"3T",6C:"6C",28:"28",12:"12"}});E.R({6B:J(a){K a.1a},8y:J(a){K E.4u(a,"1a")},8x:J(a){K E.2Z(a,2,"2B")},8v:J(a){K E.2Z(a,2,"4t")},8u:J(a){K E.4u(a,"2B")},8t:J(a){K E.4u(a,"4t")},8s:J(a){K E.5i(a.1a.1C,a)},8r:J(a){K E.5i(a.1C)},6z:J(a){K E.12(a,"8q")?a.8o||a.8n.T:E.2I(a.3p)}},J(c,d){E.1n[c]=J(b){L a=E.2c(6,d);7(b&&1o b=="25")a=E.3e(b,a);K 6.2F(E.57(a))}});E.R({6y:"3t",8m:"6q",3o:"6o",8l:"5a",8k:"6S"},J(c,b){E.1n[c]=J(){L a=18;K 6.R(J(){Q(L i=0,M=a.M;i<M;i++)E(a[i])[b](6)})}});E.R({8j:J(a){E.1J(6,a,"");7(6.15==1)6.52(a)},8i:J(a){E.1t.1b(6,a)},8h:J(a){E.1t.1V(6,a)},8g:J(a){E.1t[E.1t.3Y(6,a)?"1V":"1b"](6,a)},1V:J(a){7(!a||E.1E(a,[6]).r.M){E("*",6).1b(6).R(J(){E.16.1V(6);E.35(6)});7(6.1a)6.1a.34(6)}},4x:J(){E(">*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K i<m[3]-0},88:J(a,i,m){K i>m[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i<T.4L.M;i++)7(T.4L[i].2Y){3z(18.3R,0);K}E.21()},S);7(E.14.2d){L a;(J(){7(E.2Q)K;7(T.39!="5V"&&T.39!="1y"){3z(18.3R,0);K}7(a===10)a=E("W, 7a[7A=7z]").M;7(T.4L.M!=a){3z(18.3R,0);K}E.21()})()}E.16.1b(1e,"3U",E.21)}E.R(("7y,7x,3U,7w,5d,4H,4V,7v,"+"7G,7u,7t,4P,4O,7s,2k,"+"58,7K,7q,7p,3a").23(","),J(i,b){E.1n[b]=J(a){K a?6.2j(b,a):6.1N(b)}});L I=J(a,c){L b=a.4S;2b(b&&b!=c)1S{b=b.1a}1X(3a){b=c}K b==c};E(1e).2j("4H",J(){E("*").1b(T).3w()});E.1n.1s({3U:J(g,d,c){7(E.1q(g))K 6.2j("3U",g);L e=g.1f(" ");7(e>=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i<a.M;i++)7(!a[i]())a.72(i--,1);7(!a.M){6I(E.3W);E.3W=V}},13)}},1G:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1G=P;6.45(0,6.2m());7(6.1l=="27"||6.1l=="1R")6.Y.W[6.1l]="8N";E(6.Y).1G()},1I:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1I=P;6.45(6.2m(),0)},30:J(a){L t=(1B 3v()).3L();7(a||t>6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{})) \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/jquery.markitup.js b/admin/scripts/markitup/markitup/jquery.markitup.js
new file mode 100644
index 0000000..1bdf319
--- /dev/null
+++ b/admin/scripts/markitup/markitup/jquery.markitup.js
@@ -0,0 +1,553 @@
+// ----------------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// v 1.1.5
+// Dual licensed under the MIT and GPL licenses.
+// ----------------------------------------------------------------------------
+// Copyright (C) 2007-2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// ----------------------------------------------------------------------------
+(function($) {
+ $.fn.markItUp = function(settings, extraSettings) {
+ var options, ctrlKey, shiftKey, altKey;
+ ctrlKey = shiftKey = altKey = false;
+
+ options = { id: '',
+ nameSpace: '',
+ root: '',
+ previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
+ previewAutoRefresh: true,
+ previewPosition: 'after',
+ previewTemplatePath: '~/templates/preview.html',
+ previewParserPath: '',
+ previewParserVar: 'data',
+ resizeHandle: true,
+ beforeInsert: '',
+ afterInsert: '',
+ onEnter: {},
+ onShiftEnter: {},
+ onCtrlEnter: {},
+ onTab: {},
+ markupSet: [ { /* set */ } ]
+ };
+ $.extend(options, settings, extraSettings);
+
+ // compute markItUp! path
+ if (!options.root) {
+ $('script').each(function(a, tag) {
+ miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
+ if (miuScript !== null) {
+ options.root = miuScript[1];
+ }
+ });
+ }
+
+ return this.each(function() {
+ var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
+ clicked, hash, header, footer, previewWindow, template, iFrame, abort;
+ $$ = $(this);
+ textarea = this;
+ levels = [];
+ abort = false;
+ scrollPosition = caretPosition = 0;
+ caretOffset = -1;
+
+ options.previewParserPath = localize(options.previewParserPath);
+ options.previewTemplatePath = localize(options.previewTemplatePath);
+
+ // apply the computed path to ~/
+ function localize(data, inText) {
+ if (inText) {
+ return data.replace(/("|')~\//g, "$1"+options.root);
+ }
+ return data.replace(/^~\//, options.root);
+ }
+
+ // init and build editor
+ function init() {
+ id = ''; nameSpace = '';
+ if (options.id) {
+ id = 'id="'+options.id+'"';
+ } else if ($$.attr("id")) {
+ id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
+
+ }
+ if (options.nameSpace) {
+ nameSpace = 'class="'+options.nameSpace+'"';
+ }
+ $$.wrap('<div '+nameSpace+'></div>');
+ $$.wrap('<div '+id+' class="markItUp"></div>');
+ $$.wrap('<div class="markItUpContainer"></div>');
+ $$.addClass("markItUpEditor");
+
+ // add the header before the textarea
+ header = $('<div class="markItUpHeader"></div>').insertBefore($$);
+ $(dropMenus(options.markupSet)).appendTo(header);
+
+ // add the footer after the textarea
+ footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
+
+ // add the resize handle after textarea
+ if (options.resizeHandle === true && $.browser.safari !== true) {
+ resizeHandle = $('<div class="markItUpResizeHandle"></div>')
+ .insertAfter($$)
+ .bind("mousedown", function(e) {
+ var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
+ mouseMove = function(e) {
+ $$.css("height", Math.max(20, e.clientY+h-y)+"px");
+ return false;
+ };
+ mouseUp = function(e) {
+ $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
+ return false;
+ };
+ $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
+ });
+ footer.append(resizeHandle);
+ }
+
+ // listen key events
+ $$.keydown(keyPressed).keyup(keyPressed);
+
+ // bind an event to catch external calls
+ $$.bind("insertion", function(e, settings) {
+ if (settings.target !== false) {
+ get();
+ }
+ if (textarea === $.markItUp.focused) {
+ markup(settings);
+ }
+ });
+
+ // remember the last focus
+ $$.focus(function() {
+ $.markItUp.focused = this;
+ });
+ }
+
+ // recursively build header with dropMenus from markupset
+ function dropMenus(markupSet) {
+ var ul = $('<ul></ul>'), i = 0;
+ $('li:hover > ul', ul).css('display', 'block');
+ $.each(markupSet, function() {
+ var button = this, t = '', title, li, j;
+ title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
+ key = (button.key) ? 'accesskey="'+button.key+'"' : '';
+ if (button.separator) {
+ li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
+ } else {
+ i++;
+ for (j = levels.length -1; j >= 0; j--) {
+ t += levels[j]+"-";
+ }
+ li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
+ .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
+ return false;
+ }).click(function() {
+ return false;
+ }).mouseup(function() {
+ if (button.call) {
+ eval(button.call)();
+ }
+ markup(button);
+ return false;
+ }).hover(function() {
+ $('> ul', this).show();
+ $(document).one('click', function() { // close dropmenu if click outside
+ $('ul ul', header).hide();
+ }
+ );
+ }, function() {
+ $('> ul', this).hide();
+ }
+ ).appendTo(ul);
+ if (button.dropMenu) {
+ levels.push(i);
+ $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
+ }
+ }
+ });
+ levels.pop();
+ return ul;
+ }
+
+ // markItUp! markups
+ function magicMarkups(string) {
+ if (string) {
+ string = string.toString();
+ string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
+ function(x, a) {
+ var b = a.split('|!|');
+ if (altKey === true) {
+ return (b[1] !== undefined) ? b[1] : b[0];
+ } else {
+ return (b[1] === undefined) ? "" : b[0];
+ }
+ }
+ );
+ // [![prompt]!], [![prompt:!:value]!]
+ string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
+ function(x, a) {
+ var b = a.split(':!:');
+ if (abort === true) {
+ return false;
+ }
+ value = prompt(b[0], (b[1]) ? b[1] : '');
+ if (value === null) {
+ abort = true;
+ }
+ return value;
+ }
+ );
+ return string;
+ }
+ return "";
+ }
+
+ // prepare action
+ function prepare(action) {
+ if ($.isFunction(action)) {
+ action = action(hash);
+ }
+ return magicMarkups(action);
+ }
+
+ // build block to insert
+ function build(string) {
+ openWith = prepare(clicked.openWith);
+ placeHolder = prepare(clicked.placeHolder);
+ replaceWith = prepare(clicked.replaceWith);
+ closeWith = prepare(clicked.closeWith);
+ if (replaceWith !== "") {
+ block = openWith + replaceWith + closeWith;
+ } else if (selection === '' && placeHolder !== '') {
+ block = openWith + placeHolder + closeWith;
+ } else {
+ block = openWith + (string||selection) + closeWith;
+ }
+ return { block:block,
+ openWith:openWith,
+ replaceWith:replaceWith,
+ placeHolder:placeHolder,
+ closeWith:closeWith
+ };
+ }
+
+ // define markup to insert
+ function markup(button) {
+ var len, j, n, i;
+ hash = clicked = button;
+ get();
+
+ $.extend(hash, { line:"",
+ root:options.root,
+ textarea:textarea,
+ selection:(selection||''),
+ caretPosition:caretPosition,
+ ctrlKey:ctrlKey,
+ shiftKey:shiftKey,
+ altKey:altKey
+ }
+ );
+ // callbacks before insertion
+ prepare(options.beforeInsert);
+ prepare(clicked.beforeInsert);
+ if (ctrlKey === true && shiftKey === true) {
+ prepare(clicked.beforeMultiInsert);
+ }
+ $.extend(hash, { line:1 });
+
+ if (ctrlKey === true && shiftKey === true) {
+ lines = selection.split(/\r?\n/);
+ for (j = 0, n = lines.length, i = 0; i < n; i++) {
+ if ($.trim(lines[i]) !== '') {
+ $.extend(hash, { line:++j, selection:lines[i] } );
+ lines[i] = build(lines[i]).block;
+ } else {
+ lines[i] = "";
+ }
+ }
+ string = { block:lines.join('\n')};
+ start = caretPosition;
+ len = string.block.length + (($.browser.opera) ? n : 0);
+ } else if (ctrlKey === true) {
+ string = build(selection);
+ start = caretPosition + string.openWith.length;
+ len = string.block.length - string.openWith.length - string.closeWith.length;
+ len -= fixIeBug(string.block);
+ } else if (shiftKey === true) {
+ string = build(selection);
+ start = caretPosition;
+ len = string.block.length;
+ len -= fixIeBug(string.block);
+ } else {
+ string = build(selection);
+ start = caretPosition + string.block.length ;
+ len = 0;
+ start -= fixIeBug(string.block);
+ }
+ if ((selection === '' && string.replaceWith === '')) {
+ caretOffset += fixOperaBug(string.block);
+
+ start = caretPosition + string.openWith.length;
+ len = string.block.length - string.openWith.length - string.closeWith.length;
+
+ caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
+ caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
+ }
+ $.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
+
+ if (string.block !== selection && abort === false) {
+ insert(string.block);
+ set(start, len);
+ } else {
+ caretOffset = -1;
+ }
+ get();
+
+ $.extend(hash, { line:'', selection:selection });
+
+ // callbacks after insertion
+ if (ctrlKey === true && shiftKey === true) {
+ prepare(clicked.afterMultiInsert);
+ }
+ prepare(clicked.afterInsert);
+ prepare(options.afterInsert);
+
+ // refresh preview if opened
+ if (previewWindow && options.previewAutoRefresh) {
+ refreshPreview();
+ }
+
+ // reinit keyevent
+ shiftKey = altKey = ctrlKey = abort = false;
+ }
+
+ // Substract linefeed in Opera
+ function fixOperaBug(string) {
+ if ($.browser.opera) {
+ return string.length - string.replace(/\n*/g, '').length;
+ }
+ return 0;
+ }
+ // Substract linefeed in IE
+ function fixIeBug(string) {
+ if ($.browser.msie) {
+ return string.length - string.replace(/\r*/g, '').length;
+ }
+ return 0;
+ }
+
+ // add markup
+ function insert(block) {
+ if (document.selection) {
+ var newSelection = document.selection.createRange();
+ newSelection.text = block;
+ } else {
+ $$.val($$.val().substring(0, caretPosition) + block + $$.val().substring(caretPosition + selection.length, $$.val().length));
+ }
+ }
+
+ // set a selection
+ function set(start, len) {
+ if (textarea.createTextRange){
+ // quick fix to make it work on Opera 9.5
+ if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
+ return false;
+ }
+ range = textarea.createTextRange();
+ range.collapse(true);
+ range.moveStart('character', start);
+ range.moveEnd('character', len);
+ range.select();
+ } else if (textarea.setSelectionRange ){
+ textarea.setSelectionRange(start, start + len);
+ }
+ textarea.scrollTop = scrollPosition;
+ textarea.focus();
+ }
+
+ // get the selection
+ function get() {
+ textarea.focus();
+
+ scrollPosition = textarea.scrollTop;
+ if (document.selection) {
+ selection = document.selection.createRange().text;
+ if ($.browser.msie) { // ie
+ var range = document.selection.createRange(), rangeCopy = range.duplicate();
+ rangeCopy.moveToElementText(textarea);
+ caretPosition = -1;
+ while(rangeCopy.inRange(range)) { // fix most of the ie bugs with linefeeds...
+ rangeCopy.moveStart('character');
+ caretPosition ++;
+ }
+ } else { // opera
+ caretPosition = textarea.selectionStart;
+ }
+ } else { // gecko
+ caretPosition = textarea.selectionStart;
+ selection = $$.val().substring(caretPosition, textarea.selectionEnd);
+ }
+ return selection;
+ }
+
+ // open preview window
+ function preview() {
+ if (!previewWindow || previewWindow.closed) {
+ if (options.previewInWindow) {
+ previewWindow = window.open('', 'preview', options.previewInWindow);
+ } else {
+ iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
+ if (options.previewPosition == 'after') {
+ iFrame.insertAfter(footer);
+ } else {
+ iFrame.insertBefore(header);
+ }
+ previewWindow = iFrame[iFrame.length-1].contentWindow || frame[iFrame.length-1];
+ }
+ } else if (altKey === true) {
+ if (iFrame) {
+ iFrame.remove();
+ }
+ previewWindow.close();
+ previewWindow = iFrame = false;
+ }
+ if (!options.previewAutoRefresh) {
+ refreshPreview();
+ }
+ }
+
+ // refresh Preview window
+ function refreshPreview() {
+ if (previewWindow.document) {
+ try {
+ sp = previewWindow.document.documentElement.scrollTop
+ } catch(e) {
+ sp = 0;
+ }
+ previewWindow.document.open();
+ previewWindow.document.write(renderPreview());
+ previewWindow.document.close();
+ previewWindow.document.documentElement.scrollTop = sp;
+ }
+ if (options.previewInWindow) {
+ previewWindow.focus();
+ }
+ }
+
+ function renderPreview() {
+ if (options.previewParserPath !== '') {
+ $.ajax( {
+ type: 'POST',
+ async: false,
+ url: options.previewParserPath,
+ data: options.previewParserVar+'='+encodeURIComponent($$.val()),
+ success: function(data) {
+ phtml = localize(data, 1);
+ }
+ } );
+ } else {
+ if (!template) {
+ $.ajax( {
+ async: false,
+ url: options.previewTemplatePath,
+ success: function(data) {
+ template = localize(data, 1);
+ }
+ } );
+ }
+ phtml = template.replace(/<!-- content -->/g, $$.val());
+ }
+ return phtml;
+ }
+
+ // set keys pressed
+ function keyPressed(e) {
+ shiftKey = e.shiftKey;
+ altKey = e.altKey;
+ ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false;
+
+ if (e.type === 'keydown') {
+ if (ctrlKey === true) {
+ li = $("a[accesskey="+String.fromCharCode(e.keyCode)+"]", header).parent('li');
+ if (li.length !== 0) {
+ ctrlKey = false;
+ li.triggerHandler('mouseup');
+ return false;
+ }
+ }
+ if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
+ if (ctrlKey === true) { // Enter + Ctrl
+ ctrlKey = false;
+ markup(options.onCtrlEnter);
+ return options.onCtrlEnter.keepDefault;
+ } else if (shiftKey === true) { // Enter + Shift
+ shiftKey = false;
+ markup(options.onShiftEnter);
+ return options.onShiftEnter.keepDefault;
+ } else { // only Enter
+ markup(options.onEnter);
+ return options.onEnter.keepDefault;
+ }
+ }
+ if (e.keyCode === 9) { // Tab key
+ if (shiftKey == true || ctrlKey == true || altKey == true) { // Thx Dr Floob.
+ return false;
+ }
+ if (caretOffset !== -1) {
+ get();
+ caretOffset = $$.val().length - caretOffset;
+ set(caretOffset, 0);
+ caretOffset = -1;
+ return false;
+ } else {
+ markup(options.onTab);
+ return options.onTab.keepDefault;
+ }
+ }
+ }
+ }
+
+ init();
+ });
+ };
+
+ $.fn.markItUpRemove = function() {
+ return this.each(function() {
+ $$ = $(this).unbind().removeClass('markItUpEditor');
+ $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
+ }
+ );
+ };
+
+ $.markItUp = function(settings) {
+ var options = { target:false };
+ $.extend(options, settings);
+ if (options.target) {
+ return $(options.target).each(function() {
+ $(this).focus();
+ $(this).trigger('insertion', [options]);
+ });
+ } else {
+ $('textarea').trigger('insertion', [options]);
+ }
+ };
+})(jQuery);
diff --git a/admin/scripts/markitup/markitup/jquery.markitup.pack.js b/admin/scripts/markitup/markitup/jquery.markitup.pack.js
new file mode 100644
index 0000000..f1244c9
--- /dev/null
+++ b/admin/scripts/markitup/markitup/jquery.markitup.pack.js
@@ -0,0 +1,9 @@
+// ----------------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// v 1.1.5
+// Dual licensed under the MIT and GPL licenses.
+// ----------------------------------------------------------------------------
+// Copyright (C) 2007-2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){$.24.T=3(f,g){E k,v,A,F;v=A=F=7;k={C:\'\',12:\'\',U:\'\',1j:\'\',1A:8,25:\'26\',1k:\'~/2Q/1B.1C\',1b:\'\',27:\'28\',1l:8,1D:\'\',1E:\'\',1F:{},1G:{},1H:{},1I:{},29:[{}]};$.V(k,f,g);2(!k.U){$(\'2R\').1c(3(a,b){1J=$(b).14(0).2S.2T(/(.*)2U\\.2V(\\.2W)?\\.2X$/);2(1J!==2a){k.U=1J[1]}})}4 G.1c(3(){E d,u,15,16,p,H,L,P,17,1m,w,1n,M,18;d=$(G);u=G;15=[];18=7;16=p=0;H=-1;k.1b=1d(k.1b);k.1k=1d(k.1k);3 1d(a,b){2(b){4 a.W(/("|\')~\\//g,"$1"+k.U)}4 a.W(/^~\\//,k.U)}3 2b(){C=\'\';12=\'\';2(k.C){C=\'C="\'+k.C+\'"\'}l 2(d.1K("C")){C=\'C="T\'+(d.1K("C").2c(0,1).2Y())+(d.1K("C").2c(1))+\'"\'}2(k.12){12=\'N="\'+k.12+\'"\'}d.1L(\'<z \'+12+\'></z>\');d.1L(\'<z \'+C+\' N="T"></z>\');d.1L(\'<z N="2Z"></z>\');d.2d("2e");17=$(\'<z N="30"></z>\').2f(d);$(1M(k.29)).1N(17);1m=$(\'<z N="31"></z>\').1O(d);2(k.1l===8&&$.X.32!==8){1l=$(\'<z N="33"></z>\').1O(d).1e("34",3(e){E h=d.2g(),y=e.2h,1o,1p;1o=3(e){d.2i("2g",35.36(20,e.2h+h-y)+"37");4 7};1p=3(e){$("1C").1P("2j",1o).1P("1q",1p);4 7};$("1C").1e("2j",1o).1e("1q",1p)});1m.2k(1l)}d.2l(1Q).38(1Q);d.1e("1R",3(e,a){2(a.1r!==7){14()}2(u===$.T.2m){Y(a)}});d.1f(3(){$.T.2m=G})}3 1M(b){E c=$(\'<Z></Z>\'),i=0;$(\'B:2n > Z\',c).2i(\'39\',\'q\');$.1c(b,3(){E a=G,t=\'\',1s,B,j;1s=(a.19)?(a.1S||\'\')+\' [3a+\'+a.19+\']\':(a.1S||\'\');19=(a.19)?\'2o="\'+a.19+\'"\':\'\';2(a.2p){B=$(\'<B N="3b">\'+(a.2p||\'\')+\'</B>\').1N(c)}l{i++;2q(j=15.6-1;j>=0;j--){t+=15[j]+"-"}B=$(\'<B N="2r 2r\'+t+(i)+\' \'+(a.3c||\'\')+\'"><a 3d="" \'+19+\' 1s="\'+1s+\'">\'+(a.1S||\'\')+\'</a></B>\').1e("3e",3(){4 7}).2s(3(){4 7}).1q(3(){2(a.2t){3f(a.2t)()}Y(a);4 7}).2n(3(){$(\'> Z\',G).3g();$(D).3h(\'2s\',3(){$(\'Z Z\',17).2u()})},3(){$(\'> Z\',G).2u()}).1N(c);2(a.2v){15.3i(i);$(B).2d(\'3j\').2k(1M(a.2v))}}});15.3k();4 c}3 2w(c){2(c){c=c.3l();c=c.W(/\\(\\!\\(([\\s\\S]*?)\\)\\!\\)/g,3(x,a){E b=a.1T(\'|!|\');2(F===8){4(b[1]!==2x)?b[1]:b[0]}l{4(b[1]===2x)?"":b[0]}});c=c.W(/\\[\\!\\[([\\s\\S]*?)\\]\\!\\]/g,3(x,a){E b=a.1T(\':!:\');2(18===8){4 7}1U=3m(b[0],(b[1])?b[1]:\'\');2(1U===2a){18=8}4 1U});4 c}4""}3 I(a){2($.3n(a)){a=a(P)}4 2w(a)}3 1g(a){J=I(L.J);1a=I(L.1a);Q=I(L.Q);O=I(L.O);2(Q!==""){q=J+Q+O}l 2(m===\'\'&&1a!==\'\'){q=J+1a+O}l{q=J+(a||m)+O}4{q:q,J:J,Q:Q,1a:1a,O:O}}3 Y(a){E b,j,n,i;P=L=a;14();$.V(P,{1t:"",U:k.U,u:u,m:(m||\'\'),p:p,v:v,A:A,F:F});I(k.1D);I(L.1D);2(v===8&&A===8){I(L.3o)}$.V(P,{1t:1});2(v===8&&A===8){R=m.1T(/\\r?\\n/);2q(j=0,n=R.6,i=0;i<n;i++){2($.3p(R[i])!==\'\'){$.V(P,{1t:++j,m:R[i]});R[i]=1g(R[i]).q}l{R[i]=""}}o={q:R.3q(\'\\n\')};11=p;b=o.q.6+(($.X.1V)?n:0)}l 2(v===8){o=1g(m);11=p+o.J.6;b=o.q.6-o.J.6-o.O.6;b-=1u(o.q)}l 2(A===8){o=1g(m);11=p;b=o.q.6;b-=1u(o.q)}l{o=1g(m);11=p+o.q.6;b=0;11-=1u(o.q)}2((m===\'\'&&o.Q===\'\')){H+=1W(o.q);11=p+o.J.6;b=o.q.6-o.J.6-o.O.6;H=d.K().1h(p,d.K().6).6;H-=1W(d.K().1h(0,p))}$.V(P,{p:p,16:16});2(o.q!==m&&18===7){2y(o.q);1X(11,b)}l{H=-1}14();$.V(P,{1t:\'\',m:m});2(v===8&&A===8){I(L.3r)}I(L.1E);I(k.1E);2(w&&k.1A){1Y()}A=F=v=18=7}3 1W(a){2($.X.1V){4 a.6-a.W(/\\n*/g,\'\').6}4 0}3 1u(a){2($.X.2z){4 a.6-a.W(/\\r*/g,\'\').6}4 0}3 2y(a){2(D.m){E b=D.m.1Z();b.2A=a}l{d.K(d.K().1h(0,p)+a+d.K().1h(p+m.6,d.K().6))}}3 1X(a,b){2(u.2B){2($.X.1V&&$.X.3s>=9.5&&b==0){4 7}1i=u.2B();1i.3t(8);1i.2C(\'21\',a);1i.3u(\'21\',b);1i.3v()}l 2(u.2D){u.2D(a,a+b)}u.1v=16;u.1f()}3 14(){u.1f();16=u.1v;2(D.m){m=D.m.1Z().2A;2($.X.2z){E a=D.m.1Z(),1w=a.3w();1w.3x(u);p=-1;3y(1w.3z(a)){1w.2C(\'21\');p++}}l{p=u.2E}}l{p=u.2E;m=d.K().1h(p,u.3A)}4 m}3 1B(){2(!w||w.3B){2(k.1j){w=3C.2F(\'\',\'1B\',k.1j)}l{M=$(\'<2G N="3D"></2G>\');2(k.25==\'26\'){M.1O(1m)}l{M.2f(17)}w=M[M.6-1].3E||3F[M.6-1]}}l 2(F===8){2(M){M.3G()}w.2H();w=M=7}2(!k.1A){1Y()}}3 1Y(){2(w.D){3H{22=w.D.2I.1v}3I(e){22=0}w.D.2F();w.D.3J(2J());w.D.2H();w.D.2I.1v=22}2(k.1j){w.1f()}}3 2J(){2(k.1b!==\'\'){$.2K({2L:\'3K\',2M:7,2N:k.1b,28:k.27+\'=\'+3L(d.K()),2O:3(a){23=1d(a,1)}})}l{2(!1n){$.2K({2M:7,2N:k.1k,2O:3(a){1n=1d(a,1)}})}23=1n.W(/<!-- 3M -->/g,d.K())}4 23}3 1Q(e){A=e.A;F=e.F;v=(!(e.F&&e.v))?e.v:7;2(e.2L===\'2l\'){2(v===8){B=$("a[2o="+3N.3O(e.1x)+"]",17).1y(\'B\');2(B.6!==0){v=7;B.3P(\'1q\');4 7}}2(e.1x===13||e.1x===10){2(v===8){v=7;Y(k.1H);4 k.1H.1z}l 2(A===8){A=7;Y(k.1G);4 k.1G.1z}l{Y(k.1F);4 k.1F.1z}}2(e.1x===9){2(A==8||v==8||F==8){4 7}2(H!==-1){14();H=d.K().6-H;1X(H,0);H=-1;4 7}l{Y(k.1I);4 k.1I.1z}}}}2b()})};$.24.3Q=3(){4 G.1c(3(){$$=$(G).1P().3R(\'2e\');$$.1y(\'z\').1y(\'z.T\').1y(\'z\').Q($$)})};$.T=3(a){E b={1r:7};$.V(b,a);2(b.1r){4 $(b.1r).1c(3(){$(G).1f();$(G).2P(\'1R\',[b])})}l{$(\'u\').2P(\'1R\',[b])}}})(3S);',62,241,'||if|function|return||length|false|true|||||||||||||else|selection||string|caretPosition|block||||textarea|ctrlKey|previewWindow|||div|shiftKey|li|id|document|var|altKey|this|caretOffset|prepare|openWith|val|clicked|iFrame|class|closeWith|hash|replaceWith|lines||markItUp|root|extend|replace|browser|markup|ul||start|nameSpace||get|levels|scrollPosition|header|abort|key|placeHolder|previewParserPath|each|localize|bind|focus|build|substring|range|previewInWindow|previewTemplatePath|resizeHandle|footer|template|mouseMove|mouseUp|mouseup|target|title|line|fixIeBug|scrollTop|rangeCopy|keyCode|parent|keepDefault|previewAutoRefresh|preview|html|beforeInsert|afterInsert|onEnter|onShiftEnter|onCtrlEnter|onTab|miuScript|attr|wrap|dropMenus|appendTo|insertAfter|unbind|keyPressed|insertion|name|split|value|opera|fixOperaBug|set|refreshPreview|createRange||character|sp|phtml|fn|previewPosition|after|previewParserVar|data|markupSet|null|init|substr|addClass|markItUpEditor|insertBefore|height|clientY|css|mousemove|append|keydown|focused|hover|accesskey|separator|for|markItUpButton|click|call|hide|dropMenu|magicMarkups|undefined|insert|msie|text|createTextRange|moveStart|setSelectionRange|selectionStart|open|iframe|close|documentElement|renderPreview|ajax|type|async|url|success|trigger|templates|script|src|match|jquery|markitup|pack|js|toUpperCase|markItUpContainer|markItUpHeader|markItUpFooter|safari|markItUpResizeHandle|mousedown|Math|max|px|keyup|display|Ctrl|markItUpSeparator|className|href|contextmenu|eval|show|one|push|markItUpDropMenu|pop|toString|prompt|isFunction|beforeMultiInsert|trim|join|afterMultiInsert|version|collapse|moveEnd|select|duplicate|moveToElementText|while|inRange|selectionEnd|closed|window|markItUpPreviewFrame|contentWindow|frame|remove|try|catch|write|POST|encodeURIComponent|content|String|fromCharCode|triggerHandler|markItUpRemove|removeClass|jQuery'.split('|'),0,{})) \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/readme.txt b/admin/scripts/markitup/markitup/readme.txt
new file mode 100644
index 0000000..8e52604
--- /dev/null
+++ b/admin/scripts/markitup/markitup/readme.txt
@@ -0,0 +1,62 @@
+markItUp! 1.1.5
+
+CHANGE LOG
+markItUp! 1.1.5 2009-05-01
+- Modified: http://drupal.org/project/wysiwyg compatibility
+- Modified: Alt/Ctrl/Alt+Tab are now disabled
+
+markItUp! 1.1.4 2008-12-03
+- Fixed: Extra quote deleted line 95
+
+markItUp! 1.1.3 2008-09-12
+- Fixed: IE7 preview problem
+
+markItUp! 1.1.2 2008-07-17
+- Fixed: Quick fix for Opera 9.5 caret position problem after insertion
+
+markItUp! 1.1.1 2008-06-02
+- Fixed: Key events status are passed to callbacks properly
+- Improved: ScrollPosition is kept in the preview when its refreshed
+
+markItUp! 1.1.0 2008-05-04
+- Modified: Textarea's id is no more moved to the main container
+- Modified: NameSpace Span become a Div to remain strict
+- Added: Relative path to the script is computed
+- Added: Relative path to the script passed to callbacks
+- Added: Global instance ID property
+- Added: $(element).markItUpRemove() to remove markItUp!
+- Added: Resize handle is now optional with resizeHandle property
+- Added: Property previewInWindow is added and accept window parameter
+- Added: Property previewPosition is added
+- Modified: Resize handle is no more displayed in Safari to avoid repetition with the native handle
+- Modified: Property previewIframeRefresh become previewAutorefresh
+- Modified: Built-in Html Preview call a template file
+- Improved: Autorefreshing is now apply for preview in window too
+- Improved: Cancel button in prompt window cancel now the whole insertion process
+- Improved: Cleaner markItUp! code added to the DOM
+- Removed: Depreciated preview properties as previewBaseUrl, previewCharset, previewCssPath, previewBodyId, previewBodyClassName
+- Removed: Property previewIframe not longer exists
+- Fixed: "Magic markups" works with line feeds
+- Fixed: Key events are initialized after insertion
+- Fixed: Internet Explorer line feed offset bug
+- Fixed: Shortcut keys on Mac OS
+- Fixed: Ctrl+click works and doesn't open Mac context menu anymore
+- Fixed: Ctrl+click works and doesn't open the page in a new tab anymore
+- Fixed: Minor Css modifications
+
+markItUp! 1.0.3 2008-04-04
+- Fixed: IE7 Preview empty baseurl problem
+- Fixed: IE7 external targeted insertion
+- Added: Property scrollPosition is passed to callbacks functions
+
+markItUp! 1.0.2 2008-03-31
+- Fixed: IE7 Html preview problems
+- Fixed: Selection is kept if nothing is inserted
+- Improved: Code minified
+
+markItUp! 1.0.1 2008-03-21
+- Removed: Global PlaceHolder
+- Modified: Property previewCharset is setted to "utf-8" by default
+
+markItUp! 1.0.0 2008-03-01
+- First public release
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/bold.png b/admin/scripts/markitup/markitup/sets/bbcode/images/bold.png
new file mode 100644
index 0000000..889ae80
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/bold.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/clean.png b/admin/scripts/markitup/markitup/sets/bbcode/images/clean.png
new file mode 100644
index 0000000..7e7cefb
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/clean.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/code.png b/admin/scripts/markitup/markitup/sets/bbcode/images/code.png
new file mode 100644
index 0000000..63fe6ce
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/code.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/fonts.png b/admin/scripts/markitup/markitup/sets/bbcode/images/fonts.png
new file mode 100644
index 0000000..b7960db
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/fonts.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/italic.png b/admin/scripts/markitup/markitup/sets/bbcode/images/italic.png
new file mode 100644
index 0000000..8482ac8
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/italic.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/link.png b/admin/scripts/markitup/markitup/sets/bbcode/images/link.png
new file mode 100644
index 0000000..25eacb7
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/link.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/list-bullet.png b/admin/scripts/markitup/markitup/sets/bbcode/images/list-bullet.png
new file mode 100644
index 0000000..4a8672b
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/list-bullet.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/list-item.png b/admin/scripts/markitup/markitup/sets/bbcode/images/list-item.png
new file mode 100644
index 0000000..8cb4d69
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/list-item.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/list-numeric.png b/admin/scripts/markitup/markitup/sets/bbcode/images/list-numeric.png
new file mode 100644
index 0000000..33b0b8d
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/list-numeric.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/picture.png b/admin/scripts/markitup/markitup/sets/bbcode/images/picture.png
new file mode 100644
index 0000000..4a158fe
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/picture.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/preview.png b/admin/scripts/markitup/markitup/sets/bbcode/images/preview.png
new file mode 100644
index 0000000..a9925a0
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/preview.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/quotes.png b/admin/scripts/markitup/markitup/sets/bbcode/images/quotes.png
new file mode 100644
index 0000000..e54ebeb
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/quotes.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/stroke.png b/admin/scripts/markitup/markitup/sets/bbcode/images/stroke.png
new file mode 100644
index 0000000..612058a
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/stroke.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/images/underline.png b/admin/scripts/markitup/markitup/sets/bbcode/images/underline.png
new file mode 100644
index 0000000..90d0df2
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/images/underline.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/readme.txt b/admin/scripts/markitup/markitup/sets/bbcode/readme.txt
new file mode 100644
index 0000000..745d5dd
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/readme.txt
@@ -0,0 +1,11 @@
+Markup language:
+BBCode
+
+Description:
+A basic BBCode markup set with Bold, Italic, Underline, Picture, Link, Size, List, Quotes, Code, Clean button, Preview button.
+
+Install:
+- Download the zip file
+- Unzip it in your markItUp! sets folder
+- Modify your JS link to point at this set.js
+- Modify your CSS link to point at this style.css \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/set.js b/admin/scripts/markitup/markitup/sets/bbcode/set.js
new file mode 100644
index 0000000..4641a1d
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/set.js
@@ -0,0 +1,39 @@
+// ----------------------------------------------------------------------------
+// markItUp!
+// ----------------------------------------------------------------------------
+// Copyright (C) 2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// BBCode tags example
+// http://en.wikipedia.org/wiki/Bbcode
+// ----------------------------------------------------------------------------
+// Feel free to add more tags
+// ----------------------------------------------------------------------------
+mySettings = {
+ previewParserPath: '', // path to your BBCode parser
+ markupSet: [
+ {name:'Bold', key:'B', openWith:'[b]', closeWith:'[/b]'},
+ {name:'Italic', key:'I', openWith:'[i]', closeWith:'[/i]'},
+ {name:'Underline', key:'U', openWith:'[u]', closeWith:'[/u]'},
+ {separator:'---------------' },
+ {name:'Picture', key:'P', replaceWith:'[img][![Url]!][/img]'},
+ {name:'Link', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'},
+ {separator:'---------------' },
+ {name:'Size', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]',
+ dropMenu :[
+ {name:'Big', openWith:'[size=200]', closeWith:'[/size]' },
+ {name:'Normal', openWith:'[size=100]', closeWith:'[/size]' },
+ {name:'Small', openWith:'[size=50]', closeWith:'[/size]' }
+ ]},
+ {separator:'---------------' },
+ {name:'Bulleted list', openWith:'[list]\n', closeWith:'\n[/list]'},
+ {name:'Numeric list', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'},
+ {name:'List item', openWith:'[*] '},
+ {separator:'---------------' },
+ {name:'Quotes', openWith:'[quote]', closeWith:'[/quote]'},
+ {name:'Code', openWith:'[code]', closeWith:'[/code]'},
+ {separator:'---------------' },
+ {name:'Clean', className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } },
+ {name:'Preview', className:"preview", call:'preview' }
+ ]
+} \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/sets/bbcode/style.css b/admin/scripts/markitup/markitup/sets/bbcode/style.css
new file mode 100644
index 0000000..3da35fd
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/bbcode/style.css
@@ -0,0 +1,47 @@
+/* -------------------------------------------------------------------
+// markItUp!
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp .markItUpButton1 a {
+ background-image:url(images/bold.png);
+}
+.markItUp .markItUpButton2 a {
+ background-image:url(images/italic.png);
+}
+.markItUp .markItUpButton3 a {
+ background-image:url(images/underline.png);
+}
+
+.markItUp .markItUpButton4 a {
+ background-image:url(images/picture.png);
+}
+.markItUp .markItUpButton5 a {
+ background-image:url(images/link.png);
+}
+
+.markItUp .markItUpButton6 a {
+ background-image:url(images/fonts.png);
+}
+.markItUp .markItUpButton7 a {
+ background-image:url(images/list-bullet.png);
+}
+.markItUp .markItUpButton8 a {
+ background-image:url(images/list-numeric.png);
+}
+.markItUp .markItUpButton9 a {
+ background-image:url(images/list-item.png);
+}
+
+.markItUp .markItUpButton10 a {
+ background-image:url(images/quotes.png);
+}
+.markItUp .markItUpButton11 a {
+ background-image:url(images/code.png);
+}
+
+.markItUp .clean a {
+ background-image:url(images/clean.png);
+}
+.markItUp .preview a {
+ background-image:url(images/preview.png);
+} \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/sets/default/images/bold.png b/admin/scripts/markitup/markitup/sets/default/images/bold.png
new file mode 100644
index 0000000..889ae80
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/bold.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/images/clean.png b/admin/scripts/markitup/markitup/sets/default/images/clean.png
new file mode 100644
index 0000000..7e7cefb
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/clean.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/images/image.png b/admin/scripts/markitup/markitup/sets/default/images/image.png
new file mode 100644
index 0000000..fc3c393
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/image.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/images/italic.png b/admin/scripts/markitup/markitup/sets/default/images/italic.png
new file mode 100644
index 0000000..8482ac8
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/italic.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/images/link.png b/admin/scripts/markitup/markitup/sets/default/images/link.png
new file mode 100644
index 0000000..25eacb7
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/link.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/images/picture.png b/admin/scripts/markitup/markitup/sets/default/images/picture.png
new file mode 100644
index 0000000..4a158fe
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/picture.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/images/preview.png b/admin/scripts/markitup/markitup/sets/default/images/preview.png
new file mode 100644
index 0000000..a9925a0
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/preview.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/images/stroke.png b/admin/scripts/markitup/markitup/sets/default/images/stroke.png
new file mode 100644
index 0000000..612058a
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/images/stroke.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/sets/default/set.js b/admin/scripts/markitup/markitup/sets/default/set.js
new file mode 100644
index 0000000..2498b25
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/set.js
@@ -0,0 +1,27 @@
+// ----------------------------------------------------------------------------
+// markItUp!
+// ----------------------------------------------------------------------------
+// Copyright (C) 2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// Html tags
+// http://en.wikipedia.org/wiki/html
+// ----------------------------------------------------------------------------
+// Basic set. Feel free to add more tags
+// ----------------------------------------------------------------------------
+mySettings = {
+ onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
+ onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
+ onTab: {keepDefault:false, replaceWith:' '},
+ markupSet: [
+ {name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
+ {name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
+ {name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
+ {separator:'---------------' },
+ {name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
+ {name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
+ {separator:'---------------' },
+ {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
+ {name:'Preview', className:'preview', call:'preview'}
+ ]
+} \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/sets/default/style.css b/admin/scripts/markitup/markitup/sets/default/style.css
new file mode 100644
index 0000000..26cb927
--- /dev/null
+++ b/admin/scripts/markitup/markitup/sets/default/style.css
@@ -0,0 +1,27 @@
+/* -------------------------------------------------------------------
+// markItUp!
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp .markItUpButton1 a {
+ background-image:url(images/bold.png);
+}
+.markItUp .markItUpButton2 a {
+ background-image:url(images/italic.png);
+}
+.markItUp .markItUpButton3 a {
+ background-image:url(images/stroke.png);
+}
+
+.markItUp .markItUpButton4 a {
+ background-image:url(images/picture.png);
+}
+.markItUp .markItUpButton5 a {
+ background-image:url(images/link.png);
+}
+
+.markItUp .markItUpButton6 a {
+ background-image:url(images/clean.png);
+}
+.markItUp .preview a {
+ background-image:url(images/preview.png);
+} \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-container.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-container.png
new file mode 100644
index 0000000..a28e018
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-container.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png
new file mode 100644
index 0000000..39cdbd8
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png
new file mode 100644
index 0000000..b3188dc
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-html.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-html.png
new file mode 100644
index 0000000..11bff45
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-html.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-json.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-json.png
new file mode 100644
index 0000000..e898c1d
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-json.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-markdown.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-markdown.png
new file mode 100644
index 0000000..c199715
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-markdown.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-textile.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-textile.png
new file mode 100644
index 0000000..3ab1e9f
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-textile.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-wiki.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-wiki.png
new file mode 100644
index 0000000..7887181
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-wiki.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-xml.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-xml.png
new file mode 100644
index 0000000..33b1c5d
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor-xml.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor.png b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor.png
new file mode 100644
index 0000000..ab7cde4
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/bg-editor.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/handle.png b/admin/scripts/markitup/markitup/skins/markitup/images/handle.png
new file mode 100644
index 0000000..3993b20
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/handle.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/menu.png b/admin/scripts/markitup/markitup/skins/markitup/images/menu.png
new file mode 100644
index 0000000..44a07af
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/menu.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/images/submenu.png b/admin/scripts/markitup/markitup/skins/markitup/images/submenu.png
new file mode 100644
index 0000000..03d1977
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/images/submenu.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/markitup/style.css b/admin/scripts/markitup/markitup/skins/markitup/style.css
new file mode 100644
index 0000000..05f053c
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/markitup/style.css
@@ -0,0 +1,148 @@
+/* -------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp * {
+ margin:0px; padding:0px;
+ outline:none;
+}
+.markItUp a:link,
+.markItUp a:visited {
+ color:#000;
+ text-decoration:none;
+}
+.markItUp {
+ width:580px;
+ margin:5px 0 5px 0;
+ border:5px solid #F5F5F5;
+}
+.markItUpContainer {
+ border:1px solid #3C769D;
+ background:#FFF url(images/bg-container.png) repeat-x top left;
+ padding:5px 5px 2px 5px;
+ font:11px Verdana, Arial, Helvetica, sans-serif;
+}
+.markItUpEditor {
+ font:12px 'Courier New', Courier, monospace;
+ padding:5px 5px 5px 35px;
+ border:3px solid #3C769D;
+ width:567px;
+ height:320px;
+ background-image:url(images/bg-editor.png);
+ background-repeat:no-repeat;
+ clear:both; display:block;
+ line-height:18px;
+ overflow:auto;
+}
+.markItUpPreviewFrame {
+ overflow:auto;
+ background-color:#FFFFFF;
+ border:1px solid #3C769D;
+ width:99.9%;
+ height:300px;
+ margin:5px 0;
+}
+.markItUpFooter {
+ width:100%;
+ cursor:n-resize;
+}
+.markItUpResizeHandle {
+ overflow:hidden;
+ width:22px; height:5px;
+ margin-left:auto;
+ margin-right:auto;
+ background-image:url(images/handle.png);
+ cursor:n-resize;
+}
+/***************************************************************************************/
+/* first row of buttons */
+.markItUpHeader ul li {
+ list-style:none;
+ float:left;
+ position:relative;
+}
+.markItUpHeader ul li ul{
+ display:none;
+}
+.markItUpHeader ul li:hover > ul{
+ display:block;
+}
+.markItUpHeader ul .markItUpDropMenu {
+ background:transparent url(images/menu.png) no-repeat 115% 50%;
+ margin-right:5px;
+}
+.markItUpHeader ul .markItUpDropMenu li {
+ margin-right:0px;
+}
+.markItUpHeader ul .markItUpSeparator {
+ margin:0 10px;
+ width:1px;
+ height:16px;
+ overflow:hidden;
+ background-color:#CCC;
+}
+.markItUpHeader ul ul .markItUpSeparator {
+ width:auto; height:1px;
+ margin:0px;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul {
+ display:none;
+ position:absolute;
+ top:18px; left:0px;
+ background:#F5F5F5;
+ border:1px solid #3C769D;
+ height:inherit;
+}
+.markItUpHeader ul ul li {
+ float:none;
+ border-bottom:1px solid #3C769D;
+}
+.markItUpHeader ul ul .markItUpDropMenu {
+ background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul ul {
+ position:absolute;
+ top:-1px; left:150px;
+}
+.markItUpHeader ul ul ul li {
+ float:none;
+}
+.markItUpHeader ul a {
+ display:block;
+ width:16px; height:16px;
+ text-indent:-10000px;
+ background-repeat:no-repeat;
+ padding:3px;
+ margin:0px;
+}
+.markItUpHeader ul ul a {
+ display:block;
+ padding-left:0px;
+ text-indent:0;
+ width:120px;
+ padding:5px 5px 5px 25px;
+ background-position:2px 50%;
+}
+.markItUpHeader ul ul a:hover {
+ color:#FFF;
+ background-color:#3C769D;
+}
+/**************************************************************************************
+.html .markItUpEditor {
+ background-image:url(images/bg-editor-html.png);
+}
+.markdown .markItUpEditor {
+ background-image:url(images/bg-editor-markdown.png);
+}
+.textile .markItUpEditor {
+ background-image:url(images/bg-editor-textile.png);
+}
+.bbcode .markItUpEditor {
+ background-image:url(images/bg-editor-bbcode.png);
+}
+.wiki .markItUpEditor,
+.dotclear .markItUpEditor {
+ background-image:url(images/bg-editor-wiki.png);
+}*/ \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/skins/simple/images/handle.png b/admin/scripts/markitup/markitup/skins/simple/images/handle.png
new file mode 100644
index 0000000..3993b20
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/simple/images/handle.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/simple/images/menu.png b/admin/scripts/markitup/markitup/skins/simple/images/menu.png
new file mode 100644
index 0000000..44a07af
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/simple/images/menu.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/simple/images/submenu.png b/admin/scripts/markitup/markitup/skins/simple/images/submenu.png
new file mode 100644
index 0000000..03d1977
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/simple/images/submenu.png
Binary files differ
diff --git a/admin/scripts/markitup/markitup/skins/simple/style.css b/admin/scripts/markitup/markitup/skins/simple/style.css
new file mode 100644
index 0000000..1838ded
--- /dev/null
+++ b/admin/scripts/markitup/markitup/skins/simple/style.css
@@ -0,0 +1,118 @@
+/* -------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp * {
+ margin:0px; padding:0px;
+ outline:none;
+}
+.markItUp a:link,
+.markItUp a:visited {
+ color:#000;
+ text-decoration:none;
+}
+.markItUp {
+ width:700px;
+ margin:5px 0 5px 0;
+}
+.markItUpContainer {
+ font:11px Verdana, Arial, Helvetica, sans-serif;
+}
+.markItUpEditor {
+ font:12px 'Courier New', Courier, monospace;
+ padding:5px;
+ width:690px;
+ height:320px;
+ clear:both; display:block;
+ line-height:18px;
+ overflow:auto;
+}
+.markItUpPreviewFrame {
+ overflow:auto;
+ background-color:#FFF;
+ width:99.9%;
+ height:300px;
+ margin:5px 0;
+}
+.markItUpFooter {
+ width:100%;
+}
+.markItUpResizeHandle {
+ overflow:hidden;
+ width:22px; height:5px;
+ margin-left:auto;
+ margin-right:auto;
+ background-image:url(images/handle.png);
+ cursor:n-resize;
+}
+/***************************************************************************************/
+/* first row of buttons */
+.markItUpHeader ul li {
+ list-style:none;
+ float:left;
+ position:relative;
+}
+.markItUpHeader ul li:hover > ul{
+ display:block;
+}
+.markItUpHeader ul .markItUpDropMenu {
+ background:transparent url(images/menu.png) no-repeat 115% 50%;
+ margin-right:5px;
+}
+.markItUpHeader ul .markItUpDropMenu li {
+ margin-right:0px;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul {
+ display:none;
+ position:absolute;
+ top:18px; left:0px;
+ background:#FFF;
+ border:1px solid #000;
+}
+.markItUpHeader ul ul li {
+ float:none;
+ border-bottom:1px solid #000;
+}
+.markItUpHeader ul ul .markItUpDropMenu {
+ background:#FFF url(images/submenu.png) no-repeat 100% 50%;
+}
+.markItUpHeader ul .markItUpSeparator {
+ margin:0 10px;
+ width:1px;
+ height:16px;
+ overflow:hidden;
+ background-color:#CCC;
+}
+.markItUpHeader ul ul .markItUpSeparator {
+ width:auto; height:1px;
+ margin:0px;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul ul {
+ position:absolute;
+ top:-1px; left:150px;
+}
+.markItUpHeader ul ul ul li {
+ float:none;
+}
+.markItUpHeader ul a {
+ display:block;
+ width:16px; height:16px;
+ text-indent:-10000px;
+ background-repeat:no-repeat;
+ padding:3px;
+ margin:0px;
+}
+.markItUpHeader ul ul a {
+ display:block;
+ padding-left:0px;
+ text-indent:0;
+ width:120px;
+ padding:5px 5px 5px 25px;
+ background-position:2px 50%;
+}
+.markItUpHeader ul ul a:hover {
+ color:#FFF;
+ background-color:#000;
+}
diff --git a/admin/scripts/markitup/markitup/templates/preview.css b/admin/scripts/markitup/markitup/templates/preview.css
new file mode 100644
index 0000000..ad91a87
--- /dev/null
+++ b/admin/scripts/markitup/markitup/templates/preview.css
@@ -0,0 +1,5 @@
+/* preview style examples */
+body {
+ background-color:#EFEFEF;
+ font:70% Verdana, Arial, Helvetica, sans-serif;
+} \ No newline at end of file
diff --git a/admin/scripts/markitup/markitup/templates/preview.html b/admin/scripts/markitup/markitup/templates/preview.html
new file mode 100644
index 0000000..b8b3702
--- /dev/null
+++ b/admin/scripts/markitup/markitup/templates/preview.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>markItUp! preview template</title>
+<link rel="stylesheet" type="text/css" href="~/templates/preview.css" />
+</head>
+<body>
+<!-- content -->
+</body>
+</html>
diff --git a/admin/scripts/mocha.js b/admin/scripts/mocha.js
new file mode 100644
index 0000000..a220424
--- /dev/null
+++ b/admin/scripts/mocha.js
@@ -0,0 +1,156 @@
+/*
+ * --------------------------------------------------------------------
+ * Simple Password Strength Checker
+ * by Siddharth S, www.ssiddharth.com, hello@ssiddharth.com
+ * for Net Tuts, www.net.tutsplus.com
+ * Version: 1.0, 05.10.2009
+ * --------------------------------------------------------------------
+ */
+
+
+$(document).ready(function()
+{
+ var strPassword;
+ var charPassword;
+ var complexity = $("#complexity");
+ var rating = $("#rating")
+ var minPasswordLength = 6;
+ var baseScore = 0, score = 0;
+
+ var num = {};
+ num.Excess = 0;
+ num.Upper = 0;
+ num.Numbers = 0;
+ num.Symbols = 0;
+
+ var bonus = {};
+ bonus.Excess = 3;
+ bonus.Upper = 4;
+ bonus.Numbers = 5;
+ bonus.Symbols = 5;
+ bonus.Combo = 0;
+ bonus.FlatLower = 0;
+ bonus.FlatNumber = 0;
+
+ outputResult();
+ $("#inputPassword").bind("keyup", checkVal);
+
+function checkVal()
+{
+ init();
+
+ if (charPassword.length >= minPasswordLength)
+ {
+ baseScore = 50;
+ analyzeString();
+ calcComplexity();
+ }
+ else
+ {
+ baseScore = 0;
+ }
+
+ outputResult();
+}
+
+function init()
+{
+ strPassword= $("#inputPassword").val();
+ charPassword = strPassword.split("");
+
+ num.Excess = 0;
+ num.Upper = 0;
+ num.Numbers = 0;
+ num.Symbols = 0;
+ bonus.Combo = 0;
+ bonus.FlatLower = 0;
+ bonus.FlatNumber = 0;
+ baseScore = 0;
+ score =0;
+}
+
+function analyzeString ()
+{
+ for (i=0; i<charPassword.length;i++)
+ {
+ if (charPassword[i].match(/[A-Z]/g)) {num.Upper++;}
+ if (charPassword[i].match(/[0-9]/g)) {num.Numbers++;}
+ if (charPassword[i].match(/(.*[!,@,#,$,%,^,&,*,?,_,~])/)) {num.Symbols++;}
+ }
+
+ num.Excess = charPassword.length - minPasswordLength;
+
+ if (num.Upper && num.Numbers && num.Symbols)
+ {
+ bonus.Combo = 25;
+ }
+
+ else if ((num.Upper && num.Numbers) || (num.Upper && num.Symbols) || (num.Numbers && num.Symbols))
+ {
+ bonus.Combo = 15;
+ }
+
+ if (strPassword.match(/^[\sa-z]+$/))
+ {
+ bonus.FlatLower = -15;
+ }
+
+ if (strPassword.match(/^[\s0-9]+$/))
+ {
+ bonus.FlatNumber = -35;
+ }
+}
+
+function calcComplexity()
+{
+ score = baseScore + (num.Excess*bonus.Excess) + (num.Upper*bonus.Upper) + (num.Numbers*bonus.Numbers) + (num.Symbols*bonus.Symbols) + bonus.Combo + bonus.FlatLower + bonus.FlatNumber;
+
+}
+
+function outputResult()
+{
+ if ($("#inputPassword").val()== "")
+ {
+ complexity.html(" ");
+ rating.removeClass("short weak good strong secure").addClass("default");
+ }
+ else if (charPassword.length < minPasswordLength)
+ {
+ complexity.html("Too Short");
+ rating.removeClass("weak good strong secure").addClass("short");
+ }
+ else if (score<50)
+ {
+ complexity.html("Weak");
+ rating.removeClass("good strong secure").addClass("weak");
+ }
+ else if (score>=50 && score<75)
+ {
+ complexity.html("Good");
+ rating.removeClass("strong secure").addClass("good");
+ }
+ else if (score>=75 && score<100)
+ {
+ complexity.html("Strong");
+ rating.removeClass("secure").addClass("strong");
+ }
+ else if (score>=100)
+ {
+ complexity.html("Secure");
+ rating.addClass("secure");
+ }
+
+ /*
+ $("#details").html("Base Score :<span class=\"value\">" + baseScore + "</span>"
+ + "<br />Length Bonus :<span class=\"value\">" + (num.Excess*bonus.Excess) + " ["+num.Excess+"x"+bonus.Excess+"]</span> "
+ + "<br />Upper case bonus :<span class=\"value\">" + (num.Upper*bonus.Upper) + " ["+num.Upper+"x"+bonus.Upper+"]</span> "
+ + "<br />Number Bonus :<span class=\"value\"> " + (num.Numbers*bonus.Numbers) + " ["+num.Numbers+"x"+bonus.Numbers+"]</span>"
+ + "<br />Symbol Bonus :<span class=\"value\"> " + (num.Symbols*bonus.Symbols) + " ["+num.Symbols+"x"+bonus.Symbols+"]</span>"
+ + "<br />Combination Bonus :<span class=\"value\"> " + bonus.Combo + "</span>"
+ + "<br />Lower case only penalty :<span class=\"value\"> " + bonus.FlatLower + "</span>"
+ + "<br />Numbers only penalty :<span class=\"value\"> " + bonus.FlatNumber + "</span>"
+ + "<br />Total Score:<span class=\"value\"> " + score + "</span>" ); */
+}
+
+}
+);
diff --git a/admin/settings/functions.php b/admin/settings/functions.php
new file mode 100644
index 0000000..1e3ada4
--- /dev/null
+++ b/admin/settings/functions.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+
+function changePassword(){
+echo "<script type=\"text/javascript\" src=\"scripts/mocha.js\"></script>";
+ global $db;
+
+ if(isset($_POST['processed']))
+ {
+ $password = $_POST['password'];
+ $confirm = $_POST['confirm'];
+
+ if($password != $confirm){
+ ReportError("The passwords you entered did not match.");
+ PageRedirect(3, "?op=settings&change=password");
+ return;
+ }else if(strlen($password)<6){
+ ReportError("The password you entered is less than 6 characters.");
+ PageRedirect(3, "?op=settings&change=password");
+ return;
+ }
+ $newpassword = crypt(md5($password),'iamnotadirtywhorebitch');
+ $username = $_SESSION['username'];
+ $db->Query("UPDATE `bayonet_users` SET `password` = '$newpassword' WHERE `username` = '$username' LIMIT 1");
+
+ echo "Your password has successfully been changed.";
+ PageRedirect(3,"?op=settings");
+ return;
+ }
+?>
+<div id="pwordCont">
+<form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
+<h1>Change Your Password</h1>
+ <table>
+ <tr>
+ <td class="right">Password: </td>
+ <td><input type="password" id="inputPassword" name="password" style="width:200px;" /></td>
+ <td>
+ <table cellspacing="0">
+ <tr><td>Password Strength:</td><td id="complexity"></td></tr>
+ <tr><td colspan="2"><div class="outer"><div id="rating"></div></div></td></tr>
+ </table>
+ </td>
+ </tr>
+ <tr><td></td><td style="text-align:center; color:#626262;">Minimum of 6 Characters</td><td></td></tr>
+ <tr>
+ <td>Confirm Password: </td>
+ <td><input type="password" name="confirm" style="width:200px;" /></td>
+ </tr>
+ <tr><td colspan="2"><input type="submit" value="Change Password" name="processed" /></td>
+ </table>
+</form>
+</div>
+<?php
+} \ No newline at end of file
diff --git a/admin/settings/index.php b/admin/settings/index.php
new file mode 100644
index 0000000..e3c8946
--- /dev/null
+++ b/admin/settings/index.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+ <link rel="stylesheet" type="text/css" href="settings/style.css" media="screen"/>
+ <div style="text-align:left;"><h2>- Account Settings</h2>
+ -<a href="?op=settings&change=password" >Change password</a>, email, name<br />
+ </div>
+
+ <?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'settings/functions.php';
+
+ if(isset($_GET['change']))
+ {
+ $change = $_GET['change'];
+ if($change == "password"){
+ changePassword();
+ }else if($change == "email"){
+ changeEmail();
+ }
+ //return;
+ }
+
+
+?>
+
+ </tr>
+ </table>
+
+
+
+ \ No newline at end of file
diff --git a/admin/settings/style.css b/admin/settings/style.css
new file mode 100644
index 0000000..9969542
--- /dev/null
+++ b/admin/settings/style.css
@@ -0,0 +1,64 @@
+/* START>> PASSWORD STYLES */
+
+input{
+ font-family: "Lucida Grande", "Verdana", sans-serif;
+}
+
+#pwordCont{
+ font-family: "Lucida Grande", "Verdana", sans-serif;
+ width: 820px;
+ font-size:12px;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 50px 0 0 0;
+}
+
+#complexity{
+ color: #000;
+ font-size: 10px;
+ text-align: center;
+}
+
+.outer {
+ width:180px;
+ height:5px;
+ background-color: #CCC;
+}
+
+.default {
+ height:5px;
+ background-color: #CCC;
+ width:0px;
+}
+.short {
+ height:5px;
+ background-color: #aa0033;
+ width:15px;
+}
+.weak {
+ height:5px;
+ background-color: #aa0033;
+ width:45px;
+}
+.good {
+ height:5px;
+ background-color: #6699cc;
+ width:90px;
+}
+.strong {
+ height:5px;
+ background-color: #008000;
+ width:135px;
+}
+.secure {
+ height:5px;
+ background-color: #008000;
+ width:180px;
+}
+
+span.value{
+ font-weight:bold;
+ float: right;
+}
+
+/* END>> PASSWORD STYLES */ \ No newline at end of file
diff --git a/admin/style.css b/admin/style.css
new file mode 100644
index 0000000..686276b
--- /dev/null
+++ b/admin/style.css
@@ -0,0 +1,143 @@
+body {
+ background-color:#225eac;
+ text-align:center;
+ font-family:sans-serif;
+ font-size:10pt;
+}
+
+img {
+ border:0px;
+}
+
+a, a:visited, a:active {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+ text-decoration:none;
+}
+
+a:hover {
+ font-family:sans-serif;
+ font-size:10pt;
+ color: #225eac;
+ text-decoration:none;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-weight: normal;
+}
+h2 {
+ font-size:26px;
+}
+h3 {
+ font-size:20px;
+}
+
+div.wrapper {
+ width:1024px;
+ background-color:white;
+ padding:15px;
+}
+
+td {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+}
+
+table.panel {
+ height:350px;
+ border:1px solid #848484;
+}
+
+td.panel-none {
+ width:201px;
+ vertical-align:top;
+}
+
+td.panel-shadow {
+ background-image:url("../images/rightshadow.png");
+ background-position: left;
+ background-repeat: repeat-y;
+ width:201px;
+ padding-left: 10px;
+ vertical-align:top;
+}
+
+.panel-box {
+ background-image:url("../images/rightshadow.png");
+ background-position: left;
+ background-repeat: repeat-y;
+ padding-left: 10px;
+ vertical-align:top;
+}
+
+.option-box {
+ background-color: #6f6f6f;
+}
+
+table.panelitems {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+}
+
+table.panelitems tr {
+ height:20px;
+}
+
+table.panelitems tr.highlight {
+ background-color: #5b8dda;
+}
+
+/* Panel Links */
+table.panel a, table.panel a:hover, table.panel a:visited, table.panel a:active {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+ text-decoration:none;
+}
+
+/* Panel Highlight Links << must be after Panel Links */
+tr.highlight a, tr.highlight a:visited, tr.highlight a:hover, tr.highlight a:active {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:white;
+}
+fieldset {
+ padding:0px;
+ border: 1px solid #a1a1a1;
+}
+
+ /*********************************
+ ** Content Styles **
+ *********************************/
+ div.contentBorder1 {
+ }
+ div.contentBorder2 {
+ border:1px solid #848484;
+ }
+ div.contentHeading {
+ background-repeat:repeat-x;
+ background-color: #5b8dda;
+ text-align:left;
+ height:25px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-top:5px;
+ color:white;
+ }
+ div.content {
+ text-align:left;
+ background-color:white;
+ padding:10px;
+ color:#333333;
+ }
+
+.left{
+ text-align:left;
+}
+.right{
+ text-align:right;
+}
+ \ No newline at end of file
diff --git a/blocks/announcements/index.php b/blocks/announcements/index.php
new file mode 100644
index 0000000..dca72dd
--- /dev/null
+++ b/blocks/announcements/index.php
@@ -0,0 +1,8 @@
+<?php
+
+ global $db;
+ $result = $db->Query("SELECT `text` FROM `bayonet_announcements` LIMIT 1");
+ $row = $db->FetchRow($result);
+ echo bbcode_format($row['text']);
+
+?> \ No newline at end of file
diff --git a/blocks/donations/index.php b/blocks/donations/index.php
new file mode 100644
index 0000000..7b62be4
--- /dev/null
+++ b/blocks/donations/index.php
@@ -0,0 +1,7 @@
+
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick" />
+<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYB02pTNLjJ9viE69oKIjYRn9waGeUXDObQnS4UMXyr791TDGSY0ekY9VialPYYHO62fCXnza4lbYuiywVBO7rtmANED7FFTL2MO5pSLpHvhY2RC/gXxId24P8EDg/+oxtlVkW3QxYN9bwGoN+YI7qHyDzBPFOcYg/eWVNuKhSCeazELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI27H2lXKV0t6AgZhtt2zkaDfgIG2AaAOITZYGnG1+bVRxgjLMPWsFSsKSQbZDCNF4AvE7deOiW96NMHVIJoW6Bd8eBiANNb3C/uMZ4VG+OOMoL5ZUiXrdxDNxdXj39r1V3AvIZQGiXRKXgzohwXsLCSNJTjoYGAf9XKfKjF/O7KHCBkaRMNiErNT9bhZo6a8fVL7IJFFZFeggRcKWgtPFo818h6CCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA5MTIyNjA1MzYxN1owIwYJKoZIhvcNAQkEMRYEFJph1XKiDvpvkS9qivFVa0yEu+5GMA0GCSqGSIb3DQEBAQUABIGAvd2V0F6+dYpeLUS5ygxOYUmgxuo8ORUYcRUp+J/ICWDkOrkJwFI1QfcH1hx9vdQUg1TNdREeovbEZx47T9G7HHVpZTcNCQeQNsz0IpFZTfmQAD71ad3qXQvJyh/ghsE/s9guMO6x5AQ1iQdA5ls928WvpqYx8EFs7fGvKYhrPzI=-----END PKCS7-----" />
+<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" />
+<!-- <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /> -->
+
diff --git a/blocks/forum_login/index.php b/blocks/forum_login/index.php
new file mode 100644
index 0000000..c5343d9
--- /dev/null
+++ b/blocks/forum_login/index.php
@@ -0,0 +1,44 @@
+<?php
+$avatar_path = '/cms/forums/avatars/';
+require_once dirname(__FILE__) . '/../../forums/SSI.php';
+
+//decho($GLOBALS['user_info']);
+
+
+global $user_info;
+
+$user = $user_info;
+$name = $user['name'];
+$avatar = empty($user['avatar']['url']) ? 'blank.gif' : $user['avatar']['url'];
+$ip = $user['ip'];
+$posts = $user['posts'];
+$messages = $user['messages'];
+$unread_messages = $user['unread_messages'];
+
+if(strstr($avatar,'http://'))
+{
+ $avatar_path = NULL;
+}
+
+if (isset($GLOBALS['ID_MEMBER']) && $GLOBALS['ID_MEMBER'] != 0): ?>
+ <div>
+ <p>
+ <center>
+ <b>Your IP:</b> <?php echo $ip; ?><br />
+ <?php /* fix this, what about avatars that arent saved no our site */ ?>
+ <img src="<?php echo $avatar_path . $avatar; ?>" alt="<?php echo 'No Avatar'; ?>" /><br/>
+ <b>Total posts:</b> <?php echo $posts; ?><br />
+ </center>
+ </p>
+
+ <p>
+ Welcome, <?php echo $name; ?> (<?php ssi_logout('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); ?>)<br />
+ <b>Inbox:</b> <?php echo $messages; ?><br />
+ <b>Unread:</b> <?php echo $unread_messages; ?><br />
+ </p>
+
+ </div>
+
+<?php else: ?>
+<?php ssi_login('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); ?>
+<?php endif; ?>
diff --git a/blocks/mini_calendar/functions.php b/blocks/mini_calendar/functions.php
new file mode 100644
index 0000000..ffc98a6
--- /dev/null
+++ b/blocks/mini_calendar/functions.php
@@ -0,0 +1,195 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+ /**
+ * PrintCalendar() - prints the calendar with events
+ */
+ ?>
+<script type="text/javascript">
+function openEvent(date)
+{
+ myWindow = window.open('http://testbed.3rd-infantry-division.org/cms/blocks/mini_calendar/event.php?date='+date+'','','width=300,height=300')
+ myWindow.focus();
+}
+</script>
+ <?php
+ function PrintCalendar(){
+
+ $date = time();
+ date_default_timezone_set("America/New_York"); //EASTERN TIME ZONE
+
+ $day = date('d', $date);
+ $today = date('j', $date);
+ $month = date('m', $date);
+ $monthNum = date('n', $date);
+ $year = date('Y', $date);
+
+ /* Accounts for the last couple days from the previous months */
+ $first_day = mktime(0,0,0,$monthNum, 1, $year);
+
+ $title = date('F', $first_day);
+
+ $day_of_week = date('D', $first_day);
+
+ switch($day_of_week){
+ case "Sun": $blank = 0; break;
+ case "Mon": $blank = 1; break;
+ case "Tue": $blank = 2; break;
+ case "Wed": $blank = 3; break;
+ case "Thu": $blank = 4; break;
+ case "Fri": $blank = 5; break;
+ case "Sat": $blank = 6; break;
+ }
+
+ /* calculates the days in the current month */
+ $days_in_month = cal_days_in_month(0, $monthNum, $year);
+
+ //makes sure that previous year is not year 0
+ if($monthNum == 1){
+ $previous_month = 12;
+ $previous_year = $year-1;
+ }else{
+ $previous_month = $monthNum-1;
+ $previous_year = $year;
+ }
+ //makes sure the next year is not year 13
+ if($monthNum == 12){
+ $next_month = 1;
+ $next_year = $year+1;
+ }else{
+ $next_month = $monthNum+1;
+ $next_year = $year;
+ }
+ ?>
+ <center>
+ <table class="calendar" style="background-color:white;" cellspacing="1" cellpadding="0">
+ <tr style="background-color:#999999; height:20px;">
+ <td colspan="50" style="vertical-align:middle; text-align:center;">
+ <!-- <a href="?op=calendar&month=<?php echo $previous_month.'&year='.$previous_year; ?>"><<</a> -->
+ <!-- Month Name and Year -->
+ &nbsp;&nbsp;<span class="monthTitle"><?php echo strtoupper($title).' '.$year; ?></span>&nbsp;&nbsp;
+ <!-- <a href="?op=calendar&month=<?php echo $next_month.'&year='.$next_year; ?>">>></a> -->
+ </td>
+ </tr>
+
+ <tr>
+ <th class="weekday">Sun</th><th class="weekday">Mon</th><th class="weekday">Tue</th><th class="weekday">Wed</th>
+ <th class="weekday">Thu</th><th class="weekday">Fri</th><th class="weekday">Sat</th>
+ </tr>
+
+ <tr>
+ <?php
+
+ $day_count = 1; //holds the current day of the week 1-7
+ $day_num = 1; //holds the current day of the month 1-31
+
+ $days_monthbefore = cal_days_in_month(0, $previous_month, $year);
+ //prints the numbers of days for the previous month
+ while($blank > 0){
+ $blank = $blank-1;
+ $days_before = $days_monthbefore-$blank;
+ echo '<td class="cal_notmonth">'.$days_before.'</td>'; //'.$days_before.'</td>';
+ $day_count++;
+ }
+
+$sqlToday = date("Y-m-d", mktime(0, 0, 0, $monthNum, $today, $year));
+$events = GetEventsOnInterval("{$year}-{$monthNum}-01","{$year}-{$monthNum}-{$days_in_month}");
+
+ //loop printing each day of the CURRENT month ONLY
+ while($day_num <= $days_in_month){
+
+ if($day_count==1 || $day_count==7){
+ echo '<td class="cal_weekend">'; //weekends
+ }else{
+ echo '<td class="cal_weekday">'; //weekdays
+ }
+
+ $sqlDate = date("Y-m-d", mktime(0, 0, 0, $monthNum, $day_num, $year));
+
+ //checks to see if the current day has events
+ $isEvent=false;
+ foreach($events as $event){
+ if($event['date'] == $sqlDate){
+ $isEvent = true;
+ if($event['date'] == $sqlToday){
+ $todaysEvents[] = $event;
+ }
+ }
+
+ }
+ if($day_num == $today && $isEvent==true){
+ echo '<div class="eventtoday">'.$day_num.'</div>';
+ }else if($day_num == $today && $isEvent==false){
+ echo '<div class="monthtoday">'.$day_num.'</div>';
+ }else if($day_num != $today && $isEvent==true){
+ echo "<div class=\"event\" onclick=\"openEvent('{$sqlDate}')\">";
+ echo $day_num;
+ echo '</div>';
+ }else{
+ echo $day_num;
+ }
+
+ echo '</td>';
+
+ $day_num++;
+ $day_count++;
+
+ if($day_count > 7){
+ echo '</tr><tr>';
+ $day_count = 1;
+ }
+ }
+
+ $days_after = 1;
+ //loop for printing the days for the next month
+ while($day_count > 1 && $day_count <=7){
+ echo '<td class="cal_notmonth">'.$days_after.'</td>'; //'.$days_after.'</td>';
+ $days_after++;
+ $day_count++;
+ }
+
+ ?>
+
+ </tr>
+ </table>
+ </center>
+<?php
+ //list events for today
+ if(count($todaysEvents)>0){
+ echo "<h3>Today's Events</h3>";
+ foreach($todaysEvents as $event){
+ $time = date("g:i a", strtotime($event['date']." ".$event['time']));
+ echo "<span style=\"background-color: {$event['color']}\">&nbsp;&nbsp;</span>&nbsp;{$event['title']} @ {$time}<br />";
+ }
+ }
+ }
+
+function GetEventsOnInterval($start,$end){
+ global $db;
+ $result = $db->Query("SELECT `event_id`, `title`, `color`, `date`, `time` FROM `bayonet_events` WHERE `date` BETWEEN '$start' AND '$end' ORDER BY `time` ASC");
+ $events = $db->Fetch($result);
+ return $events;
+}
+
+ ?> \ No newline at end of file
diff --git a/blocks/mini_calendar/index.php b/blocks/mini_calendar/index.php
new file mode 100644
index 0000000..c58469b
--- /dev/null
+++ b/blocks/mini_calendar/index.php
@@ -0,0 +1,3 @@
+<link rel="stylesheet" type="text/css" href="blocks/mini_calendar/style.css" media="screen"/>
+<?php include 'blocks/mini_calendar/functions.php'; ?>
+<?php PrintCalendar(); ?>
diff --git a/blocks/mini_calendar/scripts.js b/blocks/mini_calendar/scripts.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/blocks/mini_calendar/scripts.js
diff --git a/blocks/mini_calendar/style.css b/blocks/mini_calendar/style.css
new file mode 100644
index 0000000..d34db05
--- /dev/null
+++ b/blocks/mini_calendar/style.css
@@ -0,0 +1,114 @@
+/* START>> CALENDAR STYLES*/
+ .monthTitle{
+ color:black;
+ text-align:center;
+ font-size:12px;
+ font-weight:bold;
+ font-family:arial;
+ }
+ td.weekday {
+ width:40px;
+ height:20px;
+ background-color:#cb2121;
+ color:green;
+ text-align:center;
+ font-size:10px;
+ /* font-weight:bold; */
+ }
+ th.weekday {
+ width:40px;
+ height:29px;
+ background-color:white;
+ color:black;
+ text-align:center;
+ font-size:11px;
+ font-weight:normal;
+ }
+ .monthday {
+ width:40px;
+ height:20px;
+ background-color:#aea2a2;
+ color:white;
+ text-align:left;
+ font-size:10pt;
+ /* font-weight:bold; */
+
+ }
+ .monthtoday {
+ width:38px;
+ height:38px;
+ /* background-color:#3666ba; */
+ color:#225eac;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ font-family: arial;
+ border:1px solid #333333;
+ }
+ .event {
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ text-align:center;
+ border:1px solid #333333;
+ cursor: pointer;
+ }
+ table.calendar a, table.calendar a:visited, table.calendar a:active, table.calendar a:hover {
+ color:white;
+ }
+ .eventtoday {
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ color: white;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ font-family: arial;
+ border:1px solid #333333;
+ }
+ td.cal_weekday {
+ width:40px;
+ height:40px;
+ background-color:#a1a1a1;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:12px;
+ }
+ td.cal_weekend {
+ width:40px;
+ height:40px;
+ background-color:#8f8f8f;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:12px;
+ }
+ td.cal_notmonth {
+ width:40px;
+ height:40px;
+ background-color:#6e6e6e;
+ vertical-align:top;
+ color:#d4d4d4;
+ text-align:left;
+ font-size:11px;
+ }
+ div.event_title {
+ font-family: Geneva, Verdana, Arial;
+ font-size: 14px;
+ }
+ div.event_text {
+ font-family: Geneva, Verdana, Arial;
+ font-size: 12px;
+ padding-top: 3px;
+ padding-left: 10px;
+ padding-right: 5px;
+ }
+ div.event_time {
+ font-family: Geneva, Verdana, Arial;
+ font-size: 12px;
+ }
+/* END>> CALENDAR STYLES */ \ No newline at end of file
diff --git a/blocks/rss_agw/index.php b/blocks/rss_agw/index.php
new file mode 100644
index 0000000..21506bb
--- /dev/null
+++ b/blocks/rss_agw/index.php
@@ -0,0 +1,107 @@
+<link rel="stylesheet" type="text/css" href="blocks/rss_agw/style.css" media="screen"/>
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+// {{{ prerequesists
+
+/**
+ * Check to make sure the cURL extension is available to us
+ */
+if (!extension_loaded('curl')) {
+ $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
+ if (!@dl($prefix . 'curl.' . PHP_SHLIB_SUFFIX)) {
+ trigger_error('Unable to load the PHP cURL extension.', E_USER_ERROR);
+ exit;
+ }
+}
+
+// {{{ constants
+
+/**
+ * Armed Global Warfare Feed
+ */
+define('AGW_FEED', 'http://www.armedglobalwarfare.com/index.php?type=rss;action=.xml;limit=300');
+
+/**
+ * Cache File
+ */
+define('AGW_CACHE', dirname(__FILE__) . '/rss_cache.xml');
+define('AGW_AGE_CACHE', time() - 3600);
+
+/**
+ * Feed Variables
+ */
+$agwFeed = array();
+$agwXml = null;
+$agwProcess = true;
+
+// }}}
+
+// {{{ main
+
+/**
+ * Check existance of cache
+ */
+if (file_exists(AGW_CACHE) && (filectime(AGW_CACHE) > AGW_AGE_CACHE)) {
+ $agwFeed = simplexml_load_file(AGW_CACHE);
+ $agwProcess = false;
+}
+
+/**
+ * If we don't have a cache then we'll need to build one
+ */
+if ($agwProcess === true) {
+ /**
+ * Set up global options for cURL to utilize for the transfer.
+ */
+ $options = array(CURLOPT_FORBID_REUSE => true,
+ CURLOPT_POST => false,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_TIMEOUT => 3,
+ CURLOPT_USERAGENT => 'Mozilla/5.0 (Compatible; libCURL)',
+ CURLOPT_VERBOSE => false);
+
+ /**
+ * Initialize cURL
+ */
+ $agwFeedSource = curl_init(AGW_FEED);
+ curl_setopt_array($agwFeedSource, $options);
+
+ /**
+ * Execute cURL container and store the output
+ */
+ $agwFeedOutput = curl_exec($agwFeedSource);
+
+ /**
+ * Parse the received data
+ */
+
+ if (!curl_errno($agwFeedSource)) {
+ $agwFeed = simplexml_load_string($agwFeedOutput);
+ $agwXml = new SimpleXMLElement($agwFeedOutput);
+
+ file_put_contents(AGW_CACHE, $agwXml->asXML(), LOCK_EX);
+ curl_close($agwFeedSource);
+ }
+ else {
+ curl_close($agwFeedSource);
+ }
+
+ /**
+ * Check to make sure the results are not empty before proceeding.
+ */
+ if (empty($agwFeed) || !is_object($agwFeed)) $agwFeed = array();
+}
+
+/**
+ * Process output
+ */
+foreach ($agwFeed->channel->item as $item) {
+ if ($item->category != 'Tournament Announcements') continue;
+
+ echo '<a href="' . $item->link . '" onclick="javascript:window.open(this.href, \'_blank\'); return false;">' .
+ '<span class="title">' . $item->title . '</span></a><br />' .
+ '<span class="date">' . $item->pubDate . '</span><br /><br /><hr />' . PHP_EOL;
+}
+// }}}
+?>
diff --git a/blocks/rss_agw/style.css b/blocks/rss_agw/style.css
new file mode 100644
index 0000000..e9d0824
--- /dev/null
+++ b/blocks/rss_agw/style.css
@@ -0,0 +1,17 @@
+ .rss img {
+ display: none;
+ }
+ .rss span.title{
+ font-size: 10px;
+ font-weight: bold;
+ /* text-decoration:underline; */
+ }
+
+ .rss span.date{
+ font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif;
+ font-size: 11px;
+ text-transform: uppercase;
+ font-weight:bold;
+ text-align: center;
+ letter-spacing: 2px;
+ } \ No newline at end of file
diff --git a/blocks/rudi/index.php b/blocks/rudi/index.php
new file mode 100644
index 0000000..da9f4e1
--- /dev/null
+++ b/blocks/rudi/index.php
@@ -0,0 +1,6 @@
+<ul class="block">
+<li><?php echo LinkModule('rudi',NULL,'Roster'); ?></li>
+<li><?php echo LinkModule('rudi','&amp;show=awards','Awards &amp; Medals'); ?></li>
+<li><?php echo LinkModule('rudi','&amp;show=ranks','Ranks'); ?></li>
+</ul>
+
diff --git a/blocks/server_monitor/index.php b/blocks/server_monitor/index.php
new file mode 100644
index 0000000..791a5b2
--- /dev/null
+++ b/blocks/server_monitor/index.php
@@ -0,0 +1,16 @@
+<?php
+
+$feed = fopen("http://module.game-monitor.com/216.245.211.59:28910/data/server.php","r");
+$tmp = fgets($feed);
+$server = unserialize($tmp);
+
+OpenBlock("Game Server");
+echo "<div style=\"margin:5px;\">\n
+<a href=\"{$server->link}\">{$server->name}</a><br/>\n
+IP: {$server->ip}:{$server->port}<br/>\n
+Players: {$server->player}/{$server->maxplayer}<br/>\n
+</td></tr>\n
+</div>\n";
+CloseBlock();
+
+?> \ No newline at end of file
diff --git a/blocks/soldier_info/index.php b/blocks/soldier_info/index.php
new file mode 100644
index 0000000..f7ff24c
--- /dev/null
+++ b/blocks/soldier_info/index.php
@@ -0,0 +1,66 @@
+<?php
+if($_COOKIE['mybbuser'] != '')
+{
+ global $db;
+ $logged_in = 'true';
+
+ $username = stripslashes($_COOKIE['mybbuser']);
+ $login_cookie = explode('_', $username);
+ $result = $db->Query("SELECT `uid`, `username`, `unreadpms`, `totalpms`, `postnum`, `usergroup`, `additionalgroups` FROM `mybb_users` WHERE `uid` = '".$login_cookie['0']."' AND `loginkey` = '".$login_cookie['1']."'");
+ $check_num = $db->Rows($result);
+ if ($check_num != '1')
+ {
+ $past = time() - 100;
+ $logged_in = '';
+ setcookie('mybbuser', gone, $past);
+ header("location: index.php");
+ }
+ while(($row = $db->Fetch($result))!==false)
+ {
+ $logged_uid = $row['uid'];
+ $logged_username = $row['username'];
+ $avatar_type = $row['avatartype'];
+ $pm_unread = $row['unreadpms'];
+ $pm_total = $row['totalpms'];
+ $postnum = $row['postnum'];
+
+ $main_usergroup = $row['usergroup'];
+ $add_usergroup = $row['additionalgroups'];
+
+ $add_usergroups= explode(',', $add_usergroup);
+ }
+}
+?>
+ <center>
+
+ Your IP: <?php echo $_SERVER['REMOTE_ADDR']; ?><br />
+<?php
+ if ($logged_in == 'true'){
+?>
+ <!-- <img src="<?php echo $avatar; ?>" alt="<?php echo $logged_username; ?>"/><br /><br /> -->
+ <?php echo $postnum;?> post(s)<br /><br />
+ </center>
+
+ Welcome, <?php echo $logged_username; ?> <a href="logout.php">Logout</a><br />
+ <hr />
+ Private Messages <br />
+ Unread: <a href="forums/private.php"><?php echo $pm_unread; ?></a><br />
+ Total: <a href="forums/private.php"><?php echo $pm_total; ?></a><br />
+ <hr />
+<?php
+ }
+ else{
+?>
+ Welcome Guest.<br /><br />
+
+ <form method="POST" action="">
+ <table>
+ <tr><td><input type="text" name="username" /></td></tr>
+ <tr><td><input type="password" name="password" /></td><td><input type="submit" value="Login" /></td></tr>
+ </table>
+ </form>
+
+ </center>
+<?php
+ }
+?> \ No newline at end of file
diff --git a/blocks/tsviewer/index.php b/blocks/tsviewer/index.php
new file mode 100644
index 0000000..fd24fb3
--- /dev/null
+++ b/blocks/tsviewer/index.php
@@ -0,0 +1,12 @@
+<?php
+
+/**
+* The overlaying css div.content class is messing up the padding of the text.
+* Apparently I cannot override this...
+*/
+echo "<div style=\"padding:0px; margin: 5px;\">\n";
+$ts = implode('',file("http://www.tsviewer.com/ts_viewer_pur.php?ID=902437&bg=&type=8f8f8f&type_size=11&type_family=5&info=1&channels=1&users=1&type_s_color=000000&type_s_weight=bold&type_s_style=normal&type_s_variant=normal&type_s_decoration=none&type_s_color_h=525284&type_s_weight_h=bold&type_s_style_h=normal&type_s_variant_h=normal&type_s_decoration_h=underline&type_i_color=000000&type_i_weight=normal&type_i_style=normal&type_i_variant=normal&type_i_decoration=none&type_i_color_h=525284&type_i_weight_h=normal&type_i_style_h=normal&type_i_variant_h=normal&type_i_decoration_h=underline&type_c_color=000000&type_c_weight=normal&type_c_style=normal&type_c_variant=normal&type_c_decoration=none&type_c_color_h=525284&type_c_weight_h=normal&type_c_style_h=normal&type_c_variant_h=normal&type_c_decoration_h=underline&type_u_color=000000&type_u_weight=normal&type_u_style=normal&type_u_variant=normal&type_u_decoration=none&type_u_color_h=525284&type_u_weight_h=normal&type_u_style_h=normal&type_u_variant_h=normal&type_u_decoration_h=none"));
+echo $ts;
+echo "</div>\n";
+
+?>
diff --git a/docs/COPYING b/docs/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/docs/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/images/3rdbanner.png b/images/3rdbanner.png
new file mode 100644
index 0000000..d1bec5c
--- /dev/null
+++ b/images/3rdbanner.png
Binary files differ
diff --git a/images/3rdidtext.png b/images/3rdidtext.png
new file mode 100644
index 0000000..701fb06
--- /dev/null
+++ b/images/3rdidtext.png
Binary files differ
diff --git a/images/add.gif b/images/add.gif
new file mode 100644
index 0000000..836dbf2
--- /dev/null
+++ b/images/add.gif
Binary files differ
diff --git a/images/addnewarticle.png b/images/addnewarticle.png
new file mode 100644
index 0000000..0e29960
--- /dev/null
+++ b/images/addnewarticle.png
Binary files differ
diff --git a/images/addnewpage.png b/images/addnewpage.png
new file mode 100644
index 0000000..c60c68c
--- /dev/null
+++ b/images/addnewpage.png
Binary files differ
diff --git a/images/annoucement.png b/images/annoucement.png
new file mode 100644
index 0000000..c70591d
--- /dev/null
+++ b/images/annoucement.png
Binary files differ
diff --git a/images/announcement.png b/images/announcement.png
new file mode 100644
index 0000000..c70591d
--- /dev/null
+++ b/images/announcement.png
Binary files differ
diff --git a/images/arrowleft.png b/images/arrowleft.png
new file mode 100644
index 0000000..502ae41
--- /dev/null
+++ b/images/arrowleft.png
Binary files differ
diff --git a/images/arrowright.png b/images/arrowright.png
new file mode 100644
index 0000000..ddd163b
--- /dev/null
+++ b/images/arrowright.png
Binary files differ
diff --git a/images/bayonetLogo.png b/images/bayonetLogo.png
new file mode 100644
index 0000000..4183a88
--- /dev/null
+++ b/images/bayonetLogo.png
Binary files differ
diff --git a/images/blockbackground.jpg b/images/blockbackground.jpg
new file mode 100644
index 0000000..ea6c7d3
--- /dev/null
+++ b/images/blockbackground.jpg
Binary files differ
diff --git a/images/calendar.png b/images/calendar.png
new file mode 100644
index 0000000..86b9861
--- /dev/null
+++ b/images/calendar.png
Binary files differ
diff --git a/images/delete.gif b/images/delete.gif
new file mode 100644
index 0000000..4e2a37f
--- /dev/null
+++ b/images/delete.gif
Binary files differ
diff --git a/images/dicon.png b/images/dicon.png
new file mode 100644
index 0000000..e9323cb
--- /dev/null
+++ b/images/dicon.png
Binary files differ
diff --git a/images/dlaxlogo.png b/images/dlaxlogo.png
new file mode 100644
index 0000000..b4991ae
--- /dev/null
+++ b/images/dlaxlogo.png
Binary files differ
diff --git a/images/editfiles.png b/images/editfiles.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/images/editfiles.png
Binary files differ
diff --git a/images/editpage.png b/images/editpage.png
new file mode 100644
index 0000000..ab3fd58
--- /dev/null
+++ b/images/editpage.png
Binary files differ
diff --git a/images/error.gif b/images/error.gif
new file mode 100644
index 0000000..cb1fcbe
--- /dev/null
+++ b/images/error.gif
Binary files differ
diff --git a/images/error.png b/images/error.png
new file mode 100644
index 0000000..5bc1824
--- /dev/null
+++ b/images/error.png
Binary files differ
diff --git a/images/favicon.ico b/images/favicon.ico
new file mode 100644
index 0000000..121f619
--- /dev/null
+++ b/images/favicon.ico
Binary files differ
diff --git a/images/file_doc.png b/images/file_doc.png
new file mode 100644
index 0000000..b1da1ef
--- /dev/null
+++ b/images/file_doc.png
Binary files differ
diff --git a/images/file_pdf.png b/images/file_pdf.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/images/file_pdf.png
Binary files differ
diff --git a/images/file_rtf.png b/images/file_rtf.png
new file mode 100644
index 0000000..39304c1
--- /dev/null
+++ b/images/file_rtf.png
Binary files differ
diff --git a/images/file_word.png b/images/file_word.png
new file mode 100644
index 0000000..3011f00
--- /dev/null
+++ b/images/file_word.png
Binary files differ
diff --git a/images/hgrad.png b/images/hgrad.png
new file mode 100644
index 0000000..86daf8b
--- /dev/null
+++ b/images/hgrad.png
Binary files differ
diff --git a/images/larrow.png b/images/larrow.png
new file mode 100644
index 0000000..554b6e9
--- /dev/null
+++ b/images/larrow.png
Binary files differ
diff --git a/images/leftshadow.png b/images/leftshadow.png
new file mode 100644
index 0000000..1f32159
--- /dev/null
+++ b/images/leftshadow.png
Binary files differ
diff --git a/images/limericklax.png b/images/limericklax.png
new file mode 100644
index 0000000..1a565ea
--- /dev/null
+++ b/images/limericklax.png
Binary files differ
diff --git a/images/logo.jpg b/images/logo.jpg
new file mode 100644
index 0000000..cfe19c2
--- /dev/null
+++ b/images/logo.jpg
Binary files differ
diff --git a/images/lvgrad.png b/images/lvgrad.png
new file mode 100644
index 0000000..487d7e3
--- /dev/null
+++ b/images/lvgrad.png
Binary files differ
diff --git a/images/navbackground.jpg b/images/navbackground.jpg
new file mode 100644
index 0000000..93ffece
--- /dev/null
+++ b/images/navbackground.jpg
Binary files differ
diff --git a/images/navbg.png b/images/navbg.png
new file mode 100644
index 0000000..00a8f88
--- /dev/null
+++ b/images/navbg.png
Binary files differ
diff --git a/images/navigation.png b/images/navigation.png
new file mode 100644
index 0000000..739c95f
--- /dev/null
+++ b/images/navigation.png
Binary files differ
diff --git a/images/navspacer.png b/images/navspacer.png
new file mode 100644
index 0000000..cdc8cb4
--- /dev/null
+++ b/images/navspacer.png
Binary files differ
diff --git a/images/news_header.png b/images/news_header.png
new file mode 100644
index 0000000..00861bf
--- /dev/null
+++ b/images/news_header.png
Binary files differ
diff --git a/images/nvgrad.png b/images/nvgrad.png
new file mode 100644
index 0000000..5e4c05c
--- /dev/null
+++ b/images/nvgrad.png
Binary files differ
diff --git a/images/photogallery.png b/images/photogallery.png
new file mode 100644
index 0000000..a161a55
--- /dev/null
+++ b/images/photogallery.png
Binary files differ
diff --git a/images/photoleft.png b/images/photoleft.png
new file mode 100644
index 0000000..f4eb3af
--- /dev/null
+++ b/images/photoleft.png
Binary files differ
diff --git a/images/photoright.png b/images/photoright.png
new file mode 100644
index 0000000..16a251b
--- /dev/null
+++ b/images/photoright.png
Binary files differ
diff --git a/images/rarrow.png b/images/rarrow.png
new file mode 100644
index 0000000..9a272d9
--- /dev/null
+++ b/images/rarrow.png
Binary files differ
diff --git a/images/rightshadow.png b/images/rightshadow.png
new file mode 100644
index 0000000..bc970f0
--- /dev/null
+++ b/images/rightshadow.png
Binary files differ
diff --git a/images/sandbackground.jpg b/images/sandbackground.jpg
new file mode 100644
index 0000000..2a2d800
--- /dev/null
+++ b/images/sandbackground.jpg
Binary files differ
diff --git a/images/spacer.png b/images/spacer.png
new file mode 100644
index 0000000..f187f4a
--- /dev/null
+++ b/images/spacer.png
Binary files differ
diff --git a/images/vgrad.png b/images/vgrad.png
new file mode 100644
index 0000000..e7a96e8
--- /dev/null
+++ b/images/vgrad.png
Binary files differ
diff --git a/images/view.gif b/images/view.gif
new file mode 100644
index 0000000..52cbddb
--- /dev/null
+++ b/images/view.gif
Binary files differ
diff --git a/images/xoma_logo.jpg b/images/xoma_logo.jpg
new file mode 100644
index 0000000..36914ff
--- /dev/null
+++ b/images/xoma_logo.jpg
Binary files differ
diff --git a/include/classes.php b/include/classes.php
new file mode 100644
index 0000000..5f51e99
--- /dev/null
+++ b/include/classes.php
@@ -0,0 +1,238 @@
+<?php
+
+abstract class Bayonet_Layout
+{
+ function OpenContent()
+ {
+ echo "<div class=\"contentBorder1\">";
+ echo "<div class=\"contentBorder2\">";
+ }
+
+ function CloseContent()
+ {
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+class Bayonet_Theme extends Bayonet_Layout
+{
+ static public $index;
+ static public $header;
+ static public $footer;
+
+ static public $name;
+ static public $root_path;
+ static public $include_path;
+ static public $image_path;
+ static public $config_path;
+ static public $config;
+ static public $primary_css;
+
+ static function init()
+ {
+ if (!isset($_GET['theme']))
+ {
+ self::$name = Bayonet_Config::$ini['site']['theme'];
+ }
+ else
+ {
+ self::$name = $_GET['theme'];
+ }
+
+ decho('Initializing theme variables for \'' . self::$name . '\'');
+ self::$root_path = dirname(BAYONET_ROOT) . '/themes/' . self::$name;
+ self::$include_path = self::$root_path . '/include';
+ self::$image_path = self::$root_path . '/images';
+ self::$primary_css = self::$include_path . '/primary.css';
+ self::$config_path = self::$include_path . '/theme.ini';
+
+ if (!self::is_valid())
+ {
+ die('Theme failed during initialization.');
+ }
+ self::$config = parse_ini_file(self::$config_path, true);
+
+ self::$index = self::$root_path . '/index.php';
+ self::$header = self::$root_path . '/header.php';
+ self::$footer = self::$root_path . '/footer.php';
+
+ //decho(get_class_vars(Bayonet_Theme)); //do not re-enable this
+ self::load();
+ }
+
+ static private function is_valid()
+ {
+ if (file_exists(self::$root_path) && file_exists(self::$include_path) &&
+ file_exists(self::$config_path)) return true;
+ else return false;
+ }
+
+ static function load()
+ {
+ global $db, $config;
+ decho("Loading theme: '" . self::$name . "'");
+ require self::$index;
+ }
+}
+
+class Bayonet_Config
+{
+ static $ini;
+ static function init()
+ {
+ decho('Parsing configuration data');
+ if (file_exists(BAYONET_CONFIG))
+ {
+ self::$ini = parse_ini_file(BAYONET_CONFIG, true);
+ decho(self::$ini);
+ }
+ else die(BAYONET_CONFIG . ' not found');
+ }
+}
+
+class Bayonet
+{
+ static function init()
+ {
+ global $db, $config;
+ Bayonet_Config::init();
+
+ // Set globally referenced configuration and database variables
+ $config = Bayonet_Config::$ini;
+ $db = new Bayonet_SQL();
+
+ //Connect to the MySQL server
+ $db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']);
+ $db->Select_db($config['sql']['database']);
+
+ decho('Initializing Bayonet');
+ Bayonet_Theme::init();
+ }
+}
+
+
+define('PASSWORD', true);
+define('NO_PASSWORD', false);
+define('CHECKED', true);
+
+class BayonetForm
+{
+ static public $request;
+
+ public function __construct($action, $method)
+ {
+ $this->request = $_POST;
+ echo "<form action=\"$action\" method=\"$method\">\n";
+ }
+
+ public function __destruct()
+ {
+ echo "</form>\n";
+ }
+
+ function getKeyStates($keys)
+ {
+ $good = array();
+ $bad = array();
+
+ if (!is_array($keys)) return array();
+
+ foreach ($keys as $key => $value)
+ {
+ if (!empty($value)) $good[$key] = $value;
+ else $bad[$key] = $value;
+ }
+
+ $data = array('set' => $good, 'unset' => $bad);
+
+ return $data;
+ }
+
+ function verify($submit_key)
+ {
+ return $this->verifySubmit($submit_key);
+ }
+
+ function verifySubmit($submit_key)
+ {
+ return isset($this->request[$submit_key]) ? true : false;
+ }
+
+ function button($extern_name, $value, $text = "Button")
+ {
+ echo "<button name=\"{$extern_name}\" value=\"{$value}\">{$text}</button>\n";
+ }
+
+ function submitButton($extern_name, $value = "Submit")
+ {
+ echo "<input type=\"submit\" name=\"{$extern_name}\" value=\"{$value}\" />\n";
+ }
+
+ function reset($value = "Reset")
+ {
+ echo "<input type=\"reset\" value=\"{$value}\" />\n";
+ }
+
+ function textField($extern_name, $value = null, $isPassword = false, $size = null,
+ $max = null)
+ {
+ $type = 'text';
+ if ($isPassword) $type = 'password';
+
+ $value = filter_var($value, FILTER_SANITIZE_STRING);
+ echo "<input type=\"{$type}\" name=\"{$extern_name}\" value=\"$value\" size=\"{$size}\" maxLength=\"{$max}\" />\n";
+ }
+
+ function radioButton($extern_name, $value, $isChecked = false)
+ {
+ if ($isChecked)
+ {
+ echo "<input type=\"radio\" name=\"{$extern_name}\" value=\"$value\" checked=\"checked\"/>\n";
+ }
+ else
+ {
+ echo "<input type=\"radio\" name=\"{$extern_name}\" value=\"$value\" />\n";
+ }
+ }
+
+ function checkBox($extern_name, $value, $isChecked = false)
+ {
+ if ($isChecked)
+ {
+ echo "<input type=\"checkbox\" name=\"{$extern_name}\" value=\"$value\" checked=\"checked\"/>\n";
+ }
+ else
+ {
+ echo "<input type=\"checkbox\" name=\"{$extern_name}\" value=\"$value\" />\n";
+ }
+ }
+
+ function dropDown($extern_name, $values = array('None'), $select = null)
+ {
+ $selectIterator = 1;
+
+ echo "<select name=\"{$extern_name}\">\n";
+ foreach ($values as $option => $text)
+ {
+ if (!is_null($select) && $selectIterator !== (int)$select)
+ {
+ echo "<option value=\"{$option}\">{$text}</option>\n";
+ }
+ else
+ {
+ echo "<option value=\"{$option}\" selected=\"selected\">{$text}</option>\n";
+ }
+ $selectIterator++;
+ }
+ echo "</select>\n";
+ }
+
+ function textArea($extern_name, $rows = 10, $cols = 30, $value = null)
+ {
+ $value = filter_var($value, FILTER_SANITIZE_STRING);
+ echo "<textarea name=\"{$extern_name}\" rows=\"$rows\" cols=\"$cols\">{$value}</textarea>\n";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/include/debug.php b/include/debug.php
new file mode 100644
index 0000000..a0c2236
--- /dev/null
+++ b/include/debug.php
@@ -0,0 +1,225 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+define("RUDI_DEBUG",true);
+define("RUDI_DEBUG_LEVEL",true);
+define('NO_REPEAT',false);
+define('REPEAT',true);
+define('FORCE', true);
+
+static $last_message = NULL;
+static $last_message_count = 0;
+
+static $log_message_last = NULL;
+static $log_message_queue = array();
+static $log_message_pos = 0;
+
+function decho($message, $force = false)
+{
+ global $log_message_last, $log_message_queue, $log_message_pos, $config;
+
+ if($force == false)
+ {
+ if($config['debug']['enabled'] == false ||
+ $config['debug']['show_messages'] == false) return;
+ }
+
+
+ date_default_timezone_set($config['logs']['timezone']);
+ $timestamp = date('H:i:s T');
+ if(!is_array($message) && !is_object($message))
+ $message = "[$timestamp]: $message";
+ else
+ {
+ $message = $message;
+ }
+
+ //if(count($log_message_queue) >= 100)
+ // array_pop($log_message_queue);
+
+ array_push($log_message_queue, $message);
+
+ $log_message_pos++;
+}
+
+function queuePrint($obj, $force = false)
+{
+ global $config;
+
+ if($force == false)
+ {
+ if($config['debug']['enabled'] == false ||
+ $config['debug']['show_messages'] == false) return;
+ }
+
+ if(is_array($obj))
+ {
+ $array_dump = print_r($obj,true);
+ if(empty($obj))
+ {
+ echo "Array was empty<br />\n";
+ return;
+ }
+ echo "<pre>" . $array_dump . "</pre><br/>\n";
+ //WriteLog($array_dump,BAYONET_LOG_INFO);
+ }
+ elseif(is_object($obj))
+ {
+ ob_start();
+ var_dump($obj);
+ $obj_dump = ob_get_contents();
+ ob_end_clean();
+ //htmlentities($obj_dump,ENT_QUOTES);
+ //WriteLog($obj_dump,BAYONET_LOG_INFO);
+ echo "<pre>" . $obj_dump . "</pre><br/>\n";
+ }
+ elseif(is_string($obj))
+ {
+ $message = wordwrap($obj,80,'<br />');
+ echo $obj . "<br/>\n";
+ //WriteLog($message,BAYONET_LOG_INFO);
+ }
+ else
+ {
+ echo "queuePrint: Invalid type of " . gettype($obj) . "<br/>\n";
+ }
+}
+
+function logQueueFlush($force = false)
+{
+ error_reporting(0);
+ global $log_message_queue, $config;
+
+ if($force == false)
+ {
+ if($config['debug']['show_messages'] == false) return;
+ }
+
+ $messageCount = 0;
+ static $log_message_last_count = 0;
+ static $next = false;
+
+ //OpenContent();
+ echo "<div class=\"contentHeading\">Bayonet Debug Messages</div>";
+ echo "<div class=\"content\">";
+
+ if(count($log_message_queue) < 1)
+ {
+ echo "<p>No messages</p>";
+ echo "</div></div>";
+ return false;
+ }
+
+ echo "<b>" . count($log_message_queue) . " messages received.</b><br/><br/>\n";
+ foreach($log_message_queue as $message)
+ {
+ if($message != $log_message_queue[$messageCount - 1])
+ {
+ if($force)
+ queuePrint($message, true);
+ else
+ queuePrint($message);
+ }
+ elseif($message == $log_message_queue[$messageCount - 1])
+ {
+ $log_message_last_count++;
+ if($config['debug']['repeat_messages'] == true)
+ {
+ //echo "{$messageCount}: $message<br/>\n";
+ if($force)
+ queuePrint($message,true);
+ else
+ queuePrint($message);
+ }
+ if($config['debug']['repeat_messages'] == false)
+ {
+ if($log_message_queue[$messageCount + 1] != $message)
+ {
+ $next = true;
+ }
+ }
+
+ }
+
+ if($next == true)
+ {
+ queuePrint("<b>Last message recieved $log_message_last_count times</b><br/>\n");
+ $log_message_last_count = 0;
+ $next = false;
+ }
+
+ ++$messageCount;
+ }
+
+ echo "</div>";
+ //CloseContent();
+ error_reporting(1);
+}
+
+/*
+function decho($message, $flag = REPEAT)
+{
+ global $last_message, $last_message_count;
+ if($last_message == $message)
+ {
+ if($flag == NO_REPEAT)
+ ++$last_message_count;
+ else
+ $last_message_count = $last_message_count;
+ return;
+ }
+ elseif($last_message != $message)
+ {
+ if($last_message_count > 0 && !is_array($last_message) && !is_object($last_message))
+ {
+ WriteLog("Receieved previous message <b>$last_message_count</b> times\n",BAYONET_LOG_INFO);
+ }
+ else
+ {
+ if(is_array($message))
+ {
+ $array_dump = print_r($message,true);
+ WriteLog($array_dump,BAYONET_LOG_INFO);
+ }
+ elseif(is_object($message))
+ {
+ ob_start();
+ var_dump($message);
+ $obj_dump = ob_get_contents();
+ ob_end_clean();
+ //htmlentities($obj_dump,ENT_QUOTES);
+ WriteLog($obj_dump,BAYONET_LOG_INFO);
+ }
+ elseif(is_string($message))
+ {
+ $message = wordwrap($message,80,'<br />');
+ WriteLog($message,BAYONET_LOG_INFO);
+ }
+ }
+
+ $last_message_count = 0;
+ }
+
+ $last_message = $message;
+
+}
+*/
+
+
+?> \ No newline at end of file
diff --git a/include/functions.php b/include/functions.php
new file mode 100644
index 0000000..109f11c
--- /dev/null
+++ b/include/functions.php
@@ -0,0 +1,615 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * bbcode_format()
+ *
+ * Modified public domain code from www.phpit.net
+ *
+ * @param mixed $str
+ * @return
+ */
+
+include_once 'classes.php';
+
+function bbcode_format ($str)
+{
+ $str = htmlentities($str);
+ $str = strip_tags($str);
+ //$str = wordwrap($str,100,"\n",true);
+
+ $simple_search = array(
+ '/\[b\](.*?)\[\/b\]/is',
+ '/\[i\](.*?)\[\/i\]/is',
+ '/\[u\](.*?)\[\/u\]/is',
+ '/\[s\](.+?)\[\/s\]/is',
+ '/\[hr\]/is',
+ '/\[pi\](.*?)\[\/pi\]/is',
+ '/\[title\](.*?)\[\/title\]/is',
+ '/\[article\](.*?)\[\/article\]/is',
+ '/\[section\](.*?)\[\/section\]/is',
+ '/\[code\](.*?)\[\/code\]/is',
+ '/\[quote\](.*?)\[\/quote\]/is',
+ '/\[quote\=(.*?)\](.*?)\[\/quote\]/is',
+ '/\[url\](.*?)\[\/url\]/is',
+ '/\[url\=(.*?)\](.*?)\[\/url\]/is',
+ '/\[align\=(.*?)\](.*?)\[\/align\]/is',
+ '/\[size\=(.*?)\](.*?)\[\/size\]/is',
+ '/\[img\=(.*?)\](.*?)\[\/img\]/is',
+ '/\[img align\=(.+?)\](.+?)\[\/img\]/is',
+ '/\[mail\](.*?)\[\/mail\]/is',
+ '/\[mail\=(.*?)\](.*?)\[\/mail\]/is',
+ '/\[list\](.*?)\[\/list\]/is'
+ );
+
+ $simple_replace = array(
+ '<strong>$1</strong>',
+ '<em>$1</em>',
+ '<u>$1</u>',
+ '<span class="strikethrough">$1</span>',
+ '<hr>',
+ '<p style="text-indent:3em;">$1</p>',
+ '<h2>$1</h2>',
+ '<h3>$1</h3>',
+ '<h4>$1</h4>',
+ '<blockquote><pre>$1</pre></blockquote>',
+ '<blockquote>$1</blockquote>',
+ '<i>$1 wrote:</i><br/><blockquote>$2</blockquote>',
+ '<a href="$1">$1</a>',
+ '<a href="$1">$2</a>',
+ '<div style="text-align: $1">$2</align>',
+ '<font style="font-size:$1px;">$2</font>',
+ '<img src="$1" alt="$2"/>',
+ '<img src=\"$2\" align=\"$1\" />',
+ '<a href="mailto:$1">$1</a>',
+ '<a href="mailto:$1">$2</a>',
+ '<li style="list-style-position: inside; padding:10px">$1</li>'
+ );
+
+ $str = preg_replace ($simple_search, $simple_replace, $str);
+ $str = nl2br($str);
+ return $str;
+}
+
+/**
+ * BBcode 2 HTML was written by WAY2WEB.net
+ */
+function BBCode($Text)
+ {
+ // Replace any html brackets with HTML Entities to prevent executing HTML or script
+ // Don't use strip_tags here because it breaks [url] search by replacing & with amp
+ $Text = str_replace("<", "&lt;", $Text);
+ $Text = str_replace(">", "&gt;", $Text);
+
+ // Convert new line chars to html <br /> tags
+ $Text = nl2br($Text);
+
+ // Set up the parameters for a URL search string
+ $URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'";
+ // Set up the parameters for a MAIL search string
+ $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@";
+
+ // Perform URL Search
+ $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" target="_blank">$1</a>', $Text);
+ $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+ //$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+
+ // Perform MAIL Search
+ $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text);
+ $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);
+
+ // Check for bold text
+ $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<span class="bold">$1</span>',$Text);
+
+ // Check for Italics text
+ $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<span class="italics">$1</span>',$Text);
+
+ // Check for Underline text
+ $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'<span class="underline">$1</span>',$Text);
+
+ // Check for strike-through text
+ $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'<span class="strikethrough">$1</span>',$Text);
+
+ // Check for over-line text
+ $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
+
+ // Check for colored text
+ $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text);
+
+ // Check for sized text
+ $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text);
+
+ // Check for list text
+ $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '<ul class="listlowerroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text);
+ $Text = str_replace("[*]", "<li>", $Text);
+
+ // Check for font change text
+ $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text);
+
+ // Declare the format for [code] layout
+ $CodeLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [code] text
+ $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text);
+ // Declare the format for [php] layout
+ $phpLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [php] text
+ $Text = preg_replace("/\[php\](.+?)\[\/php\]/is",$phpLayout, $Text);
+
+ // Declare the format for [quote] layout
+ $QuoteLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Quote:</td>
+ </tr>
+ <tr>
+ <td class="quotebody">$1</td>
+ </tr>
+ </table>';
+
+ // Check for [quote] text
+ $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text);
+
+ // Images
+ // [img]pathtoimage[/img]
+ $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1" />', $Text);
+
+ //[img=align]image source[/img]
+ $Text = preg_replace("(\[img align\=(.+?)\](.+?)\[\/img\])is","<img src=\"$2\" align=\"$1\" />",$Text);
+
+ // [img=widthxheight]image source[/img]
+ $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1" />', $Text);
+
+ // Alignment
+ // [align=type]text[/align]
+ $Text = preg_replace("(\[align=(.+?)\](.+?)\[\/align\])is","<div style=\"text-align: $1\">$2</div>",$Text);
+
+ return $Text;
+ }
+
+function articleHeading($text){
+
+ // Set the content-type
+ header('Content-type: image/png');
+
+ //$text = $_GET['text'];
+
+ $im = imagecreatefrompng('images/news_header.png'); // open image
+ imagealphablending($im, true); // setting alpha blending on
+ imagesavealpha($im, true); // save alphablending setting (important)
+
+ // Create some colors
+ $black = imagecolorallocate($im, 0, 0, 0);
+
+
+ // Replace path by your own font path
+ //$font = 'TrajanPro-Regular.otf';
+ //$font = 'TrajanPro-Bold.otf';
+ $font = 'BrushScriptStd.otf';
+ //$font = 'TRATS__.TTF';
+ //$text = strtoupper($text);
+
+ // Add the text
+ imagettftext($im, 18, 0, 0, 17, $black, $font, $text);
+
+ // Using imagepng() results in clearer text compared with imagejpeg()
+ imagepng($im);
+ imagedestroy($im);
+}
+
+function LinkList($array)
+{
+ if(!is_array($array))
+ {
+ ReportError("List was not an array");
+ return;
+ }
+
+ echo "<ul class=\"block\">";
+ foreach($array as $text => $link)
+ {
+ echo "<li><a href=\"$link\">$text</a></li>";
+ }
+ echo "</ul>";
+}
+
+/**
+ * LinkModule()
+ *
+ * Helper function to link to Bayonet modules.
+ *
+ * @param mixed $module_name
+ * @param mixed $link_name
+ * @return
+ */
+function LinkModule($module_name,$args = NULL,$link_name)
+{
+
+ return "<a href=\"index.php?load={$module_name}{$args}\">{$link_name}</a>";
+}
+
+/**
+ * LinkModuleFile()
+ *
+ * Helper function to link to Bayonet internal module files.
+ *
+ * @param mixed $module_name
+ * @param mixed $link_name
+ * @return
+ */
+ function LinkModuleFile($module_name, $file_name, $link_name)
+ {
+ return "<a href=\"?load={$module_name}&amp;file={$file_name}\">{$link_name}</a>";
+ }
+
+/**
+ * LinkPage()
+ *
+ * Helper function to link to Bayonet pages.
+ *
+ * @param mixed $page_id
+ * @param mixed $page_name
+ * @return
+ */
+function LinkPage($page_id,$page_name)
+{
+ return "<a href=\"?load=page&amp;id={$page_id}\">{$page_name}</a>";
+}
+
+/**
+ * LinkInternal()
+ *
+ * Helper function to link to a relative Bayonet path.
+ *
+ * @param mixed $name
+ * @param string $rel_path
+ * @param string $file
+ * @return
+ */
+function LinkInternal($name,$file,$rel_path = "./")
+{
+ return "<a href=\"{$rel_path}{$file}\">{$name}</a>";
+}
+
+if(!defined("CALLED_FROM_ADMIN"))
+{
+ /**
+ * OpenTable()
+ * Begins a Bayonet site table.
+ * @return
+ */
+ function OpenTable($width = "100%")
+ {
+ //width="100%" is important. Otherwise all of our tables will be text width.
+ echo "<table width=\"{$width}\" align=\"center\">\n";
+ }
+
+ /**
+ * CloseTable()
+ * Closes a Bayonet site table.
+ * @return
+ */
+ function CloseTable()
+ {
+ echo "</table>";
+ }
+
+ /**
+ * OpenContent()
+ * Begins a Bayonet site table.
+ * MOVE FOR CUSTOMIZED USE FOR THEMES
+ * @return
+ */
+/* function OpenContent()
+ {
+ echo "<div class=\"contentBorder1\">";
+ echo "<div class=\"contentBorder2\">";
+ } */
+
+ /**
+ * CloseContent()
+ * Closes a Bayonet site table.
+ * @return
+ */
+ /* function CloseContent()
+ {
+ echo "</div>";
+ echo "</div>";
+ } */
+}
+/* MOVED TO THEMES
+function OpenBlock($title = 'New Block')
+{
+ OpenContent();
+ echo "<div class=\"contentHeading\">{$title}</div>";
+ echo "<div class=\"content\">";
+}
+
+function CloseBlock()
+{
+ echo "</div>";
+ CloseContent();
+} */
+
+static $error_stack_messages = array(); //global stack of errors accumulated throughout execution
+function push_error_stack($message)
+{
+ global $error_stack_messages;
+
+ if(count($error_stack_messages) >= 100)
+ array_pop($error_stack_messages);
+
+ array_push($error_stack_messages, $message);
+}
+
+function fatal_error_handler($buffer) {
+ if (ereg("(error</b>:)(.+)(<br)", $buffer, $regs) ) {
+ $err = preg_replace("/<.*?>/","",$regs[2]);
+ //ReportError($err);
+ }
+ return $buffer;
+}
+
+function handle_error ($errno, $errstr, $errfile, $errline)
+{
+ //decho("<b>Warning:</b> $errfile:$errline, $errstr");
+ push_error_stack("<b>Error Number:</b> $errno<br/><b>Error:</b> $errstr<br/><b>In File:</b> $errfile<br/><b>Line:</b> $errline");
+ if($errno == FATAL || $errno == ERROR){
+ push_error_stack($errstr);
+ ob_end_flush();
+ exit(0);
+ }
+}
+
+/**
+ * ReportError()
+ *
+ * This function should be called in the event that an error has occured.
+ *
+ * @param mixed $message - automatically logged
+ * @return
+ */
+function ReportError($message)
+{
+ //WriteLog($message,BAYONET_LOG_ERROR);
+ //OpenContent();
+ echo "<div class=\"contentHeading\">Error Message</div><div class=\"content\">{$message}</div>";
+ //CloseContent();
+}
+
+/**
+ * ReportHack()
+ *
+ * This function should be called in the event that we are confirming
+ * a hacking attempt.
+ *
+ * @param mixed $message - automatically logged
+ * @return void
+ */
+function ReportHack($message)
+{
+ //WriteLog($message,BAYONET_LOG_HACK);
+ //OpenContent();
+ echo "<div class=\"contentHeading\">Hacking Attempt</div><div class=\"content\">{$message}</div>";
+ //CloseContent();
+}
+
+/**
+ * PageRedirect()
+ *
+ * performs an http redirect
+ *
+ * @param $delay
+ * @param $link
+ */
+function PageRedirect($delay, $link)
+{
+ echo "<meta http-equiv=\"Refresh\" content=\"{$delay};url={$link}\">";
+}
+
+
+/**
+ * array_dump()
+ *
+ * Useful against $_POST and $_GET variables, for dumping data to
+ * a log file, or to stdout. The return value is a single string,
+ * with each array key => value pair delimited by a character.
+ * The default character is a pipe -> '|'. It is assumed that if
+ * wanted to have a newline character inserted, just replace $spacer
+ * with '\n'.
+ *
+ * @param mixed $array
+ * @param string $spacer
+ * @return
+ */
+function array_dump($array, $spacer = '|')
+{
+ $retval = NULL;
+ foreach($array as $challenge => $answer)
+ {
+ $retval .= " $challenge => $answer " . $spacer;
+ }
+
+ return $retval;
+}
+
+/**
+ * WriteLog()
+ *
+ * This function can be accessed directly, however, anything that is
+ * passed to ReportError() or ReportHack(), or decho() will be logged in their
+ * appropriate log file.
+ *
+ * Change made: added checks to see if the log files exist before opening
+ *
+ * @param mixed $message
+ * @param mixed $flag
+ * @return
+ */
+define('BAYONET_LOG_HACK','bayonet_log_hack');
+define('BAYONET_LOG_ERROR','bayonet_log_error');
+define('BAYONET_LOG_WARN','bayonet_log_warn');
+define('BAYONET_LOG_INFO','bayonet_log_info');
+
+function WriteLogBayonet($message,$flag)
+{
+ global $config;
+ $enabled = $config['logs']['enabled'];
+
+ if(!$enabled)
+ {
+ return false;
+ }
+
+ $dir = $config['logs']['dir'];
+ date_default_timezone_set($config['logs']['timezone']);
+ $varstr = array_dump($_GET);
+ $type = NULL;
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $hostname = gethostbyaddr($ip);
+ $executed = $_SERVER['PHP_SELF'];
+ $timestamp = date('Y-M-d H:i:s T');
+
+
+ $message = str_replace("\n",'',$message);
+ $message = str_replace("<br>",'',$message);
+
+ switch($flag)
+ {
+ case BAYONET_LOG_HACK:
+ if(!file_exists($dir.'hacks.log')){
+ break;
+ }
+ $fp = fopen($dir.'hacks.log','a');
+ $type = 'HACK';
+ $full_message = "TIMESTAMP: {$timestamp}\n\t\tIP: {$ip}\n\t\tHOSTNAME: {$hostname}\n\t\tACTION: {$type} of {$executed}\n\t\tDEFERRAL: {$message}\n\t\tVAR: ({$varstr})\n\n";
+ break;
+ case BAYONET_LOG_ERROR:
+ if(!file_exists($dir.'error.log')){
+ break;
+ }
+ $fp = fopen($dir.'error.log','a');
+ $type = 'ERROR';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_WARN:
+ if(!file_exists($dir.'warn.log')){
+ break;
+ }
+ $fp = fopen($dir.'warn.log','a');
+ $type = 'WARN';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_INFO:
+ if(!file_exists($dir.'info.log')){
+ break;
+ }
+ $fp = fopen($dir.'info.log','a');
+ $type = 'INFO';
+ $full_message = "({$timestamp}) - {$type} - {$message}\n";
+ break;
+ default:
+ echo 'To log something, you need to define a log to write to.<br>';
+ return;
+ }
+ if(file_exists($fp)){
+ fwrite($fp,$full_message);
+ fclose($fp);
+ }else{
+ //echo "could not write to file because file does not exist.<br />";
+ }
+}
+
+/**
+ * valid_result()
+ *
+ * Determine if a mysqli result is valid.
+ * Can be used on normal objects to check if they are empty.
+ *
+ * @param mixed $p_result
+ * @return
+ */
+function valid_result($p_result)
+{
+ if(is_object($p_result) && count($p_result) <= 1)
+ return false;
+ else
+ return true;
+}
+
+/**
+ * GetBlocks()
+ *
+ * Includes all directories listed in blocks/ and uses the bayonet_blocks
+ * MySQL table to determine the order of the blocks displayed.
+ *
+ * @return
+ */
+
+define('BLOCK_LEFT', 0);
+define('BLOCK_RIGHT', 1);
+
+function GetBlocks($position = BLOCK_LEFT)
+{
+ global $config;
+ global $db;
+
+ $query = sprintf("SELECT block_id, active, weight, position, dir_name, title FROM bayonet_blocks WHERE active = 1 AND position = %d ORDER BY weight", (int)$position);
+ $result = $db->Query($query);
+
+
+
+ $blocks = $db->Fetch($result);
+ if(empty($blocks)) return;
+
+ foreach($blocks as $block)
+ {
+ $load = 'blocks/'.$block['dir_name'].'/index.php';
+ if(file_exists($load))
+ {
+ OpenBlock($block['title']);
+ include_once $load;
+ CloseBlock();
+ decho("'{$block['dir_name']}' block loaded");
+ }
+ else
+ {
+ ReportError("Failed to load block, '{$block['dir_name']}'. Check block config.");
+ }
+ if($config['blocks']['spacer']) echo "<br />";
+ }
+}
+?> \ No newline at end of file
diff --git a/include/sql.class.php b/include/sql.class.php
new file mode 100644
index 0000000..c32de63
--- /dev/null
+++ b/include/sql.class.php
@@ -0,0 +1,167 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+static $db_queries = 0;
+static $db_connections = 0;
+static $db_frees = 0;
+static $db_fetches = 0;
+
+class Bayonet_SQL
+{
+ protected $hostname;
+ public function Connect($hostname, $username, $passwd)
+ {
+ global $db_connections;
+ $db_connections++;
+
+ $this->hostname = $hostname;
+
+ decho("Connecting ('$hostname')");
+ return ($GLOBALS['___mysqli_ston'] = mysqli_connect($hostname, $username, $passwd));
+ }
+
+ public function Disconnect($link)
+ {
+ decho("Disconnecting ('$link' from '$this->hostname')");
+ return mysqli_close($GLOBALS['___mysqli_ston']);
+ }
+
+ public function Stat()
+ {
+ return mysqli_stat($GLOBALS['___mysqli_ston']);
+ }
+
+ public function Select_db($db)
+ {
+ decho("Selecting database ('$db')");
+ return mysqli_select_db($GLOBALS['___mysqli_ston'], $db);
+ }
+
+ private function validResult($p_result)
+ {
+ if($this->Rows($p_result) > 0)
+ return true;
+ else
+ return false;
+ }
+
+ public function Query($str)
+ {
+ global $db_queries;
+ $db_queries++;
+ return mysqli_query($GLOBALS['___mysqli_ston'], $str);
+ }
+
+ public function Free($result)
+ {
+ global $db_frees;
+ $db_frees++;
+ @((mysqli_free_result($result) || (is_object($result) && (get_class($result) == "mysqli_result"))) ? true : false);
+ }
+
+ public function Fetch($result)
+ {
+ return $this->FetchArray($result);
+ }
+
+ public function FetchArray($p_result)
+ {
+ global $db_fetches;
+ $db_fetches++;
+ decho('Fetching result');
+
+ if(!$this->validResult($p_result))
+ {
+ decho('Result was not valid.');
+ return array();
+ }
+
+ while ($row = mysqli_fetch_array($p_result, MYSQLI_ASSOC))
+ {
+ $result[] = $row;
+ }
+ $this->Free($p_result);
+
+ return is_array($result) ? $result : array();
+ }
+
+ public function FetchObject($p_result, $class, $no_array = false)
+ {
+ global $db_fetches;
+ $db_fetches++;
+
+ decho("Fetching object result");
+
+ if(!$this->validResult($p_result))
+ {
+ decho('Result was not valid.');
+ return (object)array();
+ }
+
+ while ($row = mysqli_fetch_object($p_result, $class))
+ {
+ if($no_array == true)
+ (object)$result = $row;
+ else
+ (object)$result[] = $row;
+ }
+
+ $this->Free($p_result);
+
+ // TODO: Test for objects inside of $result array
+ if($no_array == true) { return is_object($result) ? $result : (object)$nothing; }
+ return is_array($result) ? $result : (object)array();
+ }
+
+ public function FetchAssoc($result)
+ {
+ return $this->FetchArray($result);
+ }
+
+ public function FetchRow($p_result)
+ {
+ global $db_fetches;
+ $db_fetches++;
+
+ decho("Fetching single row");
+
+ if(!$this->validResult($p_result))
+ {
+ decho('Result was not valid.');
+ return array();
+ }
+
+ while ($row = mysqli_fetch_assoc($p_result)) {
+ $result = $row;
+ }
+
+ $this->Free($p_result);
+
+ return is_array($result) ? $result : array();
+ }
+
+ public function Rows($result)
+ {
+ decho("Fetching number of rows");
+
+ return mysqli_num_rows($result);
+ }
+}
+
+?>
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..d6280da
--- /dev/null
+++ b/index.php
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * DO NOT MOVE THESE DEFINES
+ */
+define('BAYONET_ROOT', basename(dirname('.')));
+define('BAYONET_INCLUDE', BAYONET_ROOT . '/include');
+define('BAYONET_CONFIG', BAYONET_ROOT . '/include/config.ini');
+
+require BAYONET_INCLUDE . '/debug.php';
+require BAYONET_INCLUDE . '/sql.class.php';
+require BAYONET_INCLUDE . '/functions.php';
+require_once BAYONET_INCLUDE . '/classes.php';
+
+/* Initialize Bayonet CMS */
+Bayonet::init();
+
+
+?> \ No newline at end of file
diff --git a/logs/error.log b/logs/error.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/logs/error.log
diff --git a/logs/hacks.log b/logs/hacks.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/logs/hacks.log
diff --git a/logs/info.log b/logs/info.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/logs/info.log
diff --git a/modules.php b/modules.php
new file mode 100644
index 0000000..e576881
--- /dev/null
+++ b/modules.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+define("MODULE_FILE",true);
+global $load,$index_module;
+
+/**
+ * Assign _GET variables
+ */
+if(isset($_GET['load']))
+ $load = $_GET['load'];
+
+if(isset($_GET['file']))
+ $file = $_GET['file'];
+
+/**
+ * Determine the default module to load
+ */
+if(is_null($load))
+{
+ $load = $config['modules']['default'];
+}
+
+/**
+ * If the error stack has recieved messages, output each failure in a clean fashion
+ */
+global $error_stack_messages;
+if(!empty($error_stack_messages))
+{
+ $messageBuffer = NULL;
+ foreach($error_stack_messages as $order => $error)
+ {
+ $messageBuffer .= "<p><b>Stack Order:</b> $order<br/>$error</p>";
+ }
+ ReportError($messageBuffer);
+ //exit(1);
+}
+
+$module_path = "modules/" . $load;
+$module_index = $module_path . "/index.php";
+$module_internal_file = "modules/" . $load . "/" . $file;
+
+/** Sanity Check
+ * If the module or a file associated with the module is a symbolic link then
+ * commit suicide. Symbolic links to malicious code can be dangerous.
+ */
+if(isset($load) || isset($file))
+{
+ if(is_link($module_path))
+ {
+ decho("Refusing to follow symbolic link to '$load'");
+ exit(1);
+ }
+
+ if(is_link($module_internal_file))
+ {
+ decho("Refusing to follow symbolic link to '$file'");
+ exit(1);
+ }
+}
+
+/** Sanity Check
+ * Determine if the module or file passed into $load actually exists
+ * If everything checks out, load the module or file, else commit suicide.
+ */
+if(isset($load) && !empty($load) && !isset($file))
+{
+ if(file_exists($module_path))
+ {
+ include $module_index;
+ decho("'$load' module loaded");
+ }
+ else
+ {
+ ReportError("Cannot load module directory.<br>\n");
+ }
+}
+/**
+ * Load an internal module file
+ */
+elseif(isset($load) && isset($file))
+{
+ if(file_exists($module_path))
+ {
+ if(file_exists($module_internal_file))
+ {
+ include $module_internal_file;
+ decho("Loaded '$file' file from $load module");
+ }
+ else
+ {
+ ReportError("Cannot load module directory.<br>\n");
+ }
+ }
+ else
+ {
+ ReportError("Cannot load module file.<br>\n");
+ }
+}
+else
+{
+ ReportError("Failure to load module.<br>\n");
+}
+
+
+?> \ No newline at end of file
diff --git a/modules/admin/admin_functions.php b/modules/admin/admin_functions.php
new file mode 100644
index 0000000..6c2b394
--- /dev/null
+++ b/modules/admin/admin_functions.php
@@ -0,0 +1,152 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ /*
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+function is_loggedin()
+{
+ $id = session_id();
+ if($id == "")
+ {
+ header("location: index.php");
+ return false;
+ }
+ return true;
+}
+
+function login()
+{
+ global $db;
+
+ if(isset($_SESSION['username']) || isset($_SESSION['password']))
+ {
+ return true;
+ }
+
+ if(isset($_POST['processed']))
+ {
+ $username = addslashes($_POST['username']);
+ $password = addslashes($_POST['password']);
+ $password = crypt(md5($password),'iamnotadirtywhorebitch');
+ $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password'");
+ $rows = $db->Rows($result);
+
+ if($rows > 0)
+ {
+ $_SESSION['username'] = stripslashes($username);
+ $_SESSION['password'] = stripslashes($password);
+ return true;
+ }
+ else
+ {
+ ReportError("Login incorrect.");
+ return false;
+ }
+
+ }
+ else
+ {
+ echo "<form action=\"\" method=\"post\">\n";
+ OpenTable();
+ echo "<tr><th colspan=\"2\">Administrative Login</th></tr>\n";
+
+ echo "<tr><td><table width=\"5\" align=\"center\">\n
+ <tr><th style=\"text-align:right;\">Username</th><td><input size=\"20\" type=\"text\" name=\"username\"></td></tr>\n
+ <tr><th style=\"text-align:right;\">Password</th><td><input size=\"20\" type=\"password\" name=\"password\"></td></tr>\n
+ <tr><th colspan=\"2\" align=\"right\"><input type=\"Submit\" name=\"processed\" value=\"Submit\"></th></tr></td></tr>\n
+ </table>\n";
+ CloseTable();
+ echo "</form>\n";
+ return false;
+ }
+}
+
+function logout()
+{
+ session_unset();
+ session_destroy();
+}
+*/
+/**
+ * CompileAdmin()
+ *
+ * because we want to have a horizontal display of options, we need to have
+ * the data separated by arrays. the data is processed into single tables, and is
+ * echoed in realtime. we checked to make sure they were arrays, but there is no
+ * checking to make sure the data passed is not malicious in nature.
+ *
+ * @param mixed $head
+ * @param mixed $body
+ * @return
+ */
+ /*
+function CompileAdmin($head,$body)
+{
+ /*if we were not passed arrays, then say goodbye
+ if(!is_array($head) || !is_array($body))
+ {
+ echo "must be array\n";
+ return;
+ }
+
+ echo "<table class=\"cleartable\" width=\"100%\">";
+ echo "<tr style=\"text-align:center; height:90px;\">";
+
+ $num = 1;
+ foreach($body as $td)
+ {
+ echo "<td class=\"center\" style=\"width:25%;\">$td</td>\n";
+ if($num%4 == 0){
+ echo "</tr><tr style=\"text-align:center; height:90px;\">";
+ }
+ $num++;
+ }
+ echo "</tr></table>\n";
+}
+
+
+ * OpenTable()
+ *
+ * The administration OpenTable() function requires an argument to define
+ * the header title. It may be wise to replace the standard OpenTable() function
+ * with this one... that's alot of code to unfuck though.
+ *
+ * @param mixed $title
+ * @return
+
+function OpenTable_Ex($title)
+{
+ echo "<table align=\"center\"><tr><th>{$title}</th></tr><tr><td>";
+}
+
+
+ * CloseTable()
+ *
+ * @return
+
+function CloseTable_Ex()
+{
+ echo "</td></tr></table>";
+}
+ */
+?> \ No newline at end of file
diff --git a/modules/admin/blocks/functions.php b/modules/admin/blocks/functions.php
new file mode 100644
index 0000000..0138839
--- /dev/null
+++ b/modules/admin/blocks/functions.php
@@ -0,0 +1,173 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+function ListBlocks()
+{
+ global $db;
+ $result = $db->Query("SELECT * FROM bayonet_blocks");
+ $blocks = $db->Fetch();
+
+ echo "<table align=\"center\"><tr><th colspan=\"3\">Existing Blocks</th></tr>";
+ foreach($blocks as $block)
+ {
+ echo "<tr><td>{$block['weight']} : {$block['dir_name']}</td><td><a href=\"?load=admin&op=blocks&edit={$block['block_id']}\">Edit</a></td><td><a href=\"?load=admin&op=blocks&delete={$block['block_id']}\">Delete</a></td></tr>";
+ }
+ echo "</table>";
+}
+
+function NewBlock()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+
+ if(empty($weight) || empty($dir_name) || empty($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ //Update the database with the new data.
+ $db->Query("INSERT INTO bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active'");
+ //die, because we have completed what we wanted to do.
+ echo "New block, '$dir_name', at position '$weight' added.\n";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>"></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>"></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>"></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function GetActive($block_id, &$active)
+{
+ $options = array(1 => 'Yes',0 => 'No');
+ foreach($options as $option => $value)
+ {
+ $selected = NULL;
+ if($active == $option)
+ {
+ $selected = "selected";
+ }
+ echo "<option " . $selected . " value=\"". $option ."\">" . $value . "</option>\n";
+ }
+
+
+}
+
+function EditBlock($block_id)
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+
+ if(empty($weight) || empty($dir_name) || empty($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'");
+ //$isActive = $active ? "IS" : "IS NOT";
+ echo "Block, '$dir_name', at position '$weight' has been edited.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ //Grab the page from the database according to the $page_id passed to the function.
+ // {{{ XXX: FIXME -- Re-write this
+ /*
+ $result = $db->Query("SELECT weight,dir_name,position,active FROM bayonet_blocks WHERE block_id = '$block_id'");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ //We only want one row, so we don't have to $block[]... No foreach necessary.
+ $block = $row;
+ }
+ */
+ // }}}
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>"></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>"></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>"></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <?php GetActive($block_id, $block['active']) ?>
+ </select>
+ </td>
+
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function DeleteBlock($block_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT dir_name FROM bayonet_blocks WHERE block_id = '$block_id'");
+ $block = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Block '{$block['dir_name']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_blocks WHERE block_id = '$block_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$block['dir_name']}'";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table align="center">
+ <th>Are you SURE you want to delete the block titled: '<?php echo $block['dir_name']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?>
diff --git a/modules/admin/blocks/index.php b/modules/admin/blocks/index.php
new file mode 100644
index 0000000..6dac3d2
--- /dev/null
+++ b/modules/admin/blocks/index.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * This file administers the site blocks.
+ *
+ * -weight
+ * -directory name
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+
+include $basedir.'blocks/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $block_id = $_GET['edit'];
+ EditBlock($block_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $block_id = $_GET['delete'];
+ DeleteBlock($block_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ NewBlock();
+ return;
+}
+
+echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('Create a Block','?load=admin&op=blocks&create=true')."</th></tr></table>";
+
+ListBlocks();
+
+?> \ No newline at end of file
diff --git a/modules/admin/images/addnewarticle.png b/modules/admin/images/addnewarticle.png
new file mode 100644
index 0000000..0e29960
--- /dev/null
+++ b/modules/admin/images/addnewarticle.png
Binary files differ
diff --git a/modules/admin/images/addnewpage.png b/modules/admin/images/addnewpage.png
new file mode 100644
index 0000000..c60c68c
--- /dev/null
+++ b/modules/admin/images/addnewpage.png
Binary files differ
diff --git a/modules/admin/images/announcement.png b/modules/admin/images/announcement.png
new file mode 100644
index 0000000..c70591d
--- /dev/null
+++ b/modules/admin/images/announcement.png
Binary files differ
diff --git a/modules/admin/images/calendar.png b/modules/admin/images/calendar.png
new file mode 100644
index 0000000..86b9861
--- /dev/null
+++ b/modules/admin/images/calendar.png
Binary files differ
diff --git a/modules/admin/images/editfiles.png b/modules/admin/images/editfiles.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/modules/admin/images/editfiles.png
Binary files differ
diff --git a/modules/admin/images/editpage.png b/modules/admin/images/editpage.png
new file mode 100644
index 0000000..ab3fd58
--- /dev/null
+++ b/modules/admin/images/editpage.png
Binary files differ
diff --git a/modules/admin/images/file_doc.png b/modules/admin/images/file_doc.png
new file mode 100644
index 0000000..b1da1ef
--- /dev/null
+++ b/modules/admin/images/file_doc.png
Binary files differ
diff --git a/modules/admin/images/file_pdf.png b/modules/admin/images/file_pdf.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/modules/admin/images/file_pdf.png
Binary files differ
diff --git a/modules/admin/images/file_rtf.png b/modules/admin/images/file_rtf.png
new file mode 100644
index 0000000..39304c1
--- /dev/null
+++ b/modules/admin/images/file_rtf.png
Binary files differ
diff --git a/modules/admin/images/file_word.png b/modules/admin/images/file_word.png
new file mode 100644
index 0000000..3011f00
--- /dev/null
+++ b/modules/admin/images/file_word.png
Binary files differ
diff --git a/modules/admin/images/photogallery.png b/modules/admin/images/photogallery.png
new file mode 100644
index 0000000..a161a55
--- /dev/null
+++ b/modules/admin/images/photogallery.png
Binary files differ
diff --git a/modules/admin/index.php b/modules/admin/index.php
new file mode 100644
index 0000000..fc379ea
--- /dev/null
+++ b/modules/admin/index.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ /*
+ if(!defined("MODULE_FILE"))
+ {
+ die("Access denied.");
+ }
+
+ define("ADMIN_FILE",'admin_file');
+ include 'admin_functions.php';
+
+ if($_GET['op'] == 'logout')
+ {
+ logout();
+ }
+
+ if(login())
+ {
+ //this is so dirty... sigh.
+ if(is_loggedin())
+ {
+ ?>
+ <!-- Add id="wrapper" for full height -->
+ <table align="center" width="90%" >
+ <tr><td><div style="text-align:right"><a href="?load=admin&op=logout">Logout, <?php echo $_SESSION['username']?></a></div></td></tr>
+ <tr><td>
+
+ <div class="maincontent">
+ <fieldset>
+ <legend>Administrative Tools:</legend>
+ <?php
+ $th = array('Blocks','Pages');
+ $td = array(
+ //LinkInternal('Blocks','?load=admin&op=blocks'),
+ LinkInternal('<img src="images/editpage.png" /><br />Manage Pages','?load=admin&op=pages'),
+ LinkInternal('<img src="images/navigation.png" /><br />Edit Navigation','?load=admin'),
+ LinkInternal('<img src="images/announcement.png" /><br />Edit Announcements','?load=admin'),
+ LinkInternal('<img src="images/calendar.png" /><br />Manage Events','?load=admin'),
+ LinkInternal('<img src="images/photogallery.png" /><br />Manage Galleries', '?load=admin')
+
+ );
+
+ //render administration table
+ CompileAdmin($th,$td);
+ ?>
+ </fieldset>
+
+ </td></tr>
+ <tr><td><div style="text-align:center"><?php include 'operation.php' ?></div></td></tr>
+
+ </table>
+ </div>
+ <?php )
+ }
+ } */
+
+?> \ No newline at end of file
diff --git a/modules/admin/operation.php b/modules/admin/operation.php
new file mode 100644
index 0000000..2c66ff4
--- /dev/null
+++ b/modules/admin/operation.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ /*
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+if(!isset($_GET['op']))
+{
+ echo "<center>No operation selected</center>\n";
+ return;
+}
+
+$op = $_GET['op'];
+$basedir = 'modules/admin/';
+
+if(file_exists($basedir))
+{
+ if(file_exists($basedir . $op))
+ {
+ include $basedir . $op . '/index.php';
+ }
+ else
+ {
+ ReportError("Administrative operation '$op' does not exist.");
+ }
+}
+else
+{
+ ReportError("Administrative base directory path does not exist.");
+}
+
+
+*/
+?> \ No newline at end of file
diff --git a/modules/admin/pages/functions.php b/modules/admin/pages/functions.php
new file mode 100644
index 0000000..fc97ffc
--- /dev/null
+++ b/modules/admin/pages/functions.php
@@ -0,0 +1,227 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function ListArticles($pageid){
+
+ global $db;
+ $result = $db->Query("SELECT article_id,title FROM bayonet_articles WHERE `page_id` = $pageid ORDER BY `weight`");
+ $articles = $db->Fetch($result);
+
+ echo "<table class=\"cleartable\" width=\"100%\" cellspacing=\"0\">";
+
+ if(count($articles)==0){
+ echo "<tr><td>There are no articles posted on this page.<br /></td></tr></table>";
+ return;
+ }
+ foreach($articles as $article)
+ {
+ if($_GET['aid'] == $article['article_id'])
+ echo '<tr style="background-color:#c1c1c1; height:30px;">';
+ else
+ echo '<tr style="height:30px;">';
+ ?>
+
+ <td>^</td>
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden;">
+ <a href="?load=admin&op=pages&edit=<?php echo $pageid; ?>&aid=<?php echo $article['article_id']?>"><?php echo $article['title']; ?></a>
+ </td>
+ <td>v</td>
+ </tr>
+
+ <?php
+ }
+
+ echo "</table>";
+
+
+
+}
+
+function EditArticle($article_id){
+
+ global $db;
+ //Grab the page from the database according to the $article_id passed to the function.
+ // {{{ XXX: FIXME -- Needs to be re-written
+ /*
+ $result = $db->Query("SELECT title,text FROM bayonet_articles WHERE article_id = '$article_id'");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ //We only want one row, so we don't have to $article[]... No foreach necessary.
+ $article = $row;
+ }
+ */
+ // }}}
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table class="cleartable">
+ <tr><td>
+ <input type="text" name="title" value="<?php echo $article['title'] ?>" maxlength="50" size="30" />
+ <input type="submit" name="processed" value="Submit Changes" />
+ </td></tr>
+ <tr><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $article['text'] ?></textarea></td></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function ListPages($pid = NULL)
+{
+ global $db;
+ $pages = $db->Query("SELECT page_id,title FROM bayonet_pages");
+
+ echo 'Select page: <select id="pagenames" onchange="gotoEditPage(this.id)">';
+ echo '<option value="0">-&nbsp;-&nbsp;-&nbsp;-&nbsp;-&nbsp;-&nbsp;-&nbsp;-</option>';
+ //echo "<table align=\"center\"><tr><th colspan=\"3\">Existing Pages</th></tr>";
+
+
+ foreach($pages as $page)
+ {
+ if($pid == $page['page_id'])
+ echo "<option value=\"{$page['page_id']}\" selected>{$page['title']}</option>";
+ else
+ echo "<option value=\"{$page['page_id']}\">{$page['title']}</option>";
+ }
+ echo '</select>';
+ // echo "</table>";
+}
+
+function NewPage()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("INSERT INTO bayonet_pages SET title = '$title', text = '$text'");
+ echo "New page, '$title', has been added.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ ?>
+ <h3>Add New Page</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $page['title'] ?>" /></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $page['text'] ?></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function EditPage($page_id)
+{
+ global $db;
+ $page_id = addslashes($page_id);
+
+ // If the user has submitted, then process their request.
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_pages SET title = '$title', text = '$text' WHERE page_id = '$page_id'");
+ echo "Page, '$title', has been edited.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ $aid = $_GET['aid'];
+?>
+ <table width="100%">
+ <tr>
+ <td><?php ListPages($page_id); ?></td>
+ <td><?php echo LinkInternal('<img src="images/view.gif" />&nbsp;View this Page','?load=page&id='.$page_id); ?></td>
+ <td class="right"><?php echo LinkInternal('<img src="images/delete.gif" />&nbsp;Delete this Page','?load=admin&op=pages&delete='.$page_id); ?></td>
+ </tr>
+ </table>
+ <hr />
+ <table class="cleartable" width="100%" style="height:95%;" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;">
+ <?php ListArticles($page_id); ?>
+ </td>
+ <td style="width:589px; vertical-align:top; border-left:1px solid #848484;">
+ <?php
+ //if article is set then EditArticle();
+ if($aid > 0){
+ EditArticle($aid);
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
+ <?php
+}
+
+function DeletePage($page_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT title FROM bayonet_pages WHERE page_id = '$page_id'");
+ $page = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Page '{$page['title']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_pages WHERE page_id = '$page_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$page['title']}'";
+ return;
+ }
+ if($page_id == 1){
+ echo "You can not delete the home page.";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you SURE you want to delete the page titled: '<?php echo $page['title']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?>
diff --git a/modules/admin/pages/index.php b/modules/admin/pages/index.php
new file mode 100644
index 0000000..0fb6cff
--- /dev/null
+++ b/modules/admin/pages/index.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ ?>
+
+ <div class="maincontent">
+ <fieldset style="height:500px">
+ <legend>Manage Pages:</legend>
+<?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'pages/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $page_id = $_GET['edit'];
+ EditPage($page_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $page_id = $_GET['delete'];
+ DeletePage($page_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ $create = $_GET['create'];
+ if($create)
+ {
+ NewPage();
+ return;
+ }
+}
+?>
+
+ <table width="100%">
+ <tr>
+ <td><?php ListPages(); ?></td>
+ <td class="right">
+ <?php echo LinkInternal('<img src="images/add.gif" />&nbsp;Create a Page','?load=admin&op=pages&create=true'); ?>
+ </td>
+
+ <tr>
+ </table>
+ </fieldset>
+</div>
diff --git a/modules/download/index.php b/modules/download/index.php
new file mode 100644
index 0000000..b819e8d
--- /dev/null
+++ b/modules/download/index.php
@@ -0,0 +1,134 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if(!defined("MODULE_FILE"))
+{
+ die("Access denied...");
+}
+
+function getCategoryList()
+{
+ global $db;
+ $query = sprintf("SELECT category_id, title FROM bayonet_downloads_categories");
+ $result = $db->Query($query);
+ $categories = $db->Fetch($result);
+
+ return $categories;
+}
+
+function getCategoryName($category)
+{
+ global $db;
+ if(!filter_var($category, FILTER_VALIDATE_INT))
+ return array();
+
+ $query = sprintf("SELECT category_id, title FROM bayonet_downloads_categories WHERE category_id = %d", (int)$category);
+ $result = $db->Query($query);
+ $data = $db->FetchRow($result);
+
+ return $data['title'];
+ //return is_array($data) ? $data : array();
+}
+
+function getCategoryFiles($category)
+{
+ global $db;
+ $query = sprintf("SELECT ca.category_id, ca.title AS category, dl.name, dl.filename, dl.description FROM bayonet_downloads_categories AS ca LEFT OUTER JOIN bayonet_downloads AS dl ON dl.category_id = ca.category_id WHERE ca.category_id = %d", (int)$category);
+
+ $result = $db->Query($query);
+ $downloads = $db->FetchArray($result);
+ decho('downloads data');
+ decho($downloads);
+ decho('downloads data done');
+
+ return $downloads;
+}
+
+global $db;
+$downloads = NULL;
+$download_relative_path = "modules/" . basename(dirname(__FILE__)) . "/files/";
+$download_absolute_path = dirname(__FILE__) . "/files/";
+
+$category = $_GET['category'];
+if(isset($category) && !filter_var($category, FILTER_VALIDATE_INT))
+{
+ ReportHack("Purposely invalid category entry.");
+ return;
+}
+
+$downloads = getCategoryFiles($category);
+decho($downloads);
+
+OpenContent();
+echo "<div class=\"contentHeading\">Categories</div>\n";
+echo "<div class=\"content\">\n";
+
+$categoryList = getCategoryList();
+
+ foreach($categoryList as $categoryListItem)
+ {
+ echo "<p>";
+ echo LinkModule("download", "&amp;category={$categoryListItem['category_id']}",$categoryListItem['title']);
+ echo "</p>\n";
+ }
+
+
+echo "</div>\n</div>\n";
+CloseContent();
+
+echo "<br/>"; //spacer between div tags
+
+if(isset($category))
+{
+ OpenContent();
+ echo "<div class=\"contentHeading\">" . getCategoryName($category) . "</div>\n";
+ echo "<div class=\"content\">\n";
+
+ OpenContent();
+ echo "<div class=\"contentHeading\">Files</div>\n";
+ echo "<div class=\"content\">\n";
+
+ if(empty($downloads))
+ {
+ echo "No downloads available.\n";
+ return;
+ }
+
+ foreach($downloads as $file)
+ {
+ $download_full_path = $download_absolute_path . $file['filename'];
+
+ if(!file_exists($download_full_path)) $broken = "(Broken link detected)";
+ echo "<p>";
+ echo LinkInternal($file['name'], $file['filename'], $download_relative_path) . " $broken<br/>\n";
+ echo "<b>Filename:</b> {$file['filename']}<br/>\n";
+ printf("<b>Size:</b> %.2fKB<br/>\n", filesize($download_full_path) / 1024);
+ echo "<b>MD5 Hash:</b> " . md5_file($download_full_path) . "<br/>\n";
+ echo "<b>Description:</b> {$file['description']}<br/>\n";
+ echo "</p>";
+
+ }
+ //logQueueFlush(FORCE);
+
+ echo "</div>\n</div>";
+ echo "</div>\n</div>";
+}
+ CloseContent();
+CloseContent();
+?>
diff --git a/modules/index/index.php b/modules/index/index.php
new file mode 100644
index 0000000..54c8dbd
--- /dev/null
+++ b/modules/index/index.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * MODULE - INDEX >>
+ * This page is a module that displays multiple modules
+ * Database should store a list of module names in the order they are to be displayed
+ * This should be fairly simple to produce -- Dont forget to set this as the default
+ * in the config.php array
+ *
+ */
+
+define('INDEX_MODULE', true);
+
+$result = $db->Query("SELECT `dir_name` FROM `bayonet_modules` ORDER BY `weight` ASC");
+$modules = $db->Fetch($result);
+foreach($modules as $module)
+{
+ $indexModules[] = $module['dir_name'];
+}
+
+foreach($indexModules as $module)
+{
+ if(file_exists("modules/" . $module))
+ {
+ include 'modules/' . $module . '/index.php';
+ decho("Index module loaded: '$module'");
+ }
+ else
+ {
+ OpenContent();
+ ReportError("Cannot load module '{$module}' directory.<br>\n");
+ CloseContent();
+ }
+ echo "<br />";
+}
+
+?>
diff --git a/modules/news/categories/3rdIDnews.png b/modules/news/categories/3rdIDnews.png
new file mode 100644
index 0000000..e31a7f5
--- /dev/null
+++ b/modules/news/categories/3rdIDnews.png
Binary files differ
diff --git a/modules/news/categories/marnemessenger.png b/modules/news/categories/marnemessenger.png
new file mode 100644
index 0000000..691129e
--- /dev/null
+++ b/modules/news/categories/marnemessenger.png
Binary files differ
diff --git a/modules/news/functions.php b/modules/news/functions.php
new file mode 100644
index 0000000..f3505df
--- /dev/null
+++ b/modules/news/functions.php
@@ -0,0 +1,259 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+ /**
+ * getNewsComments($id)
+ * Function getting an array of comments for posted news
+ * @param id - news_id cooresponding to `bayonet_news`
+ * @return - associative array of comments
+ */
+function getNewsComments($id){
+
+ global $db;
+ $result = $db->Query("SELECT c.comment_id, c.news_id, c.author_id, c.message, c.date, u.username AS author, u.avatar as avatar ".
+ "FROM `bayonet_news_comments` AS c ".
+ "LEFT OUTER JOIN `mybb_users` AS u ON u.uid = c.author_id ".
+ "WHERE c.news_id = '$id' ".
+ "ORDER BY date ASC");
+ $comments = $db->Fetch($result);
+ /*
+ while(($row = $db->Fetch($result)) != false)
+ {
+ $comments[] = $row;
+ }
+
+ $db->Free($result);
+ */
+ return $comments;
+}
+
+ /**
+ * displayComments($data)
+ * Function that takes an array of comments and displays them in html
+ * @param data - associative array of comments from the database
+ */
+function displayComments($data){
+
+ date_default_timezone_set("America/New_York");
+ OpenContent();
+ ?>
+
+ <div id="comments">
+ <table width="100%">
+ <tr>
+ <td><h2>User Comments</h2></td>
+ <td style="text-align:right"><a href="#add">Add Yours</a></td>
+ </tr>
+ </table>
+ <ol class="comment_list parent">
+
+ <?php
+ foreach($data as $comment)
+ {
+ ?>
+ <li id="comment-<?php echo $comment['comment_id']; ?>">
+ <div class="comment_wrap">
+
+ <div class="comment_author">
+ <?php
+ if(!empty($comment['avatar'])){
+ echo "<img src=\"{$comment['avatar']}\" height=\"80px\" />";
+ }else{
+ echo "<img src=\"modules/news/images/avatar.png\" />";
+ }
+ ?>
+ <p>
+ <?php
+ if($comment['author_id']>0){
+ echo "<a href=\"{$comment['author_id']}\">{$comment['author']}</a>";
+ }else{
+ echo "Guest";
+ }
+ ?>
+
+ <span><?php echo date('F jS', strtotime($comment['date'])); ?></span>
+ </p>
+ </div>
+
+ <div class="single_comment">
+ <img src="modules/news/images/comment_arrow.png" class="comment_arrow" />
+ <p> <?php echo bbcode_format($comment['message']); ?></p>
+
+ </div>
+
+ </div>
+ </li>
+
+ <?php
+ }
+ echo "</ol>";
+
+ commentForm();
+
+ CloseContent();
+}
+
+ /**
+ * getNumOfComments($id)
+ * Function that gets the number of comments a news post has
+ * @param id - news_id cooresponding to `bayonet_news`
+ */
+function getNumOfComments($id){
+
+ global $db;
+ $result = $db->Query("SELECT `comment_id` FROM `bayonet_news_comments` WHERE `news_id` = '$id'");
+
+ return $db->Rows($result);
+}
+
+ /**
+ * getNumOfComments($id)
+ * Function that gets the desired news from the database and returns it as an array
+ * @param id - (optional) news_id cooresponding to `bayonet_news`
+ */
+function getNews($id = NULL, $limit = NULL, $index = 0){
+
+ global $db;
+ $query = "SELECT n.news_id, n.title, n.message, n.date, n.category_id, u.username AS author, c.name AS catname, c.image AS catimage ".
+ "FROM `bayonet_news` AS n ".
+ "INNER JOIN `bayonet_news_categories` AS c ON c.category_id = n.category_id ".
+ "LEFT OUTER JOIN `mybb_users` AS u ON u.uid = n.author_id ";
+ if(isset($id)){
+ $query = $query."WHERE n.news_id = '$id' ";
+ }else{
+ $query = $query."ORDER BY date DESC";
+ if($index > 0)
+ $query = $query." LIMIT $index, $limit";
+ else if($limit !=NULL)
+ $query = $query." LIMIT $limit";
+ }
+ decho($query);
+ $result = $db->Query($query);
+ $data = $db->Fetch($result);
+
+ return $data;
+}
+
+ /**
+ * displayNews($data)
+ * Function that takes an array of news and displays it as html
+ * @param data - associative array of news from the database
+ */
+function displayNews($data){
+
+ date_default_timezone_set("America/New_York");
+
+
+ if(empty($data)){
+ ReportError("Sorry, we found no news using these parameters.");
+ echo "<br />";
+ }
+
+
+ foreach($data as $news)
+ {
+ $numComments = getNumOfComments($news['news_id']);
+
+ OpenContent(); ?>
+
+ <div class="contentHeading">
+ <table width="100%">
+ <tr>
+ <td style="text-align:left;"><?php echo $news['title']; ?></td>
+ <td style="text-align:right;">Posted by: <?php echo $news['author']; ?></td>
+ </tr>
+ </table>
+ </div>
+ <div class="content">
+ <img src="modules/news/categories/<?php echo $news['catimage']; ?>" alt="<?php echo $news['catname']; ?>" align="right" />
+ <?php echo bbcode_format($news['message']); ?>
+ </div>
+ <div class="contentFooter">
+ <table width="100%">
+ <tr>
+ <td style="text-align:left;">
+ View Comments: <a href="<?php echo $_SERVER['PHP_SELF']; ?>?load=news&amp;id=<?php echo $news['news_id']; ?>"><?php echo $numComments;?> Comments</a>
+ </td>
+ <td style="text-align:right;">Posted on: <?php echo date('D M j, Y g:i a T', strtotime($news['date'])); ?></td>
+ </tr>
+ </table>
+ </div>
+
+ <?php
+ CloseContent();
+ echo "<br />";
+
+ }
+}
+
+/** This was coded on Coda with a MacBook Pro **/
+function commentForm(){
+
+ global $db;
+
+ if(isset($_POST['processed']))
+ {
+ $comment = stripslashes($_POST['comment']);
+ $author_id = stripslashes($_POST['author']);
+
+ echo "Author: {$author_id}<br />Comment: {$comment}<br />";
+ echo "Your comment has been processed. Please wait.<br />";
+ }
+
+ $cur_user_id = 0; //testing variable, until i get the login system working for this
+
+ $logged_in = false;
+?>
+<a name="add"></a>
+<h2>Add Your Comment</h2>
+
+ <ol class="comment_form_wrap">
+ <li>
+ <img src="modules/news/images/comment_arrow.png" class="textarea_arrow" />
+ <div class="comment_author">
+ <?php
+ if($avatar!=""){
+ echo "<img src=\"{$avatar}\" height=\"80px\" />";
+ }else{
+ echo "<img src=\"modules/news/images/avatar.png\" />";
+ }
+ ?>
+ <p>
+ <?php
+ if($logged_in){
+ echo $username;
+ }else{
+ echo "Guest";
+ }
+ ?>
+ <br /><span><?php echo date('F jS', time()); ?></span></p>
+ </div>
+ <form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST" id="comment_form">
+ <!-- <fieldset> -->
+ <textarea name="comment" id="comment" rows="8" cols="10" tabindex="1" class="input textarea required"></textarea>
+ <input type="hidden" value="<?php echo $cur_user_id; ?>" name="author" />
+ <input type="submit" value="Add Comment" name="processed" />
+ <!-- </fieldset> -->
+ </form>
+ </li>
+ </ol>
+
+<?php
+}
+?>
diff --git a/modules/news/images/avatar.png b/modules/news/images/avatar.png
new file mode 100644
index 0000000..825197a
--- /dev/null
+++ b/modules/news/images/avatar.png
Binary files differ
diff --git a/modules/news/images/comment_arrow.png b/modules/news/images/comment_arrow.png
new file mode 100644
index 0000000..0962f4f
--- /dev/null
+++ b/modules/news/images/comment_arrow.png
Binary files differ
diff --git a/modules/news/index.php b/modules/news/index.php
new file mode 100644
index 0000000..1dfd98a
--- /dev/null
+++ b/modules/news/index.php
@@ -0,0 +1,84 @@
+<link rel="stylesheet" type="text/css" href="modules/news/style.css" media="screen"/>
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if(!defined("MODULE_FILE"))
+{
+ die('Access Denied.');
+}
+
+include 'modules/news/functions.php';
+
+$logged_id = 2;
+
+if(!defined('INDEX_MODULE')){
+ $page_num = 1;
+ $page_num = $_GET['page']; //get variable for page number
+
+ $page_num --; //so the $index can be calculated easier while keeping [1,n] page numbers
+
+ $limit = 3; //number of items per page
+ $index = $page_num * $limit;
+
+}else{
+ //only do the limit
+ $limit = 3;
+}
+
+if(isset($_GET['id']))
+{
+ $news_id = $_GET['id'];
+ displayNews(getNews($news_id));
+ displayComments(getNewsComments($news_id));
+ return;
+}
+else
+{
+ $news = getNews(null, $limit, $index);
+ displayNews($news);
+ OpenContent();
+ if(defined('INDEX_MODULE')){
+?>
+ <div style="float:right;">
+ <a href="?load=news">Read All</a>&nbsp;
+ </div>
+
+<?php
+ }else{
+ if($page_num > 0)
+ echo "&nbsp;<a href=\"?load=news&page={$page_num}\">More Recent News</a>";
+
+ decho("count: ".count($news));
+ if(count($news) == $limit){
+?>
+ <div style="float:right;">
+ <a href="?load=news&page=<?php echo ($page_num+2); ?>">Older News</a>&nbsp;
+ </div>
+<?php
+ }
+ }
+ echo "<div class=\"clear\"></div>";
+ CloseContent();
+ return;
+}
+
+
+
+
+?> \ No newline at end of file
diff --git a/modules/news/style.css b/modules/news/style.css
new file mode 100644
index 0000000..fe98982
--- /dev/null
+++ b/modules/news/style.css
@@ -0,0 +1,234 @@
+ /*********************************
+ ** Comment Styles **
+ *********************************/
+
+ div.comment_author a, div.comment_author a:visited {
+ font-size: 10px;
+ font-family: verdana;
+ color:#3666ba;
+ }
+
+ div.comment_author a:hover, div.comment_author a:visited:hover {
+ font-size: 10px;
+ font-family: verdana;
+ color:#42423d;
+ }
+
+/* Comments */
+#comments {
+ background: #ededed;
+ padding: 25px 25px;
+ padding-top:0px;
+ border: 1px solid #dcdddd;
+ color: #42423d;
+}
+#comments a {
+ text-decoration: none;
+}
+#comments_wrap h3 {
+ font-size: 22px;
+ font-weight: normal;
+ margin: 0px;
+ padding-bottom: 20px;
+ margin-top: 10px;
+}
+#comments_wrap h3 a, #comments_wrap h3 a:hover {
+ color: #242323;
+ text-decoration: none;
+}
+#comments_wrap .get_avatar {
+ color: #a7a7a7;
+ font-size: 10px;
+ letter-spacing: -1px;
+ padding-top: 10px;
+}
+#comments ol.parent {
+ padding-bottom: 25px
+}
+#comments ol {
+ margin: 0px;
+ padding: 0px;
+ padding-left: 120px;
+}
+#comments ol li {
+ list-style: none;
+ padding: 0px;
+ margin: 10px 0px;
+ padding-top: 1px;
+}
+#comments span.comment-reply {
+ position: absolute;
+ bottom: 10px;
+ left: 20px;
+ font-size: 10px;
+ text-transform: uppercase;
+}
+#comments .comment_wrap {
+ position: relative;
+ background: #fff;
+ border: 1px solid #dcdddd;
+}
+#comments .single_comment {
+ padding: 20px;
+ padding-bottom: 60px;
+ color: #42423d;
+}
+#comments .comment_arrow {
+ position: absolute;
+ top: 20px;
+ left: -32px;
+}
+#comments .comment_author {
+ position: absolute;
+ left: -120px;
+ width: 100px;
+ color: #8d8d8d;
+ font-size: 10px;
+ line-height: 14px;
+}
+#comments .comment_author span {
+ display: block;
+}
+#comments .children {
+ padding-left: 0px;
+ border-left: 1px solid #ced0d0;
+}
+#comments .children li {
+ padding-left: 25px;
+ background: url(images/comment_li_bg.gif) no-repeat 0px 25px;
+}
+#comments .children .comment_wrap {
+ background: #f8f8f8;
+ border: 1px solid #d3d5d5;
+}
+#comments .children .comment_arrow {
+ display: none;
+}
+#comments .children .comment_author {
+ position: absolute;
+ left: auto;
+ right: 20px;
+ bottom: 10px;
+ width: 200px;
+ height: 40px;
+}
+#comments .children .comment_author p {
+ position: absolute;
+ right: 50px;
+ bottom: -20px;
+ text-align: right;
+}
+#comments .children .comment_author span {
+ display: block;
+}
+#comments .children .comment_author img {
+ width: 40px;
+ height: 40px;
+ float: right;
+}
+/* Comments Form */
+#respond {
+ position: relative;
+}
+#comments .comment_form_wrap {
+ position: relative;
+ padding-left: 120px;
+}
+#comments .parent .comment_form_wrap {
+ position: relative;
+ padding-left: 0px;
+}
+#comments .textarea_arrow {
+ position: absolute;
+ top: 25px;
+ left: 89px;
+}
+#comments .children .textarea_arrow,
+#comments .parent .textarea_arrow {
+ display: none;
+}
+#comments .comment_form_wrap .comment_author {
+ position: absolute;
+ left: 0px;
+}
+#comments .children .comment_form_wrap {
+ position: relative;
+ padding-left: 0px;
+}
+#comments .children .comment_form_wrap .comment_author,
+#comments .parent .comment_form_wrap .comment_author,
+#comments .children .form_header,
+#comments .parent .form_header {
+ display: none;
+}
+#comments .input {
+ width: 456px;
+ padding: 4px 5px;
+ background: #fff;
+ border: 1px solid #ced0d0;
+ color: #5f6565;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ display: block;
+ margin-bottom: 10px;
+}
+#comments .children .input {
+ width: 431px;
+}
+#comments .textarea {
+ padding-top: 20px;
+ padding-left: 20px;
+ width: 448px;
+ max-width: 468px;
+ height: 135px;
+ font-size: 12px;
+ color: #5f6565;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+}
+#comments .children .textarea {
+ width: 423px;
+}
+#comments #submit_comment {
+ width: 12.0em;
+ height: 3.0em;
+ float: right;
+ margin-right: 7px;
+ margin-top: 10px;
+}
+#wpUserLinks_form #submit_comment {
+ width: 12.0em;
+ height: 3.0em;
+ margin-top: 10px;
+}
+#comments .inputerror {
+ border-color: #555;
+}
+#cancel-comment-reply {
+ float: left;
+ width: 120px;
+ height: 30px;
+ margin-top: 8px;
+}
+#cancel-comment-reply-link {
+ background: #fdfdfd url(images/button_bg.png) repeat-x 0 100%;
+ border: 1px solid #bbbbbb;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ text-transform: uppercase;
+ height: 22px;
+ width: 70px;
+ text-align: center;
+ padding-bottom: 2px;
+ letter-spacing: -0.05em;
+ cursor: pointer;
+ display: block;
+ line-height: 22px;
+}
+*+html #cancel-comment-reply-link {
+ height: 22px;
+ padding-bottom: 0px;
+}
+#cancel-comment-reply-link:hover {
+ color: #232323;
+ background: #eeeeee url(images/button_bg_hover.png) repeat-x 0 100%;
+ text-decoration: none;
+}
diff --git a/modules/newsreel/images/slidenavbg.png b/modules/newsreel/images/slidenavbg.png
new file mode 100644
index 0000000..6e3a726
--- /dev/null
+++ b/modules/newsreel/images/slidenavbg.png
Binary files differ
diff --git a/modules/newsreel/images/slidenavbg2.png b/modules/newsreel/images/slidenavbg2.png
new file mode 100644
index 0000000..8b9f612
--- /dev/null
+++ b/modules/newsreel/images/slidenavbg2.png
Binary files differ
diff --git a/modules/newsreel/images/slidenavbg3.png b/modules/newsreel/images/slidenavbg3.png
new file mode 100644
index 0000000..a027d26
--- /dev/null
+++ b/modules/newsreel/images/slidenavbg3.png
Binary files differ
diff --git a/modules/newsreel/index.php b/modules/newsreel/index.php
new file mode 100644
index 0000000..f45f2f5
--- /dev/null
+++ b/modules/newsreel/index.php
@@ -0,0 +1,113 @@
+<!-- START News Reel -->
+<link rel="stylesheet" type="text/css" href="modules/newsreel/style.css" media="screen"/>
+<?php OpenContent(); ?>
+<script type="text/javascript">
+
+var current = "0";
+var stop = false;
+var slide=new Array(); //declares a new array called banner
+var x=0; //loop control and array counting variable
+var timing=7000; //value is in milliseconds, used for 3 seconds on each image
+<?php
+ global $db;
+ $x=0;
+
+ $result = $db->Query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0,6");
+ //$get_slides = mysql_query("SELECT * FROM `news_slideshow` WHERE `visible`=1");
+ $row = $db->fetch($result);
+
+ foreach($row as $slide){
+ echo 'slide['.$x.']=new Image();';
+ echo 'slide['.$x.'].src="modules/newsreel/slides/'.$slide['src'].'";';
+ if($x==0){
+ $startSRC=$slide['src'];
+ }
+ $x++;
+ }
+ $width = 100/$x;
+?>
+
+ function changeStart()
+ {
+ document.getElementById(0).style.backgroundImage="url(modules/newsreel/images/slidenavbg2.png)";
+
+ }
+
+ function mouseOverBG(id, image)
+ {
+ if(id!=current){
+ document.getElementById(id).style.backgroundImage="url(modules/newsreel/images/slidenavbg3.png)";
+ document.getElementById(id).style.color="#3666ba";
+ document.body.style.cursor = 'pointer';
+ }
+ }
+
+ function mouseOutBG(id, image)
+ {
+ if(id!=current){
+ document.getElementById(id).style.backgroundImage="url(modules/newsreel/images/slidenavbg.png)";
+ document.getElementById(id).style.color="white";
+ document.body.style.cursor = 'default';
+ }
+ }
+ function nextSlide(num, clicked)
+ {
+ if(num!=current){
+ document.myBanner.src=slide[num].src;
+ document.getElementById(num).style.backgroundImage="url(modules/newsreel/images/slidenavbg2.png)";
+ document.getElementById(current).style.backgroundImage="url(modules/newsreel/images/slidenavbg.png)";
+ document.getElementById(num).style.color="white";
+ document.body.style.cursor = 'default';
+ current=num;
+ if(clicked){
+ stop=true;
+ }
+ }
+
+ }
+ function playBanner()
+ {
+ if(!stop){
+ if(document.images)
+ {
+ if(document.myBanner.complete)
+ {
+ nextSlide(x,false)
+ x++;
+ }
+ if(x==<?php echo $x; ?>){
+ x=0;
+ }
+ var timerId=setTimeout("playBanner()", timing);
+ }
+ }
+ }
+ function init_Slides(){
+ changeStart();
+ playBanner();
+ }
+
+window.onload = init_Slides; //starts the reels movement
+
+
+</script>
+
+<div class="content1"><div class="content2">
+ <img src="modules/newsreel/slides/<?php echo $startSRC; ?>" name="myBanner" alt="newsreel" />
+ <table border="0" cellspacing="0" cellpadding="0" style="height:21px;" width="100%">
+ <tr>
+<?php
+$y=0;
+ $result = $db->Query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0, 6");
+ $row = $db->Fetch($result);
+
+ foreach($row as $link){
+ echo "<td id=\"{$y}\" width=\"{$width}%\" class=\"slidenav\" onclick=\"javascript:nextSlide(this.id, true); return false;\" onmouseover=\"javascript:mouseOverBG(this.id); return false;\" onmouseout=\"javascript:mouseOutBG(this.id); return false;\">{$link['title']}</td>\n";
+ $y++;
+ }
+?>
+ </tr>
+ </table>
+</div></div>
+<?php CloseContent(); ?>
+<!-- END News Reel --> \ No newline at end of file
diff --git a/modules/newsreel/slides/arma2move.png b/modules/newsreel/slides/arma2move.png
new file mode 100644
index 0000000..6bffbae
--- /dev/null
+++ b/modules/newsreel/slides/arma2move.png
Binary files differ
diff --git a/modules/newsreel/slides/newsite.png b/modules/newsreel/slides/newsite.png
new file mode 100644
index 0000000..b2d2b69
--- /dev/null
+++ b/modules/newsreel/slides/newsite.png
Binary files differ
diff --git a/modules/newsreel/slides/recruitmentGT.png b/modules/newsreel/slides/recruitmentGT.png
new file mode 100644
index 0000000..c74ae8c
--- /dev/null
+++ b/modules/newsreel/slides/recruitmentGT.png
Binary files differ
diff --git a/modules/newsreel/slides/teamwork.png b/modules/newsreel/slides/teamwork.png
new file mode 100644
index 0000000..99f760b
--- /dev/null
+++ b/modules/newsreel/slides/teamwork.png
Binary files differ
diff --git a/modules/newsreel/style.css b/modules/newsreel/style.css
new file mode 100644
index 0000000..bdea21c
--- /dev/null
+++ b/modules/newsreel/style.css
@@ -0,0 +1,25 @@
+ /*********************************
+ ** Newsreel Styles **
+ *********************************/
+ /* background-image uses a relative path from the stylesheet.. odd */
+
+
+ table.slideshow {
+ border-top:1px #ffffff solid;
+ /*background-image:url(slidebg.png);*/
+ vertical-align:baseline;
+ width:100%;
+ height:100%;
+ }
+ table.slideshow td {
+ color:white;
+ }
+ td.slidenav {
+ text-align:center;
+ font-size:11pt;
+ line-height: 1.4;
+ background-image:url("images/slidenavbg.png");
+ background-color: #333333;
+ vertical-align:text-bottom;
+ border-right:1px solid #333333;
+ }
diff --git a/modules/page/index.php b/modules/page/index.php
new file mode 100644
index 0000000..5b943ce
--- /dev/null
+++ b/modules/page/index.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+define("MODULE_FAIL", "You cannot access this module directly.<br/>\n",true);
+
+if(!defined("MODULE_FILE"))
+{
+ die(MODULE_FAIL);
+}
+
+global $db;
+
+/**
+ * List available pages.
+ * Only right now I don't know if the _pages table has been deprecated.
+ * I'm confused. -jhunk
+ */
+if(isset($_GET['list']))
+{
+ if($_GET['list'] == "true")
+ {
+ $results = $db->Query("SELECT title, page_id FROM bayonet_articles");
+ $pages = $db->Fetch($results);
+
+ OpenContent();
+ echo "<div class=\"contentHeading\">Page Map</div>";
+ echo "<div class=\"content\">";
+ echo "<ul>";
+ foreach($pages as $page)
+ {
+ echo "<li>" . LinkPage($page['page_id'], $page['title']) . "</li>";
+ }
+ echo "</ul>";
+ echo "</div>";
+ CloseContent();
+
+ /* Kill module execution to prevent odd page results */
+ return;
+ }
+}
+
+if(!isset($_GET['id']))
+{
+ //ReportError("No page has been requested.<br>\n");
+ // return 1;
+ $id = 1; //makes it so that the default page is the home page
+}else{
+ $id = $_GET['id'];
+}
+
+// {{{ XXX: FIXME -- Needs to be re-written
+
+$result = $db->Query("SELECT u.username AS author, p.page_created, p.title, p.text FROM `bayonet_pages` AS p LEFT OUTER JOIN `bayonet_users` AS u ON u.user_id = p.author_id WHERE p.page_id = '$id'");
+$proceed = $db->Rows($result);
+
+if($proceed > 0)
+{
+ $page = $db->FetchRow($result);
+ OpenContent();
+
+ echo "<div class=\"contentHeading\">{$page['title']}</div>";
+ echo "<div class=\"content\">";
+ //echo "<h3>".$article['title']."</h3>";
+ echo bbcode_format($page['text']);
+ echo "</div>";
+ echo "</div>";
+
+ CloseContent();
+
+ ?>
+ <?php // echo bbcode_format($page['text']) ?>
+ <!-- <tr><th><?php echo $page['author'] ?></th></tr> -->
+ <?php
+}
+else
+{
+ ReportError("Page does not exist.<br>\n");
+}
+
+?>
diff --git a/modules/rudi/admin/includes/admin.class.php b/modules/rudi/admin/includes/admin.class.php
new file mode 100644
index 0000000..fee79c9
--- /dev/null
+++ b/modules/rudi/admin/includes/admin.class.php
@@ -0,0 +1,121 @@
+<?php
+/*
+class Rank
+{
+ public function __toString()
+ {
+ return $this->longname;
+ }
+}
+
+class Award
+{
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+*/
+
+class AdminCommon extends RUDI_Common
+{
+ public function __construct()
+ {
+ parent::__construct();
+ $this->Update();
+ }
+
+ public function getRanks()
+ {
+ $result = $this->db->Query("SELECT * FROM rudi_ranks");
+ while(($row = $this->db->FetchObject($result,'Rank'))!=false)
+ {
+ $ranks[] = $row;
+ }
+
+ return $ranks;
+ }
+
+ public function getAwards()
+ {
+ $result = $this->db->Query("SELECT * FROM rudi_awards");
+ while(($row = $this->db->FetchObject($result,'Award'))!=false)
+ {
+ $awards[] = $row;
+ }
+
+ return $awards;
+ }
+}
+
+class AdminAdd
+{
+ protected $db, $link, $id;
+ public $data;
+
+ public function __construct()
+ {
+ if(is_null($id))
+ {
+ decho("No ID");
+ return;
+ }
+ $this->id = $id;
+
+ $this->db = new RUDI_SQL();
+ $this->link = $this->db->Connect('localhost','hunkeler','proball');
+ $this->db->Select_db('rudi');
+
+ //$result = $this->db->Query("INSERT INTO rudi_unit_members VALUES()");
+ //$name = $this->db->FetchArray($result);
+
+ echo "Current soldier selected: '{$name['last_name']}, {$name['first_name']}'";
+ }
+
+ public function __set($var, $val)
+ {
+ //echo "UPDATE rudi_unit_members SET $var = '$val';";
+ //mysql_query("UPDATE rudi_unit_members SET $var = '$val';");
+ $this->id = addslashes($this->id);
+ $this->db->Query("UPDATE rudi_unit_members SET $var = '$val' WHERE member_id = '{$this->id}';");
+ }
+}
+
+class AdminModify
+{
+ protected $db, $link, $id;
+ public $data;
+
+ public function __construct($id)
+ {
+ if(is_null($id))
+ {
+ decho("No ID");
+ return;
+ }
+ else
+ {
+ decho(get_class($this) . "received: $id" );
+ }
+ $this->id = $id;
+
+ $this->db = new RUDI_SQL();
+ $this->link = $this->db->Connect('localhost','hunkeler','proball');
+ $this->db->Select_db('rudi');
+
+ $result = $this->db->Query("SELECT last_name, first_name FROM rudi_unit_members WHERE member_id = '$id'");
+ $name = $this->db->FetchArray($result);
+
+ echo "Current soldier selected: '{$name['last_name']}, {$name['first_name']}'";
+ }
+
+ public function __set($var, $val)
+ {
+ //echo "UPDATE rudi_unit_members SET $var = '$val';";
+ //mysql_query("UPDATE rudi_unit_members SET $var = '$val';");
+ $this->id = addslashes($this->id);
+ $this->db->Query("UPDATE rudi_unit_members SET $var = '$val' WHERE member_id = '{$this->id}';");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/modules/rudi/admin/index.php b/modules/rudi/admin/index.php
new file mode 100644
index 0000000..33d9cd1
--- /dev/null
+++ b/modules/rudi/admin/index.php
@@ -0,0 +1,21 @@
+<?php
+
+//include '../includes/debug.php';
+//include '../includes/sql.class.php';
+//include '../includes/common.class.php';
+include 'includes/admin.class.php';
+//include '../header.php';
+
+ob_start();
+$common = new AdminCommon();
+include 'views/view.admin.php';
+
+if(isset($_GET['soldier']) && $_GET['soldier'] == 'modify')
+{
+ include 'views/view.modifysoldier.php';
+
+}
+
+//include '../footer.php';
+ob_flush();
+?> \ No newline at end of file
diff --git a/modules/rudi/admin/views/view.addsoldier.php b/modules/rudi/admin/views/view.addsoldier.php
new file mode 100644
index 0000000..370b232
--- /dev/null
+++ b/modules/rudi/admin/views/view.addsoldier.php
@@ -0,0 +1,3 @@
+<?php
+
+?> \ No newline at end of file
diff --git a/modules/rudi/admin/views/view.admin.php b/modules/rudi/admin/views/view.admin.php
new file mode 100644
index 0000000..d05e5b1
--- /dev/null
+++ b/modules/rudi/admin/views/view.admin.php
@@ -0,0 +1,20 @@
+<?php
+
+?>
+<html>
+<head>
+<title>RUDI Administration</title>
+</head>
+
+<body>
+ <table>
+ <tr><th>RUDI Administration</th></tr>
+ <table cellpadding="5">
+ <tr><th>Soldiers</th><th>Awards</th><th>Ranks</th></tr>
+ <tr><td><a href="?load=rudi&admin&soldier=add">Add</a></td><td><a href="?load=rudi&admin&award=add">Add</a></td><td><a href="?load=rudi&admin&rank=add">Add</a></td></tr>
+ <tr><td>Modify</td><td>Modify</td><td>Modify</td></tr>
+ <tr><td>Delete</td><td>Delete</td><td>Delete</td></tr>
+ </table>
+ </table>
+</body>
+</html>
diff --git a/modules/rudi/admin/views/view.deletesoldier.php b/modules/rudi/admin/views/view.deletesoldier.php
new file mode 100644
index 0000000..370b232
--- /dev/null
+++ b/modules/rudi/admin/views/view.deletesoldier.php
@@ -0,0 +1,3 @@
+<?php
+
+?> \ No newline at end of file
diff --git a/modules/rudi/admin/views/view.modifysoldier.php b/modules/rudi/admin/views/view.modifysoldier.php
new file mode 100644
index 0000000..83449b8
--- /dev/null
+++ b/modules/rudi/admin/views/view.modifysoldier.php
@@ -0,0 +1,35 @@
+
+<?php
+if(isset($_POST['id']))
+{
+ $id = $_POST['id'];
+ //unset($_POST);
+ $modify = new AdminModify((int)$id);
+ $edit =& $common->data[(int)$id];
+}
+?>
+
+<form method="POST">
+<select name="id">
+<?php foreach($common->data as $member):?>
+ <option value="<?php echo $member->member_id ?>" <?php if(!is_null($id) && $id == $member->member_id) echo ' selected '; ?>><?php echo $member->name ?></option>
+<?php endforeach; ?>
+</select>
+<button value="Select">Select</button>
+</form>
+
+<form action="" method="GET">
+<table>
+<tr><th>Modify Soldier</th></tr>
+<tr><th>Last Name</th><td><input type="text" name="last" value="<?php echo $edit->last_name ?>" /></td></tr>
+<tr><th>First Name</th><td><input type="text" value="<?php echo $edit->first_name ?>" /></td></tr>
+<tr><th>Rank</th><td><select name="rank">
+<?php foreach($common->getRanks() as $ranks): ?>
+ <option value="<?php echo $ranks->rank_id ?>"><?php echo $ranks ?></option>
+<?php endforeach; ?>
+</select></td></tr>
+<tr><th colspan="2"><input type="submit" value="submit"/></th></tr>
+</table>
+</form>
+
+<?php decho($_POST); decho($common->data[$id]); //decho($common->getRanks())?> \ No newline at end of file
diff --git a/modules/rudi/footer.php b/modules/rudi/footer.php
new file mode 100644
index 0000000..f827d01
--- /dev/null
+++ b/modules/rudi/footer.php
@@ -0,0 +1,8 @@
+<?php
+$real = sprintf("%.2fkb", memory_get_usage() / 1024);
+$peak = sprintf("%.2fkb", memory_get_peak_usage() / 1024);
+?>
+
+<center><?php echo "Connections: $db_connections | Queries: $db_queries | Fetches: $db_fetches | Released: $db_frees | Memory: (real): $real (peak): $peak"?></center>
+</body>
+</html> \ No newline at end of file
diff --git a/modules/rudi/header.php b/modules/rudi/header.php
new file mode 100644
index 0000000..47c5ffa
--- /dev/null
+++ b/modules/rudi/header.php
@@ -0,0 +1,6 @@
+<html>
+<head>
+<title>RUDI</title>
+<!-- <link rel="stylesheet" type="text/css" href="includes/rudi.css" /> -->
+</head>
+<body>
diff --git a/modules/rudi/images/flags/australia.gif b/modules/rudi/images/flags/australia.gif
new file mode 100644
index 0000000..0fe9a53
--- /dev/null
+++ b/modules/rudi/images/flags/australia.gif
Binary files differ
diff --git a/modules/rudi/images/flags/canada.gif b/modules/rudi/images/flags/canada.gif
new file mode 100644
index 0000000..bbc51a6
--- /dev/null
+++ b/modules/rudi/images/flags/canada.gif
Binary files differ
diff --git a/modules/rudi/images/flags/canada1.gif b/modules/rudi/images/flags/canada1.gif
new file mode 100644
index 0000000..777c3b7
--- /dev/null
+++ b/modules/rudi/images/flags/canada1.gif
Binary files differ
diff --git a/modules/rudi/images/flags/germany.gif b/modules/rudi/images/flags/germany.gif
new file mode 100644
index 0000000..5e9767f
--- /dev/null
+++ b/modules/rudi/images/flags/germany.gif
Binary files differ
diff --git a/modules/rudi/images/flags/index.html b/modules/rudi/images/flags/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/images/flags/index.html
diff --git a/modules/rudi/images/flags/israel.gif b/modules/rudi/images/flags/israel.gif
new file mode 100644
index 0000000..e726eb7
--- /dev/null
+++ b/modules/rudi/images/flags/israel.gif
Binary files differ
diff --git a/modules/rudi/images/flags/japan.gif b/modules/rudi/images/flags/japan.gif
new file mode 100644
index 0000000..11efbf7
--- /dev/null
+++ b/modules/rudi/images/flags/japan.gif
Binary files differ
diff --git a/modules/rudi/images/flags/korea.gif b/modules/rudi/images/flags/korea.gif
new file mode 100644
index 0000000..b534115
--- /dev/null
+++ b/modules/rudi/images/flags/korea.gif
Binary files differ
diff --git a/modules/rudi/images/flags/mexico.gif b/modules/rudi/images/flags/mexico.gif
new file mode 100644
index 0000000..bc8b7c7
--- /dev/null
+++ b/modules/rudi/images/flags/mexico.gif
Binary files differ
diff --git a/modules/rudi/images/flags/russia.gif b/modules/rudi/images/flags/russia.gif
new file mode 100644
index 0000000..5b78932
--- /dev/null
+++ b/modules/rudi/images/flags/russia.gif
Binary files differ
diff --git a/modules/rudi/images/flags/uk.gif b/modules/rudi/images/flags/uk.gif
new file mode 100644
index 0000000..fd3c469
--- /dev/null
+++ b/modules/rudi/images/flags/uk.gif
Binary files differ
diff --git a/modules/rudi/images/flags/usa.gif b/modules/rudi/images/flags/usa.gif
new file mode 100644
index 0000000..08a1933
--- /dev/null
+++ b/modules/rudi/images/flags/usa.gif
Binary files differ
diff --git a/modules/rudi/images/medals/3IDESM.jpg b/modules/rudi/images/medals/3IDESM.jpg
new file mode 100644
index 0000000..2574626
--- /dev/null
+++ b/modules/rudi/images/medals/3IDESM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/ACM.jpg b/modules/rudi/images/medals/ACM.jpg
new file mode 100644
index 0000000..e56c0e4
--- /dev/null
+++ b/modules/rudi/images/medals/ACM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/ADSM.jpg b/modules/rudi/images/medals/ADSM.jpg
new file mode 100644
index 0000000..cfa47a0
--- /dev/null
+++ b/modules/rudi/images/medals/ADSM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/AE-AMCM.jpg b/modules/rudi/images/medals/AE-AMCM.jpg
new file mode 100644
index 0000000..42ed6de
--- /dev/null
+++ b/modules/rudi/images/medals/AE-AMCM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/AGCM.jpg b/modules/rudi/images/medals/AGCM.jpg
new file mode 100644
index 0000000..81d1882
--- /dev/null
+++ b/modules/rudi/images/medals/AGCM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/BS.jpg b/modules/rudi/images/medals/BS.jpg
new file mode 100644
index 0000000..8dad4f4
--- /dev/null
+++ b/modules/rudi/images/medals/BS.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/DSC.jpg b/modules/rudi/images/medals/DSC.jpg
new file mode 100644
index 0000000..d84b801
--- /dev/null
+++ b/modules/rudi/images/medals/DSC.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/EAM.jpg b/modules/rudi/images/medals/EAM.jpg
new file mode 100644
index 0000000..ea0e4b6
--- /dev/null
+++ b/modules/rudi/images/medals/EAM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/EAMECM.jpg b/modules/rudi/images/medals/EAMECM.jpg
new file mode 100644
index 0000000..e7f3867
--- /dev/null
+++ b/modules/rudi/images/medals/EAMECM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/LOM.jpg b/modules/rudi/images/medals/LOM.jpg
new file mode 100644
index 0000000..5f6e8a3
--- /dev/null
+++ b/modules/rudi/images/medals/LOM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/MUC.jpg b/modules/rudi/images/medals/MUC.jpg
new file mode 100644
index 0000000..4567112
--- /dev/null
+++ b/modules/rudi/images/medals/MUC.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/PH.jpg b/modules/rudi/images/medals/PH.jpg
new file mode 100644
index 0000000..4375275
--- /dev/null
+++ b/modules/rudi/images/medals/PH.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/SM.jpg b/modules/rudi/images/medals/SM.jpg
new file mode 100644
index 0000000..09de8d0
--- /dev/null
+++ b/modules/rudi/images/medals/SM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/SS.jpg b/modules/rudi/images/medals/SS.jpg
new file mode 100644
index 0000000..d8599cf
--- /dev/null
+++ b/modules/rudi/images/medals/SS.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/WWIIAOM.jpg b/modules/rudi/images/medals/WWIIAOM.jpg
new file mode 100644
index 0000000..ff40ef8
--- /dev/null
+++ b/modules/rudi/images/medals/WWIIAOM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/WWIIVM.jpg b/modules/rudi/images/medals/WWIIVM.jpg
new file mode 100644
index 0000000..1256371
--- /dev/null
+++ b/modules/rudi/images/medals/WWIIVM.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/armedforcesservice.jpg b/modules/rudi/images/medals/armedforcesservice.jpg
new file mode 100644
index 0000000..14080b6
--- /dev/null
+++ b/modules/rudi/images/medals/armedforcesservice.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/armyachievement.jpg b/modules/rudi/images/medals/armyachievement.jpg
new file mode 100644
index 0000000..ed35298
--- /dev/null
+++ b/modules/rudi/images/medals/armyachievement.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/armycommendation.jpg b/modules/rudi/images/medals/armycommendation.jpg
new file mode 100644
index 0000000..20861e1
--- /dev/null
+++ b/modules/rudi/images/medals/armycommendation.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/armyservice.jpg b/modules/rudi/images/medals/armyservice.jpg
new file mode 100644
index 0000000..52d7cfe
--- /dev/null
+++ b/modules/rudi/images/medals/armyservice.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/bronzestar.jpg b/modules/rudi/images/medals/bronzestar.jpg
new file mode 100644
index 0000000..0cf5fa7
--- /dev/null
+++ b/modules/rudi/images/medals/bronzestar.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/cib1.gif b/modules/rudi/images/medals/cib1.gif
new file mode 100644
index 0000000..a9e01d6
--- /dev/null
+++ b/modules/rudi/images/medals/cib1.gif
Binary files differ
diff --git a/modules/rudi/images/medals/cib2.gif b/modules/rudi/images/medals/cib2.gif
new file mode 100644
index 0000000..258f909
--- /dev/null
+++ b/modules/rudi/images/medals/cib2.gif
Binary files differ
diff --git a/modules/rudi/images/medals/cib3.gif b/modules/rudi/images/medals/cib3.gif
new file mode 100644
index 0000000..c9ddbfc
--- /dev/null
+++ b/modules/rudi/images/medals/cib3.gif
Binary files differ
diff --git a/modules/rudi/images/medals/cib4.gif b/modules/rudi/images/medals/cib4.gif
new file mode 100644
index 0000000..4634756
--- /dev/null
+++ b/modules/rudi/images/medals/cib4.gif
Binary files differ
diff --git a/modules/rudi/images/medals/cod2duc.jpg b/modules/rudi/images/medals/cod2duc.jpg
new file mode 100644
index 0000000..099ca27
--- /dev/null
+++ b/modules/rudi/images/medals/cod2duc.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/cod4duc.jpg b/modules/rudi/images/medals/cod4duc.jpg
new file mode 100644
index 0000000..aad4498
--- /dev/null
+++ b/modules/rudi/images/medals/cod4duc.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/codduc.jpg b/modules/rudi/images/medals/codduc.jpg
new file mode 100644
index 0000000..566f81b
--- /dev/null
+++ b/modules/rudi/images/medals/codduc.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/drill_instructor_badge.gif b/modules/rudi/images/medals/drill_instructor_badge.gif
new file mode 100644
index 0000000..c7d7f83
--- /dev/null
+++ b/modules/rudi/images/medals/drill_instructor_badge.gif
Binary files differ
diff --git a/modules/rudi/images/medals/dsm.jpg b/modules/rudi/images/medals/dsm.jpg
new file mode 100644
index 0000000..b90e927
--- /dev/null
+++ b/modules/rudi/images/medals/dsm.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/esm.jpg b/modules/rudi/images/medals/esm.jpg
new file mode 100644
index 0000000..2dbbcca
--- /dev/null
+++ b/modules/rudi/images/medals/esm.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/exempattendance.jpg b/modules/rudi/images/medals/exempattendance.jpg
new file mode 100644
index 0000000..8b6354b
--- /dev/null
+++ b/modules/rudi/images/medals/exempattendance.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/goodconduct.jpg b/modules/rudi/images/medals/goodconduct.jpg
new file mode 100644
index 0000000..77277cd
--- /dev/null
+++ b/modules/rudi/images/medals/goodconduct.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/gwotem.jpg b/modules/rudi/images/medals/gwotem.jpg
new file mode 100644
index 0000000..e92cc80
--- /dev/null
+++ b/modules/rudi/images/medals/gwotem.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/gwotsm.jpg b/modules/rudi/images/medals/gwotsm.jpg
new file mode 100644
index 0000000..479ca32
--- /dev/null
+++ b/modules/rudi/images/medals/gwotsm.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/index.html-old b/modules/rudi/images/medals/index.html-old
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/images/medals/index.html-old
diff --git a/modules/rudi/images/medals/legionofmerit.jpg b/modules/rudi/images/medals/legionofmerit.jpg
new file mode 100644
index 0000000..2e52648
--- /dev/null
+++ b/modules/rudi/images/medals/legionofmerit.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/nationaldefense.jpg b/modules/rudi/images/medals/nationaldefense.jpg
new file mode 100644
index 0000000..8f96df8
--- /dev/null
+++ b/modules/rudi/images/medals/nationaldefense.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/ncoprofdev.jpg b/modules/rudi/images/medals/ncoprofdev.jpg
new file mode 100644
index 0000000..ea564ed
--- /dev/null
+++ b/modules/rudi/images/medals/ncoprofdev.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/oak_leaf_clusters.jpg b/modules/rudi/images/medals/oak_leaf_clusters.jpg
new file mode 100644
index 0000000..1927d46
--- /dev/null
+++ b/modules/rudi/images/medals/oak_leaf_clusters.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/purpleheart.jpg b/modules/rudi/images/medals/purpleheart.jpg
new file mode 100644
index 0000000..07cce39
--- /dev/null
+++ b/modules/rudi/images/medals/purpleheart.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/silverstar.jpg b/modules/rudi/images/medals/silverstar.jpg
new file mode 100644
index 0000000..60669f5
--- /dev/null
+++ b/modules/rudi/images/medals/silverstar.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/soldiers.jpg b/modules/rudi/images/medals/soldiers.jpg
new file mode 100644
index 0000000..5059ad2
--- /dev/null
+++ b/modules/rudi/images/medals/soldiers.jpg
Binary files differ
diff --git a/modules/rudi/images/medals/valor_device.png b/modules/rudi/images/medals/valor_device.png
new file mode 100644
index 0000000..533dde8
--- /dev/null
+++ b/modules/rudi/images/medals/valor_device.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/1LT.png b/modules/rudi/images/ranks/large/1LT.png
new file mode 100644
index 0000000..0e305c1
--- /dev/null
+++ b/modules/rudi/images/ranks/large/1LT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/1SG.png b/modules/rudi/images/ranks/large/1SG.png
new file mode 100644
index 0000000..9f0c0ee
--- /dev/null
+++ b/modules/rudi/images/ranks/large/1SG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/1stLT.gif b/modules/rudi/images/ranks/large/1stLT.gif
new file mode 100644
index 0000000..1f5ccce
--- /dev/null
+++ b/modules/rudi/images/ranks/large/1stLT.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/2LT.png b/modules/rudi/images/ranks/large/2LT.png
new file mode 100644
index 0000000..15a4fbf
--- /dev/null
+++ b/modules/rudi/images/ranks/large/2LT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/2ndLT.gif b/modules/rudi/images/ranks/large/2ndLT.gif
new file mode 100644
index 0000000..1762a51
--- /dev/null
+++ b/modules/rudi/images/ranks/large/2ndLT.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/CPL.png b/modules/rudi/images/ranks/large/CPL.png
new file mode 100644
index 0000000..f302179
--- /dev/null
+++ b/modules/rudi/images/ranks/large/CPL.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/CPT.png b/modules/rudi/images/ranks/large/CPT.png
new file mode 100644
index 0000000..33846a3
--- /dev/null
+++ b/modules/rudi/images/ranks/large/CPT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/CSM.png b/modules/rudi/images/ranks/large/CSM.png
new file mode 100644
index 0000000..62f557b
--- /dev/null
+++ b/modules/rudi/images/ranks/large/CSM.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/General.gif b/modules/rudi/images/ranks/large/General.gif
new file mode 100644
index 0000000..7983698
--- /dev/null
+++ b/modules/rudi/images/ranks/large/General.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/LTGeneral.gif b/modules/rudi/images/ranks/large/LTGeneral.gif
new file mode 100644
index 0000000..b8f8d7d
--- /dev/null
+++ b/modules/rudi/images/ranks/large/LTGeneral.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/MSG.png b/modules/rudi/images/ranks/large/MSG.png
new file mode 100644
index 0000000..fac8139
--- /dev/null
+++ b/modules/rudi/images/ranks/large/MSG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/MajorGeneral.gif b/modules/rudi/images/ranks/large/MajorGeneral.gif
new file mode 100644
index 0000000..2594e33
--- /dev/null
+++ b/modules/rudi/images/ranks/large/MajorGeneral.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/PFC.png b/modules/rudi/images/ranks/large/PFC.png
new file mode 100644
index 0000000..d8d8b5b
--- /dev/null
+++ b/modules/rudi/images/ranks/large/PFC.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/PV2.png b/modules/rudi/images/ranks/large/PV2.png
new file mode 100644
index 0000000..7fcc4d8
--- /dev/null
+++ b/modules/rudi/images/ranks/large/PV2.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/PVT.gif b/modules/rudi/images/ranks/large/PVT.gif
new file mode 100644
index 0000000..ca1c11e
--- /dev/null
+++ b/modules/rudi/images/ranks/large/PVT.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/SFC.png b/modules/rudi/images/ranks/large/SFC.png
new file mode 100644
index 0000000..c23f3e8
--- /dev/null
+++ b/modules/rudi/images/ranks/large/SFC.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/SGT.png b/modules/rudi/images/ranks/large/SGT.png
new file mode 100644
index 0000000..165e83c
--- /dev/null
+++ b/modules/rudi/images/ranks/large/SGT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/SMG.png b/modules/rudi/images/ranks/large/SMG.png
new file mode 100644
index 0000000..9cc03a2
--- /dev/null
+++ b/modules/rudi/images/ranks/large/SMG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/SPC.png b/modules/rudi/images/ranks/large/SPC.png
new file mode 100644
index 0000000..0f2446e
--- /dev/null
+++ b/modules/rudi/images/ranks/large/SPC.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/SSG.png b/modules/rudi/images/ranks/large/SSG.png
new file mode 100644
index 0000000..e4eecd4
--- /dev/null
+++ b/modules/rudi/images/ranks/large/SSG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/large/brigadier.gif b/modules/rudi/images/ranks/large/brigadier.gif
new file mode 100644
index 0000000..cad7d7a
--- /dev/null
+++ b/modules/rudi/images/ranks/large/brigadier.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/captain.gif b/modules/rudi/images/ranks/large/captain.gif
new file mode 100644
index 0000000..c4e9142
--- /dev/null
+++ b/modules/rudi/images/ranks/large/captain.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/colonel.gif b/modules/rudi/images/ranks/large/colonel.gif
new file mode 100644
index 0000000..58dc613
--- /dev/null
+++ b/modules/rudi/images/ranks/large/colonel.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/index.html b/modules/rudi/images/ranks/large/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/images/ranks/large/index.html
diff --git a/modules/rudi/images/ranks/large/ltc.gif b/modules/rudi/images/ranks/large/ltc.gif
new file mode 100644
index 0000000..d18509e
--- /dev/null
+++ b/modules/rudi/images/ranks/large/ltc.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/large/major.gif b/modules/rudi/images/ranks/large/major.gif
new file mode 100644
index 0000000..761410c
--- /dev/null
+++ b/modules/rudi/images/ranks/large/major.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/1LT.png b/modules/rudi/images/ranks/small/1LT.png
new file mode 100644
index 0000000..247c57d
--- /dev/null
+++ b/modules/rudi/images/ranks/small/1LT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/1SG.png b/modules/rudi/images/ranks/small/1SG.png
new file mode 100644
index 0000000..f9d3f23
--- /dev/null
+++ b/modules/rudi/images/ranks/small/1SG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/2LT.png b/modules/rudi/images/ranks/small/2LT.png
new file mode 100644
index 0000000..79c03a8
--- /dev/null
+++ b/modules/rudi/images/ranks/small/2LT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/CPL.png b/modules/rudi/images/ranks/small/CPL.png
new file mode 100644
index 0000000..37d1bdd
--- /dev/null
+++ b/modules/rudi/images/ranks/small/CPL.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/CPT.png b/modules/rudi/images/ranks/small/CPT.png
new file mode 100644
index 0000000..c4c0034
--- /dev/null
+++ b/modules/rudi/images/ranks/small/CPT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/CSM.png b/modules/rudi/images/ranks/small/CSM.png
new file mode 100644
index 0000000..db19607
--- /dev/null
+++ b/modules/rudi/images/ranks/small/CSM.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/General.gif b/modules/rudi/images/ranks/small/General.gif
new file mode 100644
index 0000000..7983698
--- /dev/null
+++ b/modules/rudi/images/ranks/small/General.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/LtGeneral.gif b/modules/rudi/images/ranks/small/LtGeneral.gif
new file mode 100644
index 0000000..6bb0a80
--- /dev/null
+++ b/modules/rudi/images/ranks/small/LtGeneral.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/MSG.png b/modules/rudi/images/ranks/small/MSG.png
new file mode 100644
index 0000000..e84bde3
--- /dev/null
+++ b/modules/rudi/images/ranks/small/MSG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/MajorGeneral.gif b/modules/rudi/images/ranks/small/MajorGeneral.gif
new file mode 100644
index 0000000..ef18ea9
--- /dev/null
+++ b/modules/rudi/images/ranks/small/MajorGeneral.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/PFC.png b/modules/rudi/images/ranks/small/PFC.png
new file mode 100644
index 0000000..76b58c0
--- /dev/null
+++ b/modules/rudi/images/ranks/small/PFC.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/PV2.png b/modules/rudi/images/ranks/small/PV2.png
new file mode 100644
index 0000000..1246d25
--- /dev/null
+++ b/modules/rudi/images/ranks/small/PV2.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/SFC.png b/modules/rudi/images/ranks/small/SFC.png
new file mode 100644
index 0000000..7e64830
--- /dev/null
+++ b/modules/rudi/images/ranks/small/SFC.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/SGT.png b/modules/rudi/images/ranks/small/SGT.png
new file mode 100644
index 0000000..0411e49
--- /dev/null
+++ b/modules/rudi/images/ranks/small/SGT.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/SMG.png b/modules/rudi/images/ranks/small/SMG.png
new file mode 100644
index 0000000..e85d54a
--- /dev/null
+++ b/modules/rudi/images/ranks/small/SMG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/SPC.png b/modules/rudi/images/ranks/small/SPC.png
new file mode 100644
index 0000000..93ff59d
--- /dev/null
+++ b/modules/rudi/images/ranks/small/SPC.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/SSG.png b/modules/rudi/images/ranks/small/SSG.png
new file mode 100644
index 0000000..592fcb3
--- /dev/null
+++ b/modules/rudi/images/ranks/small/SSG.png
Binary files differ
diff --git a/modules/rudi/images/ranks/small/brigadier.gif b/modules/rudi/images/ranks/small/brigadier.gif
new file mode 100644
index 0000000..83e48c6
--- /dev/null
+++ b/modules/rudi/images/ranks/small/brigadier.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/index.html b/modules/rudi/images/ranks/small/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/images/ranks/small/index.html
diff --git a/modules/rudi/images/ranks/small/pvt.gif b/modules/rudi/images/ranks/small/pvt.gif
new file mode 100644
index 0000000..13a4916
--- /dev/null
+++ b/modules/rudi/images/ranks/small/pvt.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/rank-1stlieutenant.gif b/modules/rudi/images/ranks/small/rank-1stlieutenant.gif
new file mode 100644
index 0000000..579223e
--- /dev/null
+++ b/modules/rudi/images/ranks/small/rank-1stlieutenant.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/rank-2ndlieutenant.gif b/modules/rudi/images/ranks/small/rank-2ndlieutenant.gif
new file mode 100644
index 0000000..84b23f1
--- /dev/null
+++ b/modules/rudi/images/ranks/small/rank-2ndlieutenant.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/rank-captain.gif b/modules/rudi/images/ranks/small/rank-captain.gif
new file mode 100644
index 0000000..1e6a620
--- /dev/null
+++ b/modules/rudi/images/ranks/small/rank-captain.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/rank-colonel.gif b/modules/rudi/images/ranks/small/rank-colonel.gif
new file mode 100644
index 0000000..870d2ff
--- /dev/null
+++ b/modules/rudi/images/ranks/small/rank-colonel.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/rank-ltcolonel.gif b/modules/rudi/images/ranks/small/rank-ltcolonel.gif
new file mode 100644
index 0000000..bfc5a79
--- /dev/null
+++ b/modules/rudi/images/ranks/small/rank-ltcolonel.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/rank-major.gif b/modules/rudi/images/ranks/small/rank-major.gif
new file mode 100644
index 0000000..c8e142d
--- /dev/null
+++ b/modules/rudi/images/ranks/small/rank-major.gif
Binary files differ
diff --git a/modules/rudi/images/ranks/small/rank-private.gif b/modules/rudi/images/ranks/small/rank-private.gif
new file mode 100644
index 0000000..ca1c11e
--- /dev/null
+++ b/modules/rudi/images/ranks/small/rank-private.gif
Binary files differ
diff --git a/modules/rudi/images/uniform/ACoia.png b/modules/rudi/images/uniform/ACoia.png
new file mode 100644
index 0000000..0e70357
--- /dev/null
+++ b/modules/rudi/images/uniform/ACoia.png
Binary files differ
diff --git a/modules/rudi/images/uniform/BBell.png b/modules/rudi/images/uniform/BBell.png
new file mode 100644
index 0000000..a9bbac9
--- /dev/null
+++ b/modules/rudi/images/uniform/BBell.png
Binary files differ
diff --git a/modules/rudi/images/uniform/BChu.png b/modules/rudi/images/uniform/BChu.png
new file mode 100644
index 0000000..a7d5a5b
--- /dev/null
+++ b/modules/rudi/images/uniform/BChu.png
Binary files differ
diff --git a/modules/rudi/images/uniform/BLevine.png b/modules/rudi/images/uniform/BLevine.png
new file mode 100644
index 0000000..50accbe
--- /dev/null
+++ b/modules/rudi/images/uniform/BLevine.png
Binary files differ
diff --git a/modules/rudi/images/uniform/BSegal.png b/modules/rudi/images/uniform/BSegal.png
new file mode 100644
index 0000000..1c9c0f2
--- /dev/null
+++ b/modules/rudi/images/uniform/BSegal.png
Binary files differ
diff --git a/modules/rudi/images/uniform/DHolson.png b/modules/rudi/images/uniform/DHolson.png
new file mode 100644
index 0000000..b372cf5
--- /dev/null
+++ b/modules/rudi/images/uniform/DHolson.png
Binary files differ
diff --git a/modules/rudi/images/uniform/EOConnell.png b/modules/rudi/images/uniform/EOConnell.png
new file mode 100644
index 0000000..9e46bfd
--- /dev/null
+++ b/modules/rudi/images/uniform/EOConnell.png
Binary files differ
diff --git a/modules/rudi/images/uniform/GTownsend.png b/modules/rudi/images/uniform/GTownsend.png
new file mode 100644
index 0000000..6d6f314
--- /dev/null
+++ b/modules/rudi/images/uniform/GTownsend.png
Binary files differ
diff --git a/modules/rudi/images/uniform/IBailey.png b/modules/rudi/images/uniform/IBailey.png
new file mode 100644
index 0000000..c53fd52
--- /dev/null
+++ b/modules/rudi/images/uniform/IBailey.png
Binary files differ
diff --git a/modules/rudi/images/uniform/JBottheim.png b/modules/rudi/images/uniform/JBottheim.png
new file mode 100644
index 0000000..bd4b964
--- /dev/null
+++ b/modules/rudi/images/uniform/JBottheim.png
Binary files differ
diff --git a/modules/rudi/images/uniform/JHunkeler.png b/modules/rudi/images/uniform/JHunkeler.png
new file mode 100644
index 0000000..06a7dff
--- /dev/null
+++ b/modules/rudi/images/uniform/JHunkeler.png
Binary files differ
diff --git a/modules/rudi/images/uniform/JMelnyk.png b/modules/rudi/images/uniform/JMelnyk.png
new file mode 100644
index 0000000..111291c
--- /dev/null
+++ b/modules/rudi/images/uniform/JMelnyk.png
Binary files differ
diff --git a/modules/rudi/images/uniform/JRobinson.png b/modules/rudi/images/uniform/JRobinson.png
new file mode 100644
index 0000000..f06c78e
--- /dev/null
+++ b/modules/rudi/images/uniform/JRobinson.png
Binary files differ
diff --git a/modules/rudi/images/uniform/KGrimes.png b/modules/rudi/images/uniform/KGrimes.png
new file mode 100644
index 0000000..db03b87
--- /dev/null
+++ b/modules/rudi/images/uniform/KGrimes.png
Binary files differ
diff --git a/modules/rudi/images/uniform/KJohnson.png b/modules/rudi/images/uniform/KJohnson.png
new file mode 100644
index 0000000..496b9fd
--- /dev/null
+++ b/modules/rudi/images/uniform/KJohnson.png
Binary files differ
diff --git a/modules/rudi/images/uniform/LTrimble.png b/modules/rudi/images/uniform/LTrimble.png
new file mode 100644
index 0000000..3d8f2b6
--- /dev/null
+++ b/modules/rudi/images/uniform/LTrimble.png
Binary files differ
diff --git a/modules/rudi/images/uniform/MLula.png b/modules/rudi/images/uniform/MLula.png
new file mode 100644
index 0000000..a674bc2
--- /dev/null
+++ b/modules/rudi/images/uniform/MLula.png
Binary files differ
diff --git a/modules/rudi/images/uniform/MMark.png b/modules/rudi/images/uniform/MMark.png
new file mode 100644
index 0000000..ed5ae93
--- /dev/null
+++ b/modules/rudi/images/uniform/MMark.png
Binary files differ
diff --git a/modules/rudi/images/uniform/MMcClellan.png b/modules/rudi/images/uniform/MMcClellan.png
new file mode 100644
index 0000000..2e7f588
--- /dev/null
+++ b/modules/rudi/images/uniform/MMcClellan.png
Binary files differ
diff --git a/modules/rudi/images/uniform/NGiroux.png b/modules/rudi/images/uniform/NGiroux.png
new file mode 100644
index 0000000..599e39c
--- /dev/null
+++ b/modules/rudi/images/uniform/NGiroux.png
Binary files differ
diff --git a/modules/rudi/images/uniform/NMartini.png b/modules/rudi/images/uniform/NMartini.png
new file mode 100644
index 0000000..e0c15fd
--- /dev/null
+++ b/modules/rudi/images/uniform/NMartini.png
Binary files differ
diff --git a/modules/rudi/images/uniform/NPuckett.png b/modules/rudi/images/uniform/NPuckett.png
new file mode 100644
index 0000000..4d842c8
--- /dev/null
+++ b/modules/rudi/images/uniform/NPuckett.png
Binary files differ
diff --git a/modules/rudi/images/uniform/PBurris.png b/modules/rudi/images/uniform/PBurris.png
new file mode 100644
index 0000000..f64736d
--- /dev/null
+++ b/modules/rudi/images/uniform/PBurris.png
Binary files differ
diff --git a/modules/rudi/images/uniform/PPederson.png b/modules/rudi/images/uniform/PPederson.png
new file mode 100644
index 0000000..c5743f9
--- /dev/null
+++ b/modules/rudi/images/uniform/PPederson.png
Binary files differ
diff --git a/modules/rudi/images/uniform/RLeahy.png b/modules/rudi/images/uniform/RLeahy.png
new file mode 100644
index 0000000..1c36abf
--- /dev/null
+++ b/modules/rudi/images/uniform/RLeahy.png
Binary files differ
diff --git a/modules/rudi/images/uniform/RThomas.png b/modules/rudi/images/uniform/RThomas.png
new file mode 100644
index 0000000..8440cc6
--- /dev/null
+++ b/modules/rudi/images/uniform/RThomas.png
Binary files differ
diff --git a/modules/rudi/images/uniform/SCorsaro.png b/modules/rudi/images/uniform/SCorsaro.png
new file mode 100644
index 0000000..1895adf
--- /dev/null
+++ b/modules/rudi/images/uniform/SCorsaro.png
Binary files differ
diff --git a/modules/rudi/images/uniform/ZBarrett.png b/modules/rudi/images/uniform/ZBarrett.png
new file mode 100644
index 0000000..c9d106b
--- /dev/null
+++ b/modules/rudi/images/uniform/ZBarrett.png
Binary files differ
diff --git a/modules/rudi/images/uniform/bailey.jpg b/modules/rudi/images/uniform/bailey.jpg
new file mode 100644
index 0000000..bcb7bd4
--- /dev/null
+++ b/modules/rudi/images/uniform/bailey.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/barrett.jpg b/modules/rudi/images/uniform/barrett.jpg
new file mode 100644
index 0000000..5d48cf0
--- /dev/null
+++ b/modules/rudi/images/uniform/barrett.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/bell.jpg b/modules/rudi/images/uniform/bell.jpg
new file mode 100644
index 0000000..e3e44c5
--- /dev/null
+++ b/modules/rudi/images/uniform/bell.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/blackburn.jpg b/modules/rudi/images/uniform/blackburn.jpg
new file mode 100644
index 0000000..1b96091
--- /dev/null
+++ b/modules/rudi/images/uniform/blackburn.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/blanchette.jpg b/modules/rudi/images/uniform/blanchette.jpg
new file mode 100644
index 0000000..4a007c2
--- /dev/null
+++ b/modules/rudi/images/uniform/blanchette.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/bottheim.jpg b/modules/rudi/images/uniform/bottheim.jpg
new file mode 100644
index 0000000..924cc75
--- /dev/null
+++ b/modules/rudi/images/uniform/bottheim.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/brooks.jpg b/modules/rudi/images/uniform/brooks.jpg
new file mode 100644
index 0000000..05de36e
--- /dev/null
+++ b/modules/rudi/images/uniform/brooks.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/brown.jpg b/modules/rudi/images/uniform/brown.jpg
new file mode 100644
index 0000000..28e32ef
--- /dev/null
+++ b/modules/rudi/images/uniform/brown.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/burris copy.jpg b/modules/rudi/images/uniform/burris copy.jpg
new file mode 100644
index 0000000..edc6aba
--- /dev/null
+++ b/modules/rudi/images/uniform/burris copy.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/burris.jpg b/modules/rudi/images/uniform/burris.jpg
new file mode 100644
index 0000000..d56c1ae
--- /dev/null
+++ b/modules/rudi/images/uniform/burris.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/bursik.jpg b/modules/rudi/images/uniform/bursik.jpg
new file mode 100644
index 0000000..e4b69a3
--- /dev/null
+++ b/modules/rudi/images/uniform/bursik.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/chu.jpg b/modules/rudi/images/uniform/chu.jpg
new file mode 100644
index 0000000..f548952
--- /dev/null
+++ b/modules/rudi/images/uniform/chu.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/clark.jpg b/modules/rudi/images/uniform/clark.jpg
new file mode 100644
index 0000000..35febd8
--- /dev/null
+++ b/modules/rudi/images/uniform/clark.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/clayton.jpg b/modules/rudi/images/uniform/clayton.jpg
new file mode 100644
index 0000000..87e96b0
--- /dev/null
+++ b/modules/rudi/images/uniform/clayton.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/cooke.jpg b/modules/rudi/images/uniform/cooke.jpg
new file mode 100644
index 0000000..210ef92
--- /dev/null
+++ b/modules/rudi/images/uniform/cooke.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/corsaro.jpg b/modules/rudi/images/uniform/corsaro.jpg
new file mode 100644
index 0000000..d3f084a
--- /dev/null
+++ b/modules/rudi/images/uniform/corsaro.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/cpl.jpg b/modules/rudi/images/uniform/cpl.jpg
new file mode 100644
index 0000000..22c7d84
--- /dev/null
+++ b/modules/rudi/images/uniform/cpl.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/dalia.jpg b/modules/rudi/images/uniform/dalia.jpg
new file mode 100644
index 0000000..8e762c7
--- /dev/null
+++ b/modules/rudi/images/uniform/dalia.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/ditzel.jpg b/modules/rudi/images/uniform/ditzel.jpg
new file mode 100644
index 0000000..7b104dc
--- /dev/null
+++ b/modules/rudi/images/uniform/ditzel.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/donovan.jpg b/modules/rudi/images/uniform/donovan.jpg
new file mode 100644
index 0000000..5102f3c
--- /dev/null
+++ b/modules/rudi/images/uniform/donovan.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/dubin.jpg b/modules/rudi/images/uniform/dubin.jpg
new file mode 100644
index 0000000..ce7313a
--- /dev/null
+++ b/modules/rudi/images/uniform/dubin.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/duvall.jpg b/modules/rudi/images/uniform/duvall.jpg
new file mode 100644
index 0000000..586080b
--- /dev/null
+++ b/modules/rudi/images/uniform/duvall.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/enlisted.jpg b/modules/rudi/images/uniform/enlisted.jpg
new file mode 100644
index 0000000..2007e07
--- /dev/null
+++ b/modules/rudi/images/uniform/enlisted.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/freeman.jpg b/modules/rudi/images/uniform/freeman.jpg
new file mode 100644
index 0000000..4462f88
--- /dev/null
+++ b/modules/rudi/images/uniform/freeman.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/frey.jpg b/modules/rudi/images/uniform/frey.jpg
new file mode 100644
index 0000000..d5e9253
--- /dev/null
+++ b/modules/rudi/images/uniform/frey.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/fsgt.jpg b/modules/rudi/images/uniform/fsgt.jpg
new file mode 100644
index 0000000..91f915e
--- /dev/null
+++ b/modules/rudi/images/uniform/fsgt.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/gaskin.jpg b/modules/rudi/images/uniform/gaskin.jpg
new file mode 100644
index 0000000..2638bca
--- /dev/null
+++ b/modules/rudi/images/uniform/gaskin.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/geary.jpg b/modules/rudi/images/uniform/geary.jpg
new file mode 100644
index 0000000..de111e6
--- /dev/null
+++ b/modules/rudi/images/uniform/geary.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/giles.jpg b/modules/rudi/images/uniform/giles.jpg
new file mode 100644
index 0000000..7b179ba
--- /dev/null
+++ b/modules/rudi/images/uniform/giles.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/giroux.jpg b/modules/rudi/images/uniform/giroux.jpg
new file mode 100644
index 0000000..1e652d7
--- /dev/null
+++ b/modules/rudi/images/uniform/giroux.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/goodrich.jpg b/modules/rudi/images/uniform/goodrich.jpg
new file mode 100644
index 0000000..2804e1f
--- /dev/null
+++ b/modules/rudi/images/uniform/goodrich.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/gwizdala.jpg b/modules/rudi/images/uniform/gwizdala.jpg
new file mode 100644
index 0000000..0cafe8f
--- /dev/null
+++ b/modules/rudi/images/uniform/gwizdala.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/hallock.jpg b/modules/rudi/images/uniform/hallock.jpg
new file mode 100644
index 0000000..851c9b4
--- /dev/null
+++ b/modules/rudi/images/uniform/hallock.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/higgins.jpg b/modules/rudi/images/uniform/higgins.jpg
new file mode 100644
index 0000000..ae4b7f4
--- /dev/null
+++ b/modules/rudi/images/uniform/higgins.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/holson.jpg b/modules/rudi/images/uniform/holson.jpg
new file mode 100644
index 0000000..58c6d49
--- /dev/null
+++ b/modules/rudi/images/uniform/holson.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/hornung.jpg b/modules/rudi/images/uniform/hornung.jpg
new file mode 100644
index 0000000..3964634
--- /dev/null
+++ b/modules/rudi/images/uniform/hornung.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/hunkeler.jpg b/modules/rudi/images/uniform/hunkeler.jpg
new file mode 100644
index 0000000..2775fc5
--- /dev/null
+++ b/modules/rudi/images/uniform/hunkeler.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/index.html b/modules/rudi/images/uniform/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/images/uniform/index.html
diff --git a/modules/rudi/images/uniform/jimenez.jpg b/modules/rudi/images/uniform/jimenez.jpg
new file mode 100644
index 0000000..1081c71
--- /dev/null
+++ b/modules/rudi/images/uniform/jimenez.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/kenkel.jpg b/modules/rudi/images/uniform/kenkel.jpg
new file mode 100644
index 0000000..cfaccf9
--- /dev/null
+++ b/modules/rudi/images/uniform/kenkel.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/killian.jpg b/modules/rudi/images/uniform/killian.jpg
new file mode 100644
index 0000000..d8940e0
--- /dev/null
+++ b/modules/rudi/images/uniform/killian.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/leahy.jpg b/modules/rudi/images/uniform/leahy.jpg
new file mode 100644
index 0000000..5049a76
--- /dev/null
+++ b/modules/rudi/images/uniform/leahy.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/levine.jpg b/modules/rudi/images/uniform/levine.jpg
new file mode 100644
index 0000000..3910fdb
--- /dev/null
+++ b/modules/rudi/images/uniform/levine.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/litton.jpg b/modules/rudi/images/uniform/litton.jpg
new file mode 100644
index 0000000..788bd92
--- /dev/null
+++ b/modules/rudi/images/uniform/litton.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/luker.jpg b/modules/rudi/images/uniform/luker.jpg
new file mode 100644
index 0000000..9c5f723
--- /dev/null
+++ b/modules/rudi/images/uniform/luker.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/lula.jpg b/modules/rudi/images/uniform/lula.jpg
new file mode 100644
index 0000000..a16024a
--- /dev/null
+++ b/modules/rudi/images/uniform/lula.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/madden.jpg b/modules/rudi/images/uniform/madden.jpg
new file mode 100644
index 0000000..2802c01
--- /dev/null
+++ b/modules/rudi/images/uniform/madden.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/manary.jpg b/modules/rudi/images/uniform/manary.jpg
new file mode 100644
index 0000000..921fc43
--- /dev/null
+++ b/modules/rudi/images/uniform/manary.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/mark.jpg b/modules/rudi/images/uniform/mark.jpg
new file mode 100644
index 0000000..beda1b6
--- /dev/null
+++ b/modules/rudi/images/uniform/mark.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/mcclellan.jpg b/modules/rudi/images/uniform/mcclellan.jpg
new file mode 100644
index 0000000..54ba5aa
--- /dev/null
+++ b/modules/rudi/images/uniform/mcclellan.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/mirman.jpg b/modules/rudi/images/uniform/mirman.jpg
new file mode 100644
index 0000000..8b5eb57
--- /dev/null
+++ b/modules/rudi/images/uniform/mirman.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/moncayo.jpg b/modules/rudi/images/uniform/moncayo.jpg
new file mode 100644
index 0000000..659465b
--- /dev/null
+++ b/modules/rudi/images/uniform/moncayo.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/nowlan.jpg b/modules/rudi/images/uniform/nowlan.jpg
new file mode 100644
index 0000000..73a26cd
--- /dev/null
+++ b/modules/rudi/images/uniform/nowlan.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/oconnell.jpg b/modules/rudi/images/uniform/oconnell.jpg
new file mode 100644
index 0000000..2d06f7e
--- /dev/null
+++ b/modules/rudi/images/uniform/oconnell.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/officer.jpg b/modules/rudi/images/uniform/officer.jpg
new file mode 100644
index 0000000..610f869
--- /dev/null
+++ b/modules/rudi/images/uniform/officer.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/officer1.jpg b/modules/rudi/images/uniform/officer1.jpg
new file mode 100644
index 0000000..cef96ee
--- /dev/null
+++ b/modules/rudi/images/uniform/officer1.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/papp.jpg b/modules/rudi/images/uniform/papp.jpg
new file mode 100644
index 0000000..7aa8507
--- /dev/null
+++ b/modules/rudi/images/uniform/papp.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/patterson.jpg b/modules/rudi/images/uniform/patterson.jpg
new file mode 100644
index 0000000..67b10f2
--- /dev/null
+++ b/modules/rudi/images/uniform/patterson.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/pfc.jpg b/modules/rudi/images/uniform/pfc.jpg
new file mode 100644
index 0000000..65f5156
--- /dev/null
+++ b/modules/rudi/images/uniform/pfc.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/pfc3service copy.jpg b/modules/rudi/images/uniform/pfc3service copy.jpg
new file mode 100644
index 0000000..d87f6ec
--- /dev/null
+++ b/modules/rudi/images/uniform/pfc3service copy.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/poole.jpg b/modules/rudi/images/uniform/poole.jpg
new file mode 100644
index 0000000..e3bbb99
--- /dev/null
+++ b/modules/rudi/images/uniform/poole.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/puckett.jpg b/modules/rudi/images/uniform/puckett.jpg
new file mode 100644
index 0000000..3df29db
--- /dev/null
+++ b/modules/rudi/images/uniform/puckett.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/pvt.jpg b/modules/rudi/images/uniform/pvt.jpg
new file mode 100644
index 0000000..11a23be
--- /dev/null
+++ b/modules/rudi/images/uniform/pvt.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/schneider.jpg b/modules/rudi/images/uniform/schneider.jpg
new file mode 100644
index 0000000..bd18cdf
--- /dev/null
+++ b/modules/rudi/images/uniform/schneider.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/scott.jpg b/modules/rudi/images/uniform/scott.jpg
new file mode 100644
index 0000000..e0dc4d6
--- /dev/null
+++ b/modules/rudi/images/uniform/scott.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/segal.jpg b/modules/rudi/images/uniform/segal.jpg
new file mode 100644
index 0000000..e225f83
--- /dev/null
+++ b/modules/rudi/images/uniform/segal.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/severyns.jpg b/modules/rudi/images/uniform/severyns.jpg
new file mode 100644
index 0000000..3778874
--- /dev/null
+++ b/modules/rudi/images/uniform/severyns.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/sgt.jpg b/modules/rudi/images/uniform/sgt.jpg
new file mode 100644
index 0000000..2dd8f0a
--- /dev/null
+++ b/modules/rudi/images/uniform/sgt.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/sokolowski.jpg b/modules/rudi/images/uniform/sokolowski.jpg
new file mode 100644
index 0000000..139b1fc
--- /dev/null
+++ b/modules/rudi/images/uniform/sokolowski.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/sosa.jpg b/modules/rudi/images/uniform/sosa.jpg
new file mode 100644
index 0000000..faec3bb
--- /dev/null
+++ b/modules/rudi/images/uniform/sosa.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/ssgt.jpg b/modules/rudi/images/uniform/ssgt.jpg
new file mode 100644
index 0000000..bca0043
--- /dev/null
+++ b/modules/rudi/images/uniform/ssgt.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/test.gif b/modules/rudi/images/uniform/test.gif
new file mode 100644
index 0000000..11f342b
--- /dev/null
+++ b/modules/rudi/images/uniform/test.gif
Binary files differ
diff --git a/modules/rudi/images/uniform/test_enlisted.jpg b/modules/rudi/images/uniform/test_enlisted.jpg
new file mode 100644
index 0000000..3462978
--- /dev/null
+++ b/modules/rudi/images/uniform/test_enlisted.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/thomas.jpg b/modules/rudi/images/uniform/thomas.jpg
new file mode 100644
index 0000000..6aae1f2
--- /dev/null
+++ b/modules/rudi/images/uniform/thomas.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/townsend.jpg b/modules/rudi/images/uniform/townsend.jpg
new file mode 100644
index 0000000..9f5aa7c
--- /dev/null
+++ b/modules/rudi/images/uniform/townsend.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/townsend_OLD.jpg b/modules/rudi/images/uniform/townsend_OLD.jpg
new file mode 100644
index 0000000..297996e
--- /dev/null
+++ b/modules/rudi/images/uniform/townsend_OLD.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/trimble.jpg b/modules/rudi/images/uniform/trimble.jpg
new file mode 100644
index 0000000..4120e02
--- /dev/null
+++ b/modules/rudi/images/uniform/trimble.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/whiting.jpg b/modules/rudi/images/uniform/whiting.jpg
new file mode 100644
index 0000000..75a009b
--- /dev/null
+++ b/modules/rudi/images/uniform/whiting.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/williams.jpg b/modules/rudi/images/uniform/williams.jpg
new file mode 100644
index 0000000..016f082
--- /dev/null
+++ b/modules/rudi/images/uniform/williams.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/wubbena.jpg b/modules/rudi/images/uniform/wubbena.jpg
new file mode 100644
index 0000000..ab77965
--- /dev/null
+++ b/modules/rudi/images/uniform/wubbena.jpg
Binary files differ
diff --git a/modules/rudi/images/uniform/young.jpg b/modules/rudi/images/uniform/young.jpg
new file mode 100644
index 0000000..9d08f83
--- /dev/null
+++ b/modules/rudi/images/uniform/young.jpg
Binary files differ
diff --git a/modules/rudi/images/units/2ndPlatoon.gif b/modules/rudi/images/units/2ndPlatoon.gif
new file mode 100644
index 0000000..e42b0e6
--- /dev/null
+++ b/modules/rudi/images/units/2ndPlatoon.gif
Binary files differ
diff --git a/modules/rudi/images/units/BCT.jpg b/modules/rudi/images/units/BCT.jpg
new file mode 100644
index 0000000..d667f5d
--- /dev/null
+++ b/modules/rudi/images/units/BCT.jpg
Binary files differ
diff --git a/modules/rudi/images/units/HQ.gif b/modules/rudi/images/units/HQ.gif
new file mode 100644
index 0000000..741d389
--- /dev/null
+++ b/modules/rudi/images/units/HQ.gif
Binary files differ
diff --git a/modules/rudi/images/units/index.html b/modules/rudi/images/units/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/images/units/index.html
diff --git a/modules/rudi/images/units/rocky.gif b/modules/rudi/images/units/rocky.gif
new file mode 100644
index 0000000..8aefa39
--- /dev/null
+++ b/modules/rudi/images/units/rocky.gif
Binary files differ
diff --git a/modules/rudi/images/weapons/M16a4.jpg b/modules/rudi/images/weapons/M16a4.jpg
new file mode 100644
index 0000000..44a1323
--- /dev/null
+++ b/modules/rudi/images/weapons/M16a4.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/M203-1.jpg b/modules/rudi/images/weapons/M203-1.jpg
new file mode 100644
index 0000000..2deaadb
--- /dev/null
+++ b/modules/rudi/images/weapons/M203-1.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/M21.jpg b/modules/rudi/images/weapons/M21.jpg
new file mode 100644
index 0000000..ffa1a92
--- /dev/null
+++ b/modules/rudi/images/weapons/M21.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/M249.jpg b/modules/rudi/images/weapons/M249.jpg
new file mode 100644
index 0000000..72bac7c
--- /dev/null
+++ b/modules/rudi/images/weapons/M249.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/M9.jpg b/modules/rudi/images/weapons/M9.jpg
new file mode 100644
index 0000000..21434c0
--- /dev/null
+++ b/modules/rudi/images/weapons/M9.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/USP.jpg b/modules/rudi/images/weapons/USP.jpg
new file mode 100644
index 0000000..43b3d64
--- /dev/null
+++ b/modules/rudi/images/weapons/USP.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/index.html b/modules/rudi/images/weapons/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/images/weapons/index.html
diff --git a/modules/rudi/images/weapons/m14.jpg b/modules/rudi/images/weapons/m14.jpg
new file mode 100644
index 0000000..b04c3c1
--- /dev/null
+++ b/modules/rudi/images/weapons/m14.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/m40a3.jpg b/modules/rudi/images/weapons/m40a3.jpg
new file mode 100644
index 0000000..ca8966e
--- /dev/null
+++ b/modules/rudi/images/weapons/m40a3.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/m4a1.jpg b/modules/rudi/images/weapons/m4a1.jpg
new file mode 100644
index 0000000..5b52fa4
--- /dev/null
+++ b/modules/rudi/images/weapons/m4a1.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/m67-grenade.jpg b/modules/rudi/images/weapons/m67-grenade.jpg
new file mode 100644
index 0000000..5e40c8c
--- /dev/null
+++ b/modules/rudi/images/weapons/m67-grenade.jpg
Binary files differ
diff --git a/modules/rudi/images/weapons/m84.jpg b/modules/rudi/images/weapons/m84.jpg
new file mode 100644
index 0000000..6f8ae31
--- /dev/null
+++ b/modules/rudi/images/weapons/m84.jpg
Binary files differ
diff --git a/modules/rudi/includes/common.class.php b/modules/rudi/includes/common.class.php
new file mode 100644
index 0000000..2112853
--- /dev/null
+++ b/modules/rudi/includes/common.class.php
@@ -0,0 +1,927 @@
+<?php
+
+define('RUDI_PROFILE_SMALL', true);
+define('RUDI_PROFILE_BIG', false);
+
+class Soldier
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+
+class Role
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->role_name;
+ }
+}
+
+class UnitInfo
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+
+class Award
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+
+class AwardClass
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+
+class Rank
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->longname;
+ }
+}
+
+class Drill
+{
+ public $members;
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ //$this->members = array('Newly constructed');
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->date;
+ }
+}
+
+class ServiceRecord
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+
+class AwardRecord
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+
+class CombatRecord
+{
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this) . " -> " . $this);
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+
+/**
+ * does Stat actually need to exist?
+ */
+class Stat
+{
+
+}
+
+class RUDI_Common
+{
+ protected static $db, $link;
+ protected $images_path;
+ public $data;
+
+ public function __construct()
+ {
+ decho("Constructing " . get_parent_class($this));
+ global $config, $db;
+
+ $this->images_path = $config['rudi']['images_path'];
+ $this->db = $db;
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_parent_class($this));
+ }
+
+ /**
+ * RUDI_SoldierProfile::date_diff()
+ *
+ * This was posted by stoicnluv@gmail.com at php.net.
+ * This function is assumed to be public domain source code.
+ *
+ * @param mixed $d1
+ * @param mixed $d2
+ * @return
+ */
+ private function date_diff($d1, $d2){
+ $d1 = (is_string($d1) ? strtotime($d1) : $d1);
+ $d2 = (is_string($d2) ? strtotime($d2) : $d2);
+
+ $diff_secs = abs($d1 - $d2);
+ $base_year = min(date("Y", $d1), date("Y", $d2));
+
+ $diff = mktime(0, 0, $diff_secs, 1, 1, $base_year);
+ return array(
+ "years" => date("Y", $diff) - $base_year,
+ "months_total" => (date("Y", $diff) - $base_year) * 12 + date("n", $diff) - 1,
+ "months" => date("n", $diff) - 1,
+ "days_total" => floor($diff_secs / (3600 * 24)),
+ "days" => date("j", $diff) - 1,
+ "hours_total" => floor($diff_secs / 3600),
+ "hours" => date("G", $diff),
+ "minutes_total" => floor($diff_secs / 60),
+ "minutes" => (int) date("i", $diff),
+ "seconds_total" => $diff_secs,
+ "seconds" => (int) date("s", $diff)
+ );
+ }
+
+ /**
+ * RUDI_SoldierProfile::getDiffTime()
+ *
+ * @param mixed $date
+ * @return
+ */
+ protected function getDiffTime($date, $recent = NULL)
+ {
+ if($recent == NULL)
+ {
+ $recent = time();
+ }
+
+ $test = $this->date_diff($date, $recent);
+ $y_mod = NULL;
+ $m_mod = NULL;
+ $d_mod = NULL;
+
+ if($test['years'] > 1 || $test['years'] < 1)
+ $y_mod = 's';
+ if($test['months'] > 1 || $test['months'] < 1)
+ $m_mod = 's';
+ if($test['days'] > 1 && $test['days'] < 1)
+ $d_mod = 's';
+
+ if($test['years'] < 1 && $test['months'] < 1)
+ {
+ return '['. $test['days'] .'] Day' . $d_mod . ' ';
+ }
+ /* This code does not work properly under certain conditions
+ * therefore it is commented, but left for prosterity's sake.
+ elseif($test['days'] < 1)
+ {
+ return 'Less than a day';
+ }*/
+ else
+ {
+ return '[' . $test['years'] . '] Year' . $y_mod . ' [' . $test['months'] . '] Month' . $m_mod . ' ';
+ }
+ }
+
+ protected function evalData($data)
+ {
+ if(is_array($data))
+ return (count($data) < 1) ? true : false;
+ else
+ return $data ? $data : "N/A";
+ }
+
+ protected function getCumulativeStats()
+ {
+ //$stats = array();
+ $result = $this->db->Query("SELECT platoon_id AS id, name FROM rudi_platoons");
+ $stats['platoon'] = $this->db->Rows($result);
+ $result = $this->db->Query("SELECT squad_id AS id, name FROM rudi_squads");
+ $stats['squad'] = $this->db->Rows($result);
+
+ decho($stats['platoon']);
+ decho($stats['squad']);
+
+ return $stats;
+ }
+
+ protected function getMembersOfPlatoon($id)
+ {
+ $query = sprintf("SELECT platoon_id AS id FROM rudi_unit_members WHERE platoon_id = %d", (int)$id);
+ $result = $this->db->Query($query);
+ $members = $this->db->Rows($result);
+
+ return (int)$members;
+ }
+
+ protected function getMembersOfSquad($id)
+ {
+ $query = sprintf("SELECT squad_id AS id FROM rudi_unit_members WHERE squad_id = %d", (int)$id);
+ $result = $this->db->Query($query);
+ $members = $this->db->Rows($result);
+
+ return (int)$members;
+ }
+
+ protected function getSquadMembers($squad_id)
+ {
+ $query = sprintf("SELECT m.last_name,
+ m.first_name,
+ r.shortname AS rank_short
+ FROM rudi_unit_members AS m
+ LEFT OUTER JOIN rudi_ranks AS r ON r.rank_id = m.rank_id WHERE m.squad_id = %d ORDER BY m.rank_id ",
+ (int)$squad_id);
+
+ $result = $this->db->Query($query);
+ $row = $this->db->FetchObject($result,'Soldier');
+
+ return $row;
+ }
+
+ /**
+ * RUDI_Core::getRoles()
+ *
+ * @param mixed $member_id
+ * @param mixed $rank_id
+ * @return
+ */
+ protected function getRoles($member_id, $rank_id)
+ {
+ $data = NULL;
+ $query = sprintf("SELECT r.role_id, r.name AS role_name FROM rudi_roles AS r LEFT OUTER JOIN rudi_roles_container AS rl USING(role_id) INNER JOIN rudi_unit_members AS rm USING(member_id) WHERE rm.member_id = %d AND r.name IS NOT NULL ORDER BY r.role_id ASC",
+ (int)$member_id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Role');
+
+ return $data;
+ }
+
+ /*
+ protected function getRoles($member_id, $rank_id)
+ {
+ $query = sprintf(
+ "SELECT r.role_id, "
+ ."r.name AS role_name, "
+ ."c.name AS class_name "
+ ."FROM rudi_classes AS c "
+ ."RIGHT OUTER JOIN rudi_roles AS r ON r.member_id = '%d' "
+ ."LEFT OUTER JOIN rudi_ranks AS a ON a.class_id = c.class_id "
+ ."WHERE a.rank_id = '%d' ORDER BY r.name ASC",
+ mysql_real_escape_string($member_id),
+ mysql_real_escape_string($rank_id)
+ );
+
+// $result = $this->db->Query($query);
+// $data = $this->db->FetchObject($result,'Soldier');
+ $result = $this->db->Query($query);
+ while(($row = $this->db->FetchObject($result,'Soldier'))!=false)
+ {
+ $data[] = $row;
+ }
+ $this->db->Free($result);
+
+ return $data;
+ }
+ */
+
+ //NOT FINISHED :( :(
+ /**
+ * RUDI_Core::getServiceRecord()
+ *
+ * @param mixed $member_id
+ * @return
+ */
+ protected function getServiceRecord($member_id)
+ {
+ $data = NULL;
+ $query = sprintf(
+ "SELECT r.record_id, r.date_added, r.record_note "
+ ."FROM rudi_service_record AS r "
+ ."LEFT OUTER JOIN rudi_unit_members AS m ON m.member_id = r.member_id "
+ ."WHERE r.member_id = %d ORDER BY r.date_added DESC",
+ (int)$member_id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'ServiceRecord');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getAwardRecord()
+ *
+ * @param mixed $member_id
+ * @return
+ */
+ protected function getAwardRecord($member_id)
+ {
+ $data = NULL;
+ $query = sprintf(
+ "SELECT r.award_id, r.date_added, r.record_note, a.name AS award_name, a.image "
+ ."FROM rudi_award_record AS r "
+ ."RIGHT OUTER JOIN rudi_awards AS a ON a.award_id = r.award_id "
+ ."LEFT OUTER JOIN rudi_unit_members AS m ON m.member_id = r.member_id "
+ ."WHERE r.member_id = %d ORDER BY r.date_added DESC ",
+ (int)$member_id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'AwardRecord');
+
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getCombatRecord()
+ *
+ * @param mixed $member_id
+ * @return
+ */
+ protected function getCombatRecord($member_id)
+ {
+ $data = NULL;
+ $query = sprintf(
+ "SELECT c.date, c.status, u1.name, u1.website, u.war_id "
+ ."FROM rudi_combat_record AS c "
+ ."RIGHT OUTER JOIN rudi_war_stats AS u ON u.visit_unit_id = c.visitor_id "
+ ."RIGHT OUTER JOIN rudi_war_units AS u1 ON u1.name "
+ ."LEFT OUTER JOIN rudi_unit_members AS m ON m.member_id = c.member_id "
+ ."WHERE c.member_id = %d ORDER BY c.date DESC ",
+ (int)$member_id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'CombatRecord');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getSuperiorUnit()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getSuperiorUnit($id)
+ {
+ $query = sprintf(
+ "SELECT leader_id, "
+ ."CONCAT(m.last_name, \", \", m.first_name) AS name "
+ ."FROM rudi_units AS u "
+ ."RIGHT OUTER JOIN rudi_unit_members AS m ON m.member_id = u.leader_id "
+ ."WHERE u.unit_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getSuperiorPlatoon()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getSuperiorPlatoon($id)
+ {
+ $query = sprintf(
+ "SELECT leader_id, "
+ ."CONCAT(m.last_name, \", \", m.first_name) AS name "
+ ."FROM rudi_platoons AS p "
+ ."RIGHT OUTER JOIN rudi_unit_members AS m ON m.member_id = p.leader_id "
+ ."WHERE p.platoon_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getSuperiorSquad()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getSuperiorSquad($id)
+ {
+ $query = sprintf(
+ "SELECT leader_id, "
+ ."CONCAT(m.last_name, \", \", m.first_name) AS name "
+ ."FROM rudi_squads AS s "
+ ."RIGHT OUTER JOIN rudi_unit_members AS m ON m.member_id = s.leader_id "
+ ."WHERE s.squad_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getSuperiorTeam()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getSuperiorTeam($id)
+ {
+ $query = sprintf(
+ "SELECT leader_id, "
+ ."CONCAT(m.last_name, \", \", m.first_name) AS name "
+ ."FROM rudi_teams AS t "
+ ."RIGHT OUTER JOIN rudi_unit_members AS m ON m.member_id = t.leader_id "
+ ."WHERE t.team_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getSuperiorTrue()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getSuperiorTrue($id)
+ {
+ $superior =& $this->data[$id]->superior; //Reference only the data we need to use
+ $name =& $this->data[$id]->name;
+ $leader = NULL; //Set the return value to null
+
+ /** If the data is not null/empty, and is not equaled to the member's name
+ * (to avoid leaders from leading themself) then return the next leader in line.
+ */
+
+ foreach($superior as $tier => $value)
+ {
+ //$tier is 'unit','platoon','squad','team'
+ //$value is the array underneath that has 'name', and 'leader_id'
+
+ if(!empty($value->name) && $value->name != $name)
+ $leader = $value;
+
+ }
+
+ return $leader;
+ }
+
+ /**
+ * RUDI_Core::getUnit()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getRosterUnit($id)
+ {
+ $query = sprintf(
+ "SELECT name "
+ ."FROM rudi_units AS u "
+ ."LEFT OUTER JOIN rudi_unit_members AS m ON m.unit_id = u.unit_id "
+ ."WHERE m.member_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getPlatoon()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getRosterPlatoon($id)
+ {
+ $query = sprintf(
+ "SELECT name "
+ ."FROM rudi_platoons AS p "
+ ."LEFT OUTER JOIN rudi_unit_members AS m ON m.platoon_id = p.platoon_id "
+ ."WHERE m.member_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getSquad()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getRosterSquad($id)
+ {
+ $query = sprintf(
+ "SELECT last_name "
+ ."FROM rudi_unit_members AS m "
+ ."WHERE m.squad_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+
+ /**
+ * RUDI_Core::getTeam()
+ *
+ * @param mixed $id
+ * @return
+ */
+ protected function getRosterTeam($id)
+ {
+ $query = sprintf(
+ "SELECT leader_id, "
+ ."CONCAT(m.last_name, \", \", m.first_name) AS name "
+ ."FROM rudi_teams AS t "
+ ."RIGHT OUTER JOIN rudi_unit_members AS m ON m.member_id = t.leader_id "
+ ."WHERE t.team_id = %d ",
+ (int)$id);
+
+ $result = $this->db->Query($query);
+ $data = $this->db->FetchObject($result,'Soldier');
+
+ return $data;
+ }
+ /**
+ * RUDI_Core::printRoster()
+ *
+ * @param int $unit_id
+ * @param int $leader_id
+ */
+ public function printRoster($unit_id, $leader_id){
+ foreach($this->data as $member){
+ if($member->unit_id == $unit_id && $member->status_id < 4){
+?>
+ <tr>
+ <!-- Rank -->
+ <td class="roster"><img src="<?php echo "modules/rudi/images/ranks/small/{$member->rank_short}.png"; ?>" alt="<?php echo $member->rank_short; ?>" /></td>
+ <!-- Name -->
+ <td class="roster"><a class="rudi_roster" href="?load=rudi&amp;profile=<?php echo $member->member_id ?>"><?php echo $member->last_name . ', ' . $member->first_name; ?></a></td>
+ <!-- Roles -->
+ <td class="roster">
+ <?php
+ decho(count($member->Roles) . ' roles attached to: ' . $member->last_name);
+ for($role = 0; $role < count($member->Roles); ++$role)
+ {
+ if($member->Roles[$role]->role_name)
+ {
+ //decho($role . " = (" . $member->Roles[$role]->role_name . ")");
+
+ echo $member->Roles[$role]->role_name;
+ if($role < count($member->Roles) - 1) echo ', ';
+
+ echo '&nbsp;';
+ }
+ }
+ ?>
+ </td>
+ <!-- Weapon -->
+ <td class="roster"><?php echo $member->weapon_model; ?></td>
+ <!-- Status -->
+ <td class="roster"><?php echo $member->status; ?></td>
+ </tr>
+<?php
+ }
+ }
+ }
+ /**
+ * RUDI_Core::displayUnitsRec()
+ *
+ * @param int $unit_id
+ */
+ public function displayUnitsRec($unit_id){
+ $result = $this->db->Query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = '$unit_id' ORDER BY `weight`");
+ $row = $this->db->FetchObject($result,'UnitInfo');
+ foreach($row as $unit){
+ echo "<tr><th colspan=\"5\">{$unit->name} : {$unit->callsign}</th></tr>";
+ $this->printRoster($unit->unit_id, $unit->leader_id);
+ $this->displayUnitsRec($unit->unit_id);
+ }
+ }
+
+ public function Update($query_t = RUDI_PROFILE_BIG)
+ {
+ decho(get_class($this) . "::" . __FUNCTION__ . "($query_t)");
+ $id = NULL;
+ if(isset($_GET['profile']))
+ {
+ $id = addslashes($_GET['profile']);
+ decho("Update() Profile ID: $id");
+ }
+
+ if($query_t != RUDI_PROFILE_SMALL)
+ {
+ $sql =
+ "SELECT "
+ ."m.email, "
+ ."m.xfire, "
+ ."m.first_name, "
+ ."m.last_name, "
+ ."m.member_id, "
+ ."m.status_id, "
+ ."m.bio, "
+ ."m.image AS member_image, "
+ ."m.location_city, "
+ ."m.location_province, "
+ ."m.primary_mos, "
+ ."r.rank_id, "
+ ."r.image AS rank_image, "
+ ."r.longname AS rank_long, "
+ ."r.shortname AS rank_short, "
+ ."c.name AS position, "
+ ."u.unit_id, "
+ ."u.name AS unit_name, "
+ ."p.platoon_id, "
+ ."p.name AS platoon_name, "
+ ."s.squad_id, "
+ ."s.name AS squad_name, "
+ ."s.leader_id AS squad_leader_id, "
+ ."st.name AS status, "
+ ."st.status_id, "
+ ."t.team_id, "
+ ."t.name AS team_name, "
+ ."t.leader_id AS team_leader_id, "
+ ."w.weapon_id, "
+ ."w.manufacturer AS weapon_manufacturer, "
+ ."w.model AS weapon_model, "
+ ."co.country_id, "
+ ."co.name AS country_name, "
+ ."co.image AS country_image, "
+
+ ."CONCAT(m.last_name, \", \", m.first_name) AS name, "
+ ."CONCAT(m.location_province, \", \", co.name) AS location, "
+ ."CONCAT(w.manufacturer, \" \", w.model) as weapon_name, "
+
+ ."DATE_FORMAT(m.date_enlisted, '%d %b %Y') AS enlist_date, "
+ ."DATE_FORMAT(m.date_promotion, '%d %b %Y') AS promo_date, "
+ ."DATE_FORMAT(m.date_discharged, '%d %b %Y') AS discharge_date, "
+
+ ."m.date_enlisted AS enlist_date_st, "
+ ."m.date_promotion AS promo_date_st, "
+ ."m.date_discharged AS discharge_date_st "
+
+ ."FROM rudi_unit_members AS m "
+ ."LEFT OUTER JOIN rudi_weapons AS w ON w.weapon_id = m.weapon_id "
+ ."LEFT OUTER JOIN rudi_units AS u ON u.unit_id = m.unit_id "
+ ."LEFT OUTER JOIN rudi_squads AS s ON s.squad_id = m.squad_id "
+ ."LEFT OUTER JOIN rudi_teams AS t ON t.team_id = m.team_id "
+ ."LEFT OUTER JOIN rudi_platoons AS p ON p.platoon_id = m.platoon_id "
+ ."LEFT OUTER JOIN rudi_ranks AS r ON r.rank_id = m.rank_id "
+ ."LEFT OUTER JOIN rudi_classes AS c ON c.class_id = r.class_id "
+ ."LEFT OUTER JOIN rudi_statuses AS st ON st.status_id = m.status_id "
+ ."LEFT OUTER JOIN rudi_countries AS co ON co.country_id = m.country_id ";
+ }
+ else //SMALL PROFILE QUERY
+ {
+ $sql =
+ "SELECT "
+ ."m.first_name, "
+ ."m.last_name, "
+ ."m.member_id, "
+ ."m.status_id, "
+ ."m.date_promotion, "
+ ."m.date_enlisted, "
+ ."m.primary_mos, "
+ ."r.rank_id, "
+ ."r.image AS rank_image, "
+ ."r.longname AS rank_long, "
+ ."r.shortname AS rank_short, "
+ ."r.weight AS rank_weight, "
+ ."u.unit_id, "
+ ."u.name AS unit_name, "
+ ."p.platoon_id, "
+ ."p.name AS platoon_name, "
+ ."s.squad_id, "
+ ."s.name AS squad_name, "
+ ."s.leader_id AS squad_leader_id, "
+ ."st.name AS status, "
+ ."st.status_id, "
+ ."t.team_id, "
+ ."t.name AS team_name, "
+ ."w.weapon_id, "
+ ."w.manufacturer AS weapon_manufacturer, "
+ ."w.model AS weapon_model, "
+
+ ."CONCAT(m.last_name, \", \", m.first_name) AS name, "
+ ."CONCAT(w.manufacturer, \" \", w.model) as weapon_name "
+
+ ."FROM rudi_unit_members AS m "
+ ."LEFT OUTER JOIN rudi_weapons AS w ON w.weapon_id = m.weapon_id "
+ ."LEFT OUTER JOIN rudi_combat_units AS u ON u.unit_id = m.cunit_id "
+ ."LEFT OUTER JOIN rudi_squads AS s ON s.squad_id = m.squad_id "
+ ."LEFT OUTER JOIN rudi_teams AS t ON t.team_id = m.team_id "
+ ."LEFT OUTER JOIN rudi_platoons AS p ON p.platoon_id = m.platoon_id "
+ ."LEFT OUTER JOIN rudi_ranks AS r ON r.rank_id = m.rank_id "
+ ."LEFT OUTER JOIN rudi_statuses AS st ON st.status_id = m.status_id ";
+ }
+
+ if(!is_null($id))
+ {
+ $sql .= "WHERE m.member_id = " . (int)$id . " ";
+ }
+
+ $sql .= "ORDER BY r.weight DESC , m.date_promotion ASC, m.date_enlisted ASC";
+ $result = $this->db->Query($sql);
+ $count = 0;
+
+ $row = $this->db->FetchObject($result,'Soldier');
+
+ foreach($row as $member)
+ {
+ $count = $member->member_id;
+ $this->data[$member->member_id] = $member;
+ $this->data[$count]->Roles = $this->getRoles($member->member_id,$member->rank_id);
+ if(is_object($this->data[$count]->Roles))
+ {
+ $this->data[$count]->Roles = array((object)$nothing);
+ }
+
+ if($query_t != RUDI_PROFILE_SMALL)
+ {
+ $this->data[$count]->service_record = $this->getServiceRecord($member->member_id);
+ $this->data[$count]->award_record = $this->getAwardRecord($member->member_id);
+ $this->data[$count]->combat_record = $this->getCombatRecord($member->member_id);
+ $this->data[$count]->superior->unit = $this->getSuperiorUnit($member->unit_id);
+ $this->data[$count]->superior->platoon = $this->getSuperiorPlatoon($member->platoon_id);
+ $this->data[$count]->superior->squad = $this->getSuperiorSquad($member->squad_id);
+ $this->data[$count]->superior->team = $this->getSuperiorTeam($member->team_id);
+ $this->data[$count]->superior_next = $this->getSuperiorTrue($member->member_id);
+ }
+ $count++;
+ }
+
+ return $this->data;
+ }
+
+ protected function getAwards()
+ {
+ $query = "SELECT a.award_id, a.image, a.name, a.description, a.class_id, c.name AS class_name "
+ ."FROM rudi_awards AS a "
+ ."LEFT OUTER JOIN rudi_award_classes AS c ON c.class_id = a.class_id "
+ ."ORDER BY c.class_id, a.award_id ASC";
+ $result = $this->db->Query($query);
+ $row = $this->db->FetchObject($result,'Award');
+ return $row;
+ }
+
+ protected function getAwardClasses()
+ {
+ $query = "SELECT class_id, name FROM rudi_award_classes";
+ $result = $this->db->Query($query);
+ $row = $this->db->FetchObject($result,'AwardClass');
+ return $row;
+ }
+
+ protected function getRanks()
+ {
+ $query = "SELECT rank_id, shortname, longname, image FROM rudi_ranks WHERE active = 1 ORDER BY weight DESC";
+ $result = $this->db->Query($query);
+ $row = $this->db->FetchObject($result,'Rank');
+
+ return $row;
+ }
+/*
+ protected function getDrills($id = NULL)
+ {
+ if(!is_null($id))
+ {
+ $query = sprintf("SELECT rd.drill_id, rd.date, rd.news, rd.notes, dr.performance, dr.excusal, dr.excusal_reason, dr.initiative, m.first_name, m.last_name FROM rudi_drills AS rd
+ LEFT OUTER JOIN rudi_drills_record AS dr ON dr.drill_id = rd.drill_id
+ LEFT OUTER JOIN rudi_unit_members AS m ON m.member_id = dr.member_id
+ LEFT OUTER JOIN rudi_statuses AS st ON st.status_id = m.status_id
+ WHERE rd.drill_id = %d ORDER BY date DESC",
+ (int)$id);
+ }
+ else
+ {
+ $query = "SELECT * FROM rudi_drills ORDER BY date DESC";
+ }
+
+ $result = $this->db->Query($query);
+ $row = $this->db->FetchObject($result,'Drill');
+
+ return $row;
+ }
+*/
+
+}
+
+?> \ No newline at end of file
diff --git a/modules/rudi/includes/debug.php b/modules/rudi/includes/debug.php
new file mode 100644
index 0000000..1f5f382
--- /dev/null
+++ b/modules/rudi/includes/debug.php
@@ -0,0 +1,80 @@
+<?php
+
+if(!defined(NO_ACCESS))
+{
+ ReportError("Access denied.");
+}
+
+define("RUDI_DEBUG",true);
+define("RUDI_DEBUG_LEVEL",true);
+define(NO_REPEAT,'norepeat');
+define(REPEAT,'repeat');
+
+static $last_message = NULL;
+static $last_message_count = 0;
+
+/*
+function decho($message)
+{
+ echo "<pre>\n";
+ if(is_array($message))
+ {
+ print_r($message);
+ }
+ elseif(is_object($message))
+ {
+ var_dump($message);
+ }
+ elseif(is_string($message))
+ {
+ $message = wordwrap($message,80,'<br />');
+ echo "$message\n";
+ }
+ echo "</pre>";
+}
+
+ function decho($message, $flag = NO_REPEAT)
+ {
+ global $last_message, $last_message_count;
+ if($last_message == $message)
+ {
+ if($flag == NO_REPEAT)
+ ++$last_message_count;
+ else
+ $last_message_count = $last_message_count;
+ return;
+ }
+ elseif($last_message != $message)
+ {
+ echo "<pre>";
+ if($last_message_count > 0 && !is_array($last_message) && !is_object($last_message))
+ {
+ echo "Receieved previous message <b>$last_message_count</b> times\n";
+ }
+ else
+ {
+ if(is_array($message))
+ {
+ print_r($message);
+ }
+ elseif(is_object($message))
+ {
+ var_dump($message);
+ }
+ elseif(is_string($message))
+ {
+ $message = wordwrap($message,80,'<br />');
+ echo "$message\n";
+ }
+ }
+ echo "</pre>";
+ $last_message_count = 0;
+ }
+
+ $last_message = $message;
+
+ }
+*/
+
+
+?> \ No newline at end of file
diff --git a/modules/rudi/includes/index.html b/modules/rudi/includes/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/rudi/includes/index.html
diff --git a/modules/rudi/includes/information.class.php b/modules/rudi/includes/information.class.php
new file mode 100644
index 0000000..2632675
--- /dev/null
+++ b/modules/rudi/includes/information.class.php
@@ -0,0 +1,34 @@
+<?php
+
+class RUDI_Information extends RUDI_Common
+{
+ public function __construct()
+ {
+ global $db;
+ $this->db = $db;
+ }
+
+ public function Unit($unit_id)
+ {
+ $query = sprintf("SELECT leader_id, name, logo, url, creed, bio
+ FROM rudi_units
+ WHERE unit_id = %d", (int)$unit_id);
+ $result = $this->db->Query($query);
+ $unit = $this->db->FetchObject($result, 'UnitInfo', true);
+ return $unit;
+ }
+
+ public function Platoon($unit_id, $platoon_id)
+ {
+ $query = sprintf("SELECT leader_id, name, logo, creed, bio
+ FROM rudi_platoons
+ WHERE unit_id = %d AND platoon_id = %d", (int)$unit_id, (int)$platoon_id);
+ $result = $this->db->Query($query);
+ $platoon = $this->db->FetchObject($result, 'UnitInfo', true);
+ decho($platoon);
+
+ return $platoon;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/modules/rudi/includes/rudi.css b/modules/rudi/includes/rudi.css
new file mode 100644
index 0000000..8c4ebf2
--- /dev/null
+++ b/modules/rudi/includes/rudi.css
@@ -0,0 +1,71 @@
+table.rudi {
+ /* background: green; */
+}
+/*
+table{
+ border:1px solid #000;
+}
+
+tr{
+ border:1px solid #000;
+}
+
+th{
+ padding:5px;
+ border:1px solid #000;
+}
+
+td{
+ text-align:center;
+ padding:2px;
+ border:1px solid #000;
+} */
+
+table.rudi td.data{
+ text-align:left;
+}
+
+table.rudi th {
+ width:175px;
+ color:white;
+ text-align:center;
+ background:#333;
+ font-family: arial;
+}
+
+table.rudi td {
+ text-align:center;
+ vertical-align: middle;
+ /* border: 1px solid #a1a1a1; */
+}
+
+table.rudi td.roster {
+ text-align:center;
+ vertical-align: middle;
+ border: 1px solid #a1a1a1;
+}
+
+table.rudi th.header {
+ /* table has a 5px padding so everything is 10px bigger than these values */
+ width:100px;
+ height:19px;
+ color: #FFF;
+ background:#333;
+ border: 1px solid #666;
+ font-family: arial, helvetica, sans-serif;
+ font-size:12px;
+}
+
+table.rudi td.info {
+ color: #333;
+ vertical-align: middle;
+ text-align:left;
+ padding-left: 5px;
+ border: 1px solid #666;
+ font-family: arial, helvetica, sans-serif;
+ font-size:12px;
+}
+
+#thin {
+ border:1px outset #333;
+}
diff --git a/modules/rudi/includes/sql.class.php b/modules/rudi/includes/sql.class.php
new file mode 100644
index 0000000..4066684
--- /dev/null
+++ b/modules/rudi/includes/sql.class.php
@@ -0,0 +1,90 @@
+<?php
+
+static $db_queries = 0;
+static $db_connections = 0;
+static $db_frees = 0;
+static $db_fetches = 0;
+
+class RUDI_SQL
+{
+ protected $hostname;
+ public function Connect($hostname, $username, $passwd)
+ {
+ global $db_connections;
+ ++$db_connections;
+
+ $this->hostname = $hostname;
+
+ decho("Connecting ('$hostname')");
+ return mysql_connect($hostname, $username, $passwd);
+ }
+
+ public function Disconnect($link)
+ {
+ decho("Disconnecting ('$link' from '$this->hostname')");
+ //return mysql_close($link);
+ }
+
+ public function Select_db($db)
+ {
+ decho("Selecting database ('$db')");
+ return mysql_select_db($db);
+ }
+
+ public function Query($str)
+ {
+ global $db_queries;
+ ++$db_queries;
+ //decho("Querying ('$str')");
+ return mysql_query($str);
+ }
+
+ public function Free($result)
+ {
+ global $db_frees;
+ ++$db_frees;
+ //decho("Freeing ('$result')");
+ return mysql_free_result($result);
+ }
+
+ public function Fetch($result)
+ {
+ //decho("Fetching ('$result')");
+ return $this->FetchArray($result);
+ }
+
+ public function FetchArray($result)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ /* Alias Fetch() prefered, so no decho information */
+ return mysql_fetch_array($result,MYSQL_ASSOC);
+ }
+
+ public function FetchObject($result,$class)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ //decho("Fetching ('$result')");
+ return mysql_fetch_object($result,$class);
+ }
+
+ public function FetchAssoc($result)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ return mysql_fetch_assoc($result);
+ }
+
+ public function FetchRow($result)
+ {
+ return mysql_fetch_row($result);
+ }
+
+ public function Rows($result)
+ {
+ return mysql_num_rows($result);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/modules/rudi/index.php b/modules/rudi/index.php
new file mode 100644
index 0000000..995c90d
--- /dev/null
+++ b/modules/rudi/index.php
@@ -0,0 +1,106 @@
+<link rel="stylesheet" type="text/css" href="modules/rudi/includes/rudi.css" media="screen"/>
+<?php
+//include 'header.php';
+//include 'includes/debug.php';
+//require 'includes/sql.class.php';
+include_once 'includes/common.class.php';
+include_once 'includes/drills.class.php';
+include_once 'includes/information.class.php';
+
+OpenContent();
+ echo "<div class=\"contentHeading\">RUDI: Realism Unit Data Interface</div>";
+ echo "<div class=\"content\">";
+class RUDI_Gateway extends RUDI_Common
+{
+ protected $awards, $ranks, $drills;
+
+ public function __construct()
+ {
+ decho("Constructing " . get_class($this));
+ parent::__construct();
+
+ if(isset($_GET['admin']))
+ {
+ define('BLOCK_RIGHT_DISABLE','block_right_disable');
+ include 'admin/index.php';
+ return;
+ }
+
+ if(isset($_GET['info']))
+ {
+ $info = new RUDI_Information();
+ OpenTable();
+ echo "<tr><td>\n";
+ include 'views/view.information.php';
+ echo "</tr></td>";
+ CloseTable();
+ return;
+ }
+
+ if(isset($_GET['profile']))
+ {
+ $this->Update();
+
+ OpenTable();
+ echo "<tr><td>\n";
+ include 'views/view.profile.php';
+ echo "</td></tr>";
+ CloseTable();
+ return;
+ }
+ elseif(isset($_GET['show']))
+ {
+ OpenTable();
+ echo "<tr><td>\n";
+ switch($_GET['show'])
+ {
+ case 'awards':
+ $this->awards = $this->getAwards();
+ include 'views/view.awards.php';
+ break;
+ case 'ranks':
+ $this->ranks = $this->getRanks();
+ include 'views/view.ranks.php';
+ break;
+ case 'drills':
+ //$this->drills = $this->getDrills($_GET['id']);
+ $drills = new RUDI_Drills($_GET['id']);
+ include 'views/view.drills.php';
+ break;
+ }
+ echo "</td></tr>";
+ CloseTable();
+ return;
+ }
+ else
+ {
+ $this->Update(RUDI_PROFILE_SMALL);
+ $stats = $this->getCumulativeStats();
+
+ OpenTable();
+ echo "<tr><td>\n";
+ include 'views/view.roster.php';
+ echo "</td></tr>";
+ CloseTable();
+ return;
+ }
+ }
+
+ public function __destruct()
+ {
+ decho("Destructing " . get_class($this));
+ }
+}
+
+ob_start();
+$rudi = new RUDI_Gateway();
+ob_flush();
+ echo "</div>";
+ echo "</div>";
+CloseContent();
+
+//include 'footer.php';
+//decho($test->foo[0]->member_id);
+//$test1 = new Test();
+//$test2 = new Test();
+?> \ No newline at end of file
diff --git a/modules/rudi/views/view.awards.php b/modules/rudi/views/view.awards.php
new file mode 100644
index 0000000..5039e56
--- /dev/null
+++ b/modules/rudi/views/view.awards.php
@@ -0,0 +1,81 @@
+<?php //define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?>
+<?php $medals_path = $this->images_path . "/medals/"; ?>
+
+<html>
+<head>
+ <title>Awards and Medals</title>
+
+<style type="text/css">
+/*th.header {
+ width:175px;
+ background:#333;
+}
+
+td.rudi {
+ text-align: center;
+ vertical-align: middle;
+} */
+</style>
+
+</head>
+<body>
+
+<?php $classes = $this->getAwardClasses(); ?>
+<table class="rudi" align="center" style="width: 100%;">
+
+ <?php
+ $i = 0;
+ $cl = 0;
+ while($cl != count($classes))
+ {
+ echo "<tr>";
+ echo "<th colspan=\"3\">{$classes[$cl]->name}s</th>";
+ echo "</tr>";
+ echo '<th scope="col">Image</th>';
+ echo '<th scope="col" width=\"100px\">Award</th>';
+ echo '<th scope="col">Description</th>';
+
+ foreach($this->awards as $award)
+ {
+ if($classes[$cl]->class_id == $award->class_id)
+ {
+ echo "
+ <tr>
+ <td><img src=\"modules/rudi/images/medals/{$award->image}\" alt=\"{$award->image}\"/></td>
+ <td>{$award->name}&nbsp;</td>
+ <td style=\"text-align:left;\">{$award->description}&nbsp;</td>
+ </tr>";
+ }
+
+ }
+
+ ++$cl;
+ }
+ ?>
+
+</table>
+
+<!-- grr wtf
+ <table align="center" style="width: 100%;">
+ <tr>
+ <th scope="col" class="header" style="width:1px;">Image</th>
+ <th scope="col" class="header" style="width:1px;">Award</th>
+ <th scope="col" class="header">Description</th>
+ </tr>
+
+
+ <?php //foreach($this->awards as $award): ?>
+
+ <tr>
+ <td align='center' class="rudi"><img src="/rudi/images/medals/<?php //echo $award->image; ?>"></img>&nbsp;</td>
+ <td align='center' class="rudi"><?php //echo $award->name; ?>&nbsp;</td>
+ <td align='left'><?php //echo wordwrap($award->description,80,"<br/>"); ?>&nbsp;</td>
+ </tr>
+
+ <?php //endforeach; ?>
+
+
+ </table>
+-->
+</body>
+</html> \ No newline at end of file
diff --git a/modules/rudi/views/view.drills.php b/modules/rudi/views/view.drills.php
new file mode 100644
index 0000000..aa4b30a
--- /dev/null
+++ b/modules/rudi/views/view.drills.php
@@ -0,0 +1,122 @@
+<?php
+
+function back()
+{
+ echo "<a href=\"?load=rudi&amp;show=drills\">Back</a>";
+}
+
+function Rating($val)
+{
+ define('EXCELLENT',100);
+ define('GOOD', 75);
+ define('FAIR', 50);
+ define('POOR', 25);
+ define('TERRIBLE', 0);
+
+ if($val == EXCELLENT)
+ return "Excellent";
+ elseif($val < EXCELLENT && $val >= GOOD)
+ return "Good";
+ elseif($val < GOOD && $val >= POOR)
+ return "Poor";
+ elseif($val < POOR && $val >= TERRIBLE)
+ return "Terrible";
+ else
+ return "Bad Value";
+}
+
+//$this->getMemberAttendance();
+
+OpenContent();
+?>
+<div class="contentHeading">Drills</div>
+<div class="content">
+
+<?php if(isset($_GET['id'])): ?>
+<table cellspacing="20" class="rudi" align="left" style="width: 100%;">
+<tr>
+ <th class="header">News</th>
+</tr>
+
+<tr>
+ <td style="text-align:left;"><?php echo bbcode_format($drills->manifest->news); ?>&nbsp;</td>
+</tr>
+
+<tr>
+ <th class="header">Notes</th>
+</tr>
+
+<tr>
+ <td style="text-align:left;"><?php echo bbcode_format($drills->manifest->notes); ?>&nbsp;</td>
+</tr>
+</table>
+
+<br />
+
+<table class="rudi" align="center" style="width: 100%;">
+<tr>
+ <th class="header">Soldier</th>
+ <th class="header">Performance Rating</th>
+ <th class="header">Initiative Rating</th>
+ <th class="header">Excusal</th>
+ <th class="header">Excusal Reason</th>
+</tr>
+<?php foreach($drills->manifest->members as $member): ?>
+<?php
+ $name = $member->last_name . ', ' . $member->first_name;
+ $pRating = Rating($member->performance);
+ $iRating = Rating($member->initiative);
+?>
+<tr>
+ <td class="rudi"><?php echo $name; ?>&nbsp;</td>
+ <td class="rudi"><?php echo $pRating; ?>&nbsp;</td>
+ <td class="rudi"><?php echo $iRating; ?>&nbsp;</td>
+ <td class="rudi"><?php echo ($member->excusal ? "Yes" : "No"); ?>&nbsp;</td>
+ <td class="rudi"><?php echo $this->evalData($member->excusal_reason); ?>&nbsp;</td>
+</tr>
+<?php endforeach; ?>
+</table>
+ <?php echo "<br/>"; back();
+ decho("DRILL DATA FOR ID({$_GET['id']}) QUERY");
+ decho($drills->manifest);
+ return;
+ ?>
+
+<?php endif; ?>
+
+<table class="rudi" align="center" style="width: 100%;">
+<tr>
+<th class="header">&nbsp;</th>
+<th class="header">Date</th>
+</tr>
+
+<?php foreach($drills->manifest as $drill): ?>
+<tr>
+ <td class="rudi"><a href="?load=rudi&amp;show=drills&amp;id=<?php echo $drill->drill_id; ?>">View</a></td>
+ <td class="rudi"><?php echo $drill->date; ?> </td>
+</tr>
+<?php endforeach; ?>
+</table>
+
+</div>
+<?php
+CloseContent();
+OpenContent();
+?>
+<?php if(isset($_GET['stats']) && $_GET['stats'] == 'true'): ?>
+<div class="contentHeading">Statistics</div>
+<div class="content">
+<?php
+//decho($drills->getMemberAttendanceFull());
+require_once 'view.drills.statistics.php';
+?>
+</div>
+</div>
+
+<?php endif; ?>
+
+<?php
+CloseContent();
+decho('DATA FOR NO ID QUERY');
+decho($drills->manifest);
+?>
diff --git a/modules/rudi/views/view.information.php b/modules/rudi/views/view.information.php
new file mode 100644
index 0000000..a62ba8a
--- /dev/null
+++ b/modules/rudi/views/view.information.php
@@ -0,0 +1,20 @@
+<?php
+$unit_id = $_GET['unit_id'];
+$platoon_id = $_GET['platoon_id'];
+switch($_GET['info'])
+{
+ case 'unit':
+ if(isset($unit_id))
+ include_once 'view.unit.php';
+ break;
+
+ case 'platoon':
+ if(isset($unit_id, $platoon_id))
+ include_once 'view.platoon.php';
+ break;
+
+ default:
+ ReportError('Invalid info entry');
+ return;
+}
+?> \ No newline at end of file
diff --git a/modules/rudi/views/view.platoon.php b/modules/rudi/views/view.platoon.php
new file mode 100644
index 0000000..dbbb455
--- /dev/null
+++ b/modules/rudi/views/view.platoon.php
@@ -0,0 +1,22 @@
+<?php $data = $info->Platoon($unit_id, $platoon_id); ?>
+
+<table align="center">
+ <tr>
+ <th>&nbsp;</th>
+ <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
+ </tr>
+ <tr>
+ <th width="25%">Platoon</th>
+ <td><?php echo $data->name; ?></td>
+ </tr>
+ <tr>
+ <th>Creed</th>
+ <td><?php echo $data->creed; ?></td>
+ </tr>
+ <tr>
+ <th valign="top">Biography</th>
+ <td><?php echo $data->bio; ?></td>
+ </tr>
+</table>
+
+<?php decho($data); ?> \ No newline at end of file
diff --git a/modules/rudi/views/view.profile.php b/modules/rudi/views/view.profile.php
new file mode 100644
index 0000000..6135ea4
--- /dev/null
+++ b/modules/rudi/views/view.profile.php
@@ -0,0 +1,175 @@
+<?php
+//define('BLOCK_RIGHT_DISABLE','block_right_disable');
+$member =& $this->data[$_GET['profile']];
+$uniform_image = $member->first_name[0].str_replace(array("'", "\""), "", $member->last_name).".png";
+decho($member);
+define('BLOCK_RIGHT_DISABLE', true);
+?>
+<style type="text/css">
+
+
+</style>
+
+<table class="rudi" width="100%" border="1" align="center" cellpadding="1" cellspacing="0">
+ <tr>
+ <th class="header">Viewing Profile of: <?php echo $member->rank_long . " " . $member->first_name . " " . $member->last_name; ?></th>
+ </tr>
+ <tr>
+ <td><center><img src="modules/rudi/images/uniform/<?php echo $uniform_image; ?>" />&nbsp;</center></td>
+ </tr>
+ <tr>
+ <td><table width="100%" border="0" cellpadding="1">
+ <tr>
+ <td width="20%">
+ <table width="100%" border="0" cellpadding="5" align="center" style="border: 0px;">
+ <tr>
+ <td><center><?php echo $member->primary_mos; ?></center></td>
+ </tr>
+ <tr>
+ <td><center><img src="modules/rudi/images/ranks/large/<?php echo $member->rank_image; ?>" />&nbsp;</center></td>
+ </tr>
+ <tr>
+ <td><center><img src="modules/rudi/images/flags/<?php echo $member->country_image; ?>" />&nbsp;</center></td>
+ </tr>
+ </table>
+ </td>
+ <td width="100%">
+ <table width="100%" border="0" cellpadding="5">
+ <tr>
+ <th class="header" scope="row">Location</th>
+ <td class="info"><?php echo $this->evalData($member->location); ?>&nbsp;</td>
+ <th class="header">Superior</th>
+ <td class="info"><?php
+ if(!is_null($member->superior_next->leader_id))
+ echo "<a href=\"?load=rudi&profile={$member->superior_next->leader_id}\">";
+
+ echo $this->evalData($member->superior_next->name);
+ echo "</a>&nbsp;";
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <th class="header" scope="row">Status</th>
+ <td class="info"><?php echo $this->evalData($member->status); ?>&nbsp;</td>
+ <th class="header">Position</th>
+ <td class="info"><?php echo $this->evalData($member->position); ?>&nbsp;</td>
+ </tr>
+ <tr>
+ <th class="header" scope="row">Unit</th>
+ <td class="info"><?php echo $this->evalData($member->unit_name); ?>&nbsp;</td>
+ <th class="header">Weapon</th>
+ <td class="info"><?php echo $this->evalData($member->weapon_name); ?>&nbsp;</td>
+ </tr>
+ <tr>
+ <th class="header" scope="row">Platoon</th>
+ <td class="info"><?php echo $this->evalData($member->platoon_name); ?>&nbsp;</td>
+ <th class="header" scope="row">Enlisted</th>
+ <td class="info"><?php echo $this->evalData($member->enlist_date); ?>&nbsp;</td>
+ </tr>
+ <tr>
+ <th class="header" scope="row">Squad</th>
+ <td class="info"><?php echo $this->evalData($member->squad_name); ?>&nbsp;</td>
+ <th class="header">Time In Service</th>
+ <?php if($member->discharge_date): ?>
+ <td class="info"><?php echo $this->getDiffTime($member->enlist_date_st, $member->discharge_date); ?>&nbsp;</td>
+ <?php else: ?>
+ <td class="info"><?php echo $this->getDiffTime($member->enlist_date_st); ?></td>
+ <?php endif; ?>
+
+ </tr>
+ <tr>
+ <th class="header">Team</th>
+ <td class="info"><?php echo $this->evalData($member->team_name); ?>&nbsp;</td>
+ <th class="header">Time In Grade</th>
+ <?php if($member->discharge_date): ?>
+ <td class="info"><?php echo $this->getDiffTime($member->promo_date_st, $member->discharge_date); ?>&nbsp;</td>
+ <?php else: ?>
+ <td class="info"><?php echo $this->getDiffTime($member->promo_date_st); ?></td>
+ <?php endif; ?>
+ </tr>
+ <tr>
+ <?php if($member->discharge_date): ?>
+ <td class="info" colspan="2"></td>
+ <th class="header" scope="row">Separated</th>
+ <td class="info"><?php echo $this->evalData($member->discharge_date); ?>&nbsp;</td>
+ <?php endif; ?>
+ </tr>
+
+ </table></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td><table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col">Biography</th>
+ </tr>
+ <tr >
+ <td style="text-align:left;"><?php echo $member->bio; ?>&nbsp;</td>
+ </tr>
+ </table>
+
+ &nbsp;
+
+ <table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col" colspan="3">Service Record</th>
+ </tr>
+ <tr>
+ <?php if($this->evalData($member->service_record)):?>
+ <td>No service record available&nbsp;</td>
+ <?php else:?>
+ <?php foreach($member->service_record as $record): ?>
+ <tr>
+ <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?>&nbsp;</th>
+ <td><?php echo $record->record_note; ?>&nbsp;</td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </tr>
+ </table>
+
+ &nbsp;
+
+ <table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col" colspan="4">Award Record</th>
+ </tr>
+ <tr>
+ <?php if($this->evalData($member->award_record)):?>
+ <td>No award record available&nbsp;</td>
+ <?php else:?>
+ <?php foreach($member->award_record as $record): ?>
+ <tr>
+ <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?>&nbsp;</th>
+ <td ><?php echo $this->evalData($record->award_name); ?>&nbsp;</td>
+ <td style="vertical-align:middle;"><center><img src="modules/rudi/images/medals/<?php echo $record->image; ?>"/></center></td>
+ <td width="40%"><?php echo $record->record_note; ?>&nbsp;</td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </tr>
+ </table>
+
+ &nbsp;
+
+ <table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col" colspan="3">Combat Record</th>
+ </tr>
+ <tr>
+ <?php if($this->evalData($member->combat_record)):?>
+ <td>No combat record available&nbsp;</td>
+ <?php else:?>
+ <?php foreach($member->combat_record as $record): ?>
+ <tr>
+ <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?>&nbsp;</th>
+ <td><a href="<?php echo $record->website; ?>"><?php echo $record->name; ?></a>&nbsp;</td>
+ <td><?php echo $record->status; ?>&nbsp;</td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </tr>
+ </table></td>
+ </tr>
+</table> \ No newline at end of file
diff --git a/modules/rudi/views/view.ranks.php b/modules/rudi/views/view.ranks.php
new file mode 100644
index 0000000..4792049
--- /dev/null
+++ b/modules/rudi/views/view.ranks.php
@@ -0,0 +1,37 @@
+<?php //define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?>
+
+<html>
+<head>
+ <title>Awards and Medals</title>
+
+<style type="text/css">
+/*th.header {
+ width:175px;
+ background:#333;
+}
+
+td.rudi {
+ text-align: center;
+ vertical-align: middle;
+} */
+</style>
+
+</head>
+<body>
+
+ <table class="rudi" align="center" style="width: 100%;">
+ <tr>
+ <th scope="col">Image</th>
+ <th scope="col">Rank</th>
+ </tr>
+ <?php foreach($this->ranks as $rank): ?>
+ <tr>
+ <td><img src="<?php echo "modules/rudi/images/ranks/small/{$rank->image}"; ?>" />&nbsp;</td>
+ <td><?php echo $rank->longname; ?>&nbsp;</td>
+ </tr>
+ <?php endforeach; ?>
+
+ </table>
+
+</body>
+</html> \ No newline at end of file
diff --git a/modules/rudi/views/view.roster.php b/modules/rudi/views/view.roster.php
new file mode 100644
index 0000000..c0ee92d
--- /dev/null
+++ b/modules/rudi/views/view.roster.php
@@ -0,0 +1,23 @@
+<table width="100%" class="rudi">
+<?php
+ $result = $this->db->query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = 0");
+ $row = $this->db->fetch($result);
+ foreach($row as $unit){
+ echo "<tr><th colspan=\"5\">{$unit['name']} : {$unit['callsign']}</th></tr>";
+?>
+ <tr>
+ <!-- Table header -->
+ <th class="header">Rank</th>
+ <th class="header">Name</th>
+ <th class="header">Role</th>
+ <th class="header">Weapon</th>
+ <th class="header">Status</th>
+ </tr>
+<?php
+ $this->printRoster($unit['unit_id'], $unit['leader_id']);
+ $this->displayUnitsRec($unit['unit_id']);
+ }
+
+?>
+</table>
+
diff --git a/modules/rudi/views/view.unit.php b/modules/rudi/views/view.unit.php
new file mode 100644
index 0000000..fcc66ac
--- /dev/null
+++ b/modules/rudi/views/view.unit.php
@@ -0,0 +1,22 @@
+<?php $data = $info->Unit($unit_id); ?>
+
+<table align="center">
+ <tr>
+ <th>&nbsp;</th>
+ <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
+ </tr>
+ <tr>
+ <th width="25%">Unit</th>
+ <td><?php echo $data->name; ?></td>
+ </tr>
+ <tr>
+ <th>Creed</th>
+ <td><?php echo $data->creed; ?></td>
+ </tr>
+ <tr>
+ <th valign="top">Biography</th>
+ <td><?php echo $data->bio; ?></td>
+ </tr>
+</table>
+
+<?php decho($data); ?> \ No newline at end of file
diff --git a/modules/tsviewer/index.php b/modules/tsviewer/index.php
new file mode 100644
index 0000000..d243fba
--- /dev/null
+++ b/modules/tsviewer/index.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+if(!defined("MODULE_FILE"))
+{
+ echo "Access denied...";
+ return;
+}
+
+$ts = implode('',file("http://www.tsviewer.com/ts_viewer_pur.php?ID=902437&bg=&type=8f8f8f&type_size=11&type_family=5&info=1&channels=1&users=1&type_s_color=000000&type_s_weight=bold&type_s_style=normal&type_s_variant=normal&type_s_decoration=none&type_s_color_h=525284&type_s_weight_h=bold&type_s_style_h=normal&type_s_variant_h=normal&type_s_decoration_h=underline&type_i_color=000000&type_i_weight=normal&type_i_style=normal&type_i_variant=normal&type_i_decoration=none&type_i_color_h=525284&type_i_weight_h=normal&type_i_style_h=normal&type_i_variant_h=normal&type_i_decoration_h=underline&type_c_color=000000&type_c_weight=normal&type_c_style=normal&type_c_variant=normal&type_c_decoration=none&type_c_color_h=525284&type_c_weight_h=normal&type_c_style_h=normal&type_c_variant_h=normal&type_c_decoration_h=underline&type_u_color=000000&type_u_weight=normal&type_u_style=normal&type_u_variant=normal&type_u_decoration=none&type_u_color_h=525284&type_u_weight_h=normal&type_u_style_h=normal&type_u_variant_h=normal&type_u_decoration_h=none"));
+
+$tmp = $ts;
+$tmp = strip_tags($tmp);
+preg_match("/(\d+).(\d+).(\d+).(\d+):(\d+)/", $tmp, $ip);
+
+OpenTable();
+echo "<div class=\"contentHeading\">How to Connect</div>
+<div class=\"content\"><p><b>IP:</b> $ip[0]</p><p><b>Password:</b> Garand</p></div>";
+CloseTable();
+
+OpenTable();
+echo "<div class=\"contentHeading\">Teamspeak Server</div>";
+/*echo "<div style=\"vertical-align:middle; margin-left:40%; margin-right:auto;\">\n";*/
+//echo "<div style=\"width: 30%; margin-left: auto; margin-right: auto;\">\n";
+echo "<div style=\"margin:50px;\">";
+echo $ts;
+echo "</div>\n";
+CloseTable();
+
+?>
diff --git a/themes/default/footer.php b/themes/default/footer.php
new file mode 100644
index 0000000..e971b9f
--- /dev/null
+++ b/themes/default/footer.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+$phpversion = preg_replace('/[a-z-]/', '', phpversion());
+$mtime = explode(' ', microtime());
+$totaltime = $mtime[0] + $mtime[1] - $starttime;
+$debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) peak(%.3fmb) | PHP: %s<br/>Connections: %d | Queries: %d | Fetches: %d | Frees: %d<br/>\n",
+ $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_connections, $db_queries, $db_fetches, $db_frees);
+?>
+
+<div class="footer">
+
+ <br />
+ <span class="footer-text">
+ All logos and trademarks on this site are property of their respective owner. The comments are property of their posters, all the rest &copy; 2001-<?php echo date('Y'); ?> 3rd Infantry Division.</span>
+
+ <br /><br />
+
+ <a href="admin/">Administrative Control Panel</a><br />
+<?php echo $config['product']['name'] . ' ' . $config['product']['version'] . ' ' . $config['product']['release'] ?><br />
+<?php echo stripslashes($config['product']['copyright']); ?><br />
+<?php if($config['debug']['enabled']) echo $debug_output ?><br />
+
+<a href="http://www.dreamhost.com/r.cgi?145892" target="_blank"><img src="http://www.dreamhost.com/images/rewards/80x15-e.png" /></a><br /><br />
+
+</div>
+
+<?php
+ if($config['debug']['enabled']){
+ logQueueFlush();
+ }
+?>
+
+</body>
+</html>
+<?php ob_flush();?>
+ \ No newline at end of file
diff --git a/themes/default/header.php b/themes/default/header.php
new file mode 100644
index 0000000..76dc2f9
--- /dev/null
+++ b/themes/default/header.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+global $config;
+ob_start();
+$starttime = explode(' ', microtime());
+$starttime = $starttime[1] + $starttime[0];
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
+
+<head>
+<title>3rd Infantry Division - 8 years strong - ArmaII Unit</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<?php if(isset($config['site']['favicon'])): ?>
+<!--<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/x-icon" />-->
+<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/png" />
+<?php endif; ?>
+<link rel="stylesheet" type="text/css" href="<?php echo self::$primary_css; ?>" media="screen"/>
+</head>
+
+<body> \ No newline at end of file
diff --git a/themes/default/include/primary.css b/themes/default/include/primary.css
new file mode 100644
index 0000000..7bed7ce
--- /dev/null
+++ b/themes/default/include/primary.css
@@ -0,0 +1,256 @@
+ /*********************************
+ ** Layout Styles **
+ *********************************/
+ div.container {
+ width: 990px;
+ /* width: 1000px; */
+ color: #000000;
+ margin: auto auto;
+ text-align: left; /* IE 5 fix */
+ }
+ div.banner {
+ /* width: 990px; */
+ text-align:center;
+ /* margin: auto auto; */
+ }
+ div.nav {
+ /*width: 990px; */
+ height: 28px;
+ background: #284c75;
+ background-image:url('../images/navbackground.jpg');
+ color: #000000;
+ text-align:center;
+ /* margin: auto auto; */
+ font-size:14px;
+ }
+ table.main {
+ background-image:url('../images/sandbackground.jpg');
+ padding: 0px;
+ color:#ffffff;
+ width:990px;
+ /*width: 1134px; */
+ /* width: 1234px; */
+ margin: auto auto;
+ background-color:#a3a2a0;
+ }
+
+ table.main td {
+ /* color:white; */
+ }
+ td.midcol {
+ width: 644px;
+ background-color:transparent;
+ vertical-align:top;
+ }
+ td.rightcol {
+ vertical-align:top;
+ }
+ td.leftcol {
+ width: 275px;
+ vertical-align:top;
+ }
+ div.footer {
+ text-align:center;
+ font-family:verdana;
+ font-size:10pt;
+ color:#5e5e5e;
+ background-color:#333333;
+ border-top: 1px solid #5e5e5e;
+ }
+
+ /*********************************
+ ** Content Styles **
+ *********************************/
+ div.contentBorder1 {
+ background-color:white;
+ border:1px solid #3666ba;
+ }
+ div.contentBorder2 {
+ background-color:white;
+ border:1px solid #333333;
+ }
+ div.contentHeading {
+ background-image:url(../images/blockbackground.jpg);
+ background-repeat:repeat-x;
+ background-color:#112f50;
+ height:25px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-top:5px;
+ color:white;
+ }
+ div.content {
+ padding:10px;
+ color:#333333;
+ /*background-color:#383838;
+ color:white; */
+ background-color:#f1f1f1;
+ }
+ div.content img {
+ padding:10px;
+ }
+ div.contentFooter {
+ border-top:1px solid #333333;
+ background-color:#a4a4a4;
+ color:white;
+ padding-left:5px;
+ padding-right:5px;
+ }
+ span.footer-text {
+ font-size: 10px;
+ }
+
+ .clear {
+ clear: both;
+ }
+
+ /*********************************
+ ** Nav Links Styles **
+ *********************************/
+ table.navLinks a, table.navLinks a:visited, table.navLinks a:active {
+ background-color:transparent;
+ color:white;
+ font-family:verdana;
+ font-size:11px;
+ font-weight:bold;
+ text-decoration:none;
+ }
+
+ table.navLinks a:hover, table.navLinks a:visited:hover {
+ background-color:transparent;
+ color:#d2d2d2;
+ font-size:11px;
+ font-weight:bold;
+ text-decoration:none;
+ }
+
+ table.navLinks {
+ height:25px;
+ }
+
+ table.navLinks td {
+ border-right: 1px solid #213f61;
+ vertical-align:middle;
+ }
+
+ /*********************************
+ ** Misc. Styles **
+ *********************************/
+
+ h1, h2, h3, h4, h5, h6 {
+ font-family: Helvetica, Arial, sans-serif;
+ font-weight: normal;
+ }
+ table, tr, td {
+ padding:0px;
+ border:0px;
+ margin:0px
+ }
+ body, td, div {
+ font-size:10pt;
+ /* color:black; */
+ font-family:verdana;
+ font-weight:normal;
+ }
+ a, a:visited, a:active {
+ background-color:transparent;
+ color:#3666ba;
+ font-family:verdana;
+ font-size:12px;
+ text-decoration:none;
+ }
+
+ a:hover, a:visited:hover {
+ background-color:transparent;
+ color:#3666ba;
+ font-family:verdana;
+ font-size:12px;
+ text-decoration:underline;
+ }
+ a.rudi_roster, a.rudi_roster:visited, a.rudi_roster:active, a.rudi_roster:hover {
+ color:#2b5bae;
+ }
+ body {
+ background-color:#091a34;
+ margin:0;
+ padding:0;
+ text-align:left;
+ }
+ a img {
+ border:0px;
+ }
+ form {
+ margin:0;
+ }
+ tr.rownorm{
+ background-color:white;
+
+ }
+ tr.rowhigh{
+ background-color:#e0e0e0;
+ }
+ /* photo gallery styles */
+ .photoleft{
+ background-image:url("../images/photoleft.png");
+ background-repeat:repeat-y;
+ text-align:center;
+ width:49px;
+ }
+ .photoright{
+ background-image:url("../images/photoright.png");
+ background-repeat:repeat-y;
+ text-align:center;
+ width:49px;
+ }
+ /* end photo gallery styles */
+
+ /* stuff we might need in order to add drop shadows */
+
+ div.topbar {
+ height:25px;
+ text-align:center;
+ background-color:black;
+ font-family:verdana;
+ font-size:10pt;
+ color:#797e4f;
+ }
+ div.botbar {
+ height:50px;
+ padding:5px;
+ text-align:center;
+ background-color:black;
+ font-family:verdana;
+ font-size:10pt;
+ }
+ /* may need these two when we add the background images back */
+ .leftbar {
+ /* background-image:url("../images/leftshadow.png"); */
+ background-repeat:
+ repeat-y;
+ width:50px;
+ }
+ .rightbar {
+ /* background-image:url("../images/rightshadow.png"); */
+ background-repeat:
+ repeat-y;
+ width:15px;
+ }
+
+
+ .left{
+ text-align:left;
+ }
+ .right{
+ text-align:right;
+ }
+ .center{
+ text-align:center;
+ }
+ .title{
+ font-size:14px;
+ font-weight:bold;
+ font-family:arial;
+ }
+
+@import "style_bbcode.css"
+
diff --git a/themes/default/include/style_bbcode.css b/themes/default/include/style_bbcode.css
new file mode 100644
index 0000000..7299c06
--- /dev/null
+++ b/themes/default/include/style_bbcode.css
@@ -0,0 +1,71 @@
+.bold {
+ font-weight: bold;
+}
+
+.italics {
+ font-style: italic;
+}
+
+.underline {
+ text-decoration: underline;
+}
+
+.strikethrough {
+ text-decoration: line-through;
+}
+
+.overline {
+ text-decoration: overline;
+}
+
+.quotecodeheader {
+ font-family: Verdana, arial, helvetica, sans-serif;
+ font-size: 12px;
+ font-weight: bold;
+}
+
+.codebody {
+ background-color: #FFFFFF;
+ font-family: Courier new, courier, mono;
+ font-size: 12px;
+ color: #006600;
+ border: 1px solid #BFBFBF;
+}
+
+.quotebody {
+ background-color: #FFFFFF;
+ font-family: Courier new, courier, mono;
+ font-size: 12px;
+ color: #660002;
+ border: 1px solid #BFBFBF;
+}
+
+.listbullet {
+ list-style-type: disc;
+ list-style-position: inside;
+}
+
+.listdecimal {
+ list-style-type: decimal;
+ list-style-position: inside;
+}
+
+.listlowerroman {
+ list-style-type: lower-roman;
+ list-style-position: inside;
+}
+
+.listupperroman {
+ list-style-type: upper-roman;
+ list-style-position: inside;
+}
+
+.listloweralpha {
+ list-style-type: lower-alpha;
+ list-style-position: inside;
+}
+
+.listupperalpha {
+ list-style-type: upper-alpha;
+ list-style-position: inside;
+}
diff --git a/themes/default/include/theme.ini b/themes/default/include/theme.ini
new file mode 100644
index 0000000..223cd14
--- /dev/null
+++ b/themes/default/include/theme.ini
@@ -0,0 +1,2 @@
+[author]
+name = "Joseph Hunkeler" \ No newline at end of file
diff --git a/themes/default/index.php b/themes/default/index.php
new file mode 100644
index 0000000..3d02ec1
--- /dev/null
+++ b/themes/default/index.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Bayonet Conent Management System
+ * Copyright (C) Joseph Hunkeler & Evan O'Connell
+ *
+ * Purpose of this software is to allow users to manage their website
+ * with ease and without needing to have any coding knowledge in order
+ * to maintain it. Visit [link] for any updates or feedback.
+ */
+
+/* Begin try/catch block */
+try {
+
+/* Setup error handing callbacks */
+ob_start("fatal_error_handler");
+set_error_handler("handle_error");
+
+require_once self::$root_path . '/include/functions.php';
+
+include self::$header;
+//session_start();
+?>
+
+<div class="container">
+
+<!-- banner -->
+ <div class="banner"><a href="index.php"><img src="<?php echo self::$image_path . '/logo.jpg'; ?>" alt="3rd Infantry Division - ArmAII Unit" /></a></div>
+<!-- navigation -->
+ <div class="nav"><?php require_once self::$root_path . '/navigation.php'; ?></div>
+
+<!-- content -->
+<table border="0" cellspacing="15px" cellpadding="0" class="main" width="100%">
+ <tr>
+ <td class="midcol">
+ <?php require_once 'modules.php'; ?>
+ </td>
+
+ <!-- block area RIGHT -->
+ <?php if(!defined('BLOCK_RIGHT_DISABLE')): ?>
+ <td class="rightcol">
+ <?php GetBlocks(BLOCK_RIGHT); ?>
+ </td>
+ <?php endif; ?>
+
+ </tr>
+</table>
+
+</div>
+<?php include self::$footer; ?>
+<?php
+/* Flushing is needed by the error handler */
+ob_end_flush();
+
+} //try ^^
+catch(Exception $e)
+{
+ ReportError(
+ "<style>td.short{width:100%;}</style><table style=\"width:0;\"><tr><th>Code</th>" . "<td class=\"short\">" . $e->getCode() . "</td>" . "</tr><tr><th>In File</th>" . "<td class=\"short\">" . $e->getFile() . "</td>" . "</tr></table>" . $e->getLine() . " - " . $e->getMessage() . "<br/>"
+ );
+}
+?>
diff --git a/themes/default/navigation.php b/themes/default/navigation.php
new file mode 100644
index 0000000..5765712
--- /dev/null
+++ b/themes/default/navigation.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Bayonet Conent Management System
+ * Copyright (C) Joseph Hunkeler & Evan O'Connell
+ *
+ * Purpose of this software is to allow users to manage their website
+ * with ease and without needing to have any coding knowledge in order
+ * to maintain it. Visit www.eodesign.com/cms for any updates or feedback.
+ */
+ ?>
+<table border="0" cellspacing="0" class="navLinks">
+ <tr>
+ <td>&nbsp;&nbsp;<a href="index.php">HOME</a>&nbsp;&nbsp;</td>
+<?php
+
+ $result = $db->Query("SELECT * FROM `bayonet_navigation` ORDER BY `weight`");
+ $nav = $db->Fetch($result);
+
+ foreach ($nav as $link) {
+ echo '<td>&nbsp;&nbsp;<a href="' . str_replace('&', '&amp;', $link['link']) . '">' . strtoupper($link['title']) . '</a>&nbsp;&nbsp;</td>';
+ }
+ ?>
+ </tr>
+</table>