summaryrefslogtreecommitdiff
path: root/js/prototype-window-1.3
diff options
context:
space:
mode:
Diffstat (limited to 'js/prototype-window-1.3')
-rwxr-xr-xjs/prototype-window-1.3/MIT-LICENSE19
-rwxr-xr-xjs/prototype-window-1.3/PWC-OS/body-bg.pngbin0 -> 65481 bytes
-rwxr-xr-xjs/prototype-window-1.3/PWC-OS/button-bg.gifbin0 -> 463 bytes
-rwxr-xr-xjs/prototype-window-1.3/PWC-OS/dock-bg.gifbin0 -> 173 bytes
-rwxr-xr-xjs/prototype-window-1.3/PWC-OS/index.html37
-rwxr-xr-xjs/prototype-window-1.3/PWC-OS/pwc-os.css36
-rwxr-xr-xjs/prototype-window-1.3/PWC-OS/pwc-os.js103
-rwxr-xr-xjs/prototype-window-1.3/README182
-rwxr-xr-xjs/prototype-window-1.3/documentation/PWC-OS/body-bg.pngbin0 -> 65481 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/PWC-OS/button-bg.gifbin0 -> 463 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/PWC-OS/dock-bg.gifbin0 -> 173 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/PWC-OS/index.html37
-rwxr-xr-xjs/prototype-window-1.3/documentation/PWC-OS/pwc-os.css36
-rwxr-xr-xjs/prototype-window-1.3/documentation/PWC-OS/pwc-os.js103
-rwxr-xr-xjs/prototype-window-1.3/documentation/debug.html109
-rwxr-xr-xjs/prototype-window-1.3/documentation/documentation.html544
-rwxr-xr-xjs/prototype-window-1.3/documentation/info_panel.html31
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/debug.js137
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/effects.js1094
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/extended_debug.js113
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/prototype.js3269
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/tooltip.js241
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/window.js1843
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/window_effects.js157
-rwxr-xr-xjs/prototype-window-1.3/documentation/javascripts/window_ext.js115
-rwxr-xr-xjs/prototype-window-1.3/documentation/js/application.js173
-rwxr-xr-xjs/prototype-window-1.3/documentation/logo.gifbin0 -> 3452 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/pwc.gifbin0 -> 2495 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/pwc_os_thumb.pngbin0 -> 31374 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/samples.html275
-rwxr-xr-xjs/prototype-window-1.3/documentation/stylesheets/login.css25
-rwxr-xr-xjs/prototype-window-1.3/documentation/stylesheets/style.css332
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes.html192
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert.css119
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/bottom.gifbin0 -> 70 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/bottom_left.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/bottom_right.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/left.gifbin0 -> 84 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/overlay.pngbin0 -> 2829 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/progress.gifbin0 -> 1542 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/right.gifbin0 -> 84 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/top.gifbin0 -> 70 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/top_left.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert/top_right.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alert_lite.css88
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube.css150
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/bottom-left-c.gifbin0 -> 60 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/bottom-middle.gifbin0 -> 50 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/bottom-right-c.gifbin0 -> 61 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/button-close-focus.gifbin0 -> 699 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/button-max-focus.gifbin0 -> 765 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/button-min-focus.gifbin0 -> 472 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/frame-left.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/frame-right.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/left-top.gifbin0 -> 171 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/right-top.gifbin0 -> 168 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/alphacube/top-middle.gifbin0 -> 97 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/behavior.htc51
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX.css121
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/button-close-focused.pngbin0 -> 904 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/button-maximize-focused.pngbin0 -> 882 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/button-minimize-focused.pngbin0 -> 839 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/frame-bottom-left-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/frame-bottom-mid-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/frame-bottom-right-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/frame-left-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/frame-right-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/titlebar-left-focused.pngbin0 -> 180 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/titlebar-mid-focused.pngbin0 -> 175 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/darkX/titlebar-right-focused.pngbin0 -> 180 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/debug.css25
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default.css155
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/bottom_left.gifbin0 -> 187 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/bottom_mid.gifbin0 -> 68 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/bottom_right.gifbin0 -> 187 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/bottom_right_resize.gifbin0 -> 201 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/center_left.gifbin0 -> 52 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/center_right.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/clear.gifbin0 -> 1014 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/close.gifbin0 -> 1012 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/inspect.gifbin0 -> 556 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/maximize.gifbin0 -> 1024 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/minimize.gifbin0 -> 1023 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/overlay.pngbin0 -> 2818 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/resize.gifbin0 -> 138 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/sizer.gifbin0 -> 201 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/top_left.gifbin0 -> 358 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/top_mid.gifbin0 -> 149 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/default/top_right.gifbin0 -> 357 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/iefix/blank.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/iefix/iepngfix.css3
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/iefix/iepngfix.htc54
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting.css960
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/background_buttons.gifbin0 -> 70 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-left-blue.pngbin0 -> 335 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-left-darkblue.pngbin0 -> 334 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-left-green.pngbin0 -> 347 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-left-grey.pngbin0 -> 346 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-middle-blue.pngbin0 -> 156 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-middle-darkblue.pngbin0 -> 154 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-middle-green.pngbin0 -> 155 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-middle-grey.pngbin0 -> 156 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-right-blue.pngbin0 -> 397 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-right-darkblue.pngbin0 -> 392 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-right-green.pngbin0 -> 390 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/bottom-right-grey.pngbin0 -> 424 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-close-blue.pngbin0 -> 308 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-close-darkblue.pngbin0 -> 308 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-close-green.pngbin0 -> 305 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-close-grey.pngbin0 -> 320 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-maximize-blue.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-maximize-darkblue.pngbin0 -> 212 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-maximize-green.pngbin0 -> 226 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-maximize-grey.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-minimize-blue.pngbin0 -> 164 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-minimize-darkblue.pngbin0 -> 172 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-minimize-green.pngbin0 -> 172 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/button-minimize-grey.pngbin0 -> 184 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/left-blue.pngbin0 -> 144 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/left-darkblue.pngbin0 -> 143 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/left-green.pngbin0 -> 144 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/left-grey.pngbin0 -> 144 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/pngbehavior.htc67
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/right-blue.pngbin0 -> 146 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/right-darkblue.pngbin0 -> 146 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/right-green.pngbin0 -> 146 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/right-grey.pngbin0 -> 155 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/spinner.gifbin0 -> 2037 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-left-blue.pngbin0 -> 336 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-left-darkblue.pngbin0 -> 360 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-left-green.pngbin0 -> 339 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-left-grey.pngbin0 -> 352 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-middle-blue.pngbin0 -> 200 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-middle-darkblue.pngbin0 -> 226 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-middle-green.pngbin0 -> 208 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-middle-grey.pngbin0 -> 185 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-right-blue.pngbin0 -> 423 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-right-darkblue.pngbin0 -> 451 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-right-green.pngbin0 -> 440 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/lighting/top-right-grey.pngbin0 -> 495 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x.css333
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/B.pngbin0 -> 268 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/BL.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/BL_Main.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/BR.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/BR_Main.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/B_Main.pngbin0 -> 268 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/L.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/L_Main.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/R.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/R_Main.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/T.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/TL.pngbin0 -> 360 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/TL_Main.pngbin0 -> 444 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/TR.pngbin0 -> 3818 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/TR_Main.pngbin0 -> 3818 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/T_Main.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/close.gifbin0 -> 1012 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/maximize.gifbin0 -> 1024 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x/minimize.gifbin0 -> 1023 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog.css160
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/B.pngbin0 -> 2861 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BL.pngbin0 -> 3046 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BR.pngbin0 -> 3073 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/L.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/R.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/T.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TL.pngbin0 -> 360 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TR.pngbin0 -> 3818 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/bg.gifbin0 -> 65 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/close.gifbin0 -> 1012 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/maximize.gifbin0 -> 1024 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/mac_os_x_dialog/minimize.gifbin0 -> 1023 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio.css164
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/bottom_left.pngbin0 -> 616 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/bottom_mid.pngbin0 -> 3617 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/bottom_right.pngbin0 -> 660 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/center_left.pngbin0 -> 6606 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/center_right.pngbin0 -> 6509 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/close.pngbin0 -> 772 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/minimize.pngbin0 -> 693 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/overlay.pngbin0 -> 40803 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/top_left.pngbin0 -> 971 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/top_mid.pngbin0 -> 5944 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/nuncio/top_right.pngbin0 -> 1245 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread.css108
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/.gifbin0 -> 2866 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/bottom-left-c.gifbin0 -> 60 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/bottom-middle.gifbin0 -> 50 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/bottom-right-c.gifbin0 -> 61 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/button-close-focus.gifbin0 -> 699 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/button-max-focus.gifbin0 -> 765 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/button-min-focus.gifbin0 -> 472 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/frame-left.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/frame-right.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/left-top.gifbin0 -> 273 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/right-top.gifbin0 -> 265 bytes
-rwxr-xr-xjs/prototype-window-1.3/documentation/themes/spread/top-middle.gifbin0 -> 152 bytes
-rwxr-xr-xjs/prototype-window-1.3/helper/prototype_window_class_helper.rb58
-rwxr-xr-xjs/prototype-window-1.3/javascripts/debug.js137
-rwxr-xr-xjs/prototype-window-1.3/javascripts/effects.js1094
-rwxr-xr-xjs/prototype-window-1.3/javascripts/extended_debug.js113
-rwxr-xr-xjs/prototype-window-1.3/javascripts/prototype.js3269
-rwxr-xr-xjs/prototype-window-1.3/javascripts/tooltip.js241
-rwxr-xr-xjs/prototype-window-1.3/javascripts/window.js1843
-rwxr-xr-xjs/prototype-window-1.3/javascripts/window_effects.js157
-rwxr-xr-xjs/prototype-window-1.3/javascripts/window_ext.js115
-rwxr-xr-xjs/prototype-window-1.3/samples/constraint.html83
-rwxr-xr-xjs/prototype-window-1.3/samples/dialog.html51
-rwxr-xr-xjs/prototype-window-1.3/samples/dialog_ajax.html4
-rwxr-xr-xjs/prototype-window-1.3/samples/inframe.html54
-rwxr-xr-xjs/prototype-window-1.3/samples/inset.html11
-rwxr-xr-xjs/prototype-window-1.3/samples/multi_modal.html84
-rwxr-xr-xjs/prototype-window-1.3/samples/oldFirstSampleCode.html198
-rwxr-xr-xjs/prototype-window-1.3/samples/openInside.html61
-rwxr-xr-xjs/prototype-window-1.3/samples/parent.html37
-rwxr-xr-xjs/prototype-window-1.3/samples/popup_open.html61
-rwxr-xr-xjs/prototype-window-1.3/samples/rico/index.html73
-rwxr-xr-xjs/prototype-window-1.3/samples/rico/properties_1.gifbin0 -> 896 bytes
-rwxr-xr-xjs/prototype-window-1.3/samples/rico/rico.css30
-rwxr-xr-xjs/prototype-window-1.3/samples/rico/rico_change.js2818
-rwxr-xr-xjs/prototype-window-1.3/samples/tooltips/tooltip.html79
-rwxr-xr-xjs/prototype-window-1.3/samples/tooltips/tooltip_ajax.html4
-rwxr-xr-xjs/prototype-window-1.3/samples/tooltips/tooltip_url.html21
-rwxr-xr-xjs/prototype-window-1.3/samples/window_key.html38
-rwxr-xr-xjs/prototype-window-1.3/samples/window_key_url_content.html22
-rwxr-xr-xjs/prototype-window-1.3/samples/window_store.html51
-rwxr-xr-xjs/prototype-window-1.3/themes/alert.css119
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/bottom.gifbin0 -> 70 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/bottom_left.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/bottom_right.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/left.gifbin0 -> 84 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/overlay.pngbin0 -> 2829 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/progress.gifbin0 -> 1542 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/right.gifbin0 -> 84 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/top.gifbin0 -> 70 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/top_left.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert/top_right.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alert_lite.css88
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube.css150
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/bottom-left-c.gifbin0 -> 60 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/bottom-middle.gifbin0 -> 50 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/bottom-right-c.gifbin0 -> 61 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/button-close-focus.gifbin0 -> 699 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/button-max-focus.gifbin0 -> 765 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/button-min-focus.gifbin0 -> 472 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/frame-left.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/frame-right.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/left-top.gifbin0 -> 171 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/right-top.gifbin0 -> 168 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/alphacube/top-middle.gifbin0 -> 97 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/behavior.htc51
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX.css121
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/button-close-focused.pngbin0 -> 904 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/button-maximize-focused.pngbin0 -> 882 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/button-minimize-focused.pngbin0 -> 839 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/frame-bottom-left-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/frame-bottom-mid-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/frame-bottom-right-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/frame-left-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/frame-right-focused.pngbin0 -> 142 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/titlebar-left-focused.pngbin0 -> 180 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/titlebar-mid-focused.pngbin0 -> 175 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/darkX/titlebar-right-focused.pngbin0 -> 180 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/debug.css25
-rwxr-xr-xjs/prototype-window-1.3/themes/default.css155
-rwxr-xr-xjs/prototype-window-1.3/themes/default/bottom_left.gifbin0 -> 187 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/bottom_mid.gifbin0 -> 68 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/bottom_right.gifbin0 -> 187 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/bottom_right_resize.gifbin0 -> 201 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/center_left.gifbin0 -> 52 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/center_right.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/clear.gifbin0 -> 1014 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/close.gifbin0 -> 1012 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/inspect.gifbin0 -> 556 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/maximize.gifbin0 -> 1024 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/minimize.gifbin0 -> 1023 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/overlay.pngbin0 -> 2818 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/resize.gifbin0 -> 138 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/sizer.gifbin0 -> 201 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/top_left.gifbin0 -> 358 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/top_mid.gifbin0 -> 149 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/default/top_right.gifbin0 -> 357 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/iefix/blank.gifbin0 -> 49 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/iefix/iepngfix.css3
-rwxr-xr-xjs/prototype-window-1.3/themes/iefix/iepngfix.htc54
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting.css960
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/background_buttons.gifbin0 -> 70 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-left-blue.pngbin0 -> 335 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-left-darkblue.pngbin0 -> 334 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-left-green.pngbin0 -> 347 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-left-grey.pngbin0 -> 346 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-middle-blue.pngbin0 -> 156 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-middle-darkblue.pngbin0 -> 154 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-middle-green.pngbin0 -> 155 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-middle-grey.pngbin0 -> 156 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-right-blue.pngbin0 -> 397 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-right-darkblue.pngbin0 -> 392 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-right-green.pngbin0 -> 390 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/bottom-right-grey.pngbin0 -> 424 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-close-blue.pngbin0 -> 308 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-close-darkblue.pngbin0 -> 308 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-close-green.pngbin0 -> 305 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-close-grey.pngbin0 -> 320 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-maximize-blue.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-maximize-darkblue.pngbin0 -> 212 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-maximize-green.pngbin0 -> 226 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-maximize-grey.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-minimize-blue.pngbin0 -> 164 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-minimize-darkblue.pngbin0 -> 172 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-minimize-green.pngbin0 -> 172 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/button-minimize-grey.pngbin0 -> 184 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/left-blue.pngbin0 -> 144 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/left-darkblue.pngbin0 -> 143 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/left-green.pngbin0 -> 144 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/left-grey.pngbin0 -> 144 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/pngbehavior.htc67
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/right-blue.pngbin0 -> 146 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/right-darkblue.pngbin0 -> 146 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/right-green.pngbin0 -> 146 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/right-grey.pngbin0 -> 155 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/spinner.gifbin0 -> 2037 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-left-blue.pngbin0 -> 336 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-left-darkblue.pngbin0 -> 360 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-left-green.pngbin0 -> 339 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-left-grey.pngbin0 -> 352 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-middle-blue.pngbin0 -> 200 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-middle-darkblue.pngbin0 -> 226 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-middle-green.pngbin0 -> 208 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-middle-grey.pngbin0 -> 185 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-right-blue.pngbin0 -> 423 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-right-darkblue.pngbin0 -> 451 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-right-green.pngbin0 -> 440 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/lighting/top-right-grey.pngbin0 -> 495 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x.css333
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/B.pngbin0 -> 268 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/BL.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/BL_Main.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/BR.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/BR_Main.pngbin0 -> 5068 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/B_Main.pngbin0 -> 268 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/L.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/L_Main.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/R.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/R_Main.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/T.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/TL.pngbin0 -> 360 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/TL_Main.pngbin0 -> 444 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/TR.pngbin0 -> 3818 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/TR_Main.pngbin0 -> 3818 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/T_Main.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/close.gifbin0 -> 1012 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/maximize.gifbin0 -> 1024 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x/minimize.gifbin0 -> 1023 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog.css160
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/B.pngbin0 -> 2861 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/BL.pngbin0 -> 3046 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/BR.pngbin0 -> 3073 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/L.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/R.pngbin0 -> 133 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/T.pngbin0 -> 218 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/TL.pngbin0 -> 360 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/TR.pngbin0 -> 3818 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/bg.gifbin0 -> 65 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/close.gifbin0 -> 1012 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/maximize.gifbin0 -> 1024 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/mac_os_x_dialog/minimize.gifbin0 -> 1023 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio.css164
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/bottom_left.pngbin0 -> 616 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/bottom_mid.pngbin0 -> 3617 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/bottom_right.pngbin0 -> 660 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/center_left.pngbin0 -> 6606 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/center_right.pngbin0 -> 6509 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/close.pngbin0 -> 772 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/minimize.pngbin0 -> 693 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/overlay.pngbin0 -> 40803 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/top_left.pngbin0 -> 971 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/top_mid.pngbin0 -> 5944 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/nuncio/top_right.pngbin0 -> 1245 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread.css108
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/.gifbin0 -> 2866 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/bottom-left-c.gifbin0 -> 60 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/bottom-middle.gifbin0 -> 50 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/bottom-right-c.gifbin0 -> 61 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/button-close-focus.gifbin0 -> 699 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/button-max-focus.gifbin0 -> 765 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/button-min-focus.gifbin0 -> 472 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/frame-left.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/frame-right.gifbin0 -> 64 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/left-top.gifbin0 -> 273 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/right-top.gifbin0 -> 265 bytes
-rwxr-xr-xjs/prototype-window-1.3/themes/spread/top-middle.gifbin0 -> 152 bytes
392 files changed, 25126 insertions, 0 deletions
diff --git a/js/prototype-window-1.3/MIT-LICENSE b/js/prototype-window-1.3/MIT-LICENSE
new file mode 100755
index 0000000..5bcdad1
--- /dev/null
+++ b/js/prototype-window-1.3/MIT-LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.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.
diff --git a/js/prototype-window-1.3/PWC-OS/body-bg.png b/js/prototype-window-1.3/PWC-OS/body-bg.png
new file mode 100755
index 0000000..a5226e0
--- /dev/null
+++ b/js/prototype-window-1.3/PWC-OS/body-bg.png
Binary files differ
diff --git a/js/prototype-window-1.3/PWC-OS/button-bg.gif b/js/prototype-window-1.3/PWC-OS/button-bg.gif
new file mode 100755
index 0000000..1d9d503
--- /dev/null
+++ b/js/prototype-window-1.3/PWC-OS/button-bg.gif
Binary files differ
diff --git a/js/prototype-window-1.3/PWC-OS/dock-bg.gif b/js/prototype-window-1.3/PWC-OS/dock-bg.gif
new file mode 100755
index 0000000..cb5febf
--- /dev/null
+++ b/js/prototype-window-1.3/PWC-OS/dock-bg.gif
Binary files differ
diff --git a/js/prototype-window-1.3/PWC-OS/index.html b/js/prototype-window-1.3/PWC-OS/index.html
new file mode 100755
index 0000000..dd16f70
--- /dev/null
+++ b/js/prototype-window-1.3/PWC-OS/index.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+
+ <link href="../themes/default.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/lighting.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/mac_os_x.css" rel="stylesheet" type="text/css"/>
+ <link href="./pwc-os.css" rel="stylesheet" type="text/css"/>
+
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/window_effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <script type="text/javascript" src="./pwc-os.js"> </script>
+ <title>PWC OS</title>
+
+</head>
+
+<body>
+<div id="dock">
+ <div id="theme">
+ Theme:
+ <select>
+ <option>Mac OS X</option>
+ <option>Blue lighting</option>
+ <option>Green lighting</option>
+ </select>
+ </div>
+</div>
+
+
+</body>
+</html>
diff --git a/js/prototype-window-1.3/PWC-OS/pwc-os.css b/js/prototype-window-1.3/PWC-OS/pwc-os.css
new file mode 100755
index 0000000..57dd07e
--- /dev/null
+++ b/js/prototype-window-1.3/PWC-OS/pwc-os.css
@@ -0,0 +1,36 @@
+body {
+ margin:0;
+ padding:0;
+ overflow: hidden;
+ background: #FFF8DD url(body-bg.png) no-repeat fixed center 10px;
+}
+
+#dock {
+ position:absolute;
+ bottom:0;
+ left:0;
+ width:100%;
+ height:26px;
+ background:transparent url(dock-bg.gif) repeat-x 0 0;
+ z-index: 100000;
+}
+
+.dock_icon {
+ float:left;
+ width:102px;
+ height:21px;
+ margin-top:3px;
+ background: url(button-bg.gif);
+ text-align:center;
+ font-size: 14px;
+ color: #000;
+ line-height: 22px;
+ margin-right:10px;
+ margin-left:10px;
+}
+
+#theme {
+ float:right;
+ margin-top:3px;
+ margin-right:15px;
+} \ No newline at end of file
diff --git a/js/prototype-window-1.3/PWC-OS/pwc-os.js b/js/prototype-window-1.3/PWC-OS/pwc-os.js
new file mode 100755
index 0000000..1b475bc
--- /dev/null
+++ b/js/prototype-window-1.3/PWC-OS/pwc-os.js
@@ -0,0 +1,103 @@
+// Overide WindowUtilities getPageSize to remove dock height (for maximized windows)
+WindowUtilities._oldGetPageSize = WindowUtilities.getPageSize;
+WindowUtilities.getPageSize = function() {
+ var size = WindowUtilities._oldGetPageSize();
+ var dockHeight = $('dock').getHeight();
+
+ size.pageHeight -= dockHeight;
+ size.windowHeight -= dockHeight;
+ return size;
+};
+
+
+// Overide Windows minimize to move window inside dock
+Object.extend(Windows, {
+ // Overide minimize function
+ minimize: function(id, event) {
+ var win = this.getWindow(id)
+ if (win && win.visible) {
+ // Hide current window
+ win.hide();
+
+ // Create a dock element
+ var element = document.createElement("span");
+ element.className = "dock_icon";
+ element.style.display = "none";
+ element.win = win;
+ $('dock').appendChild(element);
+ Event.observe(element, "mouseup", Windows.restore);
+ $(element).update(win.getTitle());
+
+ new Effect.Appear(element)
+ }
+ Event.stop(event);
+ },
+
+ // Restore function
+ restore: function(event) {
+ var element = Event.element(event);
+ // Show window
+ element.win.show();
+ //Windows.focus(element.win.getId());
+ element.win.toFront();
+ // Fade and destroy icon
+ new Effect.Fade(element, {afterFinish: function() {element.remove()}})
+ }
+})
+
+// blur focused window if click on document
+Event.observe(document, "click", function(event) {
+ var e = Event.element(event);
+ var win = e.up(".dialog");
+ var dock = e == $('dock') || e.up("#dock");
+ if (!win && !dock && Windows.focusedWindow) {
+ Windows.blur(Windows.focusedWindow.getId());
+ }
+})
+
+// Chnage theme callback
+var currentTheme = 0;
+function changeTheme(event) {
+ var index = Event.element(event).selectedIndex;
+ if (index == currentTheme)
+ return;
+
+ var theme, blurTheme;
+ switch (index) {
+ case 0:
+ theme = "mac_os_x";
+ blurTheme = "blur_os_x";
+ break;
+ case 1:
+ theme = "bluelighting";
+ blurTheme = "greylighting";
+ break;
+ case 2:
+ theme = "greenlighting";
+ blurTheme = "greylighting";
+ break;
+ }
+ Windows.windows.each(function(win) {
+ win.options.focusClassName = theme;
+ win.options.blurClassName = blurTheme;
+ win.changeClassName(blurTheme)
+ });
+ Windows.focusedWindow.changeClassName(theme);
+ currentTheme = index;
+}
+
+// Init webOS, create 3 windows
+function initWebOS() {
+ // Create 3 windows
+ $R(1,3).each(function(index) {
+ var win = new Window({className: "mac_os_x", blurClassName: "blur_os_x", title: "window #"+index, width:250, height:150, top: 100 + index*50, left:100 + index*50});
+ win.getContent().update("<h1>Window #" + index + "</h1>");
+ win.show();
+ })
+ //
+ $$("#theme select").first().selectedIndex = currentTheme;
+ Event.observe($$("#theme select").first(), "change", changeTheme);
+}
+Event.observe(window, "load", initWebOS)
+
+
diff --git a/js/prototype-window-1.3/README b/js/prototype-window-1.3/README
new file mode 100755
index 0000000..e2cb960
--- /dev/null
+++ b/js/prototype-window-1.3/README
@@ -0,0 +1,182 @@
+== Installation/Usage
+
+Just copy windows.js in your javascript directory, and default.css + default directory in your stylesheets directory
+See samples/index.html for more details and go on my web page : http://prototype-window.xilinus.com
+
+== Change log
+- 04/23/07 V 1.3
+ - Added: getTitle
+ - Added: blur/focus function on Windows module
+ - Added: onBlur event
+ - Fixed: WindowCloseKey works with URL content (iframe)
+ - Fixed: Modal window with a parent != document.body
+ - Updated: prototype 1.5RC3
+ - Updated: Dialog handle resizable,minimizable, maximizable, draggable and closable options
+- 02/27/07 V 1.2
+ - Added: gridX and gridY constructor's options to snap move and resize
+ - Added: Effect on modal overlay (fade/appear) only if effects.js in included.
+ You can change effect options (Windows.overlayShowEffectOptions and Windows.overlayHideEffectOptions).
+
+ - Fixed: Multimodal mode.
+ - Fixed: Works on WebKit.
+
+ - Beta: effects on minimize and maximize. You need to include window_effects.js to have them.
+
+- 02/17/07 V 1.1
+ - Constructor has been simplified, now you can just do win = new Window(). By default id is automatically generated and can be passed as options
+ win = new Window({id: "my_id", width: 100, height: 100})
+ Backward compatibility with old constructor win = new Window("my_id", {width: 100, height: 100})
+ - Observer event can be passed as window option: win = new Window({onClose: function() {alert('close')}})
+ - parent option can be id or element
+ - delegate has been removed (not really usefull) and0 setCloseCallback has been addedinstead. (It could be also passed as a constructor's option closeCallback: your_callcabck)
+ your_callcabck must return true to be able to close the window
+ - add onMove event
+ - fix constraint for minimized window
+ - destroyOnClose could be passed as constructor's option: win = new Window({destroyOnClose: true})
+ - constraint works for maximized windows
+ - Dialog ok and cancel parameters has been renamed to onOk and onCancel for coherence (ok and cancel still works)
+ - Update to Prototype 1.5 and script.aculo.us 1.7
+
+- 01/14/07 V 1.00
+ - add changeClassName to change look and feel dynamically.
+ - add constraint move. Constraint can be on a div or document.
+ - full top and bottom bar are use to move window.
+ - fixed computation of window width or height.
+ - add setURL/getURL/refresh and setHTMLContent. Content can be change dynamically.
+ - add tooltip.js add on. It's an add-on to add dynamically tooltips on a webpage (see samples/tooltips/tooltip.html)
+ Thanks to Jonathan Modell of 2moromedia.com.
+
+- 12/06/06 V 0.99
+ - remove addClass that automatically tries to include default.css
+ - add wired move/resize
+ - fix recenterAuto
+ - add show to WindowStore to be able to open a window the first time, wihtout any cookie (check samples/window_store/html)
+
+- 11/06/06 V 0.98
+ - new optional behavior for multi-level modal window.
+ - Two new add-ons (in window_ext.js file)
+ + WindowStore to save open/close window status.
+ + WindowCloseKey to handle escape key (or any keys) to close windows/dialogs
+
+- 10/26/06 V 0.97
+ - add recenterModal to constructor
+ - setAjaxContent eval response request
+ - modal window multi level
+ - fix close/closeAll issues
+ - add addCss (auto add default.css)
+
+- 09/26/06 V 0.96.3
+ - Fixed onClose, no more memory leak and nore issues with sound on IE (even on dialogs)
+ - add getLocation
+ - Debug select problem on Firefox
+ - change mouseup event to onclick event
+ - Fixed event propagation on mininize/maximize/close
+ - Add frameborder=0
+ - Add prototype_window_class_helper.rb by Jorge Díaz (http://xurde.info)
+
+- 07/22/06 V 0.96.2
+ - Fixed select issue in modal window
+
+- 07/15/06 V 0.96.1
+ - Bugs fixed
+ - Add isVisible()
+ - Update debug.js
+
+- 07/11/06 V 0.96
+ - New events onShow, onHide, onFocus
+ - isVisible()
+ - Autofit width or height if width or (NOT AND) height is set to null in the constructor
+ - updateWidth / updateHeight if you need to update width or height (useful after changing window content if you do not want scrollbars)
+ - Add top, left to showCenter(modal, top, left) optional arguments if you need to center only left or top value.
+
+- 06/30/06 V 0.95
+ - Now you can set windows or dialogs content with an Ajax request!!
+ - Fixed IE issue when you destroy window with an url that embeds mp3.
+ - Fixed buttonClass issue for Dialog.
+ - Update samples
+
+- 06/24/06 V 0.90
+ - Valid XHTML 1.0 Strict!
+ - Fixed minimize function
+ - Fixed destroy on window without hide effects
+ - No more text selection while dragging
+ - Add onMinimize/onMaximize event
+
+- 06/19/06 V 0.85.2
+ - Remove undeclared vars
+ - Set top/left to 0 if not specify
+ - Destroy objet after hide effect instead of before effect instead
+ - getSize
+ - add extended_debug.js (from Jason Pollard)
+
+- 06/13/06 V 0.85.1
+ - IE bug fixed
+
+- 06/12/06 V 0.85
+ - Autofit width or height for Dialog
+ - Better Move/Resize over
+ - Allow select in modal window (even on IE)
+ - WARNING, ok callback for Dialog should returns true to close the dialog
+ - better window HTML code (no more div inside the td)
+ - Add themes
+
+- 05/23/06 V 0.80
+ - Add setTitle
+ - Add setStatusBar
+ - Store minimize/maximize in the cookie (Thanks to Ifran)
+ - Add onload constructor parameter (Thanks to Ifran)
+ - Add button class for dialog (Thanks to Felix Shnir)
+
+- 05/09/06 V 0.75
+ - Update with Script.aculo.us 1.6.1 and Prototype 1.5.0_rc1
+ - Remove PNG for dialog overlay, use opacity as done in lightbox V2
+ - Add Windows.focusedWindow and Windows.closeAll
+ - Add name to iframe in case of url window
+ - Clean up code, use _ for private function (just name convention)
+ - Add Dialog.info function, usefull for for submit or notice info (in Rails)
+ - Add minimize and maximize buttons
+ - Add alert_lite.css without any images
+ - Debug
+
+- 04/15/06 V 0.70
+ - Add autoposition in setContent. The window will at the element location
+ - Add draggable/closable parameter if you need to specify is the window is draggable/closable or not
+ - Add parent parameter if you need a specific parent instead of body
+ - Better resize
+ - Add setCookie to store window location/size in a cookie
+ - Add parent.html sample
+
+- 04/05/06 V 0.65
+ - Update to Prototype 1.5.0_pre1, script.aculo.us 1.6.0
+ - Add setDestoyOnClose
+ - Add Windows Observer with onStartResize(), onEndResize(), onStartMove(), onEndMove(), onClose(), onDestroy() events
+ - Add setContent(id, autoresize)
+
+- 03/29/06 V 0.6
+ - Add Window delegate to manage close action
+ - Add modal mode and Dialog class with common panels: alert, confirm
+ - Clean HTML code and change caracters to lowercase to be XHTML compliant (thanks to nuxygen and Joseph)
+ - Add showEffectOptions, hideEffectOptions, effectOptions to Window constructor (thanks to Jon)
+ - Fix checkbox IE bug (big thanks to JCA)
+ - Fix other little bugs (thanks to nuxygen, Dennis, and all who sent me emails)
+ - Update samples/index.html
+ - Add new sample usng frame (samples/inset.html and samples/inframe.html but use only samples/inset.html)
+
+- 03/27/06 V 0.51
+ - New CSS theme structure
+ - Add url: constructor parameter to have a window with an URL content
+ - Add bottom/right constructor parameters
+ - Update sample files.
+
+- 03/24/06 V 0.50 Initial revision
+
+
+== License
+
+it is licensed under the terms of the MIT License, see the included MIT-LICENSE file.
+
+== Thanks
+To all of you who sent me bugs, patches and feature requests
+
+http://www.ciudadmovil.com.co/q/mod/mapa/conexion.php
+http://www.desyr.net/ \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/PWC-OS/body-bg.png b/js/prototype-window-1.3/documentation/PWC-OS/body-bg.png
new file mode 100755
index 0000000..a5226e0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/PWC-OS/body-bg.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/PWC-OS/button-bg.gif b/js/prototype-window-1.3/documentation/PWC-OS/button-bg.gif
new file mode 100755
index 0000000..1d9d503
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/PWC-OS/button-bg.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/PWC-OS/dock-bg.gif b/js/prototype-window-1.3/documentation/PWC-OS/dock-bg.gif
new file mode 100755
index 0000000..cb5febf
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/PWC-OS/dock-bg.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/PWC-OS/index.html b/js/prototype-window-1.3/documentation/PWC-OS/index.html
new file mode 100755
index 0000000..dd16f70
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/PWC-OS/index.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+
+ <link href="../themes/default.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/lighting.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/mac_os_x.css" rel="stylesheet" type="text/css"/>
+ <link href="./pwc-os.css" rel="stylesheet" type="text/css"/>
+
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/window_effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <script type="text/javascript" src="./pwc-os.js"> </script>
+ <title>PWC OS</title>
+
+</head>
+
+<body>
+<div id="dock">
+ <div id="theme">
+ Theme:
+ <select>
+ <option>Mac OS X</option>
+ <option>Blue lighting</option>
+ <option>Green lighting</option>
+ </select>
+ </div>
+</div>
+
+
+</body>
+</html>
diff --git a/js/prototype-window-1.3/documentation/PWC-OS/pwc-os.css b/js/prototype-window-1.3/documentation/PWC-OS/pwc-os.css
new file mode 100755
index 0000000..57dd07e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/PWC-OS/pwc-os.css
@@ -0,0 +1,36 @@
+body {
+ margin:0;
+ padding:0;
+ overflow: hidden;
+ background: #FFF8DD url(body-bg.png) no-repeat fixed center 10px;
+}
+
+#dock {
+ position:absolute;
+ bottom:0;
+ left:0;
+ width:100%;
+ height:26px;
+ background:transparent url(dock-bg.gif) repeat-x 0 0;
+ z-index: 100000;
+}
+
+.dock_icon {
+ float:left;
+ width:102px;
+ height:21px;
+ margin-top:3px;
+ background: url(button-bg.gif);
+ text-align:center;
+ font-size: 14px;
+ color: #000;
+ line-height: 22px;
+ margin-right:10px;
+ margin-left:10px;
+}
+
+#theme {
+ float:right;
+ margin-top:3px;
+ margin-right:15px;
+} \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/PWC-OS/pwc-os.js b/js/prototype-window-1.3/documentation/PWC-OS/pwc-os.js
new file mode 100755
index 0000000..1b475bc
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/PWC-OS/pwc-os.js
@@ -0,0 +1,103 @@
+// Overide WindowUtilities getPageSize to remove dock height (for maximized windows)
+WindowUtilities._oldGetPageSize = WindowUtilities.getPageSize;
+WindowUtilities.getPageSize = function() {
+ var size = WindowUtilities._oldGetPageSize();
+ var dockHeight = $('dock').getHeight();
+
+ size.pageHeight -= dockHeight;
+ size.windowHeight -= dockHeight;
+ return size;
+};
+
+
+// Overide Windows minimize to move window inside dock
+Object.extend(Windows, {
+ // Overide minimize function
+ minimize: function(id, event) {
+ var win = this.getWindow(id)
+ if (win && win.visible) {
+ // Hide current window
+ win.hide();
+
+ // Create a dock element
+ var element = document.createElement("span");
+ element.className = "dock_icon";
+ element.style.display = "none";
+ element.win = win;
+ $('dock').appendChild(element);
+ Event.observe(element, "mouseup", Windows.restore);
+ $(element).update(win.getTitle());
+
+ new Effect.Appear(element)
+ }
+ Event.stop(event);
+ },
+
+ // Restore function
+ restore: function(event) {
+ var element = Event.element(event);
+ // Show window
+ element.win.show();
+ //Windows.focus(element.win.getId());
+ element.win.toFront();
+ // Fade and destroy icon
+ new Effect.Fade(element, {afterFinish: function() {element.remove()}})
+ }
+})
+
+// blur focused window if click on document
+Event.observe(document, "click", function(event) {
+ var e = Event.element(event);
+ var win = e.up(".dialog");
+ var dock = e == $('dock') || e.up("#dock");
+ if (!win && !dock && Windows.focusedWindow) {
+ Windows.blur(Windows.focusedWindow.getId());
+ }
+})
+
+// Chnage theme callback
+var currentTheme = 0;
+function changeTheme(event) {
+ var index = Event.element(event).selectedIndex;
+ if (index == currentTheme)
+ return;
+
+ var theme, blurTheme;
+ switch (index) {
+ case 0:
+ theme = "mac_os_x";
+ blurTheme = "blur_os_x";
+ break;
+ case 1:
+ theme = "bluelighting";
+ blurTheme = "greylighting";
+ break;
+ case 2:
+ theme = "greenlighting";
+ blurTheme = "greylighting";
+ break;
+ }
+ Windows.windows.each(function(win) {
+ win.options.focusClassName = theme;
+ win.options.blurClassName = blurTheme;
+ win.changeClassName(blurTheme)
+ });
+ Windows.focusedWindow.changeClassName(theme);
+ currentTheme = index;
+}
+
+// Init webOS, create 3 windows
+function initWebOS() {
+ // Create 3 windows
+ $R(1,3).each(function(index) {
+ var win = new Window({className: "mac_os_x", blurClassName: "blur_os_x", title: "window #"+index, width:250, height:150, top: 100 + index*50, left:100 + index*50});
+ win.getContent().update("<h1>Window #" + index + "</h1>");
+ win.show();
+ })
+ //
+ $$("#theme select").first().selectedIndex = currentTheme;
+ Event.observe($$("#theme select").first(), "change", changeTheme);
+}
+Event.observe(window, "load", initWebOS)
+
+
diff --git a/js/prototype-window-1.3/documentation/debug.html b/js/prototype-window-1.3/documentation/debug.html
new file mode 100755
index 0000000..c38b0a8
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/debug.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Prototype Window Class : Debug</title>
+ <!-- Prototype Window Class Part -->
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <script type="text/javascript" src="../javascripts/extended_debug.js"> </script>
+
+ <link href="../themes/default.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/debug.css" rel="stylesheet" type="text/css" > </link>
+
+ <!-- Doc Part-->
+ <link href="stylesheets/style.css" rel="stylesheet" type="text/css" > </link>
+ <script type="text/javascript" src="js/application.js"> </script>
+</head>
+
+<body>
+ <script>Application.insertNavigation('debug')</script>
+ <div id="wrapper">
+ <div id= "content" class="content">
+
+In addtion of <tt>window.js</tt>, there is a little javascript <tt>debug.js</tt> more usefull than the alert javascript function to display debug information.
+
+There are few functions:
+<ul>
+ <li> <tt>showDebug()</tt> : to open the debug window.</li>
+ <li> <tt>hideDebug()</tt> to remove it.</li>
+ <li> <tt>debug(message, reverse)</tt>: to display a message in the debug window. reverse is optional if you want to append text at the beginning of the window instead of the end.</li>
+ <li> <tt>clearDebug()</tt>: to clear debug window content.</li>
+</ul>
+Just add this lines in your HTML page
+<xmp><script type="text/javascript" src="/javascripts/prototype.js"> </script>
+<script type="text/javascript" src="/javascripts/window.js"> </script>
+<script type="text/javascript" src="/javascripts/debug.js"> </script>
+
+<link href="/stylesheets/themes/default.css" rel="stylesheet" type="text/css"></link>
+<link href="/stylesheets/themes/debug.css" rel="stylesheet" type="text/css"></link>
+</xmp>
+
+<br/>And this in your code
+<xmp><script>showDebug()</script>
+</xmp>
+<br/>This window uses setCookie() to save its size and position. You will see after using it you cannot live without :).<br/>
+<a href="javascript:showDebugWindow()">Click here</a> to open the debug window that displays mouse coordinates.
+
+<script>
+var mouseTracker = null;
+var MouseTracker = Class.create();
+MouseTracker.prototype = {
+ initialize: function() {
+ this.eventMouseMove = this.mouseMoved.bindAsEventListener(this);
+ Event.observe(document, "mousemove", this.eventMouseMove);
+ },
+ destroy: function() {
+ Event.stopObserving(document, "mousemove", this.eventMouseMove);
+ },
+ mouseMoved: function(event) {
+ var pointer = [Event.pointerX(event), Event.pointerY(event)];
+ clearDebug();
+ debug("Mouse : " + pointer[0] + "," + + pointer[1]);
+ }
+}
+
+function showDebugWindow() {
+ if (mouseTracker == null)
+ mouseTracker = new MouseTracker();
+ hideDebug();
+ showDebug();
+}
+
+</script>
+
+<h2 id="addon">Add on</h2>
+Nick Hemsley has done a nice add-on to the debug window that allows you to inspect any object.<br/>
+<a href="javascript:editAddOn()">Click here</a> to inspect the H2 "Add on" title.
+
+<script>
+function editAddOn(){
+ if (mouseTracker != null) {
+ mouseTracker.destroy();
+ mouseTracker = null;
+ }
+ showDebug();
+ clearDebug();
+ inspect($('addon'));
+}
+</script>
+
+<h2 id="addon">Add on - extended</h2>
+Jason Pollard has included the Nick's add-on inside the window debug by adding a "inspect" icon in the top bar. <br/>
+Click on the <img src="../themes/default/inspect.gif"> icon and then click on an element in the page you want to inspect.<br/>
+He has also included an eval text field with history (use up and down keys).<br/><br/>
+To use it just include <tt>extended_debug.js</tt> after <tt>debug.js</tt>.<br/>
+
+<a href="javascript:showExtendedDebug()">Click here</a> to open the extended debug window.
+
+ </div>
+</div>
+<script type="text/javascript">Application.addRightColumn()</script>
+
+</body>
+</html>
diff --git a/js/prototype-window-1.3/documentation/documentation.html b/js/prototype-window-1.3/documentation/documentation.html
new file mode 100755
index 0000000..97a8846
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/documentation.html
@@ -0,0 +1,544 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Prototype Window Class : Documentation</title>
+ <!-- Prototype Window Class Part -->
+ <script type="text/javascript" src="javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="javascripts/effects.js"> </script>
+ <script type="text/javascript" src="javascripts/window.js"> </script>
+ <script type="text/javascript" src="javascripts/debug.js"> </script>
+
+ <link href="themes/default.css" rel="stylesheet" type="text/css" > </link>
+
+ <!-- Doc Part-->
+ <link href="stylesheets/style.css" rel="stylesheet" type="text/css" > </link>
+ <script type="text/javascript" src="js/application.js"> </script>
+
+</head>
+
+<body onload="Application.insertDocOverview()">
+ <script>Application.insertNavigation('documentation')</script>
+
+ <div id="wrapper">
+ <div id= "content" class="content">
+ <h2 class="first"> Overview</h2>
+ <div id="Overview"></div>
+ <h2>Window Class</h2>
+ Main class to handle windows<br/><br/>
+ <div class="function window" title="keepMultiModalWindow"><a name="keepMultiModalWindow"></a>
+ <p class="title"><span class="function">Window.keepMultiModalWindow</span> Constant for multi modal window behavior.<br><br>
+ By default (<strong>Window.keepMultiModalWindow=false</strong>), a new modal window will hide the previous one. if <strong>Window.keepMultiModalWindow=true</strong>, a new modal window will move the previous one under the overlay. </p>
+ </div>
+ <br style='clear:both'/>
+ <div class="function window" title="initialize"><a name="initialize"></a>
+ <p class="title"><span class="function">initialize(id, options)</span> Window constructor used when creating new window (new Window(id, options))</p>
+ <!--
+ <p class="parameter_header">
+ <span class="field">Argument</span>
+ <span class="explanation">Description</span>
+ </p>
+ -->
+ <p class="parameter">
+ <span class="field">id</span>
+ <span class="explanation">DOM id of the window must be unique</span>
+ </p>
+ <p class="parameter">
+ <span class="field">options</span>
+ <span class="explanation">
+ Hash map of window options, here is the key list:
+ <table>
+ <tr><th>Key</th> <th>Default</th> <th>Description </th></tr>
+ <tr><td class="key">id</td> <td class="default">generated</td> <td class="detail">window DOM id. Must be unique </td></tr>
+ <tr><td class="key">className</td> <td class="default">dialog</td> <td class="detail">Class name prefix </td></tr>
+ <tr><td class="key">title</td> <td class="default">none</td> <td class="detail">Window's title </td></tr>
+ <tr><td class="key">url</td> <td class="default">none</td> <td class="detail">URL of window content (use an iframe)</td></tr>
+ <tr><td class="key">parent</td> <td class="default">body</td> <td class="detail">Parent node of the window </td></tr>
+ <tr><td class="key">top | bottom</td> <td class="default">top:0</td> <td class="detail">Top or bottom position of the window in pixels </td></tr>
+ <tr><td class="key">right | left</td> <td class="default">left:0</td> <td class="detail">Right or left position of the window in pixels</td></tr>
+ <tr><td class="key">width / height</td> <td class="default">100</td> <td class="detail">width and height of the window </td></tr>
+ <tr><td class="key">maxWidth / maxHeight</td> <td class="default">none</td> <td class="detail">Maximum width and height of the window</td></tr>
+ <tr><td class="key">minWidth / minHeight</td> <td class="default">100/20</td> <td class="detail">Minimum width and height of the window </td></tr>
+ <tr><td class="key">resizable</td> <td class="default">true</td> <td class="detail">Specify if the window can be resized </td></tr>
+ <tr><td class="key">closable</td> <td class="default">true</td> <td class="detail">Specify if the window can be closed </td></tr>
+ <tr><td class="key">minimizable</td> <td class="default">true</td> <td class="detail">Specify if the window can be minimized </td></tr>
+ <tr><td class="key">maximizable</td> <td class="default">true</td> <td class="detail">Specify if the window can be maximized</td></tr>
+ <tr><td class="key">draggable</td> <td class="default">true</td> <td class="detail">Specify if the window can be moved </td></tr>
+ <tr><td class="key">showEffect</td> <td class="default">Effect.Appear or<br> Element.show</td> <td class="detail">Show effect function. The default value depends if effect.js of script.aculo.us is included </td></tr>
+ <tr><td class="key">hideEffect</td> <td class="default">Effect.Fade or<br> Element.hide</td> <td class="detail">Hide effect function. The default value depends if effect.js of script.aculo.us is included </td></tr>
+ <tr><td class="key">showEffectOptions</td> <td class="default">none</td> <td class="detail">Show effect options (see script.aculo.us documentation).</td></tr>
+ <tr><td class="key">hideEffectOptions</td> <td class="default">none</td> <td class="detail">Hid effect options (see script.aculo.us documentation).</td></tr>
+ <tr><td class="key">effectOptions</td> <td class="default">none</td> <td class="detail">Show and hide effect options (see script.aculo.us documentation).</td></tr>
+ <tr><td class="key">onload</td> <td class="default">none</td> <td class="detail">Onload function of the main window div or iframe</td></tr>
+ <tr><td class="key">opacity</td> <td class="default">1</td> <td class="detail">Window opacity </td></tr>
+ <tr><td class="key">recenterAuto</td> <td class="default">true</td> <td class="detail">Recenter modal window when browser size has changed</td></tr>
+ <tr><td class="key">gridX</td> <td class="default">1</td> <td class="detail">Move and resize will snap on a grid</td></tr>
+ <tr><td class="key">gridY</td> <td class="default">1</td> <td class="detail">Move and resize will snap on a grid</td></tr>
+ <tr><td class="key">recenterAuto</td> <td class="default">true</td> <td class="detail">Recenter modal window when browser size has changed</td></tr>
+ <tr><td class="key">wiredDrag</td> <td class="default">false</td> <td class="detail">Move/Resize will be done with a wired frame (customizable in CSS, class <strong>&lt;className&gt;_wired_frame</strong>. Look in alphacube.css for an example) </td></tr>
+ <tr><td class="key">destroyOnClose</td> <td class="default">false</td> <td class="detail">Destroy window when closing window. By default, the window is just hidden</td></tr>
+
+ <tr><td class="key">all callbacks</td> <td class="default">none</td> <td class="detail">All callback used in observer. Callbacks override observer callbacks:<br/>
+ <em>onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose</em>
+ </td></tr>
+ </table>
+ </span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="destroy"><a name="destroy"></a>
+ <p class="title"><span class="function">destroy()</span> Window destructor</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="getId"><a name="getId"></a>
+ <p class="title"><span class="function">getId()</span> Returns current window id</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setDestroyOnClose"><a name="setDestroyOnClose"></a>
+ <p class="title"><span class="function">setDestroyOnClose()</span> The window will be destroy by clicking on close button instead of being hidden</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setCloseCallback"><a name="setCloseCallback"></a>
+ <p class="title"><span class="function">setCloseCallback(function)</span> Sets close callback function</p>
+ <p class="parameter">
+ <span class="field">function</span>
+ <span class="explanation">Close callback function, return true if the window can be closed, else return false</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setContent"><a name="setContent"></a>
+ <p class="title"><span class="function">setContent(id, autoresize, autoposition)</span> Sets window content using an existing element (does not work with url/iframe)</p>
+ <p class="parameter">
+ <span class="field">id</span>
+ <span class="explanation">Element id to insert in the window</span>
+ </p>
+ <p class="parameter">
+ <span class="field">autoresize (default false)</span>
+ <span class="explanation">Resizes the window to fit with its content</span>
+ </p>
+ <p class="parameter">
+ <span class="field">autoposition (default false)</span>
+ <span class="explanation">Sets the current window position to the specified input element</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setHTMLContent"><a name="setHTMLContent"></a>
+ <p class="title"><span class="function">setHTMLContent(html)</span> Sets window HTML content.</p>
+ <p class="parameter">
+ <span class="field">html</span>
+ <span class="explanation">HTML code</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setURL"><a name="setURL"></a>
+ <p class="title"><span class="function">setURL(url)</span> Sets window content using an URL.</p>
+ <p class="parameter">
+ <span class="field">url</span>
+ <span class="explanation">URL for content (content will be shown using an iframe)</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="getURL"><a name="getURL"></a>
+ <p class="title"><span class="function">getURL()</span> Returns window URL content. Returns nil if content is not an url.</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="refresh"><a name="refresh"></a>
+ <p class="title"><span class="function">refresh()</span> Refreshes window URL content.s</p>
+ </div>
+ <br style='clear:both'/>
+
+
+ <div class="function window" title="setAjaxContent"><a name="setAjaxContent"></a>
+ <p class="title"><span class="function">setAjaxContent(url, options, showCentered, showModal)</span> Sets window content using an Ajax request. The request must return HTML code. See script.aculo.us <a href="http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request">Ajax.request </a>documentation for details. When the response is received, the window is shown.</p>
+ <p class="parameter">
+ <span class="field">url</span>
+ <span class="explanation">Ajax request URL</span>
+ </p>
+ <p class="parameter">
+ <span class="field">options</span>
+ <span class="explanation">Ajax request options</span>
+ </p>
+ <p class="parameter">
+ <span class="field">showCentered (default false)</span>
+ <span class="explanation">Displays window centered when response is received</span>
+ </p>
+ <p class="parameter">
+ <span class="field">showModal (default false)</span>
+ <span class="explanation">Displays window in modal mode when response is received</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+
+
+
+ <div class="function window" title="getContent"><a name="getContent"></a>
+ <p class="title"><span class="function">getContent()</span> Returns current window content (a div or an iframe)</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setCookie"><a name="setCookie"></a>
+ <p class="title"><span class="function">setCookie(name, expires, path, domain, secure)</span> Sets cookie informations to store window size and position</p>
+ <p class="parameter">
+ <span class="field">name (default window's id)</span>
+ <span class="explanation">Cookie name</span>
+ </p>
+ <p class="parameter">
+ <span class="field">expires, path, domain, secure</span>
+ <span class="explanation">Cookie attributes</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setLocation"><a name="setLocation"></a>
+ <p class="title"><span class="function">setLocation(top, left)</span> Sets window top-left position</p>
+ <p class="parameter">
+ <span class="field">top</span>
+ <span class="explanation">Top position in pixels</span>
+ </p>
+ <p class="parameter">
+ <span class="field">bottom</span>
+ <span class="explanation">Bottom position in pixels</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="getSize"><a name="getSize"></a>
+ <p class="title"><span class="function">getSize()</span> Gets window content size. Return an hash with width and height as keys</p>
+ </div>
+ <div class="function window" title="setSize"><a name="setSize"></a>
+ <p class="title"><span class="function">setSize(width, height)</span> Sets window content size</p>
+ <p class="parameter">
+ <span class="field">width</span>
+ <span class="explanation">Width in pixels</span>
+ </p>
+ <p class="parameter">
+ <span class="field">height</span>
+ <span class="explanation">Height in pixels</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="updateWidth"><a name="updateWidth"></a>
+ <p class="title"><span class="function">updateWidth()</span> Recompute window width, useful when you change window content and do not want scrolling</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="updateHeight"><a name="updateHeight"></a>
+ <p class="title"><span class="function">updateHeight()</span> Recompute window height, useful when you change window content and do not want scrolling</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="toFront"><a name="toFront"></a>
+ <p class="title"><span class="function">toFront()</span> Brings current window in front of all others</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="show"><a name="show"></a>
+ <p class="title"><span class="function">show(modal)</span> Shows window at its current position</p>
+ <p class="parameter">
+ <span class="field">modal (default false)</span>
+ <span class="explanation">Modal mode</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="showCenter"><a name="showCenter"></a>
+ <p class="title"><span class="function">showCenter(modal, top, left)</span> Shows window in page's center. You can set top (or left) if you want to center only left (or top) value</p>
+ <p class="parameter">
+ <span class="field">modal (default false)</span>
+ <span class="field">top (default null)</span>
+ <span class="field">left (default null)</span>
+ <span class="explanation">Modal mode</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="minimize"><a name="minimize"></a>
+ <p class="title"><span class="function">minimize()</span> Minimizes the window, only top bar will be displayed</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="maximize"><a name="maximize"></a>
+ <p class="title"><span class="function">maximize()</span> Maximizes the window, the window will fit the viewable area of the page</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="isMinimized"><a name="isMinimized"></a>
+ <p class="title"><span class="function">isMinimized()</span> Returns true if the window is minimized</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="isMaximized"><a name="isMaximized"></a>
+ <p class="title"><span class="function">isMaximized()</span> Returns true if the window is maximized</p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setOpacity"><a name="setOpacity"></a>
+ <p class="title"><span class="function">setOpacity(opacity)</span> Sets window opacity</p>
+ <p class="parameter">
+ <span class="field">opacity</span>
+ <span class="explanation">Float value between 0 and 1</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setZIndex"><a name="setZIndex"></a>
+ <p class="title"><span class="function">setZIndex(zindex)</span> Sets window zindex</p>
+ <p class="parameter">
+ <span class="field">zindex</span>
+ <span class="explanation">Int value</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setTitle"><a name="setTitle"></a>
+ <p class="title"><span class="function">setTitle(title)</span> Sets window title</p>
+ <p class="parameter">
+ <span class="field">title</span>
+ <span class="explanation">Window title (can be null)</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="getTitle"><a name="setTitle"></a>
+ <p class="title"><span class="function">getTitle()</span> Gets window title</p>
+ <p class="parameter">
+ <span class="explanation">Return window's title</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function window" title="setStatusBar"><a name="setStatusBar"></a>
+ <p class="title"><span class="function">setStatusBar(element)</span> Sets window status bar</p>
+ <p class="parameter">
+ <span class="field">element</span>
+ <span class="explanation">Can be HTML code or an element</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+
+ <h2> Dialog module</h2>
+ Dialog factory to open alert/confirm/info modal panels<br/><br/>
+
+ <div class="function dialogmodule" title="confirm"><a name="confirm"></a>
+ <p class="title"><span class="function">confirm(content, options)</span> Opens a modal dialog with two buttons (ok/cancel for example)</p>
+ <p class="parameter">
+ <span class="field">content</span>
+ <span class="explanation">
+ - If the content is a string, it will be the message displayed in the dialog (HTML code)<br>
+ - If the content is an hash map, it will be used for setting content with an AJAX request. The hashmap must have url key and an optional options key (ajax options request)
+ </span>
+ </p>
+ <p class="parameter">
+ <span class="field">options</span>
+ <span class="explanation">
+ Hash map of dialog options, here is the key list:
+ <table>
+ <tr><th>Key</th> <th>Default</th> <th>Description </th></tr>
+ <tr><td class="key">top</td> <td class="default">null</td> <td class="detail">Top position </td></tr>
+ <tr><td class="key">left</td> <td class="default">null</td> <td class="detail">Left position </td></tr>
+ <tr><td class="key">okLabel</td> <td class="default">Ok</td> <td class="detail">Ok button label </td></tr>
+ <tr><td class="key">cancelLabel</td> <td class="default">Cancel</td> <td class="detail">Cancel button label </td></tr>
+ <tr><td class="key">onOk</td> <td class="default">none</td> <td class="detail">Ok callback function called on ok button</td></tr>
+ <tr><td class="key">onCancel</td> <td class="default">none</td> <td class="detail">Cancel callback function called on ok button </td></tr>
+ <tr><td class="key">buttonClass</td> <td class="default">none</td> <td class="detail">Ok/Cancel button css class name </td></tr>
+ <tr><td class="key">All window parameters</td> <td class="default">none</td> <td class="detail">Add all window constructor options </td></tr>
+ </table>
+ </span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function dialogmodule" title="alert"><a name="alert"></a>
+ <p class="title"><span class="function">alert(content, options)</span> Opens a modal alert with one button (ok for example)</p>
+ <p class="parameter">
+ <span class="field">content</span>
+ <span class="explanation">
+ - If the content is a string, it will be the message displayed in the dialog (HTML code)<br>
+ - If the content is an hash map, it will be used for setting content with an AJAX request. The hashmap must have url key and an optional options key (ajax options request)
+ </span>
+ </p>
+ <p class="parameter">
+ <span class="field">options</span>
+ <span class="explanation">
+ Hash map of dialog options, here is the key list:
+ <table>
+ <tr><th>Key</th> <th>Default</th> <th>Description </th></tr>
+ <tr><td class="key">top</td> <td class="default">null</td> <td class="detail">Top position </td></tr>
+ <tr><td class="key">left</td> <td class="default">null</td> <td class="detail">Left position </td></tr>
+ <tr><td class="key">okLabel</td> <td class="default">Ok</td> <td class="detail">Ok button label </td></tr>
+ <tr><td class="key">onOk</td> <td class="default">none</td> <td class="detail">Ok callback function called on ok button</td></tr>
+ <tr><td class="key">buttonClass</td> <td class="default">none</td> <td class="detail">Ok/Cancel button css class name </td></tr>
+ <tr><td class="key">All window parameters</td> <td class="default">none</td> <td class="detail">Add all window constructor options </td></tr>
+ </table>
+ </span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function dialogmodule" title="info"><a name="info"></a>
+ <p class="title"><span class="function">info(content, options)</span> Opens a modal info panel without any button. It can have a progress image (Used to display submit waiting message for example)</p>
+ <p class="parameter">
+ <span class="field">content</span>
+ <span class="explanation">
+ - If the content is a string, it will be the message displayed in the dialog (HTML code)<br>
+ - If the content is an hash map, it will be used for setting content with an AJAX request. The hashmap must have url key and an optional options key (ajax options request)
+ </span>
+ </p>
+ <p class="parameter">
+ <span class="field">options</span>
+ <span class="explanation">
+ Hash map of dialog options, here is the key list:
+ <table>
+ <tr><th>Key</th> <th>Default</th> <th>Description </th></tr>
+ <tr><td class="key">top</td> <td class="default">null</td> <td class="detail">Top position </td></tr>
+ <tr><td class="key">left</td> <td class="default">null</td> <td class="detail">Left position </td></tr>
+ <tr><td class="key">showProgress</td> <td class="default">false</td> <td class="detail">Add a progress image (info found in the css file) </td></tr>
+ <tr><td class="key">All window parameters</td> <td class="default">none</td> <td class="detail">Add all window constructor options </td></tr>
+ </table>
+ </span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function dialogmodule" title="setInfoMessage"><a name="setInfoMessage"></a>
+ <p class="title"><span class="function">setInfoMessage(message)</span> Sets info message (Used to display waiting information like 32% done for example)</p>
+ <p class="parameter">
+ <span class="field">message</span>
+ <span class="explanation">New info message</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function dialogmodule" title="closeInfo"><a name="closeInfo"></a>
+ <p class="title"><span class="function">closeInfo()</span> Closes the current modal dialog</p>
+ </div>
+ <div style="clear:both"></div>
+
+ <h2> Windows</h2>
+ Windows factory. Handles created windows, and windows observers<br/><br/>
+
+ <div class="function windows" title="overlayShowEffectOptions"><a name="overlayShowEffectOptions"></a>
+ <p class="title"><span class="function">overlayShowEffectOptions</span> Overlay show effect options. <br/> <br/>
+ By default it's <em>{duration: 0.5}</em>. If you set it to null, no effects will be applied
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function windows" title="overlayHideEffectOptions"><a name="overlayHideEffectOptions"></a>
+ <p class="title"><span class="function">overlayHideEffectOptions</span> Overlay hide effect options. <br/> <br/>
+ By default it's <em>{duration: 0.5}</em>. If you set it to null, no effects will be applied.
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function windows" title="addObserver"><a name="addObserver"></a>
+ <p class="title"><span class="function">addObserver(observer)</span> Registers a new windows observer. Should be able to respond to <br/>
+ <em>onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose</em>
+ </p>
+ <p class="parameter">
+ <span class="field">observer</span>
+ <span class="explanation">Observer object</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function windows" title="removeObserver"><a name="removeObserver"></a>
+ <p class="title"><span class="function">removeObserver(observer)</span> Unregisters a windows observer. </p>
+ <p class="parameter">
+ <span class="field">observer</span>
+ <span class="explanation">Observer object</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function windows" title="closeAll"><a name="closeAll"></a>
+ <p class="title"><span class="function">closeAll()</span> Closes all closeable windows. </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function windows" title="getFocusedWindow"><a name="getFocusedWindow"></a>
+ <p class="title"><span class="function">getFocusedWindow()</span> Returns the focused window. </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function windows" title="focus"><a name="focus"></a>
+ <p class="title"><span class="function">focus(id)</span> Focus a window using it's id. </p>
+ <p class="parameter">
+ <span class="field">id</span>
+ <span class="explanation">Window's id</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function windows" title="blur"><a name="focus"></a>
+ <p class="title"><span class="function">blur(id)</span> Blur a window using it's id. </p>
+ <p class="parameter">
+ <span class="field">id</span>
+ <span class="explanation">Window's id</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+
+ <h2> Add-ons</h2>
+ Add-on behaviors to PWC<br/><br/>
+ <div class="function addons" title="WindowsStore.init"><a name="WindowsStore.init"></a>
+ <p class="title"><span class="function">WindowsStore.init(cookieName, expired)</span> Save automatically show/hide window status. Just add WindowsStore.init() at the end of you HTML file. </p>
+ <p class="parameter">
+ <span class="field">cookieName</span>
+ <span class="explanation">Cookie name used to store window information (default: <em>__window_store__</em>)</span>
+ </p>
+ <p class="parameter">
+ <span class="field">expired</span>
+ <span class="explanation">Cookie expiration date (default: <em>In 3 years!!</em>)</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ <div class="function addons" title="WindowCloseKey.init"><a name="WindowCloseKey.init"></a>
+ <p class="title"><span class="function">WindowCloseKey.init(keyCode)</span> Handle key to close windows or dialogs. Just add WindowsStore.init() at the end of you HTML file. </p>
+ <p class="parameter">
+ <span class="field">keyCode</span>
+ <span class="explanation">Key used to close windows (default: <em>Event.KEY_ESC</em>)</span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+ <div class="function addons" title="TooltipManager"><a name="TooltipManager"></a>
+ <p class="title"><span class="function">TooltipManager</span> Singleton to handle tooltips using PWC. </p>
+ <p class="parameter">
+ <span class="explanation">Tooltips are not "regular" tooltips that show/hide on specific areas. Those tooltips are PWC windows that keeps alive in you move the mouse over it.
+ Like this, you can have forms, links are anything you want in your tooltips.<br/><br/>
+ Tooltips content can be set by giving a html element already present in the page (usually hidden), by ajax using an url or by url.
+ It works in two modes:
+ <li>An unobtrusive mode using specific class name. In this mode only HTML and Ajax content are supported</li>
+ <li>Regular mode by adding tooltip using javascript code.</li>
+ <br/>
+ Check sample code in samples/tooltips/tooltip.html to see how it works.
+ </span>
+ </p>
+ </div>
+ <br style='clear:both'/>
+
+ </div>
+ </div>
+ <script type="text/javascript">Application.addRightColumn()</script>
+ <br/>
+ <br/>
+</body>
+</html>
+
diff --git a/js/prototype-window-1.3/documentation/info_panel.html b/js/prototype-window-1.3/documentation/info_panel.html
new file mode 100755
index 0000000..2d8f9f3
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/info_panel.html
@@ -0,0 +1,31 @@
+<div style="padding:5px; text-align:center">
+<h2 class="intro_message" style="color:#17385B">Welcome to Prototype Window Class (PWC)</h2>
+<span class="intro_message">
+ Windows and Dialogs have never been so easy.<br>
+ New version 1.3 <br><br>
+</span>
+<div style="text-align:left; margin:10px">
+
+<ul class="intro_message">
+ <li> <em>Added: </em>getTitle </li>
+ <li> <em>Added: </em>blur/focus function on Windows module </li>
+ <li> <em> Added: </em>onBlur event </li>
+ <li> <em> Fixed: </em>WindowCloseKey works with URL content (iframe) </li>
+ <li> <em> Fixed: </em>Modal window with a parent != document.body </li>
+ <li> <em> Updated: </em>prototype 1.5RC3 </li>
+ <li> <em> Updated: </em>Dialog handle resizable,minimizable, maximizable, draggable and closable options </li>
+ </li>
+
+</ul>
+<br/>
+<div style="text-align:left; margin:10px; font-size:14px">
+
+I want to thanks <a style="color:#00650e" href="http://www.mila76.it">Emanuel Mila</a> for it's great theme (lighting in 4 colors!!), this dialog use blue lighting.<br/>
+And I added a new example/tutorial to show how to create a web os like with PWC.
+Check it out: <a style="color:#00650e" href="PWC-OS">PWC OS</a>
+</div>
+<br style="clear:both"/>
+</div>
+
+<h3 class="intro_message">If it's not your first visit, and if you have any troubles with samples, clear your cache.</h3>
+</div> \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/javascripts/debug.js b/js/prototype-window-1.3/documentation/javascripts/debug.js
new file mode 100755
index 0000000..3d8f338
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/debug.js
@@ -0,0 +1,137 @@
+var debugWindow = null;
+function debug(text, reverse) {
+ if (debugWindow == null)
+ return;
+
+ time = "-"; //new Date();
+ if (reverse) {
+ $('debug').innerHTML = time + " " + text + "<br>"+ $('debug').innerHTML;
+ debugWindow.getContent().scrollTop=0;
+ }
+ else {
+ $('debug').innerHTML += time + " " + text + "<br>";
+ debugWindow.getContent().scrollTop=10000; // Far away
+ }
+}
+
+function hideDebug() {
+ if (debugWindow) {
+ debugWindow.destroy();
+ debugWindow = null;
+ }
+}
+
+function showDebug(bShow) {
+ if (debugWindow == null) {
+ debugWindow = new Window('debug_window', {className: 'dialog',width:250, height:100, right:4, bottom:42, zIndex:1000, opacity:1, showEffect: Element.show, resizable: true, title: "Debug"})
+ debugWindow.getContent().innerHTML = "<style>#debug_window .dialog_content {background:#000;}</style> <div id='debug'></div>";
+ date=new Date;
+ date.setMonth(date.getMonth()+3);
+
+ //debugWindow.setCookie(null, date);
+ }
+ if( typeof bShow == 'undefined' || bShow)debugWindow.show()
+}
+
+
+function clearDebug() {
+ if (debugWindow == null)
+ return;
+ $('debug').innerHTML = "";
+}
+
+/**
+ * document.createElement convenience wrapper
+ *
+ * The data parameter is an object that must have the "tag" key, containing
+ * a string with the tagname of the element to create. It can optionally have
+ * a "children" key which can be: a string, "data" object, or an array of "data"
+ * objects to append to this element as children. Any other key is taken as an
+ * attribute to be applied to this tag.
+ *
+ * Available under an MIT license:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * @param {Object} data The data representing the element to create
+ * @return {Element} The element created.
+ */
+function $E(data) {
+ var el;
+ if ('string'==typeof data) {
+ el=document.createTextNode(data);
+ } else {
+ //create the element
+ el=document.createElement(data.tag);
+ delete(data.tag);
+
+ //append the children
+ if ('undefined'!=typeof data.children) {
+ if ('string'==typeof data.children ||'undefined'==typeof data.children.length) {
+ //strings and single elements
+ el.appendChild($E(data.children));
+ } else {
+ //arrays of elements
+ for (var i=0, child=null; 'undefined'!=typeof (child=data.children[i]); i++) {
+ el.appendChild($E(child));
+ }
+ }
+ delete(data.children);
+ }
+
+ //any other data is attributes
+ for (attr in data) {
+ el[attr]=data[attr];
+ }
+ }
+
+ return el;
+}
+
+// FROM Nick Hemsley
+var Debug = {
+ inspectOutput: function (container, within) {
+ within = within || debugWindow.getContent()
+
+ if (debugWindow == null)
+ return;
+
+ within.appendChild(container)
+ },
+
+ inspect: function(object) {
+ var cont = $E({tag: "div", className: "inspector"})
+ Debug.inspectObj(object, cont)
+ debugWindow.getContent().appendChild(cont)
+ },
+
+ inspectObj: function (object, container) {
+ for (prop in object) {
+ Debug.inspectOutput(Debug.inspectable(object, prop), container)
+ }
+ },
+
+ inspectable: function(object, prop) {
+ cont = $E({tag: 'div', className: 'inspectable', children: [prop + " value: " + object[prop] ]})
+ cont.toInspect = object[prop]
+ Event.observe(cont, 'click', Debug.inspectClicked, false)
+ return cont
+ },
+
+ inspectClicked: function(e) {
+ Debug.inspectContained(Event.element(e))
+ Event.stop(e)
+ },
+
+ inspectContained: function(container) {
+ if (container.opened) {
+ container.parentNode.removeChild(container.opened)
+ delete(container.opened)
+ } else {
+ sibling = container.parentNode.insertBefore($E({tag: "div", className: "child"}), container.nextSibling)
+ if (container.toInspect)
+ Debug.inspectObj(container.toInspect, sibling)
+ container.opened = sibling
+ }
+ }
+}
+var inspect = Debug.inspect;
diff --git a/js/prototype-window-1.3/documentation/javascripts/effects.js b/js/prototype-window-1.3/documentation/javascripts/effects.js
new file mode 100755
index 0000000..8a4a4f9
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/effects.js
@@ -0,0 +1,1094 @@
+// script.aculo.us effects.js v1.7.1_beta1, Mon Mar 12 14:40:50 +0100 2007
+
+// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Contributors:
+// Justin Palmer (http://encytemedia.com/)
+// Mark Pilgrim (http://diveintomark.org/)
+// Martin Bialasinki
+//
+// script.aculo.us is freely distributable under the terms of an MIT-style license.
+// For details, see the script.aculo.us web site: http://script.aculo.us/
+
+// converts rgb() and #xxx to #xxxxxx format,
+// returns self (or first argument) if not convertable
+String.prototype.parseColor = function() {
+ var color = '#';
+ if(this.slice(0,4) == 'rgb(') {
+ var cols = this.slice(4,this.length-1).split(',');
+ var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
+ } else {
+ if(this.slice(0,1) == '#') {
+ if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
+ if(this.length==7) color = this.toLowerCase();
+ }
+ }
+ return(color.length==7 ? color : (arguments[0] || this));
+}
+
+/*--------------------------------------------------------------------------*/
+
+Element.collectTextNodes = function(element) {
+ return $A($(element).childNodes).collect( function(node) {
+ return (node.nodeType==3 ? node.nodeValue :
+ (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
+ }).flatten().join('');
+}
+
+Element.collectTextNodesIgnoreClass = function(element, className) {
+ return $A($(element).childNodes).collect( function(node) {
+ return (node.nodeType==3 ? node.nodeValue :
+ ((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
+ Element.collectTextNodesIgnoreClass(node, className) : ''));
+ }).flatten().join('');
+}
+
+Element.setContentZoom = function(element, percent) {
+ element = $(element);
+ element.setStyle({fontSize: (percent/100) + 'em'});
+ if(Prototype.Browser.WebKit) window.scrollBy(0,0);
+ return element;
+}
+
+Element.getInlineOpacity = function(element){
+ return $(element).style.opacity || '';
+}
+
+Element.forceRerendering = function(element) {
+ try {
+ element = $(element);
+ var n = document.createTextNode(' ');
+ element.appendChild(n);
+ element.removeChild(n);
+ } catch(e) { }
+};
+
+/*--------------------------------------------------------------------------*/
+
+Array.prototype.call = function() {
+ var args = arguments;
+ this.each(function(f){ f.apply(this, args) });
+}
+
+/*--------------------------------------------------------------------------*/
+
+var Effect = {
+ _elementDoesNotExistError: {
+ name: 'ElementDoesNotExistError',
+ message: 'The specified DOM element does not exist, but is required for this effect to operate'
+ },
+ tagifyText: function(element) {
+ if(typeof Builder == 'undefined')
+ throw("Effect.tagifyText requires including script.aculo.us' builder.js library");
+
+ var tagifyStyle = 'position:relative';
+ if(Prototype.Browser.IE) tagifyStyle += ';zoom:1';
+
+ element = $(element);
+ $A(element.childNodes).each( function(child) {
+ if(child.nodeType==3) {
+ child.nodeValue.toArray().each( function(character) {
+ element.insertBefore(
+ Builder.node('span',{style: tagifyStyle},
+ character == ' ' ? String.fromCharCode(160) : character),
+ child);
+ });
+ Element.remove(child);
+ }
+ });
+ },
+ multiple: function(element, effect) {
+ var elements;
+ if(((typeof element == 'object') ||
+ (typeof element == 'function')) &&
+ (element.length))
+ elements = element;
+ else
+ elements = $(element).childNodes;
+
+ var options = Object.extend({
+ speed: 0.1,
+ delay: 0.0
+ }, arguments[2] || {});
+ var masterDelay = options.delay;
+
+ $A(elements).each( function(element, index) {
+ new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
+ });
+ },
+ PAIRS: {
+ 'slide': ['SlideDown','SlideUp'],
+ 'blind': ['BlindDown','BlindUp'],
+ 'appear': ['Appear','Fade']
+ },
+ toggle: function(element, effect) {
+ element = $(element);
+ effect = (effect || 'appear').toLowerCase();
+ var options = Object.extend({
+ queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
+ }, arguments[2] || {});
+ Effect[element.visible() ?
+ Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
+ }
+};
+
+var Effect2 = Effect; // deprecated
+
+/* ------------- transitions ------------- */
+
+Effect.Transitions = {
+ linear: Prototype.K,
+ sinoidal: function(pos) {
+ return (-Math.cos(pos*Math.PI)/2) + 0.5;
+ },
+ reverse: function(pos) {
+ return 1-pos;
+ },
+ flicker: function(pos) {
+ var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
+ return (pos > 1 ? 1 : pos);
+ },
+ wobble: function(pos) {
+ return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
+ },
+ pulse: function(pos, pulses) {
+ pulses = pulses || 5;
+ return (
+ Math.round((pos % (1/pulses)) * pulses) == 0 ?
+ ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) :
+ 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2))
+ );
+ },
+ none: function(pos) {
+ return 0;
+ },
+ full: function(pos) {
+ return 1;
+ }
+};
+
+/* ------------- core effects ------------- */
+
+Effect.ScopedQueue = Class.create();
+Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
+ initialize: function() {
+ this.effects = [];
+ this.interval = null;
+ },
+ _each: function(iterator) {
+ this.effects._each(iterator);
+ },
+ add: function(effect) {
+ var timestamp = new Date().getTime();
+
+ var position = (typeof effect.options.queue == 'string') ?
+ effect.options.queue : effect.options.queue.position;
+
+ switch(position) {
+ case 'front':
+ // move unstarted effects after this effect
+ this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
+ e.startOn += effect.finishOn;
+ e.finishOn += effect.finishOn;
+ });
+ break;
+ case 'with-last':
+ timestamp = this.effects.pluck('startOn').max() || timestamp;
+ break;
+ case 'end':
+ // start effect after last queued effect has finished
+ timestamp = this.effects.pluck('finishOn').max() || timestamp;
+ break;
+ }
+
+ effect.startOn += timestamp;
+ effect.finishOn += timestamp;
+
+ if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
+ this.effects.push(effect);
+
+ if(!this.interval)
+ this.interval = setInterval(this.loop.bind(this), 15);
+ },
+ remove: function(effect) {
+ this.effects = this.effects.reject(function(e) { return e==effect });
+ if(this.effects.length == 0) {
+ clearInterval(this.interval);
+ this.interval = null;
+ }
+ },
+ loop: function() {
+ var timePos = new Date().getTime();
+ for(var i=0, len=this.effects.length;i<len;i++)
+ this.effects[i] && this.effects[i].loop(timePos);
+ }
+});
+
+Effect.Queues = {
+ instances: $H(),
+ get: function(queueName) {
+ if(typeof queueName != 'string') return queueName;
+
+ if(!this.instances[queueName])
+ this.instances[queueName] = new Effect.ScopedQueue();
+
+ return this.instances[queueName];
+ }
+}
+Effect.Queue = Effect.Queues.get('global');
+
+Effect.DefaultOptions = {
+ transition: Effect.Transitions.sinoidal,
+ duration: 1.0, // seconds
+ fps: 100, // 100= assume 66fps max.
+ sync: false, // true for combining
+ from: 0.0,
+ to: 1.0,
+ delay: 0.0,
+ queue: 'parallel'
+}
+
+Effect.Base = function() {};
+Effect.Base.prototype = {
+ position: null,
+ start: function(options) {
+ function codeForEvent(options,eventName){
+ return (
+ (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
+ (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
+ );
+ }
+ if(options.transition === false) options.transition = Effect.Transitions.linear;
+ this.options = Object.extend(Object.extend({},Effect.DefaultOptions), options || {});
+ this.currentFrame = 0;
+ this.state = 'idle';
+ this.startOn = this.options.delay*1000;
+ this.finishOn = this.startOn+(this.options.duration*1000);
+ this.fromToDelta = this.options.to-this.options.from;
+ this.totalTime = this.finishOn-this.startOn;
+ this.totalFrames = this.options.fps*this.options.duration;
+
+ eval('this.render = function(pos){ '+
+ 'if(this.state=="idle"){this.state="running";'+
+ codeForEvent(options,'beforeSetup')+
+ (this.setup ? 'this.setup();':'')+
+ codeForEvent(options,'afterSetup')+
+ '};if(this.state=="running"){'+
+ 'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
+ 'this.position=pos;'+
+ codeForEvent(options,'beforeUpdate')+
+ (this.update ? 'this.update(pos);':'')+
+ codeForEvent(options,'afterUpdate')+
+ '}}');
+
+ this.event('beforeStart');
+ if(!this.options.sync)
+ Effect.Queues.get(typeof this.options.queue == 'string' ?
+ 'global' : this.options.queue.scope).add(this);
+ },
+ loop: function(timePos) {
+ if(timePos >= this.startOn) {
+ if(timePos >= this.finishOn) {
+ this.render(1.0);
+ this.cancel();
+ this.event('beforeFinish');
+ if(this.finish) this.finish();
+ this.event('afterFinish');
+ return;
+ }
+ var pos = (timePos - this.startOn) / this.totalTime,
+ frame = Math.round(pos * this.totalFrames);
+ if(frame > this.currentFrame) {
+ this.render(pos);
+ this.currentFrame = frame;
+ }
+ }
+ },
+ cancel: function() {
+ if(!this.options.sync)
+ Effect.Queues.get(typeof this.options.queue == 'string' ?
+ 'global' : this.options.queue.scope).remove(this);
+ this.state = 'finished';
+ },
+ event: function(eventName) {
+ if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
+ if(this.options[eventName]) this.options[eventName](this);
+ },
+ inspect: function() {
+ var data = $H();
+ for(property in this)
+ if(typeof this[property] != 'function') data[property] = this[property];
+ return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
+ }
+}
+
+Effect.Parallel = Class.create();
+Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), {
+ initialize: function(effects) {
+ this.effects = effects || [];
+ this.start(arguments[1]);
+ },
+ update: function(position) {
+ this.effects.invoke('render', position);
+ },
+ finish: function(position) {
+ this.effects.each( function(effect) {
+ effect.render(1.0);
+ effect.cancel();
+ effect.event('beforeFinish');
+ if(effect.finish) effect.finish(position);
+ effect.event('afterFinish');
+ });
+ }
+});
+
+Effect.Event = Class.create();
+Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), {
+ initialize: function() {
+ var options = Object.extend({
+ duration: 0
+ }, arguments[0] || {});
+ this.start(options);
+ },
+ update: Prototype.emptyFunction
+});
+
+Effect.Opacity = Class.create();
+Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ // make this work on IE on elements without 'layout'
+ if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
+ this.element.setStyle({zoom: 1});
+ var options = Object.extend({
+ from: this.element.getOpacity() || 0.0,
+ to: 1.0
+ }, arguments[1] || {});
+ this.start(options);
+ },
+ update: function(position) {
+ this.element.setOpacity(position);
+ }
+});
+
+Effect.Move = Class.create();
+Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({
+ x: 0,
+ y: 0,
+ mode: 'relative'
+ }, arguments[1] || {});
+ this.start(options);
+ },
+ setup: function() {
+ // Bug in Opera: Opera returns the "real" position of a static element or
+ // relative element that does not have top/left explicitly set.
+ // ==> Always set top and left for position relative elements in your stylesheets
+ // (to 0 if you do not need them)
+ this.element.makePositioned();
+ this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
+ this.originalTop = parseFloat(this.element.getStyle('top') || '0');
+ if(this.options.mode == 'absolute') {
+ // absolute movement, so we need to calc deltaX and deltaY
+ this.options.x = this.options.x - this.originalLeft;
+ this.options.y = this.options.y - this.originalTop;
+ }
+ },
+ update: function(position) {
+ this.element.setStyle({
+ left: Math.round(this.options.x * position + this.originalLeft) + 'px',
+ top: Math.round(this.options.y * position + this.originalTop) + 'px'
+ });
+ }
+});
+
+// for backwards compatibility
+Effect.MoveBy = function(element, toTop, toLeft) {
+ return new Effect.Move(element,
+ Object.extend({ x: toLeft, y: toTop }, arguments[3] || {}));
+};
+
+Effect.Scale = Class.create();
+Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
+ initialize: function(element, percent) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({
+ scaleX: true,
+ scaleY: true,
+ scaleContent: true,
+ scaleFromCenter: false,
+ scaleMode: 'box', // 'box' or 'contents' or {} with provided values
+ scaleFrom: 100.0,
+ scaleTo: percent
+ }, arguments[2] || {});
+ this.start(options);
+ },
+ setup: function() {
+ this.restoreAfterFinish = this.options.restoreAfterFinish || false;
+ this.elementPositioning = this.element.getStyle('position');
+
+ this.originalStyle = {};
+ ['top','left','width','height','fontSize'].each( function(k) {
+ this.originalStyle[k] = this.element.style[k];
+ }.bind(this));
+
+ this.originalTop = this.element.offsetTop;
+ this.originalLeft = this.element.offsetLeft;
+
+ var fontSize = this.element.getStyle('font-size') || '100%';
+ ['em','px','%','pt'].each( function(fontSizeType) {
+ if(fontSize.indexOf(fontSizeType)>0) {
+ this.fontSize = parseFloat(fontSize);
+ this.fontSizeType = fontSizeType;
+ }
+ }.bind(this));
+
+ this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
+
+ this.dims = null;
+ if(this.options.scaleMode=='box')
+ this.dims = [this.element.offsetHeight, this.element.offsetWidth];
+ if(/^content/.test(this.options.scaleMode))
+ this.dims = [this.element.scrollHeight, this.element.scrollWidth];
+ if(!this.dims)
+ this.dims = [this.options.scaleMode.originalHeight,
+ this.options.scaleMode.originalWidth];
+ },
+ update: function(position) {
+ var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
+ if(this.options.scaleContent && this.fontSize)
+ this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
+ this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
+ },
+ finish: function(position) {
+ if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
+ },
+ setDimensions: function(height, width) {
+ var d = {};
+ if(this.options.scaleX) d.width = Math.round(width) + 'px';
+ if(this.options.scaleY) d.height = Math.round(height) + 'px';
+ if(this.options.scaleFromCenter) {
+ var topd = (height - this.dims[0])/2;
+ var leftd = (width - this.dims[1])/2;
+ if(this.elementPositioning == 'absolute') {
+ if(this.options.scaleY) d.top = this.originalTop-topd + 'px';
+ if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
+ } else {
+ if(this.options.scaleY) d.top = -topd + 'px';
+ if(this.options.scaleX) d.left = -leftd + 'px';
+ }
+ }
+ this.element.setStyle(d);
+ }
+});
+
+Effect.Highlight = Class.create();
+Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});
+ this.start(options);
+ },
+ setup: function() {
+ // Prevent executing on elements not in the layout flow
+ if(this.element.getStyle('display')=='none') { this.cancel(); return; }
+ // Disable background image during the effect
+ this.oldStyle = {};
+ if (!this.options.keepBackgroundImage) {
+ this.oldStyle.backgroundImage = this.element.getStyle('background-image');
+ this.element.setStyle({backgroundImage: 'none'});
+ }
+ if(!this.options.endcolor)
+ this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
+ if(!this.options.restorecolor)
+ this.options.restorecolor = this.element.getStyle('background-color');
+ // init color calculations
+ this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
+ this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
+ },
+ update: function(position) {
+ this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
+ return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) });
+ },
+ finish: function() {
+ this.element.setStyle(Object.extend(this.oldStyle, {
+ backgroundColor: this.options.restorecolor
+ }));
+ }
+});
+
+Effect.ScrollTo = Class.create();
+Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ this.start(arguments[1] || {});
+ },
+ setup: function() {
+ Position.prepare();
+ var offsets = Position.cumulativeOffset(this.element);
+ if(this.options.offset) offsets[1] += this.options.offset;
+ var max = window.innerHeight ?
+ window.height - window.innerHeight :
+ document.body.scrollHeight -
+ (document.documentElement.clientHeight ?
+ document.documentElement.clientHeight : document.body.clientHeight);
+ this.scrollStart = Position.deltaY;
+ this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart;
+ },
+ update: function(position) {
+ Position.prepare();
+ window.scrollTo(Position.deltaX,
+ this.scrollStart + (position*this.delta));
+ }
+});
+
+/* ------------- combination effects ------------- */
+
+Effect.Fade = function(element) {
+ element = $(element);
+ var oldOpacity = element.getInlineOpacity();
+ var options = Object.extend({
+ from: element.getOpacity() || 1.0,
+ to: 0.0,
+ afterFinishInternal: function(effect) {
+ if(effect.options.to!=0) return;
+ effect.element.hide().setStyle({opacity: oldOpacity});
+ }}, arguments[1] || {});
+ return new Effect.Opacity(element,options);
+}
+
+Effect.Appear = function(element) {
+ element = $(element);
+ var options = Object.extend({
+ from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
+ to: 1.0,
+ // force Safari to render floated elements properly
+ afterFinishInternal: function(effect) {
+ effect.element.forceRerendering();
+ },
+ beforeSetup: function(effect) {
+ effect.element.setOpacity(effect.options.from).show();
+ }}, arguments[1] || {});
+ return new Effect.Opacity(element,options);
+}
+
+Effect.Puff = function(element) {
+ element = $(element);
+ var oldStyle = {
+ opacity: element.getInlineOpacity(),
+ position: element.getStyle('position'),
+ top: element.style.top,
+ left: element.style.left,
+ width: element.style.width,
+ height: element.style.height
+ };
+ return new Effect.Parallel(
+ [ new Effect.Scale(element, 200,
+ { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }),
+ new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],
+ Object.extend({ duration: 1.0,
+ beforeSetupInternal: function(effect) {
+ Position.absolutize(effect.effects[0].element)
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.hide().setStyle(oldStyle); }
+ }, arguments[1] || {})
+ );
+}
+
+Effect.BlindUp = function(element) {
+ element = $(element);
+ element.makeClipping();
+ return new Effect.Scale(element, 0,
+ Object.extend({ scaleContent: false,
+ scaleX: false,
+ restoreAfterFinish: true,
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping();
+ }
+ }, arguments[1] || {})
+ );
+}
+
+Effect.BlindDown = function(element) {
+ element = $(element);
+ var elementDimensions = element.getDimensions();
+ return new Effect.Scale(element, 100, Object.extend({
+ scaleContent: false,
+ scaleX: false,
+ scaleFrom: 0,
+ scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
+ restoreAfterFinish: true,
+ afterSetup: function(effect) {
+ effect.element.makeClipping().setStyle({height: '0px'}).show();
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.undoClipping();
+ }
+ }, arguments[1] || {}));
+}
+
+Effect.SwitchOff = function(element) {
+ element = $(element);
+ var oldOpacity = element.getInlineOpacity();
+ return new Effect.Appear(element, Object.extend({
+ duration: 0.4,
+ from: 0,
+ transition: Effect.Transitions.flicker,
+ afterFinishInternal: function(effect) {
+ new Effect.Scale(effect.element, 1, {
+ duration: 0.3, scaleFromCenter: true,
+ scaleX: false, scaleContent: false, restoreAfterFinish: true,
+ beforeSetup: function(effect) {
+ effect.element.makePositioned().makeClipping();
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
+ }
+ })
+ }
+ }, arguments[1] || {}));
+}
+
+Effect.DropOut = function(element) {
+ element = $(element);
+ var oldStyle = {
+ top: element.getStyle('top'),
+ left: element.getStyle('left'),
+ opacity: element.getInlineOpacity() };
+ return new Effect.Parallel(
+ [ new Effect.Move(element, {x: 0, y: 100, sync: true }),
+ new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
+ Object.extend(
+ { duration: 0.5,
+ beforeSetup: function(effect) {
+ effect.effects[0].element.makePositioned();
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
+ }
+ }, arguments[1] || {}));
+}
+
+Effect.Shake = function(element) {
+ element = $(element);
+ var oldStyle = {
+ top: element.getStyle('top'),
+ left: element.getStyle('left') };
+ return new Effect.Move(element,
+ { x: 20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
+ effect.element.undoPositioned().setStyle(oldStyle);
+ }}) }}) }}) }}) }}) }});
+}
+
+Effect.SlideDown = function(element) {
+ element = $(element).cleanWhitespace();
+ // SlideDown need to have the content of the element wrapped in a container element with fixed height!
+ var oldInnerBottom = element.down().getStyle('bottom');
+ var elementDimensions = element.getDimensions();
+ return new Effect.Scale(element, 100, Object.extend({
+ scaleContent: false,
+ scaleX: false,
+ scaleFrom: window.opera ? 0 : 1,
+ scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
+ restoreAfterFinish: true,
+ afterSetup: function(effect) {
+ effect.element.makePositioned();
+ effect.element.down().makePositioned();
+ if(window.opera) effect.element.setStyle({top: ''});
+ effect.element.makeClipping().setStyle({height: '0px'}).show();
+ },
+ afterUpdateInternal: function(effect) {
+ effect.element.down().setStyle({bottom:
+ (effect.dims[0] - effect.element.clientHeight) + 'px' });
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.undoClipping().undoPositioned();
+ effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
+ }, arguments[1] || {})
+ );
+}
+
+Effect.SlideUp = function(element) {
+ element = $(element).cleanWhitespace();
+ var oldInnerBottom = element.down().getStyle('bottom');
+ return new Effect.Scale(element, window.opera ? 0 : 1,
+ Object.extend({ scaleContent: false,
+ scaleX: false,
+ scaleMode: 'box',
+ scaleFrom: 100,
+ restoreAfterFinish: true,
+ beforeStartInternal: function(effect) {
+ effect.element.makePositioned();
+ effect.element.down().makePositioned();
+ if(window.opera) effect.element.setStyle({top: ''});
+ effect.element.makeClipping().show();
+ },
+ afterUpdateInternal: function(effect) {
+ effect.element.down().setStyle({bottom:
+ (effect.dims[0] - effect.element.clientHeight) + 'px' });
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom});
+ effect.element.down().undoPositioned();
+ }
+ }, arguments[1] || {})
+ );
+}
+
+// Bug in opera makes the TD containing this element expand for a instance after finish
+Effect.Squish = function(element) {
+ return new Effect.Scale(element, window.opera ? 1 : 0, {
+ restoreAfterFinish: true,
+ beforeSetup: function(effect) {
+ effect.element.makeClipping();
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping();
+ }
+ });
+}
+
+Effect.Grow = function(element) {
+ element = $(element);
+ var options = Object.extend({
+ direction: 'center',
+ moveTransition: Effect.Transitions.sinoidal,
+ scaleTransition: Effect.Transitions.sinoidal,
+ opacityTransition: Effect.Transitions.full
+ }, arguments[1] || {});
+ var oldStyle = {
+ top: element.style.top,
+ left: element.style.left,
+ height: element.style.height,
+ width: element.style.width,
+ opacity: element.getInlineOpacity() };
+
+ var dims = element.getDimensions();
+ var initialMoveX, initialMoveY;
+ var moveX, moveY;
+
+ switch (options.direction) {
+ case 'top-left':
+ initialMoveX = initialMoveY = moveX = moveY = 0;
+ break;
+ case 'top-right':
+ initialMoveX = dims.width;
+ initialMoveY = moveY = 0;
+ moveX = -dims.width;
+ break;
+ case 'bottom-left':
+ initialMoveX = moveX = 0;
+ initialMoveY = dims.height;
+ moveY = -dims.height;
+ break;
+ case 'bottom-right':
+ initialMoveX = dims.width;
+ initialMoveY = dims.height;
+ moveX = -dims.width;
+ moveY = -dims.height;
+ break;
+ case 'center':
+ initialMoveX = dims.width / 2;
+ initialMoveY = dims.height / 2;
+ moveX = -dims.width / 2;
+ moveY = -dims.height / 2;
+ break;
+ }
+
+ return new Effect.Move(element, {
+ x: initialMoveX,
+ y: initialMoveY,
+ duration: 0.01,
+ beforeSetup: function(effect) {
+ effect.element.hide().makeClipping().makePositioned();
+ },
+ afterFinishInternal: function(effect) {
+ new Effect.Parallel(
+ [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
+ new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
+ new Effect.Scale(effect.element, 100, {
+ scaleMode: { originalHeight: dims.height, originalWidth: dims.width },
+ sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
+ ], Object.extend({
+ beforeSetup: function(effect) {
+ effect.effects[0].element.setStyle({height: '0px'}).show();
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
+ }
+ }, options)
+ )
+ }
+ });
+}
+
+Effect.Shrink = function(element) {
+ element = $(element);
+ var options = Object.extend({
+ direction: 'center',
+ moveTransition: Effect.Transitions.sinoidal,
+ scaleTransition: Effect.Transitions.sinoidal,
+ opacityTransition: Effect.Transitions.none
+ }, arguments[1] || {});
+ var oldStyle = {
+ top: element.style.top,
+ left: element.style.left,
+ height: element.style.height,
+ width: element.style.width,
+ opacity: element.getInlineOpacity() };
+
+ var dims = element.getDimensions();
+ var moveX, moveY;
+
+ switch (options.direction) {
+ case 'top-left':
+ moveX = moveY = 0;
+ break;
+ case 'top-right':
+ moveX = dims.width;
+ moveY = 0;
+ break;
+ case 'bottom-left':
+ moveX = 0;
+ moveY = dims.height;
+ break;
+ case 'bottom-right':
+ moveX = dims.width;
+ moveY = dims.height;
+ break;
+ case 'center':
+ moveX = dims.width / 2;
+ moveY = dims.height / 2;
+ break;
+ }
+
+ return new Effect.Parallel(
+ [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
+ new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
+ new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
+ ], Object.extend({
+ beforeStartInternal: function(effect) {
+ effect.effects[0].element.makePositioned().makeClipping();
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
+ }, options)
+ );
+}
+
+Effect.Pulsate = function(element) {
+ element = $(element);
+ var options = arguments[1] || {};
+ var oldOpacity = element.getInlineOpacity();
+ var transition = options.transition || Effect.Transitions.sinoidal;
+ var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
+ reverser.bind(transition);
+ return new Effect.Opacity(element,
+ Object.extend(Object.extend({ duration: 2.0, from: 0,
+ afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
+ }, options), {transition: reverser}));
+}
+
+Effect.Fold = function(element) {
+ element = $(element);
+ var oldStyle = {
+ top: element.style.top,
+ left: element.style.left,
+ width: element.style.width,
+ height: element.style.height };
+ element.makeClipping();
+ return new Effect.Scale(element, 5, Object.extend({
+ scaleContent: false,
+ scaleX: false,
+ afterFinishInternal: function(effect) {
+ new Effect.Scale(element, 1, {
+ scaleContent: false,
+ scaleY: false,
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping().setStyle(oldStyle);
+ } });
+ }}, arguments[1] || {}));
+};
+
+Effect.Morph = Class.create();
+Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({
+ style: {}
+ }, arguments[1] || {});
+ if (typeof options.style == 'string') {
+ if(options.style.indexOf(':') == -1) {
+ var cssText = '', selector = '.' + options.style;
+ $A(document.styleSheets).reverse().each(function(styleSheet) {
+ if (styleSheet.cssRules) cssRules = styleSheet.cssRules;
+ else if (styleSheet.rules) cssRules = styleSheet.rules;
+ $A(cssRules).reverse().each(function(rule) {
+ if (selector == rule.selectorText) {
+ cssText = rule.style.cssText;
+ throw $break;
+ }
+ });
+ if (cssText) throw $break;
+ });
+ this.style = cssText.parseStyle();
+ options.afterFinishInternal = function(effect){
+ effect.element.addClassName(effect.options.style);
+ effect.transforms.each(function(transform) {
+ if(transform.style != 'opacity')
+ effect.element.style[transform.style] = '';
+ });
+ }
+ } else this.style = options.style.parseStyle();
+ } else this.style = $H(options.style)
+ this.start(options);
+ },
+ setup: function(){
+ function parseColor(color){
+ if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
+ color = color.parseColor();
+ return $R(0,2).map(function(i){
+ return parseInt( color.slice(i*2+1,i*2+3), 16 )
+ });
+ }
+ this.transforms = this.style.map(function(pair){
+ var property = pair[0], value = pair[1], unit = null;
+
+ if(value.parseColor('#zzzzzz') != '#zzzzzz') {
+ value = value.parseColor();
+ unit = 'color';
+ } else if(property == 'opacity') {
+ value = parseFloat(value);
+ if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
+ this.element.setStyle({zoom: 1});
+ } else if(Element.CSS_LENGTH.test(value)) {
+ var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+ value = parseFloat(components[1]);
+ unit = (components.length == 3) ? components[2] : null;
+ }
+
+ var originalValue = this.element.getStyle(property);
+ return {
+ style: property.camelize(),
+ originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),
+ targetValue: unit=='color' ? parseColor(value) : value,
+ unit: unit
+ };
+ }.bind(this)).reject(function(transform){
+ return (
+ (transform.originalValue == transform.targetValue) ||
+ (
+ transform.unit != 'color' &&
+ (isNaN(transform.originalValue) || isNaN(transform.targetValue))
+ )
+ )
+ });
+ },
+ update: function(position) {
+ var style = {}, transform, i = this.transforms.length;
+ while(i--)
+ style[(transform = this.transforms[i]).style] =
+ transform.unit=='color' ? '#'+
+ (Math.round(transform.originalValue[0]+
+ (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
+ (Math.round(transform.originalValue[1]+
+ (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() +
+ (Math.round(transform.originalValue[2]+
+ (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
+ transform.originalValue + Math.round(
+ ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit;
+ this.element.setStyle(style, true);
+ }
+});
+
+Effect.Transform = Class.create();
+Object.extend(Effect.Transform.prototype, {
+ initialize: function(tracks){
+ this.tracks = [];
+ this.options = arguments[1] || {};
+ this.addTracks(tracks);
+ },
+ addTracks: function(tracks){
+ tracks.each(function(track){
+ var data = $H(track).values().first();
+ this.tracks.push($H({
+ ids: $H(track).keys().first(),
+ effect: Effect.Morph,
+ options: { style: data }
+ }));
+ }.bind(this));
+ return this;
+ },
+ play: function(){
+ return new Effect.Parallel(
+ this.tracks.map(function(track){
+ var elements = [$(track.ids) || $$(track.ids)].flatten();
+ return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) });
+ }).flatten(),
+ this.options
+ );
+ }
+});
+
+Element.CSS_PROPERTIES = $w(
+ 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +
+ 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
+ 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
+ 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
+ 'fontSize fontWeight height left letterSpacing lineHeight ' +
+ 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
+ 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
+ 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
+ 'right textIndent top width wordSpacing zIndex');
+
+Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
+
+String.prototype.parseStyle = function(){
+ var element = document.createElement('div');
+ element.innerHTML = '<div style="' + this + '"></div>';
+ var style = element.childNodes[0].style, styleRules = $H();
+
+ Element.CSS_PROPERTIES.each(function(property){
+ if(style[property]) styleRules[property] = style[property];
+ });
+ if(Prototype.Browser.IE && this.indexOf('opacity') > -1) {
+ styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
+ }
+ return styleRules;
+};
+
+Element.morph = function(element, style) {
+ new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {}));
+ return element;
+};
+
+['getInlineOpacity','forceRerendering','setContentZoom',
+ 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each(
+ function(f) { Element.Methods[f] = Element[f]; }
+);
+
+Element.Methods.visualEffect = function(element, effect, options) {
+ s = effect.dasherize().camelize();
+ effect_class = s.charAt(0).toUpperCase() + s.substring(1);
+ new Effect[effect_class](element, options);
+ return $(element);
+};
+
+Element.addMethods(); \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/javascripts/extended_debug.js b/js/prototype-window-1.3/documentation/javascripts/extended_debug.js
new file mode 100755
index 0000000..2b935b1
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/extended_debug.js
@@ -0,0 +1,113 @@
+var commandHistory;
+var historyIndex;
+
+function showExtendedDebug() {
+ if (debugWindow != null) {
+ hideDebug();
+ }
+
+ if (debugWindow == null) {
+ commandHistory = new Array();
+ historyIndex = 0;
+
+ debugWindow = new Window('debug_window', {className: 'dialog',width:250, height:100, right:4, minWidth:250, bottom:42, zIndex:1000, opacity:1, showEffect: Element.show, resizable: true, title: "Debug"})
+ debugWindow.getContent().innerHTML = "<style>#debug_window .dialog_content {background:#000;}</style> <div font='monaco' id='debug' style='padding:3px;color:#0F0;font-family:monaco'></div>";
+
+ //create hourglass icon and attach events to it.
+ var cont = "<div id=\"debug_window_inspect\" style=\"width: 15px; height: 15px; background: transparent url(themes/default/inspect.gif) no-repeat 0 0; position:absolute; top:5px; left:70px; cursor:pointer; z-index:3000;\"></div>";
+
+ new Insertion.After('debug_window_maximize', cont);
+ Event.observe('debug_window_inspect', 'click', enterInspectionMode, false);
+
+ //create command text box
+ cont = "Eval:<input id=\"debug_window_command\" type=\"textbox\" style=\"width:150px; height: 12px; color: black;\">"
+ debugWindow.setStatusBar(cont);
+
+ Event.observe('debug_window_command', 'mousedown', donothing);
+ Event.observe('debug_window_command', 'keypress', evalJS, false);
+ }
+ debugWindow.show();
+}
+
+function donothing(evt){
+ Field.activate('debug_window_command');
+ return false;
+}
+
+function evalJS(evt){
+ if(evt.keyCode == Event.KEY_RETURN){
+ var js = $F('debug_window_command');
+ try{
+ var ret = eval(js);
+ if(ret != null)
+ debug(ret);
+ }catch(e){
+ debug(e);
+ }
+ $('debug_window_command').value = '';
+
+ Field.activate('debug_window_command');
+ commandHistory.push(js);
+ historyIndex = 0;
+ }
+
+ if(evt.keyCode == Event.KEY_UP){
+ if(commandHistory.length > historyIndex){
+ historyIndex++;
+ var js = commandHistory[commandHistory.length-historyIndex];
+ $('debug_window_command').value = js;
+ Event.stop(evt);
+ Field.activate('debug_window_command');
+ }
+ }
+
+ if(evt.keyCode == Event.KEY_DOWN){
+ if(commandHistory.length >= historyIndex && historyIndex > 1){
+ historyIndex--;
+ var js = commandHistory[commandHistory.length-historyIndex];
+ $('debug_window_command').value = js;
+ Event.stop(evt);
+ Field.activate('debug_window_command');
+ }
+ }
+}
+
+function enterInspectionMode(evt){
+ //stop observing magnifying glass
+ Event.stopObserving('debug_window_inspect', 'click', enterInspectionMode, false);
+ //change pointer
+ document.body.style.cursor='help';
+ //start observing mouse clicks
+ Event.observe(window, 'click', inspectItem, false);
+}
+
+function inspectItem(evt){
+ // the element that triggered the event
+ var element = Event.element(evt);
+ if(element.id!="debug_window_inspect"){
+ clearDebug()
+ //change pointer
+ document.body.style.cursor='default';
+ debug(element.id);
+ inspect(element);
+ //stop observing mouse clicks
+ Event.stopObserving(window, 'click', inspectItem, false);
+ //alert('doing something');
+ //start observing mag
+ Event.observe('debug_window_inspect', 'click', enterInspectionMode, false);
+ }
+}
+
+function clearDebug() {
+ var win = $('debug');
+ if (win == null)
+ return;
+
+ win.innerHTML=" ";
+ //clear inspections too
+ var divs = document.getElementsByClassName('inspector');
+ divs.each(function(div){
+ Element.remove(div);
+ });
+}
+
diff --git a/js/prototype-window-1.3/documentation/javascripts/prototype.js b/js/prototype-window-1.3/documentation/javascripts/prototype.js
new file mode 100755
index 0000000..5906575
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/prototype.js
@@ -0,0 +1,3269 @@
+/* Prototype JavaScript framework, version 1.5.1_rc3
+ * (c) 2005-2007 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+/*--------------------------------------------------------------------------*/
+
+var Prototype = {
+ Version: '1.5.1_rc3',
+
+ Browser: {
+ IE: !!(window.attachEvent && !window.opera),
+ Opera: !!window.opera,
+ WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
+ Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
+ },
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+ ElementExtensions: !!window.HTMLElement,
+ SpecificElementExtensions:
+ (document.createElement('div').__proto__ !==
+ document.createElement('form').__proto__)
+ },
+
+ ScriptFragment: '<script[^>]*>([\u0001-\uFFFF]*?)</script>',
+ JSONFilter: /^\/\*-secure-\s*(.*)\s*\*\/\s*$/,
+
+ emptyFunction: function() { },
+ K: function(x) { return x }
+}
+
+var Class = {
+ create: function() {
+ return function() {
+ this.initialize.apply(this, arguments);
+ }
+ }
+}
+
+var Abstract = new Object();
+
+Object.extend = function(destination, source) {
+ for (var property in source) {
+ destination[property] = source[property];
+ }
+ return destination;
+}
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (object === undefined) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : object.toString();
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ toJSON: function(object) {
+ var type = typeof object;
+ switch(type) {
+ case 'undefined':
+ case 'function':
+ case 'unknown': return;
+ case 'boolean': return object.toString();
+ }
+ if (object === null) return 'null';
+ if (object.toJSON) return object.toJSON();
+ if (object.ownerDocument === document) return;
+ var results = [];
+ for (var property in object) {
+ var value = Object.toJSON(object[property]);
+ if (value !== undefined)
+ results.push(property.toJSON() + ': ' + value);
+ }
+ return '{' + results.join(', ') + '}';
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({}, object);
+ }
+});
+
+Function.prototype.bind = function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ return __method.apply(object, args.concat($A(arguments)));
+ }
+}
+
+Function.prototype.bindAsEventListener = function(object) {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function(event) {
+ return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments)));
+ }
+}
+
+Object.extend(Number.prototype, {
+ toColorPart: function() {
+ return this.toPaddedString(2, 16);
+ },
+
+ succ: function() {
+ return this + 1;
+ },
+
+ times: function(iterator) {
+ $R(0, this, true).each(iterator);
+ return this;
+ },
+
+ toPaddedString: function(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ },
+
+ toJSON: function() {
+ return isFinite(this) ? this.toString() : 'null';
+ }
+});
+
+Date.prototype.toJSON = function() {
+ return '"' + this.getFullYear() + '-' +
+ (this.getMonth() + 1).toPaddedString(2) + '-' +
+ this.getDate().toPaddedString(2) + 'T' +
+ this.getHours().toPaddedString(2) + ':' +
+ this.getMinutes().toPaddedString(2) + ':' +
+ this.getSeconds().toPaddedString(2) + '"';
+};
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) {}
+ }
+
+ return returnValue;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create();
+PeriodicalExecuter.prototype = {
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.callback(this);
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+}
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, {
+ gsub: function(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = arguments.callee.prepareReplacement(replacement);
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ },
+
+ sub: function(pattern, replacement, count) {
+ replacement = this.gsub.prepareReplacement(replacement);
+ count = count === undefined ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ },
+
+ scan: function(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return this;
+ },
+
+ truncate: function(length, truncation) {
+ length = length || 30;
+ truncation = truncation === undefined ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : this;
+ },
+
+ strip: function() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ },
+
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ },
+
+ escapeHTML: function() {
+ var self = arguments.callee;
+ self.text.data = this;
+ return self.div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = document.createElement('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0] ? (div.childNodes.length > 1 ?
+ $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
+ div.childNodes[0].nodeValue) : '';
+ },
+
+ toQueryParams: function(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return {};
+
+ return match[1].split(separator || '&').inject({}, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift());
+ var value = pair.length > 1 ? pair.join('=') : pair[0];
+ if (value != undefined) value = decodeURIComponent(value);
+
+ if (key in hash) {
+ if (hash[key].constructor != Array) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ },
+
+ toArray: function() {
+ return this.split('');
+ },
+
+ succ: function() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ },
+
+ times: function(count) {
+ var result = '';
+ for (var i = 0; i < count; i++) result += this;
+ return result;
+ },
+
+ camelize: function() {
+ var parts = this.split('-'), len = parts.length;
+ if (len == 1) return parts[0];
+
+ var camelized = this.charAt(0) == '-'
+ ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+ : parts[0];
+
+ for (var i = 1; i < len; i++)
+ camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+ return camelized;
+ },
+
+ capitalize: function() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ },
+
+ underscore: function() {
+ return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
+ },
+
+ dasherize: function() {
+ return this.gsub(/_/,'-');
+ },
+
+ inspect: function(useDoubleQuotes) {
+ var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
+ var character = String.specialChar[match[0]];
+ return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ },
+
+ toJSON: function() {
+ return this.inspect(true);
+ },
+
+ unfilterJSON: function(filter) {
+ return this.sub(filter || Prototype.JSONFilter, '#{1}');
+ },
+
+ evalJSON: function(sanitize) {
+ var json = this.unfilterJSON();
+ try {
+ if (!sanitize || (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json)))
+ return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ },
+
+ include: function(pattern) {
+ return this.indexOf(pattern) > -1;
+ },
+
+ startsWith: function(pattern) {
+ return this.indexOf(pattern) === 0;
+ },
+
+ endsWith: function(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.lastIndexOf(pattern) === d;
+ },
+
+ empty: function() {
+ return this == '';
+ },
+
+ blank: function() {
+ return /^\s*$/.test(this);
+ }
+});
+
+if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
+ escapeHTML: function() {
+ return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ },
+ unescapeHTML: function() {
+ return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+ }
+});
+
+String.prototype.gsub.prepareReplacement = function(replacement) {
+ if (typeof replacement == 'function') return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+}
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+Object.extend(String.prototype.escapeHTML, {
+ div: document.createElement('div'),
+ text: document.createTextNode('')
+});
+
+with (String.prototype.escapeHTML) div.appendChild(text);
+
+var Template = Class.create();
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+Template.prototype = {
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ return this.template.gsub(this.pattern, function(match) {
+ var before = match[1];
+ if (before == '\\') return match[2];
+ return before + String.interpret(object[match[3]]);
+ });
+ }
+}
+
+var $break = new Object();
+var $continue = new Object();
+
+var Enumerable = {
+ each: function(iterator) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ iterator(value, index++);
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ },
+
+ eachSlice: function(number, iterator) {
+ var index = -number, slices = [], array = this.toArray();
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.map(iterator);
+ },
+
+ all: function(iterator) {
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!(iterator || Prototype.K)(value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ },
+
+ any: function(iterator) {
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!(iterator || Prototype.K)(value, index))
+ throw $break;
+ });
+ return result;
+ },
+
+ collect: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push((iterator || Prototype.K)(value, index));
+ });
+ return results;
+ },
+
+ detect: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator(value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(pattern, iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ var stringValue = value.toString();
+ if (stringValue.match(pattern))
+ results.push((iterator || Prototype.K)(value, index));
+ })
+ return results;
+ },
+
+ include: function(object) {
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ },
+
+ inGroupsOf: function(number, fillWith) {
+ fillWith = fillWith === undefined ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ },
+
+ inject: function(memo, iterator) {
+ this.each(function(value, index) {
+ memo = iterator(memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (result == undefined || value >= result)
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (result == undefined || value < result)
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator) {
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ ((iterator || Prototype.K)(value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator) {
+ return this.map(function(value, index) {
+ return {value: value, criteria: iterator(value, index)};
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.map();
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (typeof args.last() == 'function')
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ },
+
+ size: function() {
+ return this.toArray().length;
+ },
+
+ inspect: function() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+}
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray
+});
+var $A = Array.from = function(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) {
+ return iterable.toArray();
+ } else {
+ var results = [];
+ for (var i = 0, length = iterable.length; i < length; i++)
+ results.push(iterable[i]);
+ return results;
+ }
+}
+
+if (Prototype.Browser.WebKit) {
+ $A = Array.from = function(iterable) {
+ if (!iterable) return [];
+ if (!(typeof iterable == 'function' && iterable == '[object NodeList]') &&
+ iterable.toArray) {
+ return iterable.toArray();
+ } else {
+ var results = [];
+ for (var i = 0, length = iterable.length; i < length; i++)
+ results.push(iterable[i]);
+ return results;
+ }
+ }
+}
+
+Object.extend(Array.prototype, Enumerable);
+
+if (!Array.prototype._reverse)
+ Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0, length = this.length; i < length; i++)
+ iterator(this[i]);
+ },
+
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ },
+
+ compact: function() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ },
+
+ flatten: function() {
+ return this.inject([], function(array, value) {
+ return array.concat(value && value.constructor == Array ?
+ value.flatten() : [value]);
+ });
+ },
+
+ without: function() {
+ var values = $A(arguments);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ },
+
+ indexOf: function(object) {
+ for (var i = 0, length = this.length; i < length; i++)
+ if (this[i] == object) return i;
+ return -1;
+ },
+
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
+ },
+
+ reduce: function() {
+ return this.length > 1 ? this : this[0];
+ },
+
+ uniq: function(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ },
+
+ clone: function() {
+ return [].concat(this);
+ },
+
+ size: function() {
+ return this.length;
+ },
+
+ inspect: function() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ },
+
+ toJSON: function() {
+ var results = [];
+ this.each(function(object) {
+ var value = Object.toJSON(object);
+ if (value !== undefined) results.push(value);
+ });
+ return '[' + results.join(', ') + ']';
+ }
+});
+
+Array.prototype.toArray = Array.prototype.clone;
+
+function $w(string) {
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+if (Prototype.Browser.Opera){
+ Array.prototype.concat = function() {
+ var array = [];
+ for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ if (arguments[i].constructor == Array) {
+ for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
+ array.push(arguments[i][j]);
+ } else {
+ array.push(arguments[i]);
+ }
+ }
+ return array;
+ }
+}
+var Hash = function(object) {
+ if (object instanceof Hash) this.merge(object);
+ else Object.extend(this, object || {});
+};
+
+Object.extend(Hash, {
+ toQueryString: function(obj) {
+ var parts = [];
+ parts.add = arguments.callee.addPair;
+
+ this.prototype._each.call(obj, function(pair) {
+ if (!pair.key) return;
+ var value = pair.value;
+
+ if (value && typeof value == 'object') {
+ if (value.constructor == Array) value.each(function(value) {
+ parts.add(pair.key, value);
+ });
+ return;
+ }
+ parts.add(pair.key, value);
+ });
+
+ return parts.join('&');
+ },
+
+ toJSON: function(object) {
+ var results = [];
+ this.prototype._each.call(object, function(pair) {
+ var value = Object.toJSON(pair.value);
+ if (value !== undefined) results.push(pair.key.toJSON() + ': ' + value);
+ });
+ return '{' + results.join(', ') + '}';
+ }
+});
+
+Hash.toQueryString.addPair = function(key, value, prefix) {
+ key = encodeURIComponent(key);
+ if (value === undefined) this.push(key);
+ else this.push(key + '=' + (value == null ? '' : encodeURIComponent(value)));
+}
+
+Object.extend(Hash.prototype, Enumerable);
+Object.extend(Hash.prototype, {
+ _each: function(iterator) {
+ for (var key in this) {
+ var value = this[key];
+ if (value && value == Hash.prototype[key]) continue;
+
+ var pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ },
+
+ keys: function() {
+ return this.pluck('key');
+ },
+
+ values: function() {
+ return this.pluck('value');
+ },
+
+ merge: function(hash) {
+ return $H(hash).inject(this, function(mergedHash, pair) {
+ mergedHash[pair.key] = pair.value;
+ return mergedHash;
+ });
+ },
+
+ remove: function() {
+ var result;
+ for(var i = 0, length = arguments.length; i < length; i++) {
+ var value = this[arguments[i]];
+ if (value !== undefined){
+ if (result === undefined) result = value;
+ else {
+ if (result.constructor != Array) result = [result];
+ result.push(value)
+ }
+ }
+ delete this[arguments[i]];
+ }
+ return result;
+ },
+
+ toQueryString: function() {
+ return Hash.toQueryString(this);
+ },
+
+ inspect: function() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ },
+
+ toJSON: function() {
+ return Hash.toJSON(this);
+ }
+});
+
+function $H(object) {
+ if (object instanceof Hash) return object;
+ return new Hash(object);
+};
+
+// Safari iterates over shadowed properties
+if (function() {
+ var i = 0, Test = function(value) { this.key = value };
+ Test.prototype.key = 'foo';
+ for (var property in new Test('bar')) i++;
+ return i > 1;
+}()) Hash.prototype._each = function(iterator) {
+ var cache = [];
+ for (var key in this) {
+ var value = this[key];
+ if ((value && value == Hash.prototype[key]) || cache.include(key)) continue;
+ cache.push(key);
+ var pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+};
+ObjectRange = Class.create();
+Object.extend(ObjectRange.prototype, Enumerable);
+Object.extend(ObjectRange.prototype, {
+ initialize: function(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ },
+
+ _each: function(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ },
+
+ include: function(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+});
+
+var $R = function(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+}
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+}
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (typeof responder[callback] == 'function') {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) {}
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() {
+ Ajax.activeRequestCount++;
+ },
+ onComplete: function() {
+ Ajax.activeRequestCount--;
+ }
+});
+
+Ajax.Base = function() {};
+Ajax.Base.prototype = {
+ setOptions: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: ''
+ }
+ Object.extend(this.options, options || {});
+
+ this.options.method = this.options.method.toLowerCase();
+ if (typeof this.options.parameters == 'string')
+ this.options.parameters = this.options.parameters.toQueryParams();
+ }
+}
+
+Ajax.Request = Class.create();
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
+ _complete: false,
+
+ initialize: function(url, options) {
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.clone(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ // simulate other verbs over post
+ params['_method'] = this.method;
+ this.method = 'post';
+ }
+
+ this.parameters = params;
+
+ if (params = Hash.toQueryString(params)) {
+ // when GET, append parameters to URL
+ if (this.method == 'get')
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ params += '&_=';
+ }
+
+ try {
+ if (this.options.onCreate) this.options.onCreate(this.transport);
+ Ajax.Responders.dispatch('onCreate', this, this.transport);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous)
+ setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ // user-defined headers
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (typeof extras.push == 'function')
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ return !this.transport.status
+ || (this.transport.status >= 200 && this.transport.status < 300);
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState];
+ var transport = this.transport, json = this.evalJSON();
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + this.transport.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = this.getHeader('Content-type');
+ if (contentType && contentType.strip().
+ match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(transport, json);
+ Ajax.Responders.dispatch('on' + state, this, transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ // avoid memory leak in MSIE: clean up
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name);
+ } catch (e) { return null }
+ },
+
+ evalJSON: function() {
+ try {
+ var json = this.getHeader('X-JSON');
+ return json ? json.evalJSON() : null;
+ } catch (e) { return null }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Updater = Class.create();
+
+Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
+ initialize: function(container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ }
+
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+
+ var onComplete = this.options.onComplete || Prototype.emptyFunction;
+ this.options.onComplete = (function(transport, param) {
+ this.updateContent();
+ onComplete(transport, param);
+ }).bind(this);
+
+ this.request(url);
+ },
+
+ updateContent: function() {
+ var receiver = this.container[this.success() ? 'success' : 'failure'];
+ var response = this.transport.responseText;
+
+ if (!this.options.evalScripts) response = response.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (this.options.insertion)
+ new this.options.insertion(receiver, response);
+ else
+ receiver.update(response);
+ }
+
+ if (this.success()) {
+ if (this.onComplete)
+ setTimeout(this.onComplete.bind(this), 10);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create();
+Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
+ initialize: function(container, url, options) {
+ this.setOptions(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = {};
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(request) {
+ if (this.options.decay) {
+ this.decay = (request.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = request.responseText;
+ }
+ this.timer = setTimeout(this.onTimerEvent.bind(this),
+ this.decay * this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (typeof element == 'string')
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(query.snapshotItem(i));
+ return results;
+ };
+
+ document.getElementsByClassName = function(className, parentElement) {
+ var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
+ return document._getElementsByXPath(q, parentElement);
+ }
+
+} else document.getElementsByClassName = function(className, parentElement) {
+ var children = ($(parentElement) || document.body).getElementsByTagName('*');
+ var elements = [], child;
+ for (var i = 0, length = children.length; i < length; i++) {
+ child = children[i];
+ if (Element.hasClassName(child, className))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Element) var Element = {};
+
+Element.extend = function(element) {
+ var F = Prototype.BrowserFeatures;
+ if (!element || !element.tagName || element.nodeType == 3 ||
+ element._extended || F.SpecificElementExtensions || element == window)
+ return element;
+
+ var methods = {}, tagName = element.tagName, cache = Element.extend.cache,
+ T = Element.Methods.ByTag;
+
+ // extend methods for all tags (Safari doesn't need this)
+ if (!F.ElementExtensions) {
+ Object.extend(methods, Element.Methods),
+ Object.extend(methods, Element.Methods.Simulated);
+ }
+
+ // extend methods for specific tags
+ if (T[tagName]) Object.extend(methods, T[tagName]);
+
+ for (var property in methods) {
+ var value = methods[property];
+ if (typeof value == 'function' && !(property in element))
+ element[property] = cache.findOrStore(value);
+ }
+
+ element._extended = Prototype.emptyFunction;
+ return element;
+};
+
+Element.extend.cache = {
+ findOrStore: function(value) {
+ return this[value] = this[value] || function() {
+ return value.apply(null, [this].concat($A(arguments)));
+ }
+ }
+};
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ $(element).style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ $(element).style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: function(element, html) {
+ html = typeof html == 'undefined' ? '' : html.toString();
+ $(element).innerHTML = html.stripScripts();
+ setTimeout(function() {html.evalScripts()}, 10);
+ return element;
+ },
+
+ replace: function(element, html) {
+ element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
+ if (element.outerHTML) {
+ element.outerHTML = html.stripScripts();
+ } else {
+ var range = element.ownerDocument.createRange();
+ range.selectNodeContents(element);
+ element.parentNode.replaceChild(
+ range.createContextualFragment(html.stripScripts()), element);
+ }
+ setTimeout(function() {html.evalScripts()}, 10);
+ return element;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(), attribute = pair.last();
+ var value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property) {
+ element = $(element);
+ var elements = [];
+ while (element = element[property])
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return $(element).recursivelyCollect('parentNode');
+ },
+
+ descendants: function(element) {
+ return $A($(element).getElementsByTagName('*')).each(Element.extend);
+ },
+
+ firstDescendant: function(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ return $(element);
+ },
+
+ immediateDescendants: function(element) {
+ if (!(element = $(element).firstChild)) return [];
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ if (element) return [element].concat($(element).nextSiblings());
+ return [];
+ },
+
+ previousSiblings: function(element) {
+ return $(element).recursivelyCollect('previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return $(element).recursivelyCollect('nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return element.previousSiblings().reverse().concat(element.nextSiblings());
+ },
+
+ match: function(element, selector) {
+ if (typeof selector == 'string')
+ selector = new Selector(selector);
+ return selector.match($(element));
+ },
+
+ up: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(element.parentNode);
+ var ancestors = element.ancestors();
+ return expression ? Selector.findElement(ancestors, expression, index) :
+ ancestors[index || 0];
+ },
+
+ down: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return element.firstDescendant();
+ var descendants = element.descendants();
+ return expression ? Selector.findElement(descendants, expression, index) :
+ descendants[index || 0];
+ },
+
+ previous: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
+ var previousSiblings = element.previousSiblings();
+ return expression ? Selector.findElement(previousSiblings, expression, index) :
+ previousSiblings[index || 0];
+ },
+
+ next: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
+ var nextSiblings = element.nextSiblings();
+ return expression ? Selector.findElement(nextSiblings, expression, index) :
+ nextSiblings[index || 0];
+ },
+
+ getElementsBySelector: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element, args);
+ },
+
+ getElementsByClassName: function(element, className) {
+ return document.getElementsByClassName(className, element);
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (Prototype.Browser.IE) {
+ if (!element.attributes) return null;
+ var t = Element._attributeTranslations;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ var attribute = element.attributes[name];
+ return attribute ? attribute.nodeValue : null;
+ }
+ return element.getAttribute(name);
+ },
+
+ getHeight: function(element) {
+ return $(element).getDimensions().height;
+ },
+
+ getWidth: function(element) {
+ return $(element).getDimensions().width;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ var elementClassName = element.className;
+ if (elementClassName.length == 0) return false;
+ if (elementClassName == className ||
+ elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
+ return true;
+ return false;
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element).add(className);
+ return element;
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element).remove(className);
+ return element;
+ },
+
+ toggleClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className);
+ return element;
+ },
+
+ observe: function() {
+ Event.observe.apply(Event, arguments);
+ return $A(arguments).first();
+ },
+
+ stopObserving: function() {
+ Event.stopObserving.apply(Event, arguments);
+ return $A(arguments).first();
+ },
+
+ // removes whitespace-only text node children
+ cleanWhitespace: function(element) {
+ element = $(element);
+ var node = element.firstChild;
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.blank();
+ },
+
+ descendantOf: function(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+ while (element = element.parentNode)
+ if (element == ancestor) return true;
+ return false;
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var pos = Position.cumulativeOffset(element);
+ window.scrollTo(pos[0], pos[1]);
+ return element;
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ style = style == 'float' ? 'cssFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value) {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+ if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+ return value == 'auto' ? null : value;
+ },
+
+ getOpacity: function(element) {
+ return $(element).getStyle('opacity');
+ },
+
+ setStyle: function(element, styles, camelized) {
+ element = $(element);
+ var elementStyle = element.style;
+
+ for (var property in styles)
+ if (property == 'opacity') element.setOpacity(styles[property])
+ else
+ elementStyle[(property == 'float' || property == 'cssFloat') ?
+ (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
+ (camelized ? property : property.camelize())] = styles[property];
+
+ return element;
+ },
+
+ setOpacity: function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+ return element;
+ },
+
+ getDimensions: function(element) {
+ element = $(element);
+ var display = $(element).getStyle('display');
+ if (display != 'none' && display != null) // Safari bug
+ return {width: element.offsetWidth, height: element.offsetHeight};
+
+ // All *Width and *Height properties give 0 on elements with display none,
+ // so enable the element temporarily
+ var els = element.style;
+ var originalVisibility = els.visibility;
+ var originalPosition = els.position;
+ var originalDisplay = els.display;
+ els.visibility = 'hidden';
+ els.position = 'absolute';
+ els.display = 'block';
+ var originalWidth = element.clientWidth;
+ var originalHeight = element.clientHeight;
+ els.display = originalDisplay;
+ els.position = originalPosition;
+ els.visibility = originalVisibility;
+ return {width: originalWidth, height: originalHeight};
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ // Opera returns the offset relative to the positioning context, when an
+ // element is position relative but top and left have not been defined
+ if (window.opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ return element;
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ return element;
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return element;
+ element._overflow = element.style.overflow || 'auto';
+ if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
+ element.style.overflow = 'hidden';
+ return element;
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (!element._overflow) return element;
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+ element._overflow = null;
+ return element;
+ }
+};
+
+Object.extend(Element.Methods, {
+ childOf: Element.Methods.descendantOf,
+ childElements: Element.Methods.immediateDescendants
+});
+
+if (Prototype.Browser.Opera) {
+ Element.Methods._getStyle = Element.Methods.getStyle;
+ Element.Methods.getStyle = function(element, style) {
+ switch(style) {
+ case 'left':
+ case 'top':
+ case 'right':
+ case 'bottom':
+ if (Element._getStyle(element, 'position') == 'static') return null;
+ default: return Element._getStyle(element, style);
+ }
+ };
+}
+else if (Prototype.Browser.IE) {
+ Element.Methods.getStyle = function(element, style) {
+ element = $(element);
+ style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value && element.currentStyle) value = element.currentStyle[style];
+
+ if (style == 'opacity') {
+ if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+ if (value[1]) return parseFloat(value[1]) / 100;
+ return 1.0;
+ }
+
+ if (value == 'auto') {
+ if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+ return element['offset'+style.capitalize()] + 'px';
+ return null;
+ }
+ return value;
+ };
+
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ var filter = element.getStyle('filter'), style = element.style;
+ if (value == 1 || value === '') {
+ style.filter = filter.replace(/alpha\([^\)]*\)/gi,'');
+ return element;
+ } else if (value < 0.00001) value = 0;
+ style.filter = filter.replace(/alpha\([^\)]*\)/gi, '') +
+ 'alpha(opacity=' + (value * 100) + ')';
+ return element;
+ };
+
+ // IE is missing .innerHTML support for TABLE-related elements
+ Element.Methods.update = function(element, html) {
+ element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
+ var tagName = element.tagName.toUpperCase();
+ if (['THEAD','TBODY','TR','TD'].include(tagName)) {
+ var div = document.createElement('div');
+ switch (tagName) {
+ case 'THEAD':
+ case 'TBODY':
+ div.innerHTML = '<table><tbody>' + html.stripScripts() + '</tbody></table>';
+ depth = 2;
+ break;
+ case 'TR':
+ div.innerHTML = '<table><tbody><tr>' + html.stripScripts() + '</tr></tbody></table>';
+ depth = 3;
+ break;
+ case 'TD':
+ div.innerHTML = '<table><tbody><tr><td>' + html.stripScripts() + '</td></tr></tbody></table>';
+ depth = 4;
+ }
+ $A(element.childNodes).each(function(node) { element.removeChild(node) });
+ depth.times(function() { div = div.firstChild });
+ $A(div.childNodes).each(function(node) { element.appendChild(node) });
+ } else {
+ element.innerHTML = html.stripScripts();
+ }
+ setTimeout(function() { html.evalScripts() }, 10);
+ return element;
+ }
+}
+else if (Prototype.Browser.Gecko) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1) ? 0.999999 :
+ (value === '') ? '' : (value < 0.00001) ? 0 : value;
+ return element;
+ };
+}
+
+Element._attributeTranslations = {
+ names: {
+ colspan: "colSpan",
+ rowspan: "rowSpan",
+ valign: "vAlign",
+ datetime: "dateTime",
+ accesskey: "accessKey",
+ tabindex: "tabIndex",
+ enctype: "encType",
+ maxlength: "maxLength",
+ readonly: "readOnly",
+ longdesc: "longDesc"
+ },
+ values: {
+ _getAttr: function(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ },
+ _flag: function(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ },
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+ title: function(element) {
+ var node = element.getAttributeNode('title');
+ return node.specified ? node.nodeValue : null;
+ }
+ }
+};
+
+(function() {
+ Object.extend(this, {
+ href: this._getAttr,
+ src: this._getAttr,
+ disabled: this._flag,
+ checked: this._flag,
+ readonly: this._flag,
+ multiple: this._flag
+ });
+}).call(Element._attributeTranslations.values);
+
+Element.Methods.Simulated = {
+ hasAttribute: function(element, attribute) {
+ var t = Element._attributeTranslations, node;
+ attribute = t.names[attribute] || attribute;
+ node = $(element).getAttributeNode(attribute);
+ return node && node.specified;
+ }
+};
+
+Element.Methods.ByTag = {};
+
+Object.extend(Element, Element.Methods);
+
+if (!Prototype.BrowserFeatures.ElementExtensions &&
+ document.createElement('div').__proto__) {
+ window.HTMLElement = {};
+ window.HTMLElement.prototype = document.createElement('div').__proto__;
+ Prototype.BrowserFeatures.ElementExtensions = true;
+}
+
+Element.hasAttribute = function(element, attribute) {
+ if (element.hasAttribute) return element.hasAttribute(attribute);
+ return Element.Methods.Simulated.hasAttribute(element, attribute);
+};
+
+Element.addMethods = function(methods) {
+ var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+ if (arguments.length == 2) {
+ var tagName = methods;
+ methods = arguments[1];
+ }
+
+ if (!tagName) Object.extend(Element.Methods, methods || {});
+ else {
+ if (tagName.constructor == Array) tagName.each(extend);
+ else extend(tagName);
+ }
+
+ function extend(tagName) {
+ tagName = tagName.toUpperCase();
+ if (!Element.Methods.ByTag[tagName])
+ Element.Methods.ByTag[tagName] = {};
+ Object.extend(Element.Methods.ByTag[tagName], methods);
+ }
+
+ function copy(methods, destination, onlyIfAbsent) {
+ onlyIfAbsent = onlyIfAbsent || false;
+ var cache = Element.extend.cache;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = cache.findOrStore(value);
+ }
+ }
+
+ function findDOMClass(tagName) {
+ var klass;
+ var trans = {
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+ "FrameSet", "IFRAME": "IFrame"
+ };
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName.capitalize() + 'Element';
+ if (window[klass]) return window[klass];
+
+ window[klass] = {};
+ window[klass].prototype = document.createElement(tagName).__proto__;
+ return window[klass];
+ }
+
+ if (F.ElementExtensions) {
+ copy(Element.Methods, HTMLElement.prototype);
+ copy(Element.Methods.Simulated, HTMLElement.prototype, true);
+ }
+
+ if (F.SpecificElementExtensions) {
+ for (var tag in Element.Methods.ByTag) {
+ var klass = findDOMClass(tag);
+ if (typeof klass == "undefined") continue;
+ copy(T[tag], klass.prototype);
+ }
+ }
+
+ Object.extend(Element, Element.Methods);
+ delete Element.ByTag;
+};
+
+var Toggle = { display: Element.toggle };
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.Insertion = function(adjacency) {
+ this.adjacency = adjacency;
+}
+
+Abstract.Insertion.prototype = {
+ initialize: function(element, content) {
+ this.element = $(element);
+ this.content = content.stripScripts();
+
+ if (this.adjacency && this.element.insertAdjacentHTML) {
+ try {
+ this.element.insertAdjacentHTML(this.adjacency, this.content);
+ } catch (e) {
+ var tagName = this.element.tagName.toUpperCase();
+ if (['TBODY', 'TR'].include(tagName)) {
+ this.insertContent(this.contentFromAnonymousTable());
+ } else {
+ throw e;
+ }
+ }
+ } else {
+ this.range = this.element.ownerDocument.createRange();
+ if (this.initializeRange) this.initializeRange();
+ this.insertContent([this.range.createContextualFragment(this.content)]);
+ }
+
+ setTimeout(function() {content.evalScripts()}, 10);
+ },
+
+ contentFromAnonymousTable: function() {
+ var div = document.createElement('div');
+ div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>';
+ return $A(div.childNodes[0].childNodes[0].childNodes);
+ }
+}
+
+var Insertion = new Object();
+
+Insertion.Before = Class.create();
+Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
+ initializeRange: function() {
+ this.range.setStartBefore(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment, this.element);
+ }).bind(this));
+ }
+});
+
+Insertion.Top = Class.create();
+Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(true);
+ },
+
+ insertContent: function(fragments) {
+ fragments.reverse(false).each((function(fragment) {
+ this.element.insertBefore(fragment, this.element.firstChild);
+ }).bind(this));
+ }
+});
+
+Insertion.Bottom = Class.create();
+Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.appendChild(fragment);
+ }).bind(this));
+ }
+});
+
+Insertion.After = Class.create();
+Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
+ initializeRange: function() {
+ this.range.setStartAfter(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment,
+ this.element.nextSibling);
+ }).bind(this));
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
+ * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
+ * license. Please see http://www.yui-ext.com/ for more information. */
+
+var Selector = Class.create();
+
+Selector.prototype = {
+ initialize: function(expression) {
+ this.expression = expression.strip();
+ this.compileMatcher();
+ },
+
+ compileMatcher: function() {
+ // Selectors with namespaced attributes can't use the XPath version
+ if (Prototype.BrowserFeatures.XPath && !(/\[[\w-]*?:/).test(this.expression))
+ return this.compileXPathMatcher();
+
+ var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
+ c = Selector.criteria, le, p, m;
+
+ if (Selector._cache[e]) {
+ this.matcher = Selector._cache[e]; return;
+ }
+ this.matcher = ["this.matcher = function(root) {",
+ "var r = root, h = Selector.handlers, c = false, n;"];
+
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ p = ps[i];
+ if (m = e.match(p)) {
+ this.matcher.push(typeof c[i] == 'function' ? c[i](m) :
+ new Template(c[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.matcher.push("return h.unique(n);\n}");
+ eval(this.matcher.join('\n'));
+ Selector._cache[this.expression] = this.matcher;
+ },
+
+ compileXPathMatcher: function() {
+ var e = this.expression, ps = Selector.patterns,
+ x = Selector.xpath, le, m;
+
+ if (Selector._cache[e]) {
+ this.xpath = Selector._cache[e]; return;
+ }
+
+ this.matcher = ['.//*'];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ if (m = e.match(ps[i])) {
+ this.matcher.push(typeof x[i] == 'function' ? x[i](m) :
+ new Template(x[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.xpath = this.matcher.join('');
+ Selector._cache[this.expression] = this.xpath;
+ },
+
+ findElements: function(root) {
+ root = root || document;
+ if (this.xpath) return document._getElementsByXPath(this.xpath, root);
+ return this.matcher(root);
+ },
+
+ match: function(element) {
+ return this.findElements(document).include(element);
+ },
+
+ toString: function() {
+ return this.expression;
+ },
+
+ inspect: function() {
+ return "#<Selector:" + this.expression.inspect() + ">";
+ }
+};
+
+Object.extend(Selector, {
+ _cache: {},
+
+ xpath: {
+ descendant: "//*",
+ child: "/*",
+ adjacent: "/following-sibling::*[1]",
+ laterSibling: '/following-sibling::*',
+ tagName: function(m) {
+ if (m[1] == '*') return '';
+ return "[local-name()='" + m[1].toLowerCase() +
+ "' or local-name()='" + m[1].toUpperCase() + "']";
+ },
+ className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",
+ id: "[@id='#{1}']",
+ attrPresence: "[@#{1}]",
+ attr: function(m) {
+ m[3] = m[5] || m[6];
+ return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
+ },
+ pseudo: function(m) {
+ var h = Selector.xpath.pseudos[m[1]];
+ if (!h) return '';
+ if (typeof h === 'function') return h(m);
+ return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
+ },
+ operators: {
+ '=': "[@#{1}='#{3}']",
+ '!=': "[@#{1}!='#{3}']",
+ '^=': "[starts-with(@#{1}, '#{3}')]",
+ '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
+ '*=': "[contains(@#{1}, '#{3}')]",
+ '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
+ '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
+ },
+ pseudos: {
+ 'first-child': '[not(preceding-sibling::*)]',
+ 'last-child': '[not(following-sibling::*)]',
+ 'only-child': '[not(preceding-sibling::* or following-sibling::*)]',
+ 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
+ 'checked': "[@checked]",
+ 'disabled': "[@disabled]",
+ 'enabled': "[not(@disabled)]",
+ 'not': function(m) {
+ var e = m[6], p = Selector.patterns,
+ x = Selector.xpath, le, m, v;
+
+ var exclusion = [];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in p) {
+ if (m = e.match(p[i])) {
+ v = typeof x[i] == 'function' ? x[i](m) : new Template(x[i]).evaluate(m);
+ exclusion.push("(" + v.substring(1, v.length - 1) + ")");
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+ return "[not(" + exclusion.join(" and ") + ")]";
+ },
+ 'nth-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
+ },
+ 'nth-last-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
+ },
+ 'nth-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("position() ", m);
+ },
+ 'nth-last-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
+ },
+ 'first-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
+ },
+ 'last-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
+ },
+ 'only-of-type': function(m) {
+ var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
+ },
+ nth: function(fragment, m) {
+ var mm, formula = m[6], predicate;
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ if (mm = formula.match(/^(\d+)$/)) // digit only
+ return '[' + fragment + "= " + mm[1] + ']';
+ if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (mm[1] == "-") mm[1] = -1;
+ var a = mm[1] ? Number(mm[1]) : 1;
+ var b = mm[2] ? Number(mm[2]) : 0;
+ predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
+ "((#{fragment} - #{b}) div #{a} >= 0)]";
+ return new Template(predicate).evaluate({
+ fragment: fragment, a: a, b: b });
+ }
+ }
+ }
+ },
+
+ criteria: {
+ tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',
+ className: 'n = h.className(n, r, "#{1}", c); c = false;',
+ id: 'n = h.id(n, r, "#{1}", c); c = false;',
+ attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;',
+ attr: function(m) {
+ m[3] = (m[5] || m[6]);
+ return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);
+ },
+ pseudo: function(m) {
+ if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
+ return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
+ },
+ descendant: 'c = "descendant";',
+ child: 'c = "child";',
+ adjacent: 'c = "adjacent";',
+ laterSibling: 'c = "laterSibling";'
+ },
+
+ patterns: {
+ // combinators must be listed first
+ // (and descendant needs to be last combinator)
+ laterSibling: /^\s*~\s*/,
+ child: /^\s*>\s*/,
+ adjacent: /^\s*\+\s*/,
+ descendant: /^\s/,
+
+ // selectors follow
+ tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,
+ id: /^#([\w\-\*]+)(\b|$)/,
+ className: /^\.([\w\-\*]+)(\b|$)/,
+ pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s)/,
+ attrPresence: /^\[([\w]+)\]/,
+ attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/
+ },
+
+ handlers: {
+ // UTILITY FUNCTIONS
+ // joins two collections
+ concat: function(a, b) {
+ for (var i = 0, node; node = b[i]; i++)
+ a.push(node);
+ return a;
+ },
+
+ // marks an array of nodes for counting
+ mark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._counted = true;
+ return nodes;
+ },
+
+ unmark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._counted = undefined;
+ return nodes;
+ },
+
+ // mark each child node with its position (for nth calls)
+ // "ofType" flag indicates whether we're indexing for nth-of-type
+ // rather than nth-child
+ index: function(parentNode, reverse, ofType) {
+ parentNode._counted = true;
+ if (reverse) {
+ for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
+ node = nodes[i];
+ if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
+ }
+ } else {
+ for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
+ if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
+ }
+ },
+
+ // filters out duplicates and extends all nodes
+ unique: function(nodes) {
+ if (nodes.length == 0) return nodes;
+ var results = [], n;
+ for (var i = 0, l = nodes.length; i < l; i++)
+ if (!(n = nodes[i])._counted) {
+ n._counted = true;
+ results.push(Element.extend(n));
+ }
+ return Selector.handlers.unmark(results);
+ },
+
+ // COMBINATOR FUNCTIONS
+ descendant: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName('*'));
+ return results;
+ },
+
+ child: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ for (var j = 0, children = [], child; child = node.childNodes[j]; j++)
+ if (child.nodeType == 1 && child.tagName != '!') results.push(child);
+ }
+ return results;
+ },
+
+ adjacent: function(nodes) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ var next = this.nextElementSibling(node);
+ if (next) results.push(next);
+ }
+ return results;
+ },
+
+ laterSibling: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, Element.nextSiblings(node));
+ return results;
+ },
+
+ nextElementSibling: function(node) {
+ while (node = node.nextSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ previousElementSibling: function(node) {
+ while (node = node.previousSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ // TOKEN FUNCTIONS
+ tagName: function(nodes, root, tagName, combinator) {
+ tagName = tagName.toUpperCase();
+ var results = [], h = Selector.handlers;
+ if (nodes) {
+ if (combinator) {
+ // fastlane for ordinary descendant combinators
+ if (combinator == "descendant") {
+ for (var i = 0, node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName(tagName));
+ return results;
+ } else nodes = this[combinator](nodes);
+ if (tagName == "*") return nodes;
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.tagName.toUpperCase() == tagName) results.push(node);
+ return results;
+ } else return root.getElementsByTagName(tagName);
+ },
+
+ id: function(nodes, root, id, combinator) {
+ var targetNode = $(id), h = Selector.handlers;
+ if (!nodes && root == document) return targetNode ? [targetNode] : [];
+ if (nodes) {
+ if (combinator) {
+ if (combinator == 'child') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (targetNode.parentNode == node) return [targetNode];
+ } else if (combinator == 'descendant') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.descendantOf(targetNode, node)) return [targetNode];
+ } else if (combinator == 'adjacent') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Selector.handlers.previousElementSibling(targetNode) == node)
+ return [targetNode];
+ } else nodes = h[combinator](nodes);
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node == targetNode) return [targetNode];
+ return [];
+ }
+ return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
+ },
+
+ className: function(nodes, root, className, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ return Selector.handlers.byClassName(nodes, root, className);
+ },
+
+ byClassName: function(nodes, root, className) {
+ if (!nodes) nodes = Selector.handlers.descendant([root]);
+ var needle = ' ' + className + ' ';
+ for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
+ nodeClassName = node.className;
+ if (nodeClassName.length == 0) continue;
+ if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
+ results.push(node);
+ }
+ return results;
+ },
+
+ attrPresence: function(nodes, root, attr) {
+ var results = [];
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.hasAttribute(node, attr)) results.push(node);
+ return results;
+ },
+
+ attr: function(nodes, root, attr, value, operator) {
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ var handler = Selector.operators[operator], results = [];
+ for (var i = 0, node; node = nodes[i]; i++) {
+ var nodeValue = Element.readAttribute(node, attr);
+ if (nodeValue === null) continue;
+ if (handler(nodeValue, value)) results.push(node);
+ }
+ return results;
+ },
+
+ pseudo: function(nodes, name, value, root, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ return Selector.pseudos[name](nodes, value, root);
+ }
+ },
+
+ pseudos: {
+ 'first-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.previousElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'last-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.nextElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'only-child': function(nodes, value, root) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
+ results.push(node);
+ return results;
+ },
+ 'nth-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root);
+ },
+ 'nth-last-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true);
+ },
+ 'nth-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, false, true);
+ },
+ 'nth-last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true, true);
+ },
+ 'first-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, false, true);
+ },
+ 'last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, true, true);
+ },
+ 'only-of-type': function(nodes, formula, root) {
+ var p = Selector.pseudos;
+ return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
+ },
+
+ // handles the an+b logic
+ getIndices: function(a, b, total) {
+ if (a == 0) return b > 0 ? [b] : [];
+ return $R(1, total).inject([], function(memo, i) {
+ if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
+ return memo;
+ });
+ },
+
+ // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
+ nth: function(nodes, formula, root, reverse, ofType) {
+ if (nodes.length == 0) return [];
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ var h = Selector.handlers, results = [], indexed = [], m;
+ h.mark(nodes);
+ for (var i = 0, node; node = nodes[i]; i++) {
+ if (!node.parentNode._counted) {
+ h.index(node.parentNode, reverse, ofType);
+ indexed.push(node.parentNode);
+ }
+ }
+ if (formula.match(/^\d+$/)) { // just a number
+ formula = Number(formula);
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.nodeIndex == formula) results.push(node);
+ } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (m[1] == "-") m[1] = -1;
+ var a = m[1] ? Number(m[1]) : 1;
+ var b = m[2] ? Number(m[2]) : 0;
+ var indices = Selector.pseudos.getIndices(a, b, nodes.length);
+ for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
+ for (var j = 0; j < l; j++)
+ if (node.nodeIndex == indices[j]) results.push(node);
+ }
+ }
+ h.unmark(nodes);
+ h.unmark(indexed);
+ return results;
+ },
+
+ 'empty': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ // IE treats comments as element nodes
+ if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue;
+ results.push(node);
+ }
+ return results;
+ },
+
+ 'not': function(nodes, selector, root) {
+ var h = Selector.handlers, selectorType, m;
+ var exclusions = new Selector(selector).findElements(root);
+ h.mark(exclusions);
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node._counted) results.push(node);
+ h.unmark(exclusions);
+ return results;
+ },
+
+ 'enabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node.disabled) results.push(node);
+ return results;
+ },
+
+ 'disabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.disabled) results.push(node);
+ return results;
+ },
+
+ 'checked': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.checked) results.push(node);
+ return results;
+ }
+ },
+
+ operators: {
+ '=': function(nv, v) { return nv == v; },
+ '!=': function(nv, v) { return nv != v; },
+ '^=': function(nv, v) { return nv.startsWith(v); },
+ '$=': function(nv, v) { return nv.endsWith(v); },
+ '*=': function(nv, v) { return nv.include(v); },
+ '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
+ '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); }
+ },
+
+ matchElements: function(elements, expression) {
+ var matches = new Selector(expression).findElements(), h = Selector.handlers;
+ h.mark(matches);
+ for (var i = 0, results = [], element; element = elements[i]; i++)
+ if (element._counted) results.push(element);
+ h.unmark(matches);
+ return results;
+ },
+
+ findElement: function(elements, expression, index) {
+ if (typeof expression == 'number') {
+ index = expression; expression = false;
+ }
+ return Selector.matchElements(elements, expression || '*')[index || 0];
+ },
+
+ findChildElements: function(element, expressions) {
+ var exprs = expressions.join(','), expressions = [];
+ exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
+ expressions.push(m[1].strip());
+ });
+ var results = [], h = Selector.handlers;
+ for (var i = 0, l = expressions.length, selector; i < l; i++) {
+ selector = new Selector(expressions[i].strip());
+ h.concat(results, selector.findElements(element));
+ }
+ return (l > 1) ? h.unique(results) : results;
+ }
+});
+
+function $$() {
+ return Selector.findChildElements(document, $A(arguments));
+}
+var Form = {
+ reset: function(form) {
+ $(form).reset();
+ return form;
+ },
+
+ serializeElements: function(elements, getHash) {
+ var data = elements.inject({}, function(result, element) {
+ if (!element.disabled && element.name) {
+ var key = element.name, value = $(element).getValue();
+ if (value != null) {
+ if (key in result) {
+ if (result[key].constructor != Array) result[key] = [result[key]];
+ result[key].push(value);
+ }
+ else result[key] = value;
+ }
+ }
+ return result;
+ });
+
+ return getHash ? data : Hash.toQueryString(data);
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, getHash) {
+ return Form.serializeElements(Form.getElements(form), getHash);
+ },
+
+ getElements: function(form) {
+ return $A($(form).getElementsByTagName('*')).inject([],
+ function(elements, child) {
+ if (Form.Element.Serializers[child.tagName.toLowerCase()])
+ elements.push(Element.extend(child));
+ return elements;
+ }
+ );
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('disable');
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('enable');
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ return $(form).getElements().find(function(element) {
+ return element.type != 'hidden' && !element.disabled &&
+ ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ form.findFirstElement().activate();
+ return form;
+ },
+
+ request: function(form, options) {
+ form = $(form), options = Object.clone(options || {});
+
+ var params = options.parameters;
+ options.parameters = form.serialize(true);
+
+ if (params) {
+ if (typeof params == 'string') params = params.toQueryParams();
+ Object.extend(options.parameters, params);
+ }
+
+ if (form.hasAttribute('method') && !options.method)
+ options.method = form.method;
+
+ return new Ajax.Request(form.readAttribute('action'), options);
+ }
+}
+
+Object.extend(Form, Form.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+}
+
+Form.Element.Methods = {
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = {};
+ pair[element.name] = value;
+ return Hash.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ try {
+ element.focus();
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
+ !['button', 'reset', 'submit'].include(element.type)))
+ element.select();
+ } catch (e) {}
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.blur();
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.disabled = false;
+ return element;
+ }
+}
+
+Object.extend(Form.Element, Form.Element.Methods);
+Object.extend(Element.Methods.ByTag, {
+ "FORM": Object.clone(Form.Methods),
+ "INPUT": Object.clone(Form.Element.Methods),
+ "SELECT": Object.clone(Form.Element.Methods),
+ "TEXTAREA": Object.clone(Form.Element.Methods)
+});
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+var $F = Form.Element.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = {
+ input: function(element) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return Form.Element.Serializers.inputSelector(element);
+ default:
+ return Form.Element.Serializers.textarea(element);
+ }
+ },
+
+ inputSelector: function(element) {
+ return element.checked ? element.value : null;
+ },
+
+ textarea: function(element) {
+ return element.value;
+ },
+
+ select: function(element) {
+ return this[element.type == 'select-one' ?
+ 'selectOne' : 'selectMany'](element);
+ },
+
+ selectOne: function(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? this.optionValue(element.options[index]) : null;
+ },
+
+ selectMany: function(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(this.optionValue(opt));
+ }
+ return values;
+ },
+
+ optionValue: function(opt) {
+ // extend element because hasAttribute may not be native
+ return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = function() {}
+Abstract.TimedObserver.prototype = {
+ initialize: function(element, frequency, callback) {
+ this.frequency = frequency;
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ var value = this.getValue();
+ var changed = ('string' == typeof this.lastValue && 'string' == typeof value
+ ? this.lastValue != value : String(this.lastValue) != String(value));
+ if (changed) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+}
+
+Form.Element.Observer = Class.create();
+Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create();
+Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = function() {}
+Abstract.EventObserver.prototype = {
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback.bind(this));
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+}
+
+Form.Element.EventObserver = Class.create();
+Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create();
+Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+if (!window.Event) {
+ var Event = new Object();
+}
+
+Object.extend(Event, {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+
+ element: function(event) {
+ return $(event.target || event.srcElement);
+ },
+
+ isLeftClick: function(event) {
+ return (((event.which) && (event.which == 1)) ||
+ ((event.button) && (event.button == 1)));
+ },
+
+ pointerX: function(event) {
+ return event.pageX || (event.clientX +
+ (document.documentElement.scrollLeft || document.body.scrollLeft));
+ },
+
+ pointerY: function(event) {
+ return event.pageY || (event.clientY +
+ (document.documentElement.scrollTop || document.body.scrollTop));
+ },
+
+ stop: function(event) {
+ if (event.preventDefault) {
+ event.preventDefault();
+ event.stopPropagation();
+ } else {
+ event.returnValue = false;
+ event.cancelBubble = true;
+ }
+ },
+
+ // find the first node with the given tagName, starting from the
+ // node the event was triggered on; traverses the DOM upwards
+ findElement: function(event, tagName) {
+ var element = Event.element(event);
+ while (element.parentNode && (!element.tagName ||
+ (element.tagName.toUpperCase() != tagName.toUpperCase())))
+ element = element.parentNode;
+ return element;
+ },
+
+ observers: false,
+
+ _observeAndCache: function(element, name, observer, useCapture) {
+ if (!this.observers) this.observers = [];
+ if (element.addEventListener) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.addEventListener(name, observer, useCapture);
+ } else if (element.attachEvent) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.attachEvent('on' + name, observer);
+ }
+ },
+
+ unloadCache: function() {
+ if (!Event.observers) return;
+ for (var i = 0, length = Event.observers.length; i < length; i++) {
+ Event.stopObserving.apply(this, Event.observers[i]);
+ Event.observers[i][0] = null;
+ }
+ Event.observers = false;
+ },
+
+ observe: function(element, name, observer, useCapture) {
+ element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (Prototype.Browser.WebKit || element.attachEvent))
+ name = 'keydown';
+
+ Event._observeAndCache(element, name, observer, useCapture);
+ },
+
+ stopObserving: function(element, name, observer, useCapture) {
+ element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (Prototype.Browser.WebKit || element.attachEvent))
+ name = 'keydown';
+
+ if (element.removeEventListener) {
+ element.removeEventListener(name, observer, useCapture);
+ } else if (element.detachEvent) {
+ try {
+ element.detachEvent('on' + name, observer);
+ } catch (e) {}
+ }
+ }
+});
+
+/* prevent memory leaks in IE */
+if (Prototype.Browser.IE)
+ Event.observe(window, 'unload', Event.unloadCache, false);
+var Position = {
+ // set to true if needed, warning: firefox performance problems
+ // NOT neeeded for page scrolling, only if draggable contained in
+ // scrollable elements
+ includeScrollOffsets: false,
+
+ // must be called before calling withinIncludingScrolloffset, every time the
+ // page is scrolled
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ realOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ cumulativeOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ positionedOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if(element.tagName=='BODY') break;
+ var p = Element.getStyle(element, 'position');
+ if (p == 'relative' || p == 'absolute') break;
+ }
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ offsetParent: function(element) {
+ if (element.offsetParent) return element.offsetParent;
+ if (element == document.body) return element;
+
+ while ((element = element.parentNode) && element != document.body)
+ if (Element.getStyle(element, 'position') != 'static')
+ return element;
+
+ return document.body;
+ },
+
+ // caches x/y coordinate pair to use with overlap
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = this.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = this.realOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = this.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ // within must be called directly before
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+ page: function(forElement) {
+ var valueT = 0, valueL = 0;
+
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+
+ // Safari fix
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element,'position')=='absolute') break;
+
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (!window.opera || element.tagName=='BODY') {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+
+ return [valueL, valueT];
+ },
+
+ clone: function(source, target) {
+ var options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, arguments[2] || {})
+
+ // find page position of source
+ source = $(source);
+ var p = Position.page(source);
+
+ // find coordinate system to use
+ target = $(target);
+ var delta = [0, 0];
+ var parent = null;
+ // delta [0,0] will do fine with position: fixed elements,
+ // position:absolute needs offsetParent deltas
+ if (Element.getStyle(target,'position') == 'absolute') {
+ parent = Position.offsetParent(target);
+ delta = Position.page(parent);
+ }
+
+ // correct by body offsets (fixes Safari)
+ if (parent == document.body) {
+ delta[0] -= document.body.offsetLeft;
+ delta[1] -= document.body.offsetTop;
+ }
+
+ // set position
+ if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+ if(options.setWidth) target.style.width = source.offsetWidth + 'px';
+ if(options.setHeight) target.style.height = source.offsetHeight + 'px';
+ },
+
+ absolutize: function(element) {
+ element = $(element);
+ if (element.style.position == 'absolute') return;
+ Position.prepare();
+
+ var offsets = Position.positionedOffset(element);
+ var top = offsets[1];
+ var left = offsets[0];
+ var width = element.clientWidth;
+ var height = element.clientHeight;
+
+ element._originalLeft = left - parseFloat(element.style.left || 0);
+ element._originalTop = top - parseFloat(element.style.top || 0);
+ element._originalWidth = element.style.width;
+ element._originalHeight = element.style.height;
+
+ element.style.position = 'absolute';
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.width = width + 'px';
+ element.style.height = height + 'px';
+ },
+
+ relativize: function(element) {
+ element = $(element);
+ if (element.style.position == 'relative') return;
+ Position.prepare();
+
+ element.style.position = 'relative';
+ var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
+ var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.height = element._originalHeight;
+ element.style.width = element._originalWidth;
+ }
+}
+
+// Safari returns margins on body which is incorrect if the child is absolutely
+// positioned. For performance reasons, redefine Position.cumulativeOffset for
+// KHTML/WebKit only.
+if (Prototype.Browser.WebKit) {
+ Position.cumulativeOffset = function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+
+ element = element.offsetParent;
+ } while (element);
+
+ return [valueL, valueT];
+ }
+}
+
+Element.addMethods(); \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/javascripts/tooltip.js b/js/prototype-window-1.3/documentation/javascripts/tooltip.js
new file mode 100755
index 0000000..65e6106
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/tooltip.js
@@ -0,0 +1,241 @@
+// Singleton class TooltipWindow
+// This class works with special className. The tooltip content could be in your HTML page as an hidden element or
+// can be retreive by an AJAX call.
+//
+// To work, You just need to set two class name on elements that should show tooltips
+// - One to say to TooltipManager that this element must have a tooltip ('tooltip' by default)
+// - Another to indicate how to find the tooltip content
+// It could be html_XXXX if tootltip content is somewhere hidden in your page, XXX must be DOM ID of this hidden element
+// It could be ajax_XXXX if tootltip content must be find by an ajax request, XXX will be the string send as id parameter to your server.
+// Check samples/tooltips/tooltip.html to see how it works
+//
+TooltipManager = {
+ options: {cssClassName: 'tooltip', delayOver: 200, delayOut: 1000, shiftX: 10, shiftY: 10,
+ className: 'alphacube', width: 200, height: null,
+ draggable: false, minimizable: false, maximizable: false, showEffect: Element.show, hideEffect: Element.hide},
+ ajaxInfo: null,
+ elements: null,
+ showTimer: null,
+ hideTimer: null,
+
+ // Init tooltip manager
+ // parameters:
+ // - cssClassName (string) : CSS class name where tooltip should be shown.
+ // - ajaxOptions (hash) : Ajax options for ajax tooltip.
+ // For examples {url: "/tooltip/get.php", options: {method: 'get'}}
+ // see Ajax.Request documentation for details
+ //- tooltipOptions (hash) : available keys
+ // - delayOver: int in ms (default 10) delay before showing tooltip
+ // - delayOut: int in ms (default 1000) delay before hidding tooltip
+ // - shiftX: int in pixels (default 10) left shift of the tooltip window
+ // - shiftY: int in pixels (default 10) top shift of the tooltip window
+ // and All window options like showEffect: Element.show, hideEffect: Element.hide to remove animation
+ // default: {className: 'alphacube', width: 200, height: null, draggable: false, minimizable: false, maximizable: false}
+
+ init: function(cssClassName, ajaxInfo, tooltipOptions) {
+ TooltipManager.options = Object.extend(TooltipManager.options, tooltipOptions || {});
+
+ cssClassName = TooltipManager.options.cssClassName || "tooltip";
+ TooltipManager.ajaxInfo = ajaxInfo;
+ TooltipManager.elements = $$("." + cssClassName);
+ TooltipManager.elements.each(function(element) {
+ element = $(element)
+ var info = TooltipManager._getInfo(element);
+ if (info.ajax) {
+ element.ajaxId = info.id;
+ element.ajaxInfo = ajaxInfo;
+ }
+ else {
+ element.tooltipElement = $(info.id);
+ }
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ });
+ Windows.addObserver(this);
+ },
+
+ addHTML: function(element, tooltipElement) {
+ element = $(element);
+ tooltipElement = $(tooltipElement);
+ element.tooltipElement = tooltipElement;
+
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ },
+
+ addAjax: function(element, ajaxInfo) {
+ element = $(element);
+ element.ajaxInfo = ajaxInfo;
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ },
+
+ addURL: function(element, url, width, height) {
+ element = $(element);
+ element.url = url;
+ element.frameWidth = width;
+ element.frameHeight = height;
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ },
+
+ close: function() {
+ if (TooltipManager.tooltipWindow)
+ TooltipManager.tooltipWindow.hide();
+ },
+
+ preloadImages: function(path, images, extension) {
+ if (!extension)
+ extension = ".gif";
+
+ //preload images
+ $A(images).each(function(i) {
+ var image = new Image();
+ image.src= path + "/" + i + extension;
+ });
+ },
+
+ _showTooltip: function(element) {
+ if (this.element == element)
+ return;
+ // Get original element
+ while (element && (!element.tooltipElement && !element.ajaxInfo && !element.url))
+ element = element.parentNode;
+ this.element = element;
+
+ TooltipManager.showTimer = null;
+ if (TooltipManager.hideTimer)
+ clearTimeout(TooltipManager.hideTimer);
+
+ var position = Position.cumulativeOffset(element);
+ var dimension = element.getDimensions();
+
+ if (! this.tooltipWindow)
+ this.tooltipWindow = new Window("__tooltip__", TooltipManager.options);
+
+ this.tooltipWindow.hide();
+ this.tooltipWindow.setLocation(position[1] + dimension.height + TooltipManager.options.shiftY, position[0] + TooltipManager.options.shiftX);
+
+ Event.observe(this.tooltipWindow.element, "mouseover", function(event) {TooltipManager._tooltipOver(event, element)});
+ Event.observe(this.tooltipWindow.element, "mouseout", function(event) {TooltipManager._tooltipOut(event, element)});
+
+ // Reset width/height for computation
+ this.tooltipWindow.height = TooltipManager.options.height;
+ this.tooltipWindow.width = TooltipManager.options.width;
+
+ // Ajax content
+ if (element.ajaxInfo) {
+ var p = element.ajaxInfo.options.parameters;
+ var saveParam = p;
+
+ // Set by CSS
+ if (element.ajaxId) {
+ if (p)
+ p += "&id=" + element.ajaxId;
+ else
+ p = "id=" + element.ajaxId;
+ }
+ element.ajaxInfo.options.parameters = p || "";
+ this.tooltipWindow.setHTMLContent("");
+ this.tooltipWindow.setAjaxContent(element.ajaxInfo.url, element.ajaxInfo.options);
+ element.ajaxInfo.options.parameters = saveParam;
+ }
+ // URL content
+ else if (element.url) {
+ this.tooltipWindow.setURL(element.url);
+ this.tooltipWindow.setSize(element.frameWidth, element.frameHeight);
+
+ // Set tooltip size
+ this.tooltipWindow.height = element.frameHeight;
+ this.tooltipWindow.width = element.frameWidth;
+ }
+ // HTML content
+ else
+ this.tooltipWindow.setHTMLContent(element.tooltipElement.innerHTML);
+
+ if (!element.ajaxInfo) {
+ this.tooltipWindow.show();
+ this.tooltipWindow.toFront();
+ }
+ },
+
+ _hideTooltip: function(element) {
+ if (this.tooltipWindow) {
+ this.tooltipWindow.hide();
+ this.element = null;
+ }
+ },
+
+ _mouseOver: function (event) {
+ var element = Event.element(event);
+ if (TooltipManager.showTimer)
+ clearTimeout(TooltipManager.showTimer);
+
+ TooltipManager.showTimer = setTimeout(function() {TooltipManager._showTooltip(element)}, TooltipManager.options.delayOver)
+ },
+
+ _mouseOut: function(event) {
+ var element = Event.element(event);
+ if (TooltipManager.showTimer) {
+ clearTimeout(TooltipManager.showTimer);
+ TooltipManager.showTimer = null;
+ return;
+ }
+ if (TooltipManager.tooltipWindow)
+ TooltipManager.hideTimer = setTimeout(function() {TooltipManager._hideTooltip(element)}, TooltipManager.options.delayOut)
+ },
+
+ _tooltipOver: function(event, element) {
+ if (TooltipManager.hideTimer) {
+ clearTimeout(TooltipManager.hideTimer);
+ TooltipManager.hideTimer = null;
+ }
+ },
+
+ _tooltipOut: function(event, element) {
+ if (TooltipManager.hideTimer == null)
+ TooltipManager.hideTimer = setTimeout(function() {TooltipManager._hideTooltip(element)}, TooltipManager.options.delayOut)
+ },
+
+ _getInfo: function(element) {
+ // Find html_ for static content
+ var id = element.className.split(' ').detect(function(name) {return name.indexOf("html_") == 0});
+ var ajax = true;
+ if (id)
+ ajax = false;
+ else
+ // Find ajax_ for ajax content
+ id = element.className.split(' ').detect(function(name) {return name.indexOf("ajax_") == 0});
+
+ id = id.substr(id.indexOf('_')+1, id.length)
+ return id ? {ajax: ajax, id: id} : null;
+ },
+
+ onBeforeShow: function(eventName, win) {
+ var top = parseFloat(win.getLocation().top);
+ var dim = win.element.getDimensions();
+
+ if (top + dim.height > TooltipManager._getScrollTop() + TooltipManager._getPageHeight()) {
+ var position = Position.cumulativeOffset(this.element);
+
+ var top = position[1] - TooltipManager.options.shiftY - dim.height;
+ win.setLocation(top, position[0] + TooltipManager.options.shiftX)
+ }
+ },
+
+ _getPageWidth: function(){
+ return window.innerWidth || document.documentElement.clientWidth || 0;
+ },
+
+ _getPageHeight: function(){
+ return window.innerHeight || document.documentElement.clientHeight || 0;
+ },
+
+ _getScrollTop: function(){
+ return document.documentElement.scrollTop || window.pageYOffset || 0;
+ },
+
+ _getScrollLeft: function(){
+ return document.documentElement.scrollLeft || window.pageXOffset || 0;
+ }
+};
diff --git a/js/prototype-window-1.3/documentation/javascripts/window.js b/js/prototype-window-1.3/documentation/javascripts/window.js
new file mode 100755
index 0000000..5fc2533
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/window.js
@@ -0,0 +1,1843 @@
+// Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.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.
+//
+// VERSION 1.3
+
+var Window = Class.create();
+
+Window.keepMultiModalWindow = false;
+Window.hasEffectLib = (typeof Effect != 'undefined');
+Window.resizeEffectDuration = 0.4;
+
+Window.prototype = {
+ // Constructor
+ // Available parameters : className, blurClassName, title, minWidth, minHeight, maxWidth, maxHeight, width, height, top, left, bottom, right, resizable, zIndex, opacity, recenterAuto, wiredDrag
+ // hideEffect, showEffect, showEffectOptions, hideEffectOptions, effectOptions, url, draggable, closable, minimizable, maximizable, parent, onload
+ // add all callbacks (if you do not use an observer)
+ // onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
+
+ initialize: function() {
+ var id;
+ var optionIndex = 0;
+ // For backward compatibility like win= new Window("id", {...}) instead of win = new Window({id: "id", ...})
+ if (arguments.length > 0) {
+ if (typeof arguments[0] == "string" ) {
+ id = arguments[0];
+ optionIndex = 1;
+ }
+ else
+ id = arguments[0] ? arguments[0].id : null;
+ }
+
+ // Generate unique ID if not specified
+ if (!id)
+ id = "window_" + new Date().getTime();
+
+ if ($(id))
+ alert("Window " + id + " is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");
+
+ this.options = Object.extend({
+ className: "dialog",
+ blurClassName: null,
+ minWidth: 100,
+ minHeight: 20,
+ resizable: true,
+ closable: true,
+ minimizable: true,
+ maximizable: true,
+ draggable: true,
+ userData: null,
+ showEffect: (Window.hasEffectLib ? Effect.Appear : Element.show),
+ hideEffect: (Window.hasEffectLib ? Effect.Fade : Element.hide),
+ showEffectOptions: {},
+ hideEffectOptions: {},
+ effectOptions: null,
+ parent: document.body,
+ title: "&nbsp;",
+ url: null,
+ onload: Prototype.emptyFunction,
+ width: 200,
+ height: 300,
+ opacity: 1,
+ recenterAuto: true,
+ wiredDrag: false,
+ closeCallback: null,
+ destroyOnClose: false,
+ gridX: 1,
+ gridY: 1
+ }, arguments[optionIndex] || {});
+ if (this.options.blurClassName)
+ this.options.focusClassName = this.options.className;
+
+ if (typeof this.options.top == "undefined" && typeof this.options.bottom == "undefined")
+ this.options.top = this._round(Math.random()*500, this.options.gridY);
+ if (typeof this.options.left == "undefined" && typeof this.options.right == "undefined")
+ this.options.left = this._round(Math.random()*500, this.options.gridX);
+
+ if (this.options.effectOptions) {
+ Object.extend(this.options.hideEffectOptions, this.options.effectOptions);
+ Object.extend(this.options.showEffectOptions, this.options.effectOptions);
+ if (this.options.showEffect == Element.Appear)
+ this.options.showEffectOptions.to = this.options.opacity;
+ }
+ if (Window.hasEffectLib) {
+ if (this.options.showEffect == Effect.Appear)
+ this.options.showEffectOptions.to = this.options.opacity;
+
+ if (this.options.hideEffect == Effect.Fade)
+ this.options.hideEffectOptions.from = this.options.opacity;
+ }
+ if (this.options.hideEffect == Element.hide)
+ this.options.hideEffect = function(){ Element.hide(this.element); if (this.options.destroyOnClose) this.destroy(); }.bind(this)
+
+ if (this.options.parent != document.body)
+ this.options.parent = $(this.options.parent);
+
+ this.element = this._createWindow(id);
+ this.element.win = this;
+
+ // Bind event listener
+ this.eventMouseDown = this._initDrag.bindAsEventListener(this);
+ this.eventMouseUp = this._endDrag.bindAsEventListener(this);
+ this.eventMouseMove = this._updateDrag.bindAsEventListener(this);
+ this.eventOnLoad = this._getWindowBorderSize.bindAsEventListener(this);
+ this.eventMouseDownContent = this.toFront.bindAsEventListener(this);
+ this.eventResize = this._recenter.bindAsEventListener(this);
+
+ this.topbar = $(this.element.id + "_top");
+ this.bottombar = $(this.element.id + "_bottom");
+ this.content = $(this.element.id + "_content");
+
+ Event.observe(this.topbar, "mousedown", this.eventMouseDown);
+ Event.observe(this.bottombar, "mousedown", this.eventMouseDown);
+ Event.observe(this.content, "mousedown", this.eventMouseDownContent);
+ Event.observe(window, "load", this.eventOnLoad);
+ Event.observe(window, "resize", this.eventResize);
+ Event.observe(window, "scroll", this.eventResize);
+ Event.observe(this.options.parent, "scroll", this.eventResize);
+
+ if (this.options.draggable) {
+ var that = this;
+ [this.topbar, this.topbar.up().previous(), this.topbar.up().next()].each(function(element) {
+ element.observe("mousedown", that.eventMouseDown);
+ element.addClassName("top_draggable");
+ });
+ [this.bottombar.up(), this.bottombar.up().previous(), this.bottombar.up().next()].each(function(element) {
+ element.observe("mousedown", that.eventMouseDown);
+ element.addClassName("bottom_draggable");
+ });
+
+ }
+
+ if (this.options.resizable) {
+ this.sizer = $(this.element.id + "_sizer");
+ Event.observe(this.sizer, "mousedown", this.eventMouseDown);
+ }
+
+ this.useLeft = null;
+ this.useTop = null;
+ if (typeof this.options.left != "undefined") {
+ this.element.setStyle({left: parseFloat(this.options.left) + 'px'});
+ this.useLeft = true;
+ }
+ else {
+ this.element.setStyle({right: parseFloat(this.options.right) + 'px'});
+ this.useLeft = false;
+ }
+
+ if (typeof this.options.top != "undefined") {
+ this.element.setStyle({top: parseFloat(this.options.top) + 'px'});
+ this.useTop = true;
+ }
+ else {
+ this.element.setStyle({bottom: parseFloat(this.options.bottom) + 'px'});
+ this.useTop = false;
+ }
+
+ this.storedLocation = null;
+
+ this.setOpacity(this.options.opacity);
+ if (this.options.zIndex)
+ this.setZIndex(this.options.zIndex)
+
+ if (this.options.destroyOnClose)
+ this.setDestroyOnClose(true);
+
+ this._getWindowBorderSize();
+ this.width = this.options.width;
+ this.height = this.options.height;
+ this.visible = false;
+
+ this.constraint = false;
+ this.constraintPad = {top: 0, left:0, bottom:0, right:0};
+
+ if (this.width && this.height)
+ this.setSize(this.options.width, this.options.height);
+ this.setTitle(this.options.title)
+ Windows.register(this);
+ },
+
+ // Destructor
+ destroy: function() {
+ this._notify("onDestroy");
+ Event.stopObserving(this.topbar, "mousedown", this.eventMouseDown);
+ Event.stopObserving(this.bottombar, "mousedown", this.eventMouseDown);
+ Event.stopObserving(this.content, "mousedown", this.eventMouseDownContent);
+
+ Event.stopObserving(window, "load", this.eventOnLoad);
+ Event.stopObserving(window, "resize", this.eventResize);
+ Event.stopObserving(window, "scroll", this.eventResize);
+
+ Event.stopObserving(this.content, "load", this.options.onload);
+
+ if (this._oldParent) {
+ var content = this.getContent();
+ var originalContent = null;
+ for(var i = 0; i < content.childNodes.length; i++) {
+ originalContent = content.childNodes[i];
+ if (originalContent.nodeType == 1)
+ break;
+ originalContent = null;
+ }
+ if (originalContent)
+ this._oldParent.appendChild(originalContent);
+ this._oldParent = null;
+ }
+
+ if (this.sizer)
+ Event.stopObserving(this.sizer, "mousedown", this.eventMouseDown);
+
+ if (this.options.url)
+ this.content.src = null
+
+ if(this.iefix)
+ Element.remove(this.iefix);
+
+ Element.remove(this.element);
+ Windows.unregister(this);
+ },
+
+ // Sets close callback, if it sets, it should return true to be able to close the window.
+ setCloseCallback: function(callback) {
+ this.options.closeCallback = callback;
+ },
+
+ // Gets window content
+ getContent: function () {
+ return this.content;
+ },
+
+ // Sets the content with an element id
+ setContent: function(id, autoresize, autoposition) {
+ var element = $(id);
+ if (null == element) throw "Unable to find element '" + id + "' in DOM";
+ this._oldParent = element.parentNode;
+
+ var d = null;
+ var p = null;
+
+ if (autoresize)
+ d = Element.getDimensions(element);
+ if (autoposition)
+ p = Position.cumulativeOffset(element);
+
+ var content = this.getContent();
+ // Clear HTML (and even iframe)
+ this.setHTMLContent("");
+ content = this.getContent();
+
+ content.appendChild(element);
+ element.show();
+ if (autoresize)
+ this.setSize(d.width, d.height);
+ if (autoposition)
+ this.setLocation(p[1] - this.heightN, p[0] - this.widthW);
+ },
+
+ setHTMLContent: function(html) {
+ // It was an url (iframe), recreate a div content instead of iframe content
+ if (this.options.url) {
+ this.content.src = null;
+ this.options.url = null;
+
+ var content ="<div id=\"" + this.getId() + "_content\" class=\"" + this.options.className + "_content\"> </div>";
+ $(this.getId() +"_table_content").innerHTML = content;
+
+ this.content = $(this.element.id + "_content");
+ }
+
+ this.getContent().innerHTML = html;
+ },
+
+ setAjaxContent: function(url, options, showCentered, showModal) {
+ this.showFunction = showCentered ? "showCenter" : "show";
+ this.showModal = showModal || false;
+
+ options = options || {};
+
+ // Clear HTML (and even iframe)
+ this.setHTMLContent("");
+
+ this.onComplete = options.onComplete;
+ if (! this._onCompleteHandler)
+ this._onCompleteHandler = this._setAjaxContent.bind(this);
+ options.onComplete = this._onCompleteHandler;
+
+ new Ajax.Request(url, options);
+ options.onComplete = this.onComplete;
+ },
+
+ _setAjaxContent: function(originalRequest) {
+ Element.update(this.getContent(), originalRequest.responseText);
+ if (this.onComplete)
+ this.onComplete(originalRequest);
+ this.onComplete = null;
+ this[this.showFunction](this.showModal)
+ },
+
+ setURL: function(url) {
+ // Not an url content, change div to iframe
+ if (this.options.url)
+ this.content.src = null;
+ this.options.url = url;
+ var content= "<iframe frameborder='0' name='" + this.getId() + "_content' id='" + this.getId() + "_content' src='" + url + "' width='" + this.width + "' height='" + this.height + "'> </iframe>";
+ $(this.getId() +"_table_content").innerHTML = content;
+
+ this.content = $(this.element.id + "_content");
+ },
+
+ getURL: function() {
+ return this.options.url ? this.options.url : null;
+ },
+
+ refresh: function() {
+ if (this.options.url)
+ $(this.element.getAttribute('id') + '_content').src = this.options.url;
+ },
+
+ // Stores position/size in a cookie, by default named with window id
+ setCookie: function(name, expires, path, domain, secure) {
+ name = name || this.element.id;
+ this.cookie = [name, expires, path, domain, secure];
+
+ // Get cookie
+ var value = WindowUtilities.getCookie(name)
+ // If exists
+ if (value) {
+ var values = value.split(',');
+ var x = values[0].split(':');
+ var y = values[1].split(':');
+
+ var w = parseFloat(values[2]), h = parseFloat(values[3]);
+ var mini = values[4];
+ var maxi = values[5];
+
+ this.setSize(w, h);
+ if (mini == "true")
+ this.doMinimize = true; // Minimize will be done at onload window event
+ else if (maxi == "true")
+ this.doMaximize = true; // Maximize will be done at onload window event
+
+ this.useLeft = x[0] == "l";
+ this.useTop = y[0] == "t";
+
+ this.element.setStyle(this.useLeft ? {left: x[1]} : {right: x[1]});
+ this.element.setStyle(this.useTop ? {top: y[1]} : {bottom: y[1]});
+ }
+ },
+
+ // Gets window ID
+ getId: function() {
+ return this.element.id;
+ },
+
+ // Detroys itself when closing
+ setDestroyOnClose: function() {
+ this.options.destroyOnClose = true;
+ },
+
+ setConstraint: function(bool, padding) {
+ this.constraint = bool;
+ this.constraintPad = Object.extend(this.constraintPad, padding || {});
+ // Reset location to apply constraint
+ if (this.useTop && this.useLeft)
+ this.setLocation(parseFloat(this.element.style.top), parseFloat(this.element.style.left));
+ },
+
+ // initDrag event
+
+ _initDrag: function(event) {
+ // No resize on minimized window
+ if (Event.element(event) == this.sizer && this.isMinimized())
+ return;
+
+ // No move on maximzed window
+ if (Event.element(event) != this.sizer && this.isMaximized())
+ return;
+
+ if (Prototype.Browser.IE && this.heightN == 0)
+ this._getWindowBorderSize();
+
+ // Get pointer X,Y
+ this.pointer = [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];
+ if (this.options.wiredDrag)
+ this.currentDrag = this._createWiredElement();
+ else
+ this.currentDrag = this.element;
+
+ // Resize
+ if (Event.element(event) == this.sizer) {
+ this.doResize = true;
+ this.widthOrg = this.width;
+ this.heightOrg = this.height;
+ this.bottomOrg = parseFloat(this.element.getStyle('bottom'));
+ this.rightOrg = parseFloat(this.element.getStyle('right'));
+ this._notify("onStartResize");
+ }
+ else {
+ this.doResize = false;
+
+ // Check if click on close button,
+ var closeButton = $(this.getId() + '_close');
+ if (closeButton && Position.within(closeButton, this.pointer[0], this.pointer[1])) {
+ this.currentDrag = null;
+ return;
+ }
+
+ this.toFront();
+
+ if (! this.options.draggable)
+ return;
+ this._notify("onStartMove");
+ }
+ // Register global event to capture mouseUp and mouseMove
+ Event.observe(document, "mouseup", this.eventMouseUp, false);
+ Event.observe(document, "mousemove", this.eventMouseMove, false);
+
+ // Add an invisible div to keep catching mouse event over iframes
+ WindowUtilities.disableScreen('__invisible__', '__invisible__', this.overlayOpacity);
+
+ // Stop selection while dragging
+ document.body.ondrag = function () { return false; };
+ document.body.onselectstart = function () { return false; };
+
+ this.currentDrag.show();
+ Event.stop(event);
+ },
+
+ _round: function(val, round) {
+ return round == 1 ? val : val = Math.floor(val / round) * round;
+ },
+
+ // updateDrag event
+ _updateDrag: function(event) {
+ var pointer = [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];
+ var dx = pointer[0] - this.pointer[0];
+ var dy = pointer[1] - this.pointer[1];
+
+ // Resize case, update width/height
+ if (this.doResize) {
+ var w = this.widthOrg + dx;
+ var h = this.heightOrg + dy;
+
+ dx = this.width - this.widthOrg
+ dy = this.height - this.heightOrg
+
+ // Check if it's a right position, update it to keep upper-left corner at the same position
+ if (this.useLeft)
+ w = this._updateWidthConstraint(w)
+ else
+ this.currentDrag.setStyle({right: (this.rightOrg -dx) + 'px'});
+ // Check if it's a bottom position, update it to keep upper-left corner at the same position
+ if (this.useTop)
+ h = this._updateHeightConstraint(h)
+ else
+ this.currentDrag.setStyle({bottom: (this.bottomOrg -dy) + 'px'});
+
+ this.setSize(w , h);
+ this._notify("onResize");
+ }
+ // Move case, update top/left
+ else {
+ this.pointer = pointer;
+
+ if (this.useLeft) {
+ var left = parseFloat(this.currentDrag.getStyle('left')) + dx;
+ var newLeft = this._updateLeftConstraint(left);
+ // Keep mouse pointer correct
+ this.pointer[0] += newLeft-left;
+ this.currentDrag.setStyle({left: newLeft + 'px'});
+ }
+ else
+ this.currentDrag.setStyle({right: parseFloat(this.currentDrag.getStyle('right')) - dx + 'px'});
+
+ if (this.useTop) {
+ var top = parseFloat(this.currentDrag.getStyle('top')) + dy;
+ var newTop = this._updateTopConstraint(top);
+ // Keep mouse pointer correct
+ this.pointer[1] += newTop - top;
+ this.currentDrag.setStyle({top: newTop + 'px'});
+ }
+ else
+ this.currentDrag.setStyle({bottom: parseFloat(this.currentDrag.getStyle('bottom')) - dy + 'px'});
+
+ this._notify("onMove");
+ }
+ if (this.iefix)
+ this._fixIEOverlapping();
+
+ this._removeStoreLocation();
+ Event.stop(event);
+ },
+
+ // endDrag callback
+ _endDrag: function(event) {
+ // Remove temporary div over iframes
+ WindowUtilities.enableScreen('__invisible__');
+
+ if (this.doResize)
+ this._notify("onEndResize");
+ else
+ this._notify("onEndMove");
+
+ // Release event observing
+ Event.stopObserving(document, "mouseup", this.eventMouseUp,false);
+ Event.stopObserving(document, "mousemove", this.eventMouseMove, false);
+
+ Event.stop(event);
+
+ this._hideWiredElement();
+
+ // Store new location/size if need be
+ this._saveCookie()
+
+ // Restore selection
+ document.body.ondrag = null;
+ document.body.onselectstart = null;
+ },
+
+ _updateLeftConstraint: function(left) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;
+
+ if (left < this.constraintPad.left)
+ left = this.constraintPad.left;
+ if (left + this.width + this.widthE + this.widthW > width - this.constraintPad.right)
+ left = width - this.constraintPad.right - this.width - this.widthE - this.widthW;
+ }
+ return left;
+ },
+
+ _updateTopConstraint: function(top) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
+
+ var h = this.height + this.heightN + this.heightS;
+
+ if (top < this.constraintPad.top)
+ top = this.constraintPad.top;
+ if (top + h > height - this.constraintPad.bottom)
+ top = height - this.constraintPad.bottom - h;
+ }
+ return top;
+ },
+
+ _updateWidthConstraint: function(w) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;
+ var left = parseFloat(this.element.getStyle("left"));
+
+ if (left + w + this.widthE + this.widthW > width - this.constraintPad.right)
+ w = width - this.constraintPad.right - left - this.widthE - this.widthW;
+ }
+ return w;
+ },
+
+ _updateHeightConstraint: function(h) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
+ var top = parseFloat(this.element.getStyle("top"));
+
+ if (top + h + this.heightN + this.heightS > height - this.constraintPad.bottom)
+ h = height - this.constraintPad.bottom - top - this.heightN - this.heightS;
+ }
+ return h;
+ },
+
+
+ // Creates HTML window code
+ _createWindow: function(id) {
+ var className = this.options.className;
+ var win = document.createElement("div");
+ win.setAttribute('id', id);
+ win.className = "dialog";
+
+ var content;
+ if (this.options.url)
+ content= "<iframe frameborder=\"0\" name=\"" + id + "_content\" id=\"" + id + "_content\" src=\"" + this.options.url + "\"> </iframe>";
+ else
+ content ="<div id=\"" + id + "_content\" class=\"" +className + "_content\"> </div>";
+
+ var closeDiv = this.options.closable ? "<div class='"+ className +"_close' id='"+ id +"_close' onclick='Windows.close(\""+ id +"\", event)'> </div>" : "";
+ var minDiv = this.options.minimizable ? "<div class='"+ className + "_minimize' id='"+ id +"_minimize' onclick='Windows.minimize(\""+ id +"\", event)'> </div>" : "";
+ var maxDiv = this.options.maximizable ? "<div class='"+ className + "_maximize' id='"+ id +"_maximize' onclick='Windows.maximize(\""+ id +"\", event)'> </div>" : "";
+ var seAttributes = this.options.resizable ? "class='" + className + "_sizer' id='" + id + "_sizer'" : "class='" + className + "_se'";
+ var blank = "../themes/default/blank.gif";
+
+ win.innerHTML = closeDiv + minDiv + maxDiv + "\
+ <table id='"+ id +"_row1' class=\"top table_window\">\
+ <tr>\
+ <td class='"+ className +"_nw'></td>\
+ <td class='"+ className +"_n'><div id='"+ id +"_top' class='"+ className +"_title title_window'>"+ this.options.title +"</div></td>\
+ <td class='"+ className +"_ne'></td>\
+ </tr>\
+ </table>\
+ <table id='"+ id +"_row2' class=\"mid table_window\">\
+ <tr>\
+ <td class='"+ className +"_w'></td>\
+ <td id='"+ id +"_table_content' class='"+ className +"_content' valign='top'>" + content + "</td>\
+ <td class='"+ className +"_e'></td>\
+ </tr>\
+ </table>\
+ <table id='"+ id +"_row3' class=\"bot table_window\">\
+ <tr>\
+ <td class='"+ className +"_sw'></td>\
+ <td class='"+ className +"_s'><div id='"+ id +"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>\
+ <td " + seAttributes + "></td>\
+ </tr>\
+ </table>\
+ ";
+ Element.hide(win);
+ this.options.parent.insertBefore(win, this.options.parent.firstChild);
+ Event.observe($(id + "_content"), "load", this.options.onload);
+ return win;
+ },
+
+
+ changeClassName: function(newClassName) {
+ var className = this.options.className;
+ var id = this.getId();
+ $A(["_close", "_minimize", "_maximize", "_sizer", "_content"]).each(function(value) { this._toggleClassName($(id + value), className + value, newClassName + value) }.bind(this));
+ this._toggleClassName($(id + "_top"), className + "_title", newClassName + "_title");
+ $$("#" + id + " td").each(function(td) {td.className = td.className.sub(className,newClassName); });
+ this.options.className = newClassName;
+ },
+
+ _toggleClassName: function(element, oldClassName, newClassName) {
+ if (element) {
+ element.removeClassName(oldClassName);
+ element.addClassName(newClassName);
+ }
+ },
+
+ // Sets window location
+ setLocation: function(top, left) {
+ top = this._updateTopConstraint(top);
+ left = this._updateLeftConstraint(left);
+
+ var e = this.currentDrag || this.element;
+ e.setStyle({top: top + 'px'});
+ e.setStyle({left: left + 'px'});
+
+ this.useLeft = true;
+ this.useTop = true;
+ },
+
+ getLocation: function() {
+ var location = {};
+ if (this.useTop)
+ location = Object.extend(location, {top: this.element.getStyle("top")});
+ else
+ location = Object.extend(location, {bottom: this.element.getStyle("bottom")});
+ if (this.useLeft)
+ location = Object.extend(location, {left: this.element.getStyle("left")});
+ else
+ location = Object.extend(location, {right: this.element.getStyle("right")});
+
+ return location;
+ },
+
+ // Gets window size
+ getSize: function() {
+ return {width: this.width, height: this.height};
+ },
+
+ // Sets window size
+ setSize: function(width, height, useEffect) {
+ width = parseFloat(width);
+ height = parseFloat(height);
+
+ // Check min and max size
+ if (!this.minimized && width < this.options.minWidth)
+ width = this.options.minWidth;
+
+ if (!this.minimized && height < this.options.minHeight)
+ height = this.options.minHeight;
+
+ if (this.options. maxHeight && height > this.options. maxHeight)
+ height = this.options. maxHeight;
+
+ if (this.options. maxWidth && width > this.options. maxWidth)
+ width = this.options. maxWidth;
+
+
+ if (this.useTop && this.useLeft && Window.hasEffectLib && Effect.ResizeWindow && useEffect) {
+ new Effect.ResizeWindow(this, null, null, width, height, {duration: Window.resizeEffectDuration});
+ } else {
+ this.width = width;
+ this.height = height;
+ var e = this.currentDrag ? this.currentDrag : this.element;
+
+ e.setStyle({width: width + this.widthW + this.widthE + "px"})
+ e.setStyle({height: height + this.heightN + this.heightS + "px"})
+
+ // Update content size
+ if (!this.currentDrag || this.currentDrag == this.element) {
+ var content = $(this.element.id + '_content');
+ content.setStyle({height: height + 'px'});
+ content.setStyle({width: width + 'px'});
+ }
+ }
+ },
+
+ updateHeight: function() {
+ this.setSize(this.width, this.content.scrollHeight, true);
+ },
+
+ updateWidth: function() {
+ this.setSize(this.content.scrollWidth, this.height, true);
+ },
+
+ // Brings window to front
+ toFront: function() {
+ if (this.element.style.zIndex < Windows.maxZIndex)
+ this.setZIndex(Windows.maxZIndex + 1);
+ if (this.iefix)
+ this._fixIEOverlapping();
+ },
+
+ getBounds: function(insideOnly) {
+ if (! this.width || !this.height || !this.visible)
+ this.computeBounds();
+ var w = this.width;
+ var h = this.height;
+
+ if (!insideOnly) {
+ w += this.widthW + this.widthE;
+ h += this.heightN + this.heightS;
+ }
+ var bounds = Object.extend(this.getLocation(), {width: w + "px", height: h + "px"});
+ return bounds;
+ },
+
+ computeBounds: function() {
+ if (! this.width || !this.height) {
+ var size = WindowUtilities._computeSize(this.content.innerHTML, this.content.id, this.width, this.height, 0, this.options.className)
+ if (this.height)
+ this.width = size + 5
+ else
+ this.height = size + 5
+ }
+
+ this.setSize(this.width, this.height);
+ if (this.centered)
+ this._center(this.centerTop, this.centerLeft);
+ },
+
+ // Displays window modal state or not
+ show: function(modal) {
+ this.visible = true;
+ if (modal) {
+ // Hack for Safari !!
+ if (typeof this.overlayOpacity == "undefined") {
+ var that = this;
+ setTimeout(function() {that.show(modal)}, 10);
+ return;
+ }
+ Windows.addModalWindow(this);
+
+ this.modal = true;
+ this.setZIndex(Windows.maxZIndex + 1);
+ Windows.unsetOverflow(this);
+ }
+ else
+ if (!this.element.style.zIndex)
+ this.setZIndex(Windows.maxZIndex + 1);
+
+ // To restore overflow if need be
+ if (this.oldStyle)
+ this.getContent().setStyle({overflow: this.oldStyle});
+
+ this.computeBounds();
+
+ this._notify("onBeforeShow");
+ if (this.options.showEffect != Element.show && this.options.showEffectOptions)
+ this.options.showEffect(this.element, this.options.showEffectOptions);
+ else
+ this.options.showEffect(this.element);
+
+ this._checkIEOverlapping();
+ WindowUtilities.focusedWindow = this
+ this._notify("onShow");
+ },
+
+ // Displays window modal state or not at the center of the page
+ showCenter: function(modal, top, left) {
+ this.centered = true;
+ this.centerTop = top;
+ this.centerLeft = left;
+
+ this.show(modal);
+ },
+
+ isVisible: function() {
+ return this.visible;
+ },
+
+ _center: function(top, left) {
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
+ if (typeof top == "undefined")
+ top = (pageSize.windowHeight - (this.height + this.heightN + this.heightS))/2;
+ top += windowScroll.top
+
+ if (typeof left == "undefined")
+ left = (pageSize.windowWidth - (this.width + this.widthW + this.widthE))/2;
+ left += windowScroll.left
+ this.setLocation(top, left);
+ this.toFront();
+ },
+
+ _recenter: function(event) {
+ if (this.centered) {
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
+
+ // Check for this stupid IE that sends dumb events
+ if (this.pageSize && this.pageSize.windowWidth == pageSize.windowWidth && this.pageSize.windowHeight == pageSize.windowHeight &&
+ this.windowScroll.left == windowScroll.left && this.windowScroll.top == windowScroll.top)
+ return;
+ this.pageSize = pageSize;
+ this.windowScroll = windowScroll;
+ // set height of Overlay to take up whole page and show
+ if ($('overlay_modal'))
+ $('overlay_modal').setStyle({height: (pageSize.pageHeight + 'px')});
+
+ if (this.options.recenterAuto)
+ this._center(this.centerTop, this.centerLeft);
+ }
+ },
+
+ // Hides window
+ hide: function() {
+ this.visible = false;
+ if (this.modal) {
+ Windows.removeModalWindow(this);
+ Windows.resetOverflow();
+ }
+ // To avoid bug on scrolling bar
+ this.oldStyle = this.getContent().getStyle('overflow') || "auto"
+ this.getContent().setStyle({overflow: "hidden"});
+
+ this.options.hideEffect(this.element, this.options.hideEffectOptions);
+
+ if(this.iefix)
+ this.iefix.hide();
+
+ if (!this.doNotNotifyHide)
+ this._notify("onHide");
+ },
+
+ close: function() {
+ // Asks closeCallback if exists
+ if (this.visible) {
+ if (this.options.closeCallback && ! this.options.closeCallback(this))
+ return;
+
+ if (this.options.destroyOnClose) {
+ var destroyFunc = this.destroy.bind(this);
+ if (this.options.hideEffectOptions.afterFinish) {
+ var func = this.options.hideEffectOptions.afterFinish;
+ this.options.hideEffectOptions.afterFinish = function() {func();destroyFunc() }
+ }
+ else
+ this.options.hideEffectOptions.afterFinish = function() {destroyFunc() }
+ }
+ Windows.updateFocusedWindow();
+
+ this.doNotNotifyHide = true;
+ this.hide();
+ this.doNotNotifyHide = false;
+ this._notify("onClose");
+ }
+ },
+
+ minimize: function() {
+ if (this.resizing)
+ return;
+
+ var r2 = $(this.getId() + "_row2");
+
+ if (!this.minimized) {
+ this.minimized = true;
+
+ var dh = r2.getDimensions().height;
+ this.r2Height = dh;
+ var h = this.element.getHeight() - dh;
+
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
+ new Effect.ResizeWindow(this, null, null, null, this.height -dh, {duration: Window.resizeEffectDuration});
+ } else {
+ this.height -= dh;
+ this.element.setStyle({height: h + "px"});
+ r2.hide();
+ }
+
+ if (! this.useTop) {
+ var bottom = parseFloat(this.element.getStyle('bottom'));
+ this.element.setStyle({bottom: (bottom + dh) + 'px'});
+ }
+ }
+ else {
+ this.minimized = false;
+
+ var dh = this.r2Height;
+ this.r2Height = null;
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
+ new Effect.ResizeWindow(this, null, null, null, this.height + dh, {duration: Window.resizeEffectDuration});
+ }
+ else {
+ var h = this.element.getHeight() + dh;
+ this.height += dh;
+ this.element.setStyle({height: h + "px"})
+ r2.show();
+ }
+ if (! this.useTop) {
+ var bottom = parseFloat(this.element.getStyle('bottom'));
+ this.element.setStyle({bottom: (bottom - dh) + 'px'});
+ }
+ this.toFront();
+ }
+ this._notify("onMinimize");
+
+ // Store new location/size if need be
+ this._saveCookie()
+ },
+
+ maximize: function() {
+ if (this.isMinimized() || this.resizing)
+ return;
+
+ if (Prototype.Browser.IE && this.heightN == 0)
+ this._getWindowBorderSize();
+
+ if (this.storedLocation != null) {
+ this._restoreLocation();
+ if(this.iefix)
+ this.iefix.hide();
+ }
+ else {
+ this._storeLocation();
+ Windows.unsetOverflow(this);
+
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
+ var left = windowScroll.left;
+ var top = windowScroll.top;
+
+ if (this.options.parent != document.body) {
+ windowScroll = {top:0, left:0, bottom:0, right:0};
+ var dim = this.options.parent.getDimensions();
+ pageSize.windowWidth = dim.width;
+ pageSize.windowHeight = dim.height;
+ top = 0;
+ left = 0;
+ }
+
+ if (this.constraint) {
+ pageSize.windowWidth -= Math.max(0, this.constraintPad.left) + Math.max(0, this.constraintPad.right);
+ pageSize.windowHeight -= Math.max(0, this.constraintPad.top) + Math.max(0, this.constraintPad.bottom);
+ left += Math.max(0, this.constraintPad.left);
+ top += Math.max(0, this.constraintPad.top);
+ }
+
+ var width = pageSize.windowWidth - this.widthW - this.widthE;
+ var height= pageSize.windowHeight - this.heightN - this.heightS;
+
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
+ new Effect.ResizeWindow(this, top, left, width, height, {duration: Window.resizeEffectDuration});
+ }
+ else {
+ this.setSize(width, height);
+ this.element.setStyle(this.useLeft ? {left: left} : {right: left});
+ this.element.setStyle(this.useTop ? {top: top} : {bottom: top});
+ }
+
+ this.toFront();
+ if (this.iefix)
+ this._fixIEOverlapping();
+ }
+ this._notify("onMaximize");
+
+ // Store new location/size if need be
+ this._saveCookie()
+ },
+
+ isMinimized: function() {
+ return this.minimized;
+ },
+
+ isMaximized: function() {
+ return (this.storedLocation != null);
+ },
+
+ setOpacity: function(opacity) {
+ if (Element.setOpacity)
+ Element.setOpacity(this.element, opacity);
+ },
+
+ setZIndex: function(zindex) {
+ this.element.setStyle({zIndex: zindex});
+ Windows.updateZindex(zindex, this);
+ },
+
+ setTitle: function(newTitle) {
+ if (!newTitle || newTitle == "")
+ newTitle = "&nbsp;";
+
+ Element.update(this.element.id + '_top', newTitle);
+ },
+
+ getTitle: function() {
+ return $(this.element.id + '_top').innerHTML;
+ },
+
+ setStatusBar: function(element) {
+ var statusBar = $(this.getId() + "_bottom");
+
+ if (typeof(element) == "object") {
+ if (this.bottombar.firstChild)
+ this.bottombar.replaceChild(element, this.bottombar.firstChild);
+ else
+ this.bottombar.appendChild(element);
+ }
+ else
+ this.bottombar.innerHTML = element;
+ },
+
+ _checkIEOverlapping: function() {
+ if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (navigator.userAgent.indexOf('Opera')<0) && (this.element.getStyle('position')=='absolute')) {
+ new Insertion.After(this.element.id, '<iframe id="' + this.element.id + '_iefix" '+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
+ this.iefix = $(this.element.id+'_iefix');
+ }
+ if(this.iefix)
+ setTimeout(this._fixIEOverlapping.bind(this), 50);
+ },
+
+ _fixIEOverlapping: function() {
+ Position.clone(this.element, this.iefix);
+ this.iefix.style.zIndex = this.element.style.zIndex - 1;
+ this.iefix.show();
+ },
+
+ _getWindowBorderSize: function(event) {
+ // Hack to get real window border size!!
+ var div = this._createHiddenDiv(this.options.className + "_n")
+ this.heightN = Element.getDimensions(div).height;
+ div.parentNode.removeChild(div)
+
+ var div = this._createHiddenDiv(this.options.className + "_s")
+ this.heightS = Element.getDimensions(div).height;
+ div.parentNode.removeChild(div)
+
+ var div = this._createHiddenDiv(this.options.className + "_e")
+ this.widthE = Element.getDimensions(div).width;
+ div.parentNode.removeChild(div)
+
+ var div = this._createHiddenDiv(this.options.className + "_w")
+ this.widthW = Element.getDimensions(div).width;
+ div.parentNode.removeChild(div);
+
+ var div = document.createElement("div");
+ div.className = "overlay_" + this.options.className ;
+ document.body.appendChild(div);
+ //alert("no timeout:\nopacity: " + div.getStyle("opacity") + "\nwidth: " + document.defaultView.getComputedStyle(div, null).width);
+ var that = this;
+
+ // Workaround for Safari!!
+ setTimeout(function() {that.overlayOpacity = ($(div).getStyle("opacity")); div.parentNode.removeChild(div);}, 10);
+
+ // Workaround for IE!!
+ if (Prototype.Browser.IE) {
+ this.heightS = $(this.getId() +"_row3").getDimensions().height;
+ this.heightN = $(this.getId() +"_row1").getDimensions().height;
+ }
+
+ // Safari size fix
+ if (Prototype.Browser.WebKit && Prototype.Browser.WebKitVersion < 420)
+ this.setSize(this.width, this.height);
+ if (this.doMaximize)
+ this.maximize();
+ if (this.doMinimize)
+ this.minimize();
+ },
+
+ _createHiddenDiv: function(className) {
+ var objBody = document.body;
+ var win = document.createElement("div");
+ win.setAttribute('id', this.element.id+ "_tmp");
+ win.className = className;
+ win.style.display = 'none';
+ win.innerHTML = '';
+ objBody.insertBefore(win, objBody.firstChild);
+ return win;
+ },
+
+ _storeLocation: function() {
+ if (this.storedLocation == null) {
+ this.storedLocation = {useTop: this.useTop, useLeft: this.useLeft,
+ top: this.element.getStyle('top'), bottom: this.element.getStyle('bottom'),
+ left: this.element.getStyle('left'), right: this.element.getStyle('right'),
+ width: this.width, height: this.height };
+ }
+ },
+
+ _restoreLocation: function() {
+ if (this.storedLocation != null) {
+ this.useLeft = this.storedLocation.useLeft;
+ this.useTop = this.storedLocation.useTop;
+
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow)
+ new Effect.ResizeWindow(this, this.storedLocation.top, this.storedLocation.left, this.storedLocation.width, this.storedLocation.height, {duration: Window.resizeEffectDuration});
+ else {
+ this.element.setStyle(this.useLeft ? {left: this.storedLocation.left} : {right: this.storedLocation.right});
+ this.element.setStyle(this.useTop ? {top: this.storedLocation.top} : {bottom: this.storedLocation.bottom});
+ this.setSize(this.storedLocation.width, this.storedLocation.height);
+ }
+
+ Windows.resetOverflow();
+ this._removeStoreLocation();
+ }
+ },
+
+ _removeStoreLocation: function() {
+ this.storedLocation = null;
+ },
+
+ _saveCookie: function() {
+ if (this.cookie) {
+ var value = "";
+ if (this.useLeft)
+ value += "l:" + (this.storedLocation ? this.storedLocation.left : this.element.getStyle('left'))
+ else
+ value += "r:" + (this.storedLocation ? this.storedLocation.right : this.element.getStyle('right'))
+ if (this.useTop)
+ value += ",t:" + (this.storedLocation ? this.storedLocation.top : this.element.getStyle('top'))
+ else
+ value += ",b:" + (this.storedLocation ? this.storedLocation.bottom :this.element.getStyle('bottom'))
+
+ value += "," + (this.storedLocation ? this.storedLocation.width : this.width);
+ value += "," + (this.storedLocation ? this.storedLocation.height : this.height);
+ value += "," + this.isMinimized();
+ value += "," + this.isMaximized();
+ WindowUtilities.setCookie(value, this.cookie)
+ }
+ },
+
+ _createWiredElement: function() {
+ if (! this.wiredElement) {
+ if (Prototype.Browser.IE)
+ this._getWindowBorderSize();
+ var div = document.createElement("div");
+ div.className = "wired_frame " + this.options.className + "_wired_frame";
+
+ div.style.position = 'absolute';
+ this.options.parent.insertBefore(div, this.options.parent.firstChild);
+ this.wiredElement = $(div);
+ }
+ if (this.useLeft)
+ this.wiredElement.setStyle({left: this.element.getStyle('left')});
+ else
+ this.wiredElement.setStyle({right: this.element.getStyle('right')});
+
+ if (this.useTop)
+ this.wiredElement.setStyle({top: this.element.getStyle('top')});
+ else
+ this.wiredElement.setStyle({bottom: this.element.getStyle('bottom')});
+
+ var dim = this.element.getDimensions();
+ this.wiredElement.setStyle({width: dim.width + "px", height: dim.height +"px"});
+
+ this.wiredElement.setStyle({zIndex: Windows.maxZIndex+30});
+ return this.wiredElement;
+ },
+
+ _hideWiredElement: function() {
+ if (! this.wiredElement || ! this.currentDrag)
+ return;
+ if (this.currentDrag == this.element)
+ this.currentDrag = null;
+ else {
+ if (this.useLeft)
+ this.element.setStyle({left: this.currentDrag.getStyle('left')});
+ else
+ this.element.setStyle({right: this.currentDrag.getStyle('right')});
+
+ if (this.useTop)
+ this.element.setStyle({top: this.currentDrag.getStyle('top')});
+ else
+ this.element.setStyle({bottom: this.currentDrag.getStyle('bottom')});
+
+ this.currentDrag.hide();
+ this.currentDrag = null;
+ if (this.doResize)
+ this.setSize(this.width, this.height);
+ }
+ },
+
+ _notify: function(eventName) {
+ if (this.options[eventName])
+ this.options[eventName](this);
+ else
+ Windows.notify(eventName, this);
+ }
+};
+
+// Windows containers, register all page windows
+var Windows = {
+ windows: [],
+ modalWindows: [],
+ observers: [],
+ focusedWindow: null,
+ maxZIndex: 0,
+ overlayShowEffectOptions: {duration: 0.5},
+ overlayHideEffectOptions: {duration: 0.5},
+
+ addObserver: function(observer) {
+ this.removeObserver(observer);
+ this.observers.push(observer);
+ },
+
+ removeObserver: function(observer) {
+ this.observers = this.observers.reject( function(o) { return o==observer });
+ },
+
+ // onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
+ notify: function(eventName, win) {
+ this.observers.each( function(o) {if(o[eventName]) o[eventName](eventName, win);});
+ },
+
+ // Gets window from its id
+ getWindow: function(id) {
+ return this.windows.detect(function(d) { return d.getId() ==id });
+ },
+
+ // Gets the last focused window
+ getFocusedWindow: function() {
+ return this.focusedWindow;
+ },
+
+ updateFocusedWindow: function() {
+ this.focusedWindow = this.windows.length >=2 ? this.windows[this.windows.length-2] : null;
+ },
+
+ // Registers a new window (called by Windows constructor)
+ register: function(win) {
+ this.windows.push(win);
+ },
+
+ // Add a modal window in the stack
+ addModalWindow: function(win) {
+ // Disable screen if first modal window
+ if (this.modalWindows.length == 0) {
+ WindowUtilities.disableScreen(win.options.className, 'overlay_modal', win.overlayOpacity, win.getId(), win.options.parent);
+ }
+ else {
+ // Move overlay over all windows
+ if (Window.keepMultiModalWindow) {
+ $('overlay_modal').style.zIndex = Windows.maxZIndex + 1;
+ Windows.maxZIndex += 1;
+ WindowUtilities._hideSelect(this.modalWindows.last().getId());
+ }
+ // Hide current modal window
+ else
+ this.modalWindows.last().element.hide();
+ // Fucking IE select issue
+ WindowUtilities._showSelect(win.getId());
+ }
+ this.modalWindows.push(win);
+ },
+
+ removeModalWindow: function(win) {
+ this.modalWindows.pop();
+
+ // No more modal windows
+ if (this.modalWindows.length == 0)
+ WindowUtilities.enableScreen();
+ else {
+ if (Window.keepMultiModalWindow) {
+ this.modalWindows.last().toFront();
+ WindowUtilities._showSelect(this.modalWindows.last().getId());
+ }
+ else
+ this.modalWindows.last().element.show();
+ }
+ },
+
+ // Registers a new window (called by Windows constructor)
+ register: function(win) {
+ this.windows.push(win);
+ },
+
+ // Unregisters a window (called by Windows destructor)
+ unregister: function(win) {
+ this.windows = this.windows.reject(function(d) { return d==win });
+ },
+
+ // Closes all windows
+ closeAll: function() {
+ this.windows.each( function(w) {Windows.close(w.getId())} );
+ },
+
+ closeAllModalWindows: function() {
+ WindowUtilities.enableScreen();
+ this.modalWindows.each( function(win) {if (win) win.close()});
+ },
+
+ // Minimizes a window with its id
+ minimize: function(id, event) {
+ var win = this.getWindow(id)
+ if (win && win.visible)
+ win.minimize();
+ Event.stop(event);
+ },
+
+ // Maximizes a window with its id
+ maximize: function(id, event) {
+ var win = this.getWindow(id)
+ if (win && win.visible)
+ win.maximize();
+ Event.stop(event);
+ },
+
+ // Closes a window with its id
+ close: function(id, event) {
+ var win = this.getWindow(id);
+ if (win)
+ win.close();
+ if (event)
+ Event.stop(event);
+ },
+
+ blur: function(id) {
+ var win = this.getWindow(id);
+ if (!win)
+ return;
+ if (win.options.blurClassName)
+ win.changeClassName(win.options.blurClassName);
+ if (this.focusedWindow == win)
+ this.focusedWindow = null;
+ win._notify("onBlur");
+ },
+
+ focus: function(id) {
+ var win = this.getWindow(id);
+ if (!win)
+ return;
+ if (this.focusedWindow)
+ this.blur(this.focusedWindow.getId())
+
+ if (win.options.focusClassName)
+ win.changeClassName(win.options.focusClassName);
+ this.focusedWindow = win;
+ win._notify("onFocus");
+ },
+
+ unsetOverflow: function(except) {
+ this.windows.each(function(d) { d.oldOverflow = d.getContent().getStyle("overflow") || "auto" ; d.getContent().setStyle({overflow: "hidden"}) });
+ if (except && except.oldOverflow)
+ except.getContent().setStyle({overflow: except.oldOverflow});
+ },
+
+ resetOverflow: function() {
+ this.windows.each(function(d) { if (d.oldOverflow) d.getContent().setStyle({overflow: d.oldOverflow}) });
+ },
+
+ updateZindex: function(zindex, win) {
+ if (zindex > this.maxZIndex) {
+ this.maxZIndex = zindex;
+ if (this.focusedWindow)
+ this.blur(this.focusedWindow.getId())
+ }
+ this.focusedWindow = win;
+ if (this.focusedWindow)
+ this.focus(this.focusedWindow.getId())
+ }
+};
+
+var Dialog = {
+ dialogId: null,
+ onCompleteFunc: null,
+ callFunc: null,
+ parameters: null,
+
+ confirm: function(content, parameters) {
+ // Get Ajax return before
+ if (content && typeof content != "string") {
+ Dialog._runAjaxRequest(content, parameters, Dialog.confirm);
+ return
+ }
+ content = content || "";
+
+ parameters = parameters || {};
+ var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";
+ var cancelLabel = parameters.cancelLabel ? parameters.cancelLabel : "Cancel";
+
+ // Backward compatibility
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
+ parameters.windowParameters = parameters.windowParameters || {};
+
+ parameters.className = parameters.className || "alert";
+
+ var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
+ var cancelButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " cancel_button'"
+ var content = "\
+ <div class='" + parameters.className + "_message'>" + content + "</div>\
+ <div class='" + parameters.className + "_buttons'>\
+ <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
+ <input type='button' value='" + cancelLabel + "' onclick='Dialog.cancelCallback()' " + cancelButtonClass + "/>\
+ </div>\
+ ";
+ return this._openDialog(content, parameters)
+ },
+
+ alert: function(content, parameters) {
+ // Get Ajax return before
+ if (content && typeof content != "string") {
+ Dialog._runAjaxRequest(content, parameters, Dialog.alert);
+ return
+ }
+ content = content || "";
+
+ parameters = parameters || {};
+ var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";
+
+ // Backward compatibility
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
+ parameters.windowParameters = parameters.windowParameters || {};
+
+ parameters.className = parameters.className || "alert";
+
+ var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
+ var content = "\
+ <div class='" + parameters.className + "_message'>" + content + "</div>\
+ <div class='" + parameters.className + "_buttons'>\
+ <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
+ </div>";
+ return this._openDialog(content, parameters)
+ },
+
+ info: function(content, parameters) {
+ // Get Ajax return before
+ if (content && typeof content != "string") {
+ Dialog._runAjaxRequest(content, parameters, Dialog.info);
+ return
+ }
+ content = content || "";
+
+ // Backward compatibility
+ parameters = parameters || {};
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
+ parameters.windowParameters = parameters.windowParameters || {};
+
+ parameters.className = parameters.className || "alert";
+
+ var content = "<div id='modal_dialog_message' class='" + parameters.className + "_message'>" + content + "</div>";
+ if (parameters.showProgress)
+ content += "<div id='modal_dialog_progress' class='" + parameters.className + "_progress'> </div>";
+
+ parameters.ok = null;
+ parameters.cancel = null;
+
+ return this._openDialog(content, parameters)
+ },
+
+ setInfoMessage: function(message) {
+ $('modal_dialog_message').update(message);
+ },
+
+ closeInfo: function() {
+ Windows.close(this.dialogId);
+ },
+
+ _openDialog: function(content, parameters) {
+ var className = parameters.className;
+
+ if (! parameters.height && ! parameters.width) {
+ parameters.width = WindowUtilities.getPageSize(parameters.options.parent || document.body).pageWidth / 2;
+ }
+ if (parameters.id)
+ this.dialogId = parameters.id;
+ else {
+ var t = new Date();
+ this.dialogId = 'modal_dialog_' + t.getTime();
+ parameters.id = this.dialogId;
+ }
+
+ // compute height or width if need be
+ if (! parameters.height || ! parameters.width) {
+ var size = WindowUtilities._computeSize(content, this.dialogId, parameters.width, parameters.height, 5, className)
+ if (parameters.height)
+ parameters.width = size + 5
+ else
+ parameters.height = size + 5
+ }
+ parameters.effectOptions = parameters.effectOptions ;
+ parameters.resizable = parameters.resizable || false;
+ parameters.minimizable = parameters.minimizable || false;
+ parameters.maximizable = parameters.maximizable || false;
+ parameters.draggable = parameters.draggable || false;
+ parameters.closable = parameters.closable || false;
+
+ var win = new Window(parameters);
+ win.getContent().innerHTML = content;
+
+ win.showCenter(true, parameters.top, parameters.left);
+ win.setDestroyOnClose();
+
+ win.cancelCallback = parameters.onCancel || parameters.cancel;
+ win.okCallback = parameters.onOk || parameters.ok;
+
+ return win;
+ },
+
+ _getAjaxContent: function(originalRequest) {
+ Dialog.callFunc(originalRequest.responseText, Dialog.parameters)
+ },
+
+ _runAjaxRequest: function(message, parameters, callFunc) {
+ if (message.options == null)
+ message.options = {}
+ Dialog.onCompleteFunc = message.options.onComplete;
+ Dialog.parameters = parameters;
+ Dialog.callFunc = callFunc;
+
+ message.options.onComplete = Dialog._getAjaxContent;
+ new Ajax.Request(message.url, message.options);
+ },
+
+ okCallback: function() {
+ var win = Windows.focusedWindow;
+ if (!win.okCallback || win.okCallback(win)) {
+ // Remove onclick on button
+ $$("#" + win.getId()+" input").each(function(element) {element.onclick=null;})
+ win.close();
+ }
+ },
+
+ cancelCallback: function() {
+ var win = Windows.focusedWindow;
+ // Remove onclick on button
+ $$("#" + win.getId()+" input").each(function(element) {element.onclick=null})
+ win.close();
+ if (win.cancelCallback)
+ win.cancelCallback(win);
+ }
+}
+/*
+ Based on Lightbox JS: Fullsize Image Overlays
+ by Lokesh Dhakar - http://www.huddletogether.com
+
+ For more information on this script, visit:
+ http://huddletogether.com/projects/lightbox/
+
+ Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
+ (basically, do anything you want, just leave my name and link)
+*/
+
+if (Prototype.Browser.WebKit) {
+ var array = navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));
+ Prototype.Browser.WebKitVersion = parseFloat(array[1]);
+}
+
+var WindowUtilities = {
+ // From dragdrop.js
+ getWindowScroll: function(parent) {
+ var T, L, W, H;
+ parent = parent || document.body;
+ if (parent != document.body) {
+ T = parent.scrollTop;
+ L = parent.scrollLeft;
+ W = parent.scrollWidth;
+ H = parent.scrollHeight;
+ }
+ else {
+ var w = window;
+ with (w.document) {
+ if (w.document.documentElement && documentElement.scrollTop) {
+ T = documentElement.scrollTop;
+ L = documentElement.scrollLeft;
+ } else if (w.document.body) {
+ T = body.scrollTop;
+ L = body.scrollLeft;
+ }
+ if (w.innerWidth) {
+ W = w.innerWidth;
+ H = w.innerHeight;
+ } else if (w.document.documentElement && documentElement.clientWidth) {
+ W = documentElement.clientWidth;
+ H = documentElement.clientHeight;
+ } else {
+ W = body.offsetWidth;
+ H = body.offsetHeight
+ }
+ }
+ }
+ return { top: T, left: L, width: W, height: H };
+ },
+ //
+ // getPageSize()
+ // Returns array with page width, height and window width, height
+ // Core code from - quirksmode.org
+ // Edit for Firefox by pHaez
+ //
+ getPageSize: function(parent){
+ parent = parent || document.body;
+ var windowWidth, windowHeight;
+ var pageHeight, pageWidth;
+ if (parent != document.body) {
+ windowWidth = parent.getWidth();
+ windowHeight = parent.getHeight();
+ pageWidth = parent.scrollWidth;
+ pageHeight = parent.scrollHeight;
+ }
+ else {
+ var xScroll, yScroll;
+
+ if (window.innerHeight && window.scrollMaxY) {
+ xScroll = document.body.scrollWidth;
+ yScroll = window.innerHeight + window.scrollMaxY;
+ } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
+ xScroll = document.body.scrollWidth;
+ yScroll = document.body.scrollHeight;
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
+ xScroll = document.body.offsetWidth;
+ yScroll = document.body.offsetHeight;
+ }
+
+
+ if (self.innerHeight) { // all except Explorer
+ windowWidth = self.innerWidth;
+ windowHeight = self.innerHeight;
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
+ windowWidth = document.documentElement.clientWidth;
+ windowHeight = document.documentElement.clientHeight;
+ } else if (document.body) { // other Explorers
+ windowWidth = document.body.clientWidth;
+ windowHeight = document.body.clientHeight;
+ }
+
+ // for small pages with total height less then height of the viewport
+ if(yScroll < windowHeight){
+ pageHeight = windowHeight;
+ } else {
+ pageHeight = yScroll;
+ }
+
+ // for small pages with total width less then width of the viewport
+ if(xScroll < windowWidth){
+ pageWidth = windowWidth;
+ } else {
+ pageWidth = xScroll;
+ }
+ }
+ return {pageWidth: pageWidth ,pageHeight: pageHeight , windowWidth: windowWidth, windowHeight: windowHeight};
+ },
+
+ disableScreen: function(className, overlayId, overlayOpacity, contentId, parent) {
+ WindowUtilities.initLightbox(overlayId, className, function() {this._disableScreen(className, overlayId, overlayOpacity, contentId)}.bind(this), parent || document.body);
+ },
+
+ _disableScreen: function(className, overlayId, overlayOpacity, contentId) {
+ // prep objects
+ var objOverlay = $(overlayId);
+
+ var pageSize = WindowUtilities.getPageSize(objOverlay.parentNode);
+
+ // Hide select boxes as they will 'peek' through the image in IE, store old value
+ if (contentId && Prototype.Browser.IE) {
+ WindowUtilities._hideSelect();
+ WindowUtilities._showSelect(contentId);
+ }
+
+ // set height of Overlay to take up whole page and show
+ objOverlay.style.height = (pageSize.pageHeight + 'px');
+ objOverlay.style.display = 'none';
+ if (overlayId == "overlay_modal" && Window.hasEffectLib && Windows.overlayShowEffectOptions) {
+ objOverlay.overlayOpacity = overlayOpacity;
+ new Effect.Appear(objOverlay, Object.extend({from: 0, to: overlayOpacity}, Windows.overlayShowEffectOptions));
+ }
+ else
+ objOverlay.style.display = "block";
+ },
+
+ enableScreen: function(id) {
+ id = id || 'overlay_modal';
+ var objOverlay = $(id);
+ if (objOverlay) {
+ // hide lightbox and overlay
+ if (id == "overlay_modal" && Window.hasEffectLib && Windows.overlayHideEffectOptions)
+ new Effect.Fade(objOverlay, Object.extend({from: objOverlay.overlayOpacity, to:0}, Windows.overlayHideEffectOptions));
+ else {
+ objOverlay.style.display = 'none';
+ objOverlay.parentNode.removeChild(objOverlay);
+ }
+
+ // make select boxes visible using old value
+ if (id != "__invisible__")
+ WindowUtilities._showSelect();
+ }
+ },
+
+ _hideSelect: function(id) {
+ if (Prototype.Browser.IE) {
+ id = id == null ? "" : "#" + id + " ";
+ $$(id + 'select').each(function(element) {
+ if (! WindowUtilities.isDefined(element.oldVisibility)) {
+ element.oldVisibility = element.style.visibility ? element.style.visibility : "visible";
+ element.style.visibility = "hidden";
+ }
+ });
+ }
+ },
+
+ _showSelect: function(id) {
+ if (Prototype.Browser.IE) {
+ id = id == null ? "" : "#" + id + " ";
+ $$(id + 'select').each(function(element) {
+ if (WindowUtilities.isDefined(element.oldVisibility)) {
+ // Why?? Ask IE
+ try {
+ element.style.visibility = element.oldVisibility;
+ } catch(e) {
+ element.style.visibility = "visible";
+ }
+ element.oldVisibility = null;
+ }
+ else {
+ if (element.style.visibility)
+ element.style.visibility = "visible";
+ }
+ });
+ }
+ },
+
+ isDefined: function(object) {
+ return typeof(object) != "undefined" && object != null;
+ },
+
+ // initLightbox()
+ // Function runs on window load, going through link tags looking for rel="lightbox".
+ // These links receive onclick events that enable the lightbox display for their targets.
+ // The function also inserts html markup at the top of the page which will be used as a
+ // container for the overlay pattern and the inline image.
+ initLightbox: function(id, className, doneHandler, parent) {
+ // Already done, just update zIndex
+ if ($(id)) {
+ Element.setStyle(id, {zIndex: Windows.maxZIndex + 1});
+ Windows.maxZIndex++;
+ doneHandler();
+ }
+ // create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
+ else {
+ var objOverlay = document.createElement("div");
+ objOverlay.setAttribute('id', id);
+ objOverlay.className = "overlay_" + className
+ objOverlay.style.display = 'none';
+ objOverlay.style.position = 'absolute';
+ objOverlay.style.top = '0';
+ objOverlay.style.left = '0';
+ objOverlay.style.zIndex = Windows.maxZIndex + 1;
+ Windows.maxZIndex++;
+ objOverlay.style.width = '100%';
+ parent.insertBefore(objOverlay, parent.firstChild);
+ if (Prototype.Browser.WebKit && id == "overlay_modal") {
+ setTimeout(function() {doneHandler()}, 10);
+ }
+ else
+ doneHandler();
+ }
+ },
+
+ setCookie: function(value, parameters) {
+ document.cookie= parameters[0] + "=" + escape(value) +
+ ((parameters[1]) ? "; expires=" + parameters[1].toGMTString() : "") +
+ ((parameters[2]) ? "; path=" + parameters[2] : "") +
+ ((parameters[3]) ? "; domain=" + parameters[3] : "") +
+ ((parameters[4]) ? "; secure" : "");
+ },
+
+ getCookie: function(name) {
+ var dc = document.cookie;
+ var prefix = name + "=";
+ var begin = dc.indexOf("; " + prefix);
+ if (begin == -1) {
+ begin = dc.indexOf(prefix);
+ if (begin != 0) return null;
+ } else {
+ begin += 2;
+ }
+ var end = document.cookie.indexOf(";", begin);
+ if (end == -1) {
+ end = dc.length;
+ }
+ return unescape(dc.substring(begin + prefix.length, end));
+ },
+
+ _computeSize: function(content, id, width, height, margin, className) {
+ var objBody = document.body;
+ var tmpObj = document.createElement("div");
+ tmpObj.setAttribute('id', id);
+ tmpObj.className = className + "_content";
+
+ if (height)
+ tmpObj.style.height = height + "px"
+ else
+ tmpObj.style.width = width + "px"
+
+ tmpObj.style.position = 'absolute';
+ tmpObj.style.top = '0';
+ tmpObj.style.left = '0';
+ tmpObj.style.display = 'none';
+
+ tmpObj.innerHTML = content;
+ objBody.insertBefore(tmpObj, objBody.firstChild);
+
+ var size;
+ if (height)
+ size = $(tmpObj).getDimensions().width + margin;
+ else
+ size = $(tmpObj).getDimensions().height + margin;
+ objBody.removeChild(tmpObj);
+ return size;
+ }
+}
+
diff --git a/js/prototype-window-1.3/documentation/javascripts/window_effects.js b/js/prototype-window-1.3/documentation/javascripts/window_effects.js
new file mode 100755
index 0000000..6ad73cc
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/window_effects.js
@@ -0,0 +1,157 @@
+Effect.ResizeWindow = Class.create();
+Object.extend(Object.extend(Effect.ResizeWindow.prototype, Effect.Base.prototype), {
+ initialize: function(win, top, left, width, height) {
+ this.window = win;
+ this.window.resizing = true;
+
+ var size = win.getSize();
+ this.initWidth = parseFloat(size.width);
+ this.initHeight = parseFloat(size.height);
+
+ var location = win.getLocation();
+ this.initTop = parseFloat(location.top);
+ this.initLeft = parseFloat(location.left);
+
+ this.width = width != null ? parseFloat(width) : this.initWidth;
+ this.height = height != null ? parseFloat(height) : this.initHeight;
+ this.top = top != null ? parseFloat(top) : this.initTop;
+ this.left = left != null ? parseFloat(left) : this.initLeft;
+
+ this.dx = this.left - this.initLeft;
+ this.dy = this.top - this.initTop;
+ this.dw = this.width - this.initWidth;
+ this.dh = this.height - this.initHeight;
+
+ this.r2 = $(this.window.getId() + "_row2");
+ this.content = $(this.window.getId() + "_content");
+
+ this.contentOverflow = this.content.getStyle("overflow") || "auto";
+ this.content.setStyle({overflow: "hidden"});
+
+ // Wired mode
+ if (this.window.options.wiredDrag) {
+ this.window.currentDrag = win._createWiredElement();
+ this.window.currentDrag.show();
+ this.window.element.hide();
+ }
+
+ this.start(arguments[5]);
+ },
+
+ update: function(position) {
+ var width = Math.floor(this.initWidth + this.dw * position);
+ var height = Math.floor(this.initHeight + this.dh * position);
+ var top = Math.floor(this.initTop + this.dy * position);
+ var left = Math.floor(this.initLeft + this.dx * position);
+
+ if (window.ie) {
+ if (Math.floor(height) == 0)
+ this.r2.hide();
+ else if (Math.floor(height) >1)
+ this.r2.show();
+ }
+ this.r2.setStyle({height: height});
+ this.window.setSize(width, height);
+ this.window.setLocation(top, left);
+ },
+
+ finish: function(position) {
+ // Wired mode
+ if (this.window.options.wiredDrag) {
+ this.window._hideWiredElement();
+ this.window.element.show();
+ }
+
+ this.window.setSize(this.width, this.height);
+ this.window.setLocation(this.top, this.left);
+ this.r2.setStyle({height: null});
+
+ this.content.setStyle({overflow: this.contentOverflow});
+
+ this.window.resizing = false;
+ }
+});
+
+Effect.ModalSlideDown = function(element) {
+ var windowScroll = WindowUtilities.getWindowScroll();
+ var height = element.getStyle("height");
+ element.setStyle({top: - (parseFloat(height) - windowScroll.top) + "px"});
+
+ element.show();
+ return new Effect.Move(element, Object.extend({ x: 0, y: parseFloat(height) }, arguments[1] || {}));
+};
+
+
+Effect.ModalSlideUp = function(element) {
+ var height = element.getStyle("height");
+ return new Effect.Move(element, Object.extend({ x: 0, y: -parseFloat(height) }, arguments[1] || {}));
+};
+
+PopupEffect = Class.create();
+PopupEffect.prototype = {
+ initialize: function(htmlElement) {
+ this.html = $(htmlElement);
+ this.options = Object.extend({className: "popup_effect", duration: 0.4}, arguments[1] || {});
+
+ },
+ show: function(element, options) {
+ var position = Position.cumulativeOffset(this.html);
+ var size = this.html.getDimensions();
+ var bounds = element.win.getBounds();
+ this.window = element.win;
+ // Create a div
+ if (!this.div) {
+ this.div = document.createElement("div");
+ this.div.className = this.options.className;
+ this.div.style.height = size.height + "px";
+ this.div.style.width = size.width + "px";
+ this.div.style.top = position[1] + "px";
+ this.div.style.left = position[0] + "px";
+ this.div.style.position = "absolute"
+ document.body.appendChild(this.div);
+ }
+ if (this.options.fromOpacity)
+ this.div.setStyle({opacity: this.options.fromOpacity})
+ this.div.show();
+ var style = "top:" + bounds.top + ";left:" +bounds.left + ";width:" + bounds.width +";height:" + bounds.height;
+ if (this.options.toOpacity)
+ style += ";opacity:" + this.options.toOpacity;
+
+ new Effect.Morph(this.div ,{style: style, duration: this.options.duration, afterFinish: this._showWindow.bind(this)});
+ },
+
+ hide: function(element, options) {
+ var position = Position.cumulativeOffset(this.html);
+ var size = this.html.getDimensions();
+ this.window.visible = true;
+ var bounds = this.window.getBounds();
+ this.window.visible = false;
+
+ this.window.element.hide();
+
+ this.div.style.height = bounds.height;
+ this.div.style.width = bounds.width;
+ this.div.style.top = bounds.top;
+ this.div.style.left = bounds.left;
+
+ if (this.options.toOpacity)
+ this.div.setStyle({opacity: this.options.toOpacity})
+
+ this.div.show();
+ var style = "top:" + position[1] + "px;left:" + position[0] + "px;width:" + size.width +"px;height:" + size.height + "px";
+
+ if (this.options.fromOpacity)
+ style += ";opacity:" + this.options.fromOpacity;
+ new Effect.Morph(this.div ,{style: style, duration: this.options.duration, afterFinish: this._hideDiv.bind(this)});
+ },
+
+ _showWindow: function() {
+ this.div.hide();
+ this.window.element.show();
+ },
+
+ _hideDiv: function() {
+ this.div.hide();
+ }
+}
+
diff --git a/js/prototype-window-1.3/documentation/javascripts/window_ext.js b/js/prototype-window-1.3/documentation/javascripts/window_ext.js
new file mode 100755
index 0000000..60efac6
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/javascripts/window_ext.js
@@ -0,0 +1,115 @@
+// Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.com)
+// YOU MUST INCLUDE window.js BEFORE
+//
+// Object to store hide/show windows status in a cookie
+// Just add at the end of your HTML file this javascript line: WindowStore.init()
+WindowStore = {
+ doSetCookie: false,
+ cookieName: "__window_store__",
+ expired: null,
+
+ // Init function with two optional parameters
+ // - cookieName (default = __window_store__)
+ // - expiration date (default 3 years from now)
+ init: function(cookieName, expired) {
+ WindowStore.cookieName = cookieName || WindowStore.cookieName
+
+ if (! expired) {
+ var today = new Date();
+ today.setYear(today.getYear()+1903);
+ WindowStore.expired = today;
+ }
+ else
+ WindowStore.expired = expired;
+
+ Windows.windows.each(function(win) {
+ win.setCookie(win.getId(), WindowStore.expired);
+ });
+
+ // Create observer on show/hide events
+ var myObserver = {
+ onShow: function(eventName, win) {
+ WindowStore._saveCookie();
+ },
+
+ onClose: function(eventName, win) {
+ WindowStore._saveCookie();
+ },
+
+ onHide: function(eventName, win) {
+ WindowStore._saveCookie();
+ }
+ }
+ Windows.addObserver(myObserver);
+
+ WindowStore._restoreWindows();
+ WindowStore._saveCookie();
+ },
+
+ show: function(win) {
+ eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName));
+ if (cookie != null) {
+ if (cookie[win.getId()])
+ win.show();
+ }
+ else
+ win.show();
+ },
+
+ // Function to store windows show/hide status in a cookie
+ _saveCookie: function() {
+ if (!doSetCookie)
+ return;
+
+ var cookieValue = "{";
+ Windows.windows.each(function(win) {
+ if (cookieValue != "{")
+ cookieValue += ","
+ cookieValue += win.getId() + ": " + win.isVisible();
+ });
+ cookieValue += "}"
+
+ WindowUtilities.setCookie(cookieValue, [WindowStore.cookieName, WindowStore.expired]);
+ },
+
+ // Function to restore windows show/hide status from a cookie if exists
+ _restoreWindows: function() {
+ eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName));
+ if (cookie != null) {
+ doSetCookie = false;
+ Windows.windows.each(function(win) {
+ if (cookie[win.getId()])
+ win.show();
+ });
+ }
+ doSetCookie = true;
+ }
+}
+
+// Object to set a close key an all windows
+WindowCloseKey = {
+ keyCode: Event.KEY_ESC,
+
+ init: function(keyCode) {
+ if (keyCode)
+ WindowCloseKey.keyCode = keyCode;
+
+ Event.observe(document, 'keydown', this._closeCurrentWindow.bindAsEventListener(this));
+ },
+
+ _closeCurrentWindow: function(event) {
+ var e = event || window.event
+ var characterCode = e.which || e.keyCode;
+
+ // Check if there is a top window (it means it's an URL content)
+ var win = top.Windows.focusedWindow;
+ if (characterCode == WindowCloseKey.keyCode && win) {
+ if (win.cancelCallback)
+ top.Dialog.cancelCallback();
+ else if (win.okCallback)
+ top.Dialog.okCallback();
+ else
+ top.Windows.close(top.Windows.focusedWindow.getId());
+ }
+ }
+} \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/js/application.js b/js/prototype-window-1.3/documentation/js/application.js
new file mode 100755
index 0000000..a650e73
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/js/application.js
@@ -0,0 +1,173 @@
+var Application = {
+ lastId: 0,
+ currentSampleNb: 0,
+
+ getNewId: function() {
+ Application.lastId++;
+ return "window_id_" + Application.lastId;
+ },
+
+ showCode: function(a, id) {
+ a.innerHTML = $(id + "_codediv").visible() ? "View source" : "Hide source"
+ $(id + "_codediv").toggle();
+ },
+
+ editCode: function(id) {
+ var pre = $(id);
+ // First time
+ if (!pre.textarea) {
+ var textarea = document.createElement("textarea");
+ var dim = pre.getDimensions();
+ textarea.setAttribute('id', id + "_edit");
+ textarea.setAttribute('class', 'listing');
+
+ pre.textarea = textarea
+
+ pre.parentNode.insertBefore(textarea, pre);
+ }
+ // Show text area
+ if (pre.visible()) {
+ var dim = pre.getDimensions();
+
+ pre.textarea.value = pre.innerHTML;
+ pre.hide();
+ pre.textarea.style.height = dim.height + "px"
+ pre.textarea.style.width = "100%"
+ pre.textarea.style.display = "block";
+
+ pre.textarea.focus();
+ $(id+'_edit_button').innerHTML = "Stop editing";
+ }
+ // Remove text area
+ else {
+ pre.update(pre.textarea.value);
+ pre.textarea.style.display = "none";
+ pre.show();
+ $(id+'_edit_button').innerHTML = "Edit Source";
+ }
+ },
+
+ evalCode: function(id) {
+ var pre = $(id);
+ var code;
+ if (pre.textarea && pre.textarea.visible)
+ code = pre.textarea.value;
+ else
+ code = pre.innerHTML;
+
+ code = code.gsub("&lt;", "<");
+ code = code.gsub("&gt;", ">");
+
+ try {
+ eval(code);
+ }
+ catch (error) {
+ Dialog.alert(" error accurs while interprating your javascript code <br/>" + error, {windowParameters: {width:300, showEffect:Element.show}, okLabel: "close"});
+ }
+ },
+
+ addTitle: function(title, id) {
+ Application.currentSampleNb++;
+ idButton = id + '_click_button';
+
+ document.write("<h2>" + Application.currentSampleNb + ". " + title + " (<span class='title' id='" + idButton + "' href='#' onmouseover=\"$('" + idButton + "').addClassName('selected')\" onmouseout=\"$('" + idButton + "').removeClassName('selected')\" onclick=\"Application.evalCode('" + id + "', true)\">click here</span>)</h2>")
+ },
+
+ addShowButton: function(id) {
+ idButton = id + '_show_button';
+ document.write("<span class='title2' id='" + idButton + "' onmouseover=\"$('" + idButton + "').addClassName('selected')\" onmouseout=\"$('" + idButton + "').removeClassName('selected')\" onclick=\"Application.showCode(this, '" + id + "')\">View source</span>")
+ },
+
+ addEditButton: function(id) {
+ idButton = id + '_edit_button';
+ html = "<p class='buttons'><span class='button' onmouseover=\"$('" + idButton + "').addClassName('selected')\" onmouseout=\"$('" + idButton + "').removeClassName('selected')\" id='" + idButton + "' onclick=\"Application.editCode('" + id + "')\">Edit Source</span> </p>";
+ document.write(html)
+ },
+
+ addViewThemeButton: function(theme, modal) {
+ idButton = theme + '_theme_button';
+ html = "<span class='title2' onmouseover=\"$('" + idButton + "').addClassName('selected')\" onmouseout=\"$('" + idButton + "').removeClassName('selected')\" id='" + idButton + "' onclick=\"Application.openThemeWindow('" + theme + "')\">View a window</span>";
+ document.write(html)
+ },
+
+ addViewThemeDialogButton: function(theme, modal) {
+ idButton = theme + '_modal_theme_button';
+ html = "<span class='title2' onmouseover=\"$('" + idButton + "').addClassName('selected')\" onmouseout=\"$('" + idButton + "').removeClassName('selected')\" id='" + idButton + "' onclick=\"Application.openThemeDialog('" + theme + "')\">Open a alert dialog</span>";
+ document.write(html)
+ },
+
+ openThemeWindow: function(theme, modal) {
+ var win = new Window(Application.getNewId(), {className: theme, width:300, height:200, title: "Theme : " + theme});
+ win.getContent().innerHTML= "Lorem ipsum dolor sit amet, consectetur adipiscing elit, set eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc.";
+ win.showCenter(modal);
+ },
+
+ openThemeDialog: function(theme, modal) {
+ Dialog.alert("Lorem ipsum dolor sit amet, consectetur adipiscing elit, set eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc",
+ {windowParameters: {className: theme, width:350}, okLabel: "close"});
+ },
+
+ insertDocOverview: function() {
+ var div = $('Overview');
+ var html = "<table class='overview''><tr>";
+
+ // Window
+ html += "<td>Window Class <ul>";
+ $$(".window").each(function(element){html += "- <a href='#" + element.title + "'>" + element.title + "</a><br/>"});
+ html += "</ul></td>";
+
+ // Dialog
+ html += "<td>Dialog Module <ul>";
+ $$(".dialogmodule").each(function(element){html += "- <a href='#" + element.title + "'>" + element.title + "</a><br/>"});
+ html += "</ul></td>";
+
+ // Windows
+ html += "<td>Windows Module <ul>";
+ $$(".windows").each(function(element){html += "- <a href='#" + element.title + "'>" + element.title + "</a><br/>"});
+ html += "</ul></td>";
+
+ // Windows
+ html += "<td>Windows Add-ons <ul>";
+ $$(".addons").each(function(element){html += "- <a href='#" + element.title + "'>" + element.title + "</a><br/>"});
+ html += "</ul></td>";
+
+ html += "</tr></table>"
+ div.innerHTML = html;
+ },
+
+ insertNavigation: function(selected) {
+ document.write('\
+ <h1><a href="http://prototype-window.xilinus.com"><img border=0 src="pwc.gif"/></a></h1>\
+ <div class="navigation">\
+ <ul>\
+ <li><a id="menu_documentation" href="documentation.html">Documentation</a></li>\
+ <li><a id="menu_samples" href="samples.html">Samples</a></li>\
+ <li><a id="menu_debug" href="debug.html">Debug</a></li>\
+ <li><a id="menu_themes" href="themes.html">Themes</a></li>\
+ </ul>\
+ </div>');
+ $('menu_' + selected).addClassName("selected");
+ },
+ addRightColumn: function() {
+ document.write('\
+ <style>\
+ div#wrapper{\
+ float:left;\
+ width:100%\
+ }\
+ div#content{\
+ margin-right:0px;\
+ padding-right:10px;\
+ border-right: none;\
+ }\
+ div#navigation{\
+ float:left;\
+ width:00px;\
+ margin-left:0px;\
+ text-align:left;\
+ background:#fef1e2;\
+ }\
+ </style>\
+ ')
+ }
+}
diff --git a/js/prototype-window-1.3/documentation/logo.gif b/js/prototype-window-1.3/documentation/logo.gif
new file mode 100755
index 0000000..e322e94
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/logo.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/pwc.gif b/js/prototype-window-1.3/documentation/pwc.gif
new file mode 100755
index 0000000..1eaea04
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/pwc.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/pwc_os_thumb.png b/js/prototype-window-1.3/documentation/pwc_os_thumb.png
new file mode 100755
index 0000000..54cccea
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/pwc_os_thumb.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/samples.html b/js/prototype-window-1.3/documentation/samples.html
new file mode 100755
index 0000000..4b1ee5d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/samples.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title>Prototype Window Class : Samples</title>
+
+ <!-- Prototype Window Class Part -->
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/window_effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+
+ <link href="../themes/default.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/spread.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/alert.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/alert_lite.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/alphacube.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/debug.css" rel="stylesheet" type="text/css" > </link>
+
+ <!-- Doc Part-->
+ <script type="text/javascript" src="js/application.js"> </script>
+ <link href="stylesheets/login.css" rel="stylesheet" type="text/css" > </link>
+ <link href="stylesheets/style.css" rel="stylesheet" type="text/css" > </link>
+ <style>
+ #myDialogId .myButtonClass {
+ padding:3px;
+ font-size:20px;
+ width:100px;
+ }
+ #myDialogId .ok_button {
+ color:#2F2;
+ }
+ #myDialogId .cancel_button {
+ color:#F88;
+ }
+ </style>
+ </head>
+ <script>
+ var contentWin;
+
+ </script>
+ <body onload="">
+ <script>Application.insertNavigation('samples')</script>
+ <div id="wrapper">
+ <div id= "content" class="content">
+ <div id="samples">
+ Here is a list of sample codes to show different ways to create windows and dialogs. You can view source of each example, even edit it and test your modification immediatly in your browser. Just click again on the link to open a new window/dialog with the modified code. Each window uses a javascript function to get a new id and DO NOT call setDestroyOnClose().<br/>
+You can open <a href="#" onclick="showDebug();"> the debug window </a> if you want to see some debug outputs.
+
+<br/><br/><img border=0 src="pwc_os_thumb.png"/><br/><b>Do not forget to check <a href="PWC-OS/index.html">PWC-OS</a></b>
+
+ <script>Application.addTitle('Open a simple window', 'open_window1')</script>
+ <p class="description">
+ This sample opens a simple window with some parameters like specific hide and show effects. This sample use a wired frame for move/resize.
+ </p>
+ <script>Application.addShowButton('open_window1')</script>
+
+ <div class="listing" style="display:none" id="open_window1_codediv">
+ <xmp id="open_window1" class="listing" >
+var win = new Window({className: "dialog", width:350, height:400, zIndex: 100, resizable: true, title: "Sample window", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, wiredDrag: true})
+
+win.getContent().innerHTML= "<div style='padding:10px'> Lorem ipsum dolor sit amet, consectetur adipiscing elit, set eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incom dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda et tam. \
+At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon. Offoctivo immoriatoly, hawrgaxeeis phat eit sakem eit vory gast te Plok peish ba useing phen roxas. Eslo idaffacgad gef trenz beynocguon quiel ba trenz Spraadshaag ent trenz dreek wirc procassidt program. Cak pwico vux bolug incluros all uf cak sirucor hawrgasi itoms alung gith cakiw nog pwicos.\
+Lor sum amet, commy nulputat. Duipit lum ipisl eros dolortionsed tin hent aliquis illam volor in ea feum in ut adipsustrud elent ulluptat. Duisl ullan ex et am vulputem augiam doloreet amet enibh eui te dipit acillutat acilis amet, suscil er iuscilla con utat, quisis eu feugait ad dolore commy nullam iuscilisl iureril ilisl del ut pratuer iliquis acipissit accum quis nulluptat. Dui bla faccumsan velis auguero con henis duismolor sumsandrem quat vulluptat alit er iniamcore exeriure vero core te dit ut nulla feummolore commod dipis augiamcommod tem ese dolestrud do odo odiamco eetummy nis aliquamcommy nonse eu feugue del eugiamconsed ming estrud magnis exero eumsandio enisim del dio od tat.sumsan et pratum velit ing etue te consequis alis nullan et, quis am iusci bla feummy.</div>"
+win.setStatusBar("Status bar info");
+win.showCenter();
+ </xmp>
+ <script>Application.addEditButton('open_window1')</script>
+ </div>
+
+ <script>Application.addTitle('Open a window with an URL inside', 'open_window2')</script>
+ <p class="description">
+ This sample opens a window with RubyOnRails.com site in it. It uses another theme.
+ </p>
+ <script>Application.addShowButton('open_window2')</script>
+
+ <div class="listing" style="display:none" id="open_window2_codediv">
+ <xmp id="open_window2" class="listing">
+var win = new Window({className: "spread", title: "Ruby on Rails",
+ top:70, left:100, width:300, height:200,
+ url: "http://www.rubyonrails.org/", showEffectOptions: {duration:1.5}})
+win.show();
+ </xmp>
+ <script>Application.addEditButton('open_window2')</script>
+ </div>
+
+ <script>Application.addTitle('Open a window with an existing content inside', 'open_window3')</script>
+ <p class="description">
+ <div id="container">
+ <div id="test_content" style="float:right;width:100px; height:150px;background:#DFA; color:#000; font-size:12px;">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit
+ </div>
+
+ This sample opens a window with green div on the right as content. It will keep the same size and position. Close the window to restore the div in the page.<br/>
+ It also uses a window observer to restore the div after closing the window.
+ </p>
+ </div>
+
+ <script>Application.addShowButton('open_window3')</script>
+
+ <div class="listing" style="display:none" id="open_window3_codediv">
+ <xmp id="open_window3" class="listing">
+if (contentWin != null) {
+ Dialog.alert("Close the window 'Test' before opening it again!",{width:200, height:130});
+}
+else {
+ contentWin = new Window({maximizable: false, resizable: false, hideEffect:Element.hide, showEffect:Element.show, minWidth: 10, destroyOnClose: true})
+ contentWin.setContent('test_content', true, true)
+ contentWin.show();
+
+ // Set up a windows observer, check ou debug window to get messages
+ myObserver = {
+ onDestroy: function(eventName, win) {
+ if (win == contentWin) {
+ $('container').appendChild($('test_content'));
+ contentWin = null;
+ Windows.removeObserver(this);
+ }
+ debug(eventName + " on " + win.getId())
+ }
+ }
+ Windows.addObserver(myObserver);
+}
+ </xmp>
+ <script>Application.addEditButton('open_window3')</script>
+ </div>
+
+
+ <script>Application.addTitle('Open an alert dialog', 'open_alert')</script>
+ <p class="description">
+ This sample opens a alert dialog with the default alert theme (alert.css). width/height/okLabel are specified and also ok callback function.
+ </p>
+ <script>Application.addShowButton('open_alert')</script>
+
+ <div class="listing" style="display:none" id="open_alert_codediv">
+ <xmp id="open_alert" class="listing">
+Dialog.alert("Test of alert panel, check out debug window after closing it",
+ {width:300, height:100, okLabel: "close",
+ ok:function(win) {debug("validate alert panel"); return true;}});
+ </xmp>
+ <script>Application.addEditButton('open_alert')</script>
+ </div>
+
+ <script>Application.addTitle('Open a confirm dialog', 'open_confirm')</script>
+ <p class="description">
+ This sample opens a confirm dialog with the default alert theme (alert.css). width/okLabel are specified and also ok/cancel callback function.
+ Height is not set so the dialog will fit content's height. It also change ok/cancel button class (CSS above).
+ </p>
+ <xmp id="button_css"><style>
+#myDialogId .myButtonClass {
+ padding:3px;
+ font-size:20px;
+ width:100px;
+}
+#myDialogId .ok_button {
+ color:#2F2;
+}
+#myDialogId .cancel_button {
+ color:#F88;
+}
+</style></xmp>
+ <script>Application.addShowButton('open_confirm')</script>
+ <div class="listing" style="display:none" id="open_confirm_codediv">
+ <xmp id="open_confirm">
+Dialog.confirm("Test of confirm panel, check out debug window after closing it.",
+ {width:300, okLabel: "close",
+ buttonClass: "myButtonClass",
+ id: "myDialogId",
+ cancel:function(win) {debug("cancel confirm panel")},
+ ok:function(win) {debug("validate confirm panel"); return true;}
+ });
+ </xmp>
+ <script>Application.addEditButton('open_confirm')</script>
+ </div>
+
+ <script>Application.addTitle('Open a info dialog', 'open_info')</script>
+ <p class="description">
+ This sample opens a info dialog with a progress image. It will be display 3 seconds with a countdown.
+ </p>
+ <script>Application.addShowButton('open_info')</script>
+
+ <div class="listing" style="display:none" id="open_info_codediv">
+ <xmp id="open_info">
+var timeout;
+function openInfoDialog() {
+ Dialog.info("Test of info panel, it will close <br>in 3s ...",
+ {width:250, height:100, showProgress: true});
+ timeout=3;
+ setTimeout(infoTimeout, 1000)
+}
+
+function infoTimeout() {
+ timeout--;
+ if (timeout >0) {
+ Dialog.setInfoMessage("Test of info panel, it will close <br>in " + timeout + "s ...")
+ setTimeout(infoTimeout, 1000)
+ }
+ else
+ Dialog.closeInfo()
+}
+openInfoDialog();
+ </xmp>
+ <script>Application.addEditButton('open_info')</script>
+ </div>
+
+
+ <script>Application.addTitle('Open a login window', 'open_login')</script>
+ <p class="description">
+ This advanced sample opens a login window with a nice effect if login fails. The window update also its height to display an error message to avoid scrollbars.
+ The login window design is done in the HTML file with display:none.<br/>
+ Here is the login HTML code (<a href="stylesheets/login.css">see also login CSS file</a>):
+ </p>
+
+<xmp><div id="login" style="display:none">
+ <p><span id='login_error_msg' class="login_error" style="display:none">&nbsp;</span></p>
+ <div style="clear:both"></div>
+ <p><span class="login_label">login</span> <span class="login_input"><input type="text"/></span></p>
+ <div style="clear:both"></div>
+ <p><span class="login_label">password</span> <span class="login_input"><input type="password"/></span></p>
+ <div style="clear:both"></div>
+</div></xmp>
+ </p>
+ <div id="login" style="display:none">
+ <p><span id='login_error_msg' class="login_error" style="display:none">&nbsp;</span></p>
+ <div style="clear:both"></div>
+ <p><span class="login_label">login</span> <span class="login_input"><input type="text"/></span></p>
+ <div style="clear:both"></div>
+ <p><span class="login_label">password</span> <span class="login_input"><input type="password"/></span></p>
+ <div style="clear:both"></div>
+ </div>
+ <script>Application.addShowButton('open_login')</script>
+
+ <div class="listing" style="display:none" id="open_login_codediv">
+ <xmp id="open_login">
+Dialog.confirm($('login').innerHTML, {className:"alphacube", width:400,
+ okLabel: "login", cancelLabel: "cancel",
+ onOk:function(win){
+ $('login_error_msg').innerHTML='Login or password inccorect';
+ $('login_error_msg').show();
+ Windows.focusedWindow.updateHeight();
+ new Effect.Shake(Windows.focusedWindow.getId()); return false;}});
+ </xmp>
+ <script>Application.addEditButton('open_login')</script>
+ </div>
+
+ <script>Application.addTitle('Ajax Dialog', 'ajax_dialog')</script>
+ <p class="description">
+ Instead of writing HTML in the same page, fill the dialog with an Ajax request. (View the requested file <a href="info_panel.html">info_panel.html</a>, do view source to see HTML content)
+ </p>
+ <script>Application.addShowButton('open_ajax_dialog')</script>
+
+ <div class="listing" style="display:none" id="open_ajax_dialog_codediv">
+ <xmp id="ajax_dialog">Dialog.alert({url: "info_panel.html", options: {method: 'get'}},
+ {className: "alphacube", width:540, okLabel: "Close"});</xmp>
+ <script>Application.addEditButton('open_ajax_dialog')</script>
+ </div>
+ <h2>
+ 9. Samples included in the distrib
+ </h2>
+ <ul>
+ <li><a href="current/samples/constraint.html">Constraint</a>: Constraint move/resize inside a div, insiade a page event by settings top/bottom/left/right margins.</li>
+ <li><a href="current/samples/multi_modal.html">Multi Modal</a>: Open three modal windows one by one. You can keep them visible or hidden one by one.</li>
+ <li><a href="current/samples/window_store.html">Window Store add-on</a>: Save in cookies windows location but also open/close status.</li>
+ <li><a href="current/samples/window_key.html">Window Key add-on</a>: Set a key to close dialog (escape key by default)</li>
+ <li><a href="current/samples/tooltips/tooltip.html">Tooltip add-on</a>: Use PWC to create tooltips. Tooltips will stay visible if you move your mouse over. You can add forms or links inside. Tooltip content can be HTML, Ajax or an URL.</li>
+ </ul>
+ </div>
+
+ </div>
+ </div>
+ <script type="text/javascript">Application.addRightColumn()</script>
+ </body>
+</html> \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/stylesheets/login.css b/js/prototype-window-1.3/documentation/stylesheets/login.css
new file mode 100755
index 0000000..590a281
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/stylesheets/login.css
@@ -0,0 +1,25 @@
+.login_label, .login_input, .login_error {
+ padding:10px;
+ color:#000;
+ text-align:left;
+ float:left;
+ width:100px;
+ font-size:20px;
+ color:#64355A;
+}
+
+.login_input {
+ width:200px;
+}
+
+.login_error {
+ width:250px;
+ color:#F00;
+}
+
+.login_input input {
+ width:100%;
+}
+#login {
+ background:#123;
+} \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/stylesheets/style.css b/js/prototype-window-1.3/documentation/stylesheets/style.css
new file mode 100755
index 0000000..72a603d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/stylesheets/style.css
@@ -0,0 +1,332 @@
+html, body {
+ margin: 0px;
+ padding: 0px;
+ height: 100%;
+ font: 14px "Trebuchet MS",Verdana,Arial,sans-serif;
+ background:#FFF
+}
+
+.content {
+ margin:00px 30px 0px 30px;
+ padding-right:10px;
+}
+
+iframe.frame_content {
+ width:100%;
+ height:100%;
+ border:0;
+ overflow:visible;
+}
+
+pre, xmp {
+ font: 12px Courier;
+ background:#F5F5F5;
+ padding:10px;
+ border: 1px dotted #272727;
+ overflow:auto;
+ width:95%;
+ margin:0;
+}
+
+textarea.listing {
+ width:100%;
+ font: 12px Courier;
+}
+
+a {
+ font: 14px "Trebuchet MS",Verdana,Arial,sans-serif;
+ text-decoration:none;
+ color:#ED2123;
+}
+
+a:hover {
+ text-decoration:underline;
+}
+
+
+.navigation a.selected {
+ background:#FFF;
+ border-bottom:none;
+ border-bottom: 1px solid #FFF;
+}
+
+h1 {
+ font: 20px "Trebuchet MS",Verdana,Arial,sans-serif;
+ clear:left;
+ text-align:left;
+ padding-top:5px;
+ padding-bottom:10px;
+}
+
+h2 {
+ font: 16px "Trebuchet MS",Verdana,Arial,sans-serif;
+ color:#F37D1F;
+ clear:left;
+ padding-top:20px;
+ padding-bottom:0px;
+ margin:0 0 10px 0;
+}
+
+h2.first {
+ padding-top:10px;
+}
+
+h3 {
+ font-size: 14px;
+ font-weight: normal;
+ color:#272727;
+ padding-top:10px;
+}
+
+p {
+ margin:0;
+ margin-bottom:5px;
+ padding:0;
+}
+
+span.title {
+ font: 16px "Trebuchet MS",Verdana,Arial,sans-serif;
+ color:#ED2123;
+ cursor:pointer
+}
+
+span.title2 {
+ font: 12px "Trebuchet MS",Verdana,Arial,sans-serif;
+ color:#ED2123;
+ cursor:pointer
+}
+
+.navigation ul {
+ margin:0;
+ padding:10px 0 5px 0;
+ text-align:center;
+ border-bottom: 1px solid #272727;
+}
+
+.navigation li {
+ display:inline;
+ padding:0px;
+ margin:0px;
+}
+
+.navigation a {
+ border: 1px solid #272727;
+ padding:5px;
+ background:#DDD;
+}
+
+p.description {
+ padding-bottom:0;
+ margin-bottom:0;
+}
+
+p.buttons {
+ margin:0;
+ padding:0;
+}
+
+span.button {
+ margin:0;
+ padding:0;
+ border-bottom: 1px dotted #272727;
+ border-right: 1px dotted #272727;
+ border-left: 1px dotted #272727;
+ width:100px;
+ text-align:center;
+ float:left;
+ background:#EEE;
+ color:#ED2123;
+}
+
+span.selected {
+ background:#ED2123;
+ color:#FFF;
+}
+
+div.separator {
+ margin:20px;
+ clear:both;
+}
+div.versions {
+ font-size: 12px;
+}
+div.versions ul {
+ font-size: 12px;
+ margin:4px;
+ padding-left:20px;
+}
+
+/* DOCUMENATION PART*/
+div.function {
+ border: 1px solid #888;
+ background:#FAF1E4;
+ float:left;
+ width:825px;
+ margin-bottom: 20px;
+}
+div.function .title {
+ padding: 5px 5px 5px 10px;
+ margin:0;
+ background:#F9F7F4;
+}
+
+p.parameter, p.parameter_header {
+ font-size: 12px;
+ margin:0;
+ clear:left;
+ border-top: 1px dotted #272727;
+}
+
+p.parameter_header {
+ border-top: 1px dotted #272727;
+ border-bottom: 1px dotted #272727;
+ background:#F9F7F4;
+ float:left;
+}
+
+span.field, span.explanation {
+ float:left;
+ width:200px;
+ padding: 2px 2px 2px 10px;
+}
+
+span.explanation {
+ border-left: 1px dotted #272727;
+}
+
+span.explanation {
+ width:600px;
+}
+
+span.function {
+ font-family:"Courier";
+ display:block;
+ color:#A57F00;
+}
+
+th {
+ font: 14px "Trebuchet MS",Verdana,Arial,sans-serif;
+ font-variant: small-caps;
+ color:#000;
+ text-align:left;
+}
+
+th, td.key, td.default, td.detail {
+ padding-right:10px;
+ padding-bottom:3px;
+ vertical-align: top;
+}
+
+td.key {
+ font-style: italic ;
+ color:#666;
+}
+
+span.key, span.default, span.detail {
+ padding-bottom:3px;
+}
+
+span.header {
+ font: 14px "Trebuchet MS",Verdana,Arial,sans-serif;
+ font-variant: small-caps;
+ color:#000;
+}
+
+.explanation ul {
+ padding:0;
+ margin:0;
+}
+
+.explanation .details {
+ float:left;
+}
+
+table.overview td {
+ vertical-align: top;
+ padding-right:30px;
+}
+table.overview ul {
+ margin:0;
+ padding-left:5px;
+ padding-top:5px;
+}
+
+.versions ul {
+ padding:0;
+ padding-bottom:5px;
+ margin:0;
+}
+
+/* Intro panel */
+h2.intro_message {
+ padding-top:0px;
+ font-size:24px;
+}
+ul.intro_message {
+ text-align:left;
+ margin:10px;
+}
+ul.intro_message li {
+ padding:0;
+ margin:0;
+ font-size:14px;
+}
+h3.intro_message {
+ font-size:12px;
+ color:#666;
+ margin:0;
+ padding:0;
+ margin-top:10px;
+ text-align:center;
+
+}
+h4.intro_message {
+ font-size:12px;
+ color:#666;
+ margin:0;
+ padding:0;
+ text-align:left;
+}
+
+span.intro_message {
+ text-align:left;
+ font-size:18px;
+}
+xmp.intro {
+ padding:5px;
+ margin:0 2%;
+ text-align:left;
+ width:93%;
+}
+
+
+div#wrapper{
+ float:left;
+ width:100%
+}
+div#content{
+ margin-right:200px;
+ padding-right:10px;
+ border-right: 1px solid #888;
+}
+div#navigation{
+ float:left;
+ width:200px;
+ margin-left:-200px;
+ text-align:left;
+ background:#fef1e2;
+}
+
+#nm {
+ float:left;
+ background:#FFF;
+ width: 200px;
+ height:250px;
+ text-align:center;
+}
+
+#g {
+ float:left;
+ padding-top:10px;
+ padding-left:40px;
+}
diff --git a/js/prototype-window-1.3/documentation/themes.html b/js/prototype-window-1.3/documentation/themes.html
new file mode 100755
index 0000000..047ed57
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes.html
@@ -0,0 +1,192 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Prototype Window Class : Themes</title>
+ <!-- Prototype Window Class Part -->
+ <script type="text/javascript" src="javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="javascripts/effects.js"> </script>
+ <script type="text/javascript" src="javascripts/window.js"> </script>
+ <script type="text/javascript" src="javascripts/debug.js"> </script>
+
+ <link href="themes/default.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/debug.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/nuncio.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/alphacube.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/darkX.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/spread.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/mac_os_x.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/alert.css" rel="stylesheet" type="text/css" > </link>
+ <link href="themes/lighting.css" rel="stylesheet" type="text/css" > </link>
+
+ <!-- Doc Part-->
+ <link href="stylesheets/style.css" rel="stylesheet" type="text/css" > </link>
+ <script type="text/javascript" src="js/application.js"> </script>
+</head>
+
+<body>
+ <script>Application.insertNavigation('themes')</script>
+ <div id="wrapper">
+ <div id= "content" class="content">
+ <h2 class="first"> Overview</h2>
+
+ Creating a new theme is very easy. You need to describe window's look and feel in a CSS file. Name your CSS file THEME_NAME.css with thoses CSS definition:<br/>
+ By convention the images used in the CSS files are in THEME_NAME directory (it's just a convention, do it as you feel!)<br/>
+ A window is divided into 9 parts, 4 corners, 4 borders and the main content in the middle.<br/><br/>
+ View a detail <a href="#" onclick=" Effect.toggle('css_file', 'blind')">template CSS file </a>(you can copy-paste it to start a new theme). See <a href="http://art.gnome.org/themes/metacity">Art.Gnome.Org</a> for cool designs. I used two of them, it's easy to integrate in the class.<br/><br/>
+ <div style="display:none;text-align:left;color:#000000; background-color:#F8F8F8; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace;margin:5px; " id='css_file' >
+ <span style="color:#236e25;">/* North-West corner */</span><br />
+ .THEME_NAME_nw {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/TOP_LEFT_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#0000ff;">10px</span>;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">25px</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* North border */</span><br />
+ .THEME_NAME_n {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/TOP_IMAGE.gif) <span style="color:#9b4400;">repeat-x</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">25px</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* North-East corner */</span><br />
+ .THEME_NAME_ne {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/TOP_RIGHT_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#0000ff;">10px</span>; &nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">25px</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* West border */</span><br />
+ .THEME_NAME_w {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/LEFT_IMAGE.gif) <span style="color:#9b4400;">repeat-y</span> <span style="color:#9b4400;">top</span> <span style="color:#9b4400;">left</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#0000ff;">7px</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* East border */</span><br />
+ .THEME_NAME_e {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/RIGHT_IMAGE.gif) <span style="color:#9b4400;">repeat-y</span> <span style="color:#9b4400;">top</span> <span style="color:#9b4400;">right</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#0000ff;">7px</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* South-West corner */</span><br />
+ .THEME_NAME_sw {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/BOTTOM_LEFT_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#0000ff;">7px</span>;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">7px</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* South border */</span><br />
+ .THEME_NAME_s {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/BOTTOM_IMAGE.gif) <span style="color:#9b4400;">repeat-x</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">7px</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* South-East corner */</span><br />
+ .THEME_NAME_se {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/BOTTOM_RIGHT_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#0000ff;">7px</span>;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">7px</span>;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">vertical-align</span>:<span style="color:#9b4400;">top</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* Resize button */</span><br />
+ .THEME_NAME_sizer {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#0000ff;">7px</span>;<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">7px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/RESIZE_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; <br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">cursor</span>:<span style="color:#9b4400;">se-resize</span>; &nbsp;&nbsp;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* Close button */</span><br />
+ .THEME_NAME_close {<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">width</span>: <span style="color:#0000ff;">23px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">height</span>: <span style="color:#0000ff;">23px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/CLOSE_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">position</span>:<span style="color:#9b4400;">absolute</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#9b4400;">top</span>:<span style="color:#0000ff;">0px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#9b4400;">right</span>:<span style="color:#0000ff;">11px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">cursor</span>:<span style="color:#9b4400;">pointer</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">z-index</span>:<span style="color:#0000ff;">1000</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* Minimize button */</span><br />
+ .THEME_NAME_minimize {<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">width</span>: <span style="color:#0000ff;">23px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">height</span>: <span style="color:#0000ff;">23px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/MINIMIZE_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">position</span>:<span style="color:#9b4400;">absolute</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#9b4400;">top</span>:<span style="color:#0000ff;">0px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#9b4400;">right</span>:<span style="color:#0000ff;">55px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">cursor</span>:<span style="color:#9b4400;">pointer</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">z-index</span>:<span style="color:#0000ff;">1000</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* Maximize button */</span><br />
+ .THEME_NAME_maximize {<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">width</span>: <span style="color:#0000ff;">23px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">height</span>: <span style="color:#0000ff;">23px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">background</span>: <span style="color:#9b4400;">transparent</span> <span style="color:#9b4400;">url</span>(THEME_NAME/MAXIMIZE_IMAGE.gif) <span style="color:#9b4400;">no-repeat</span> <span style="color:#0000ff;">0 0</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">position</span>:<span style="color:#9b4400;">absolute</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#9b4400;">top</span>:<span style="color:#0000ff;">0px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#9b4400;">right</span>:<span style="color:#0000ff;">33px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">cursor</span>:<span style="color:#9b4400;">pointer</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">z-index</span>:<span style="color:#0000ff;">1000</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* Title bar */</span><br />
+ .THEME_NAME_title {<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">float</span>:<span style="color:#9b4400;">left</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">height</span>:<span style="color:#0000ff;">14px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">font-size</span>:<span style="color:#0000ff;">14px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">text-align</span>:<span style="color:#9b4400;">center</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">margin-top</span>:<span style="color:#0000ff;">2px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#9b4400;">100</span><span style="color:#0000ff;">%</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">color</span>:<span style="color:#760f15;">#123456</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* Content div (not used for url) */</span><br />
+ .THEME_NAME_content {<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">overflow</span>:<span style="color:#9b4400;">auto</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">color</span>: <span style="color:#760f15;">#000</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">font-family</span>: Tahoma, Arial, sans-serif;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">font-size</span>: <span style="color:#0000ff;">10px</span>;<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">background</span>:<span style="color:#760f15;">#FDFDFD</span>;<br />
+ }<br />
+ <br />
+ <span style="color:#236e25;">/* Overlay for modal window, sp&eacute;cify color and opacity (three times to work on all browsers */</span><br />
+ .overlay_THEME_NAME {<br />
+ &nbsp;&nbsp;<span style="color:#88134f;">background-color</span>: <span style="color:#760f15;">#85BBEF</span>;<br />
+ &nbsp;&nbsp;filter:alpha(opacity=<span style="color:#0000ff;">60</span>);<br />
+ &nbsp;&nbsp;-moz-opacity: <span style="color:#0000ff;">0</span>.<span style="color:#0000ff;">6</span>;<br />
+ &nbsp;&nbsp;opacity: <span style="color:#0000ff;">0</span>.<span style="color:#0000ff;">6</span>;<br />
+ }<br />
+ <br />
+ <br />
+ </div>
+
+ Take a look to an existing CSS file like <a href="themes/alphacube.css">alphacube.css</a> or <a href="themes/mac_os_x.css">mac_os_x.css</a> (with PNG image and IE specific code)
+
+ <h2>Themes included in this release</h2>
+ <ul>
+ <li>Default (<script>Application.addViewThemeButton('dialog')</script>)</li>
+ <li>MacShadow (<script>Application.addViewThemeButton('mac_os_x')</script>)</li>
+ <li>Lighting (from Emanuel Mila) (<script>Application.addViewThemeButton('bluelighting')</script>)</li>
+ <li>Nuncio (from Brice Joly) (<script>Application.addViewThemeButton('nuncio')</script>)</li>
+ <li>Alphacube from <a href="http://art.gnome.org/themes/metacity/1171">Art.Gnome.Org</a> (<script>Application.addViewThemeButton('alphacube')</script>)</li>
+ <li>Spread (Alphacube with a different color scheme) (<script>Application.addViewThemeButton('spread')</script>)</li>
+ <li>DarkX from <a href="http://art.gnome.org/themes/metacity/708">Art.Gnome.Org</a> (<script>Application.addViewThemeButton('darkX')</script>)</li>
+ <li>Lighting from <a href="http://art.gnome.org/themes/metacity/708">Mila</a> (<script>Application.addViewThemeButton('lighting')</script>)</li>
+ <br/>
+ <li>Default dialog (<script>Application.addViewThemeDialogButton('alert')</script>)</li>
+ <li>Alphacube as dialog (<script>Application.addViewThemeDialogButton('alphacube')</script>)</li>
+
+ </ul>
+ </div>
+</div>
+<script type="text/javascript">Application.addRightColumn()</script>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/themes/alert.css b/js/prototype-window-1.3/documentation/themes/alert.css
new file mode 100755
index 0000000..432d14e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert.css
@@ -0,0 +1,119 @@
+.overlay_alert {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.alert_nw {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/top_left.gif) no-repeat bottom left;
+}
+
+.alert_n {
+ height: 5px;
+ background: transparent url(alert/top.gif) repeat-x bottom left;
+}
+
+.alert_ne {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/top_right.gif) no-repeat bottom left
+}
+
+.alert_e {
+ width: 5px;
+ background: transparent url(alert/right.gif) repeat-y 0 0;
+}
+
+.alert_w {
+ width: 5px;
+ background: transparent url(alert/left.gif) repeat-y 0 0;
+}
+
+.alert_sw {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/bottom_left.gif) no-repeat 0 0;
+}
+
+.alert_s {
+ height: 5px;
+ background: transparent url(alert/bottom.gif) repeat-x 0 0;
+}
+
+.alert_se, .alert_sizer {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/bottom_right.gif) no-repeat 0 0;
+}
+
+.alert_close {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_minimize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_maximize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_title {
+ float:left;
+ height:1px;
+ width:100%;
+}
+
+.alert_content {
+ overflow:visible;
+ color: #000;
+ font-family: Tahoma, Arial, sans-serif;
+ font: 12px arial;
+ background: #FFF;
+}
+
+/* For alert/confirm dialog */
+.alert_window {
+ background: #FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.alert_message {
+ font: 12px arial;
+ width:100%;
+ color:#F00;
+ padding-bottom:10px;
+}
+
+.alert_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.alert_buttons input {
+ width:20%;
+ margin:10px;
+}
+
+.alert_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background: #FFF url('alert/progress.gif') no-repeat center center
+}
+
+
diff --git a/js/prototype-window-1.3/documentation/themes/alert/bottom.gif b/js/prototype-window-1.3/documentation/themes/alert/bottom.gif
new file mode 100755
index 0000000..9870f52
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/bottom.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/bottom_left.gif b/js/prototype-window-1.3/documentation/themes/alert/bottom_left.gif
new file mode 100755
index 0000000..583f113
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/bottom_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/bottom_right.gif b/js/prototype-window-1.3/documentation/themes/alert/bottom_right.gif
new file mode 100755
index 0000000..230ba12
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/bottom_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/left.gif b/js/prototype-window-1.3/documentation/themes/alert/left.gif
new file mode 100755
index 0000000..4a3fab5
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/overlay.png b/js/prototype-window-1.3/documentation/themes/alert/overlay.png
new file mode 100755
index 0000000..2f3344e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/overlay.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/progress.gif b/js/prototype-window-1.3/documentation/themes/alert/progress.gif
new file mode 100755
index 0000000..529e72f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/progress.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/right.gif b/js/prototype-window-1.3/documentation/themes/alert/right.gif
new file mode 100755
index 0000000..85ba9e2
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/top.gif b/js/prototype-window-1.3/documentation/themes/alert/top.gif
new file mode 100755
index 0000000..8f61936
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/top_left.gif b/js/prototype-window-1.3/documentation/themes/alert/top_left.gif
new file mode 100755
index 0000000..fabb33a
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/top_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert/top_right.gif b/js/prototype-window-1.3/documentation/themes/alert/top_right.gif
new file mode 100755
index 0000000..9fec6fa
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert/top_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alert_lite.css b/js/prototype-window-1.3/documentation/themes/alert_lite.css
new file mode 100755
index 0000000..c2ad538
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alert_lite.css
@@ -0,0 +1,88 @@
+.overlay_alert_lite {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.alert_lite_sizer {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_close {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_minimize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_maximize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_title {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_content {
+ overflow:auto;
+ color: #000;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background: #FFF;
+}
+
+
+/* For alert/confirm dialog */
+.alert_lite_window {
+ border:1px solid #F00;
+ background: #FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.alert_lite_message {
+ font-size:16px;
+ text-align:center;
+ width:100%;
+ color:#F00;
+ padding-bottom:10px;
+}
+
+.alert_lite_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.alert_lite_buttons input {
+ width:20%;
+ margin:10px;
+}
+
+.alert_lite_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background: #FFF url('alert/progress.gif') no-repeat center center
+}
+
+table.alert_lite_header {
+ border:1px solid #F00;
+ background:#FFF
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube.css b/js/prototype-window-1.3/documentation/themes/alphacube.css
new file mode 100755
index 0000000..7d2790e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube.css
@@ -0,0 +1,150 @@
+.overlay_alphacube {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.alphacube_nw {
+ background: transparent url(alphacube/left-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.alphacube_n {
+ background: transparent url(alphacube/top-middle.gif) repeat-x 0 0;
+ height:25px;
+}
+
+.alphacube_ne {
+ background: transparent url(alphacube/right-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.alphacube_w {
+ background: transparent url(alphacube/frame-left.gif) repeat-y top left;
+ width:7px;
+}
+
+.alphacube_e {
+ background: transparent url(alphacube/frame-right.gif) repeat-y top right;
+ width:7px;
+}
+
+.alphacube_sw {
+ background: transparent url(alphacube/bottom-left-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.alphacube_s {
+ background: transparent url(alphacube/bottom-middle.gif) repeat-x 0 0;
+ height:7px;
+}
+
+.alphacube_se, .alphacube_sizer {
+ background: transparent url(alphacube/bottom-right-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.alphacube_sizer {
+ cursor:se-resize;
+}
+
+.alphacube_close {
+ width: 23px;
+ height: 23px;
+ background: transparent url(alphacube/button-close-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:11px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.alphacube_minimize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(alphacube/button-min-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:55px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.alphacube_maximize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(alphacube/button-max-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:33px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.alphacube_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#123456;
+}
+
+.alphacube_content {
+ overflow:auto;
+ color: #000;
+ font-family: Tahoma, Arial, sans-serif;
+ font: 12px arial;
+ background:#FDFDFD;
+}
+
+/* For alert/confirm dialog */
+.alphacube_window {
+ border:1px solid #F00;
+ background: #FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.alphacube_message {
+ font: 12px arial;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.alphacube_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.alphacube_buttons input {
+ width:20%;
+ margin:10px;
+}
+
+.alphacube_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background: #FFF url('alert/progress.gif') no-repeat center center
+}
+
+.alphacube_wired_frame {
+ background: #FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/bottom-left-c.gif b/js/prototype-window-1.3/documentation/themes/alphacube/bottom-left-c.gif
new file mode 100755
index 0000000..531acdc
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/bottom-left-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/bottom-middle.gif b/js/prototype-window-1.3/documentation/themes/alphacube/bottom-middle.gif
new file mode 100755
index 0000000..d4ce3be
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/bottom-middle.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/bottom-right-c.gif b/js/prototype-window-1.3/documentation/themes/alphacube/bottom-right-c.gif
new file mode 100755
index 0000000..2164c22
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/bottom-right-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/button-close-focus.gif b/js/prototype-window-1.3/documentation/themes/alphacube/button-close-focus.gif
new file mode 100755
index 0000000..99f635c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/button-close-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/button-max-focus.gif b/js/prototype-window-1.3/documentation/themes/alphacube/button-max-focus.gif
new file mode 100755
index 0000000..1708a1e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/button-max-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/button-min-focus.gif b/js/prototype-window-1.3/documentation/themes/alphacube/button-min-focus.gif
new file mode 100755
index 0000000..ff69d1b
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/button-min-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/frame-left.gif b/js/prototype-window-1.3/documentation/themes/alphacube/frame-left.gif
new file mode 100755
index 0000000..543f13d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/frame-left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/frame-right.gif b/js/prototype-window-1.3/documentation/themes/alphacube/frame-right.gif
new file mode 100755
index 0000000..5d7afef
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/frame-right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/left-top.gif b/js/prototype-window-1.3/documentation/themes/alphacube/left-top.gif
new file mode 100755
index 0000000..8373aaa
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/left-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/right-top.gif b/js/prototype-window-1.3/documentation/themes/alphacube/right-top.gif
new file mode 100755
index 0000000..77cf65e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/right-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/alphacube/top-middle.gif b/js/prototype-window-1.3/documentation/themes/alphacube/top-middle.gif
new file mode 100755
index 0000000..9cab17d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/alphacube/top-middle.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/behavior.htc b/js/prototype-window-1.3/documentation/themes/behavior.htc
new file mode 100755
index 0000000..437c5ec
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/behavior.htc
@@ -0,0 +1,51 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="propertyChanged()" />
+<script>
+
+var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32";
+var realSrc;
+var blankSrc = "blank.gif";
+
+if (supported) fixImage();
+
+function propertyChanged() {
+ if (!supported) return;
+
+ var pName = event.propertyName;
+ if (pName != "src") return;
+ // if not set to blank
+ if ( ! new RegExp(blankSrc).test(src))
+ fixImage();
+};
+
+function fixImage() {
+ // get src
+ var src = element.src;
+
+ // check for real change
+ if (src == realSrc) {
+ element.src = blankSrc;
+ return;
+ }
+
+ if ( ! new RegExp(blankSrc).test(src)) {
+ // backup old src
+ realSrc = src;
+ }
+
+ // test for png
+ if ( /\.png$/.test( realSrc.toLowerCase() ) ) {
+ // set blank image
+ element.src = blankSrc;
+ // set filter
+ element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
+ src + "',sizingMethod='scale')";
+ }
+ else {
+ // remove filter
+ element.runtimeStyle.filter = "";
+ }
+}
+
+</script>
+</public:component> \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/themes/darkX.css b/js/prototype-window-1.3/documentation/themes/darkX.css
new file mode 100755
index 0000000..2f83cfd
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX.css
@@ -0,0 +1,121 @@
+.overlay_darkX {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.darkX_nw {
+ background: transparent url(darkX/titlebar-left-focused.png) no-repeat 0 0;
+ width:6px;
+ height:21px;
+}
+.darkX_n {
+ background: transparent url(darkX/titlebar-mid-focused.png) repeat-x 0 0;
+ height:21px;
+}
+.darkX_ne {
+ background: transparent url(darkX/titlebar-right-focused.png) no-repeat 0 0;
+ width:6px;
+ height:21px;
+}
+.darkX_w {
+ background: transparent url(darkX/frame-left-focused.png) repeat-y top left;
+ width:3px;
+}
+
+.darkX_e {
+ background: transparent url(darkX/frame-right-focused.png) repeat-y top right;
+ width:3px;
+}
+
+.darkX_sw {
+ background: transparent url(darkX/frame-bottom-left-focused.png) no-repeat 0 0;
+ width:5px;
+ height:3px;
+}
+.darkX_s {
+ background: transparent url(darkX/frame-bottom-mid-focused.png) repeat-x 0 0;
+ height:3px;
+}
+.darkX_se, .darkX_sizer {
+ background: transparent url(darkX/frame-bottom-right-focused.png) no-repeat 0 0;
+ width:5px;
+ height:3px;
+}
+
+.darkX_sizer {
+ cursor:se-resize;
+}
+
+.darkX_close {
+ width: 21px;
+ height: 21px;
+ background: transparent url(darkX/button-close-focused.png) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:5px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkX_minimize {
+ width: 21px;
+ height: 21px;
+ background: transparent url(darkX/button-minimize-focused.png) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:26px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkX_maximize {
+ width: 21px;
+ height: 21px;
+ background: transparent url(darkX/button-maximize-focused.png) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:47px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+
+.darkX_title {
+ float:left;
+ height:14px;
+ font-size:12px;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#FFF;
+}
+
+.darkX_content {
+ overflow:auto;
+ color: #E6DF2A;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 14px;
+ background:#5E5148;
+}
+
+
+/* FOR IE */
+* html .darkX_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-minimize-focused.png", sizingMethod="crop");
+}
+
+* html .darkX_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-maximize-focused.png", sizingMethod="scale");
+}
+
+* html .darkX_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-close-focused.png", sizingMethod="crop");
+}
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/button-close-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/button-close-focused.png
new file mode 100755
index 0000000..da5a8ac
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/button-close-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/button-maximize-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/button-maximize-focused.png
new file mode 100755
index 0000000..b0bd9cd
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/button-maximize-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/button-minimize-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/button-minimize-focused.png
new file mode 100755
index 0000000..b04e18f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/button-minimize-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-left-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-left-focused.png
new file mode 100755
index 0000000..7d89f7b
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-left-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-mid-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-mid-focused.png
new file mode 100755
index 0000000..e50eacc
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-mid-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-right-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-right-focused.png
new file mode 100755
index 0000000..8915659
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/frame-bottom-right-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/frame-left-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/frame-left-focused.png
new file mode 100755
index 0000000..ff9f336
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/frame-left-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/frame-right-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/frame-right-focused.png
new file mode 100755
index 0000000..f69ea00
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/frame-right-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/titlebar-left-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/titlebar-left-focused.png
new file mode 100755
index 0000000..1436e84
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/titlebar-left-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/titlebar-mid-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/titlebar-mid-focused.png
new file mode 100755
index 0000000..f7be50b
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/titlebar-mid-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/darkX/titlebar-right-focused.png b/js/prototype-window-1.3/documentation/themes/darkX/titlebar-right-focused.png
new file mode 100755
index 0000000..ae23785
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/darkX/titlebar-right-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/debug.css b/js/prototype-window-1.3/documentation/themes/debug.css
new file mode 100755
index 0000000..69e3b7f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/debug.css
@@ -0,0 +1,25 @@
+div.inspector div.inspectable {
+ padding: 0.25em 0 0.25em 1em;
+ background-color: Gray;
+ color: white;
+ border: outset 2px white;
+ cursor: pointer;
+}
+
+div.inspector div.child {
+ margin: 0 0 0 1em;
+}
+
+#debug_window_content { /* DIV container for debug sizing*/
+ width:250px;
+ height:100px;
+ background-color:#000;
+}
+
+#debug { /* DIV container for debug contents*/
+ padding:3px;
+ color:#0f0;
+ font-family:monaco, Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-size:10px;
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/default.css b/js/prototype-window-1.3/documentation/themes/default.css
new file mode 100755
index 0000000..6ab1378
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default.css
@@ -0,0 +1,155 @@
+.overlay_dialog {
+ background-color: #666666;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.overlay___invisible__ {
+ background-color: #666666;
+ filter:alpha(opacity=0);
+ -moz-opacity: 0;
+ opacity: 0;
+}
+
+.dialog_nw {
+ width: 9px;
+ height: 23px;
+ background: transparent url(default/top_left.gif) no-repeat 0 0;
+}
+
+.dialog_n {
+ background: transparent url(default/top_mid.gif) repeat-x 0 0;
+ height: 23px;
+}
+
+.dialog_ne {
+ width: 9px;
+ height: 23px;
+ background: transparent url(default/top_right.gif) no-repeat 0 0;
+}
+
+.dialog_e {
+ width: 2px;
+ background: transparent url(default/center_right.gif) repeat-y 0 0;
+}
+
+.dialog_w {
+ width: 2px;
+ background: transparent url(default/center_left.gif) repeat-y 0 0;
+}
+
+.dialog_sw {
+ width: 9px;
+ height: 19px;
+ background: transparent url(default/bottom_left.gif) no-repeat 0 0;
+}
+
+.dialog_s {
+ background: transparent url(default/bottom_mid.gif) repeat-x 0 0;
+ height: 19px;
+}
+
+.dialog_se {
+ width: 9px;
+ height: 19px;
+ background: transparent url(default/bottom_right.gif) no-repeat 0 0;
+}
+
+.dialog_sizer {
+ width: 9px;
+ height: 19px;
+ background: transparent url(default/sizer.gif) no-repeat 0 0;
+ cursor:se-resize;
+}
+
+.dialog_close {
+ width: 14px;
+ height: 14px;
+ background: transparent url(default/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:5px;
+ left:8px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.dialog_minimize {
+ width: 14px;
+ height: 15px;
+ background: transparent url(default/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:5px;
+ left:28px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.dialog_maximize {
+ width: 14px;
+ height: 15px;
+ background: transparent url(default/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:5px;
+ left:49px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.dialog_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ color:#000;
+}
+
+.dialog_content {
+ overflow:auto;
+ color: #DDD;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background-color:#123;
+}
+
+.top_draggable, .bottom_draggable {
+ cursor:move;
+}
+
+.status_bar {
+ font-size:12px;
+}
+.status_bar input{
+ font-size:12px;
+}
+
+.wired_frame {
+ display: block;
+ position: absolute;
+ border: 1px #000 dashed;
+}
+
+/* DO NOT CHANGE THESE VALUES*/
+.dialog {
+ display: block;
+ position: absolute;
+}
+
+.dialog table.table_window {
+ border-collapse: collapse;
+ border-spacing: 0;
+ width: 100%;
+ margin: 0px;
+ padding:0px;
+}
+
+.dialog table.table_window td , .dialog table.table_window th {
+ padding: 0;
+}
+
+.dialog .title_window {
+ -moz-user-select:none;
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/default/bottom_left.gif b/js/prototype-window-1.3/documentation/themes/default/bottom_left.gif
new file mode 100755
index 0000000..4c73d35
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/bottom_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/bottom_mid.gif b/js/prototype-window-1.3/documentation/themes/default/bottom_mid.gif
new file mode 100755
index 0000000..9205d30
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/bottom_mid.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/bottom_right.gif b/js/prototype-window-1.3/documentation/themes/default/bottom_right.gif
new file mode 100755
index 0000000..8d002ee
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/bottom_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/bottom_right_resize.gif b/js/prototype-window-1.3/documentation/themes/default/bottom_right_resize.gif
new file mode 100755
index 0000000..649b0d8
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/bottom_right_resize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/center_left.gif b/js/prototype-window-1.3/documentation/themes/default/center_left.gif
new file mode 100755
index 0000000..79e7a1c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/center_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/center_right.gif b/js/prototype-window-1.3/documentation/themes/default/center_right.gif
new file mode 100755
index 0000000..554c55c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/center_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/clear.gif b/js/prototype-window-1.3/documentation/themes/default/clear.gif
new file mode 100755
index 0000000..c10b166
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/clear.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/close.gif b/js/prototype-window-1.3/documentation/themes/default/close.gif
new file mode 100755
index 0000000..31ef5a3
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/close.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/inspect.gif b/js/prototype-window-1.3/documentation/themes/default/inspect.gif
new file mode 100755
index 0000000..ebeeb02
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/inspect.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/maximize.gif b/js/prototype-window-1.3/documentation/themes/default/maximize.gif
new file mode 100755
index 0000000..892a0f0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/maximize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/minimize.gif b/js/prototype-window-1.3/documentation/themes/default/minimize.gif
new file mode 100755
index 0000000..a721416
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/minimize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/overlay.png b/js/prototype-window-1.3/documentation/themes/default/overlay.png
new file mode 100755
index 0000000..648e71e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/overlay.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/resize.gif b/js/prototype-window-1.3/documentation/themes/default/resize.gif
new file mode 100755
index 0000000..c440702
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/resize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/sizer.gif b/js/prototype-window-1.3/documentation/themes/default/sizer.gif
new file mode 100755
index 0000000..649b0d8
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/sizer.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/top_left.gif b/js/prototype-window-1.3/documentation/themes/default/top_left.gif
new file mode 100755
index 0000000..774538a
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/top_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/top_mid.gif b/js/prototype-window-1.3/documentation/themes/default/top_mid.gif
new file mode 100755
index 0000000..6124e78
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/top_mid.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/default/top_right.gif b/js/prototype-window-1.3/documentation/themes/default/top_right.gif
new file mode 100755
index 0000000..fbc94bf
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/default/top_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/iefix/blank.gif b/js/prototype-window-1.3/documentation/themes/iefix/blank.gif
new file mode 100755
index 0000000..75b945d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/iefix/blank.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/iefix/iepngfix.css b/js/prototype-window-1.3/documentation/themes/iefix/iepngfix.css
new file mode 100755
index 0000000..257a1b1
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/iefix/iepngfix.css
@@ -0,0 +1,3 @@
+/* PNG fix for all themes that uses PNG images on IE */
+td, div { behavior: url(../themes/iefix/iepngfix.htc) }
+
diff --git a/js/prototype-window-1.3/documentation/themes/iefix/iepngfix.htc b/js/prototype-window-1.3/documentation/themes/iefix/iepngfix.htc
new file mode 100755
index 0000000..a6c683b
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/iefix/iepngfix.htc
@@ -0,0 +1,54 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="doFix()" />
+
+<script type="text/javascript">
+
+// IE5.5+ PNG Alpha Fix v1.0RC4
+// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the CC-GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+// Modified/Simplified on 04/23/2007 by Sebastien Gruhier (http://www.xilinus.com)
+// To work only on background and to handle repeat bg
+
+// This must be a path to a blank image. That's all the configuration you need.
+if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
+
+var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+
+function filt(s, m)
+{
+ if (filters[f])
+ {
+ filters[f].enabled = s ? true : false;
+ if (s) with (filters[f]) { src = s; sizingMethod = m }
+ }
+ else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
+}
+
+function doFix()
+{
+ // Assume IE7 is OK.
+ if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
+ (event && !/(background|src)/.test(event.propertyName))) return;
+
+ var bgImg = currentStyle.backgroundImage || style.backgroundImage;
+ var bgRepeat = currentStyle.backgroundRepeat || style.backgroundRepeat;
+ if (bgImg && bgImg != 'none')
+ {
+ if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
+ {
+ var s = RegExp.$1;
+ if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ style.width = offsetWidth + 'px';
+ style.backgroundImage = 'none';
+ filt(s, bgRepeat == "no-repeat" ? 'crop' : 'scale');
+ }
+ }
+}
+
+doFix();
+
+</script>
+</public:component> \ No newline at end of file
diff --git a/js/prototype-window-1.3/documentation/themes/lighting.css b/js/prototype-window-1.3/documentation/themes/lighting.css
new file mode 100755
index 0000000..95ec287
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting.css
@@ -0,0 +1,960 @@
+.overlay___invisible__ {
+ background-color: #666;
+ filter:alpha(opacity=0);
+ -moz-opacity: 0;
+ opacity: 0;
+}
+
+.top_draggable, .bottom_draggable {
+ cursor:move;
+}
+
+.status_bar {
+ font-size:12px;
+}
+.status_bar input{
+ font-size:12px;
+}
+
+.wired_frame {
+ display:block;
+ position:absolute;
+ border:1px #000 dashed;
+}
+
+
+
+.overlay_bluelighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.bluelighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.bluelighting_nw {
+ background:transparent url(lighting/top-left-blue.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.bluelighting_n {
+ background:transparent url(lighting/top-middle-blue.png) repeat-x 0 0;
+ height:28px;
+}
+
+.bluelighting_ne {
+ background:transparent url(lighting/top-right-blue.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.bluelighting_w {
+ background:transparent url(lighting/left-blue.png) repeat-y top left;
+ width:9px;
+}
+
+.bluelighting_e {
+ background:transparent url(lighting/right-blue.png) repeat-y top right;
+ width:15px;
+}
+
+.bluelighting_sw {
+ background:transparent url(lighting/bottom-left-blue.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.bluelighting_s {
+ background:transparent url(lighting/bottom-middle-blue.png) repeat-x 0 0;
+ height:15px;
+}
+
+.bluelighting_se, .bluelighting_sizer {
+ background:transparent url(lighting/bottom-right-blue.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.bluelighting_sizer {
+ cursor:se-resize;
+}
+
+.bluelighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-blue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.bluelighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-blue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.bluelighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-blue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.bluelighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#17385B;
+}
+
+.bluelighting_content {
+ overflow:auto;
+ color:#000;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#BFDBFF;
+}
+
+/* For alert/confirm dialog */
+.bluelighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.bluelighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.bluelighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.bluelighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.bluelighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .bluelighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_se, * html .bluelighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_content {
+ background:#B8D7FF;
+}
+
+
+
+.overlay_greylighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greylighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greylighting_nw {
+ background:transparent url(lighting/top-left-grey.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.greylighting_n {
+ background:transparent url(lighting/top-middle-grey.png) repeat-x 0 0;
+ height:28px;
+}
+
+.greylighting_ne {
+ background:transparent url(lighting/top-right-grey.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.greylighting_w {
+ background:transparent url(lighting/left-grey.png) repeat-y top left;
+ width:9px;
+}
+
+.greylighting_e {
+ background:transparent url(lighting/right-grey.png) repeat-y top right;
+ width:15px;
+}
+
+.greylighting_sw {
+ background:transparent url(lighting/bottom-left-grey.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.greylighting_s {
+ background:transparent url(lighting/bottom-middle-grey.png) repeat-x 0 0;
+ height:15px;
+}
+
+.greylighting_se, .greylighting_sizer {
+ background:transparent url(lighting/bottom-right-grey.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.greylighting_sizer {
+ cursor:se-resize;
+}
+
+.greylighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-grey.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greylighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-grey.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greylighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-grey.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greylighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#525252;
+}
+
+.greylighting_content {
+ overflow:auto;
+ color:#000;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#CDCDCD;
+}
+
+/* For alert/confirm dialog */
+.greylighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.greylighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.greylighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.greylighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.greylighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .greylighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-grey.png", sizingMethod="scale");
+}
+
+* html .greylighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-grey.png", sizingMethod="scale");
+}
+
+* html .greylighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-grey.png", sizingMethod="scale");
+}
+
+* html .greylighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-grey.png", sizingMethod="scale");
+}
+
+* html greylighting_se, * html .greylighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_content {
+ background:#C7C7C7;
+}
+
+
+
+.overlay_greenlighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greenlighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greenlighting_nw {
+ background:transparent url(lighting/top-left-green.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.greenlighting_n {
+ background:transparent url(lighting/top-middle-green.png) repeat-x 0 0;
+ height:28px;
+}
+
+.greenlighting_ne {
+ background:transparent url(lighting/top-right-green.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.greenlighting_w {
+ background:transparent url(lighting/left-green.png) repeat-y top left;
+ width:9px;
+}
+
+.greenlighting_e {
+ background:transparent url(lighting/right-green.png) repeat-y top right;
+ width:15px;
+}
+
+.greenlighting_sw {
+ background:transparent url(lighting/bottom-left-green.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.greenlighting_s {
+ background:transparent url(lighting/bottom-middle-green.png) repeat-x 0 0;
+ height:15px;
+}
+
+.greenlighting_se, .greenlighting_sizer {
+ background:transparent url(lighting/bottom-right-green.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.greenlighting_sizer {
+ cursor:se-resize;
+}
+
+.greenlighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-green.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greenlighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-green.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greenlighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-green.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greenlighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#2A6002;
+}
+
+.greenlighting_content {
+ overflow:auto;
+ color:#000;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#ACFCAF;
+}
+
+/* For alert/confirm dialog */
+.greenlighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.greenlighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.greenlighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.greenlighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.greenlighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .greenlighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-green.png", sizingMethod="scale");
+}
+
+* html .greenlighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-green.png", sizingMethod="scale");
+}
+
+* html .greenlighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-green.png", sizingMethod="scale");
+}
+
+* html .greenlighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-green.png", sizingMethod="scale");
+}
+
+* html greenlighting_se, * html .greenlighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_content {
+ background:#A4FCA7;
+}
+
+
+
+.overlay_darkbluelighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.darkbluelighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.darkbluelighting_nw {
+ background:transparent url(lighting/top-left-darkblue.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.darkbluelighting_n {
+ background:transparent url(lighting/top-middle-darkblue.png) repeat-x 0 0;
+ height:28px;
+}
+
+.darkbluelighting_ne {
+ background:transparent url(lighting/top-right-darkblue.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.darkbluelighting_w {
+ background:transparent url(lighting/left-darkblue.png) repeat-y top left;
+ width:9px;
+}
+
+.darkbluelighting_e {
+ background:transparent url(lighting/right-darkblue.png) repeat-y top right;
+ width:15px;
+}
+
+.darkbluelighting_sw {
+ background:transparent url(lighting/bottom-left-darkblue.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.darkbluelighting_s {
+ background:transparent url(lighting/bottom-middle-darkblue.png) repeat-x 0 0;
+ height:15px;
+}
+
+.darkbluelighting_se, .darkbluelighting_sizer {
+ background:transparent url(lighting/bottom-right-darkblue.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.darkbluelighting_sizer {
+ cursor:se-resize;
+}
+
+.darkbluelighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-darkblue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkbluelighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-darkblue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkbluelighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-darkblue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkbluelighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#E4EFFD;
+}
+
+.darkbluelighting_content {
+ overflow:auto;
+ color:#FFF;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#0413C0;
+}
+
+/* For alert/confirm dialog */
+.darkbluelighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.darkbluelighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.darkbluelighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.darkbluelighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.darkbluelighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .darkbluelighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-darkblue.png", sizingMethod="scale");
+}
+
+* html .darkbluelighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-darkblue.png", sizingMethod="scale");
+}
+
+* html .darkbluelighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-darkblue.png", sizingMethod="scale");
+}
+
+* html .darkbluelighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-darkblue.png", sizingMethod="scale");
+}
+
+* html darkbluelighting_se, * html .darkbluelighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_content {
+ background:#020EBA;
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/background_buttons.gif b/js/prototype-window-1.3/documentation/themes/lighting/background_buttons.gif
new file mode 100755
index 0000000..2fa58b2
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/background_buttons.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-blue.png
new file mode 100755
index 0000000..4592c19
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-darkblue.png
new file mode 100755
index 0000000..ce238f1
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-green.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-green.png
new file mode 100755
index 0000000..38f9e9e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-grey.png
new file mode 100755
index 0000000..2ace75e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-left-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-blue.png
new file mode 100755
index 0000000..439bcaa
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-darkblue.png
new file mode 100755
index 0000000..3fae972
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-green.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-green.png
new file mode 100755
index 0000000..89a732f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-grey.png
new file mode 100755
index 0000000..52bfee0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-middle-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-blue.png
new file mode 100755
index 0000000..dffb75f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-darkblue.png
new file mode 100755
index 0000000..62a4d8b
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-green.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-green.png
new file mode 100755
index 0000000..4aee20f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-grey.png
new file mode 100755
index 0000000..caa27fe
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/bottom-right-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-close-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/button-close-blue.png
new file mode 100755
index 0000000..523e0db
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-close-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-close-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/button-close-darkblue.png
new file mode 100755
index 0000000..a7b8daa
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-close-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-close-green.png b/js/prototype-window-1.3/documentation/themes/lighting/button-close-green.png
new file mode 100755
index 0000000..63f755b
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-close-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-close-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/button-close-grey.png
new file mode 100755
index 0000000..0c5375f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-close-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-blue.png
new file mode 100755
index 0000000..2cdf404
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-darkblue.png
new file mode 100755
index 0000000..4ef5758
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-green.png b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-green.png
new file mode 100755
index 0000000..d4c1e57
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-grey.png
new file mode 100755
index 0000000..35da0e0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-maximize-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-blue.png
new file mode 100755
index 0000000..92db9a0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-darkblue.png
new file mode 100755
index 0000000..e3d8654
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-green.png b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-green.png
new file mode 100755
index 0000000..4846e2f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-grey.png
new file mode 100755
index 0000000..310bcbb
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/button-minimize-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/left-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/left-blue.png
new file mode 100755
index 0000000..30275bb
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/left-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/left-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/left-darkblue.png
new file mode 100755
index 0000000..36c10e0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/left-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/left-green.png b/js/prototype-window-1.3/documentation/themes/lighting/left-green.png
new file mode 100755
index 0000000..c8aee73
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/left-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/left-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/left-grey.png
new file mode 100755
index 0000000..acc2af0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/left-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/pngbehavior.htc b/js/prototype-window-1.3/documentation/themes/lighting/pngbehavior.htc
new file mode 100755
index 0000000..36ea182
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/pngbehavior.htc
@@ -0,0 +1,67 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="doFix()" />
+
+<script type="text/javascript">
+
+// IE5.5+ PNG Alpha Fix v1.0RC4
+// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the CC-GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+
+// This must be a path to a blank image. That's all the configuration you need.
+if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
+
+
+var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+
+function filt(s, m)
+{
+ if (filters[f])
+ {
+ filters[f].enabled = s ? true : false;
+ if (s) with (filters[f]) { src = s; sizingMethod = m }
+ }
+ else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
+}
+
+function doFix()
+{
+ alert('ok')
+
+ // Assume IE7 is OK.
+ if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
+ (event && !/(background|src)/.test(event.propertyName))) return;
+
+ var bgImg = currentStyle.backgroundImage || style.backgroundImage;
+
+ if (tagName == 'IMG')
+ {
+ if ((/\.png$/i).test(src))
+ {
+ if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ style.width = offsetWidth + 'px';
+ filt(src, 'scale');
+ src = blankImg;
+ }
+ else if (src.indexOf(blankImg) < 0) filt();
+ }
+ else if (bgImg && bgImg != 'none')
+ {
+ if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
+ {
+ var s = RegExp.$1;
+ if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ style.width = offsetWidth + 'px';
+ style.backgroundImage = 'none';
+ filt(s, 'crop');
+ // IE link fix.
+ for (var n = 0; n < childNodes.length; n++)
+ if (childNodes[n].style) childNodes[n].style.position = 'relative';
+ }
+ else filt();
+ }
+}
+
+doFix();
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/right-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/right-blue.png
new file mode 100755
index 0000000..9df1b29
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/right-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/right-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/right-darkblue.png
new file mode 100755
index 0000000..10c19c7
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/right-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/right-green.png b/js/prototype-window-1.3/documentation/themes/lighting/right-green.png
new file mode 100755
index 0000000..fbe6c5e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/right-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/right-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/right-grey.png
new file mode 100755
index 0000000..33ef9d9
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/right-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/spinner.gif b/js/prototype-window-1.3/documentation/themes/lighting/spinner.gif
new file mode 100755
index 0000000..1ed786f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/spinner.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-left-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/top-left-blue.png
new file mode 100755
index 0000000..805a7d9
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-left-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-left-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/top-left-darkblue.png
new file mode 100755
index 0000000..3ed3e12
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-left-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-left-green.png b/js/prototype-window-1.3/documentation/themes/lighting/top-left-green.png
new file mode 100755
index 0000000..f6eb735
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-left-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-left-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/top-left-grey.png
new file mode 100755
index 0000000..53411cb
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-left-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-middle-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-blue.png
new file mode 100755
index 0000000..93862ff
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-middle-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-darkblue.png
new file mode 100755
index 0000000..20516e0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-middle-green.png b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-green.png
new file mode 100755
index 0000000..1352d33
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-middle-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-grey.png
new file mode 100755
index 0000000..f353828
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-middle-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-right-blue.png b/js/prototype-window-1.3/documentation/themes/lighting/top-right-blue.png
new file mode 100755
index 0000000..a95bdb5
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-right-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-right-darkblue.png b/js/prototype-window-1.3/documentation/themes/lighting/top-right-darkblue.png
new file mode 100755
index 0000000..992070c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-right-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-right-green.png b/js/prototype-window-1.3/documentation/themes/lighting/top-right-green.png
new file mode 100755
index 0000000..1ee91d4
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-right-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/lighting/top-right-grey.png b/js/prototype-window-1.3/documentation/themes/lighting/top-right-grey.png
new file mode 100755
index 0000000..2149502
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/lighting/top-right-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x.css b/js/prototype-window-1.3/documentation/themes/mac_os_x.css
new file mode 100755
index 0000000..24751f8
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x.css
@@ -0,0 +1,333 @@
+/* Focused windows */
+.overlay_mac_os_x {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.mac_os_x_nw {
+ background: transparent url(mac_os_x/TL_Main.png) no-repeat 0 0;
+ width:24px;
+ height:30px;
+}
+
+.mac_os_x_n {
+ background: transparent url(mac_os_x/T_Main.png) repeat-x 0 0;
+ height:30px;
+}
+
+.mac_os_x_ne {
+ background: transparent url(mac_os_x/TR_Main.png) no-repeat 0 0;
+ width:31px;
+ height:30px;
+}
+
+.mac_os_x_w {
+ background: transparent url(mac_os_x/L_Main.png) repeat-y top left;
+ width:16px;
+}
+
+.mac_os_x_e {
+ background: transparent url(mac_os_x/R_Main.png) repeat-y top right;
+ width:16px;
+}
+
+.mac_os_x_sw {
+ background: transparent url(mac_os_x/BL_Main.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_s {
+ background: transparent url(mac_os_x/B_Main.png) repeat-x 0 0;
+ height:40px;
+}
+
+.mac_os_x_se, .mac_os_x_sizer {
+ background: transparent url(mac_os_x/BR_Main.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_sizer {
+ cursor:se-resize;
+}
+
+.mac_os_x_close {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_minimize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:45px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_maximize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:65px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ margin-top:8px;
+ width:100%;
+ color:#000;
+}
+
+.mac_os_x_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background:#FFF;
+}
+.mac_os_x_s .status_bar {
+ padding-bottom:24px;
+}
+
+/* FOR IE */
+* html .mac_os_x_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop");
+}
+
+
+/* Focused windows */
+.overlay_blur_os_x {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.blur_os_x_nw {
+ background: transparent url(mac_os_x/TL.png) no-repeat 0 0;
+ width:24px;
+ height:30px;
+}
+
+.blur_os_x_n {
+ background: transparent url(mac_os_x/T.png) repeat-x 0 0;
+ height:30px;
+}
+
+.blur_os_x_ne {
+ background: transparent url(mac_os_x/TR.png) no-repeat 0 0;
+ width:31px;
+ height:30px;
+}
+
+.blur_os_x_w {
+ background: transparent url(mac_os_x/L.png) repeat-y top left;
+ width:16px;
+}
+
+.blur_os_x_e {
+ background: transparent url(mac_os_x/R.png) repeat-y top right;
+ width:16px;
+}
+
+.blur_os_x_sw {
+ background: transparent url(mac_os_x/BL.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.blur_os_x_s {
+ background: transparent url(mac_os_x/B.png) repeat-x 0 0;
+ height:40px;
+}
+
+.blur_os_x_se, .blur_os_x_sizer {
+ background: transparent url(mac_os_x/BR.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.blur_os_x_sizer {
+ cursor:se-resize;
+}
+
+.blur_os_x_close {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.blur_os_x_minimize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:45px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.blur_os_x_maximize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:65px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.blur_os_x_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ margin-top:8px;
+ width:100%;
+ color:#000;
+}
+
+.blur_os_x_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background:#FFF;
+}
+.blur_os_x_s .status_bar {
+ padding-bottom:24px;
+}
+
+/* FOR IE */
+* html .blur_os_x_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop");
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/B.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/B.png
new file mode 100755
index 0000000..9d771ce
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/B.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/BL.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/BL.png
new file mode 100755
index 0000000..fdca3eb
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/BL.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/BL_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/BL_Main.png
new file mode 100755
index 0000000..4b34136
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/BL_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/BR.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/BR.png
new file mode 100755
index 0000000..7c1cf2c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/BR.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/BR_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/BR_Main.png
new file mode 100755
index 0000000..9fb2481
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/BR_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/B_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/B_Main.png
new file mode 100755
index 0000000..6dc4041
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/B_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/L.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/L.png
new file mode 100755
index 0000000..6882cc5
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/L.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/L_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/L_Main.png
new file mode 100755
index 0000000..f3a8322
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/L_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/R.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/R.png
new file mode 100755
index 0000000..8080ad8
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/R.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/R_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/R_Main.png
new file mode 100755
index 0000000..890bcd6
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/R_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/T.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/T.png
new file mode 100755
index 0000000..63c265c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/T.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/TL.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/TL.png
new file mode 100755
index 0000000..5fbd409
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/TL.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/TL_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/TL_Main.png
new file mode 100755
index 0000000..dd21126
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/TL_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/TR.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/TR.png
new file mode 100755
index 0000000..aff657d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/TR.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/TR_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/TR_Main.png
new file mode 100755
index 0000000..3bde7f9
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/TR_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/T_Main.png b/js/prototype-window-1.3/documentation/themes/mac_os_x/T_Main.png
new file mode 100755
index 0000000..0efba3d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/T_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/close.gif b/js/prototype-window-1.3/documentation/themes/mac_os_x/close.gif
new file mode 100755
index 0000000..31ef5a3
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/close.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/maximize.gif b/js/prototype-window-1.3/documentation/themes/mac_os_x/maximize.gif
new file mode 100755
index 0000000..892a0f0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/maximize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x/minimize.gif b/js/prototype-window-1.3/documentation/themes/mac_os_x/minimize.gif
new file mode 100755
index 0000000..a721416
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x/minimize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog.css b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog.css
new file mode 100755
index 0000000..e663e3c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog.css
@@ -0,0 +1,160 @@
+.overlay_mac_os_x_dialog {
+ background-color: #FF7224;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.mac_os_x_dialog_nw {
+ background: transparent url(mac_os_x_dialog/L.png) repeat-y top left;
+ width:16px;
+ height:16px;
+}
+
+.mac_os_x_dialog_n {
+ background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0;
+ height:18px;
+}
+
+.mac_os_x_dialog_ne {
+ background: transparent url(mac_os_x_dialog/R.png) repeat-y top left;
+ width:16px;
+ height:16px;
+}
+
+.mac_os_x_dialog_w {
+ background: transparent url(mac_os_x_dialog/L.png) repeat-y top left;
+ width:16px;
+}
+
+.mac_os_x_dialog_e {
+ background: transparent url(mac_os_x_dialog/R.png) repeat-y top right;
+ width:16px;
+}
+
+.mac_os_x_dialog_sw {
+ background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_dialog_s {
+ background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0;
+ height:40px;
+}
+
+.mac_os_x_dialog_se, .mac_os_x_dialog_sizer {
+ background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_dialog_sizer {
+ cursor:se-resize;
+}
+
+.mac_os_x_dialog_close {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_dialog_minimize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:45px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_dialog_maximize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:65px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_dialog_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ margin-top:6px;
+ width:100%;
+ color:#000;
+}
+
+.mac_os_x_dialog_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0;
+}
+
+.mac_os_x_dialog_buttons {
+ text-align: center;
+}
+/* FOR IE */
+* html .mac_os_x_dialog_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale");
+}
+
+
+* html .mac_os_x_dialog_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_dialog_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_dialog_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop");
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/B.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/B.png
new file mode 100755
index 0000000..1549937
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/B.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BL.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BL.png
new file mode 100755
index 0000000..b80261f
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BL.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BR.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BR.png
new file mode 100755
index 0000000..d20b654
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/BR.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/L.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/L.png
new file mode 100755
index 0000000..6882cc5
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/L.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/R.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/R.png
new file mode 100755
index 0000000..8080ad8
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/R.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/T.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/T.png
new file mode 100755
index 0000000..63c265c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/T.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TL.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TL.png
new file mode 100755
index 0000000..5fbd409
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TL.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TR.png b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TR.png
new file mode 100755
index 0000000..aff657d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/TR.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/bg.gif b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/bg.gif
new file mode 100755
index 0000000..cb9b3f3
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/bg.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/close.gif b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/close.gif
new file mode 100755
index 0000000..31ef5a3
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/close.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/maximize.gif b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/maximize.gif
new file mode 100755
index 0000000..892a0f0
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/maximize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/minimize.gif b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/minimize.gif
new file mode 100755
index 0000000..a721416
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/mac_os_x_dialog/minimize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio.css b/js/prototype-window-1.3/documentation/themes/nuncio.css
new file mode 100755
index 0000000..2c439bd
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio.css
@@ -0,0 +1,164 @@
+.overlay_nuncio img { border: none; }
+
+.overlay_nuncio {
+ background-color: #666666;
+}
+
+.nuncio_nw {
+ width: 12px;
+ height: 28px;
+ background: url(nuncio/top_left.png) no-repeat;
+}
+
+.nuncio_n {
+ background: url(nuncio/top_mid.png) repeat-x;
+ height: 28px;
+}
+
+.nuncio_ne {
+ width: 21px;
+ height: 28px;
+ background: url(nuncio/top_right.png) no-repeat;
+}
+
+.nuncio_e {
+ width: 21px;
+ background: url(nuncio/center_right.png) repeat-y top right;
+}
+
+.nuncio_w {
+ width: 12px;
+ background: url(nuncio/center_left.png) repeat-y top left;
+}
+
+.nuncio_sw {
+ width: 12px;
+ height: 18px;
+ background: url(nuncio/bottom_left.png) no-repeat;
+}
+
+.nuncio_s {
+ background: url(nuncio/bottom_mid.png) repeat-x 0 0;
+ height: 18px;
+}
+
+.nuncio_se, .nuncio_sizer {
+ width: 21px;
+ height: 18px;
+ background: url(nuncio/bottom_right.png) no-repeat;
+}
+
+.nuncio_close {
+ width: 14px;
+ height: 14px;
+ background: url(nuncio/close.png) no-repeat;
+ position:absolute;
+ top:10px;
+ right:22px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.nuncio_minimize {
+ width: 14px;
+ height: 15px;
+ background: url(nuncio/minimize.png) no-repeat;
+ position:absolute;
+ top:10px;
+ right:40px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.nuncio_title {
+ float:left;
+ font-size:11px;
+ font-weight: bold;
+ font-style: italic;
+ color: #fff;
+ width: 100%
+}
+
+.nuncio_content {
+ background: url(nuncio/overlay.png) repeat;
+ overflow:auto;
+ color: #ddd;
+ font-family: Tahoma, Arial, "sans-serif";
+ font-size: 10px;
+}
+
+.nuncio_sizer {
+ cursor:se-resize;
+}
+
+
+.top_draggable, .bottom_draggable {
+ cursor:move
+}
+/* FOR IE */
+* html .nuncio_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_left.png", sizingMethod="crop");
+}
+
+* html .nuncio_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_mid.png", sizingMethod="scale");
+}
+
+* html .nuncio_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_right.png", sizingMethod="crop");
+}
+
+* html .nuncio_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_left.png", sizingMethod="scale");
+}
+
+* html .nuncio_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_right.png", sizingMethod="scale");
+}
+
+* html .nuncio_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_left.png", sizingMethod="crop");
+}
+
+* html .nuncio_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_mid.png", sizingMethod="scale");
+}
+
+* html .nuncio_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop");
+}
+
+* html .nuncio_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop");
+}
+
+* html .nuncio_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/close.png", sizingMethod="crop");
+}
+
+* html .nuncio_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/minimize.png", sizingMethod="crop");
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/bottom_left.png b/js/prototype-window-1.3/documentation/themes/nuncio/bottom_left.png
new file mode 100755
index 0000000..0b6ad03
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/bottom_left.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/bottom_mid.png b/js/prototype-window-1.3/documentation/themes/nuncio/bottom_mid.png
new file mode 100755
index 0000000..2f7f121
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/bottom_mid.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/bottom_right.png b/js/prototype-window-1.3/documentation/themes/nuncio/bottom_right.png
new file mode 100755
index 0000000..63834cc
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/bottom_right.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/center_left.png b/js/prototype-window-1.3/documentation/themes/nuncio/center_left.png
new file mode 100755
index 0000000..c616a95
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/center_left.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/center_right.png b/js/prototype-window-1.3/documentation/themes/nuncio/center_right.png
new file mode 100755
index 0000000..63527b9
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/center_right.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/close.png b/js/prototype-window-1.3/documentation/themes/nuncio/close.png
new file mode 100755
index 0000000..591ed3d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/close.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/minimize.png b/js/prototype-window-1.3/documentation/themes/nuncio/minimize.png
new file mode 100755
index 0000000..62e15be
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/minimize.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/overlay.png b/js/prototype-window-1.3/documentation/themes/nuncio/overlay.png
new file mode 100755
index 0000000..1a133ba
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/overlay.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/top_left.png b/js/prototype-window-1.3/documentation/themes/nuncio/top_left.png
new file mode 100755
index 0000000..f002fe1
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/top_left.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/top_mid.png b/js/prototype-window-1.3/documentation/themes/nuncio/top_mid.png
new file mode 100755
index 0000000..d07616d
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/top_mid.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/nuncio/top_right.png b/js/prototype-window-1.3/documentation/themes/nuncio/top_right.png
new file mode 100755
index 0000000..10513a8
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/nuncio/top_right.png
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread.css b/js/prototype-window-1.3/documentation/themes/spread.css
new file mode 100755
index 0000000..9bda2a6
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread.css
@@ -0,0 +1,108 @@
+.overlay_spread {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.spread_nw {
+ background: transparent url(spread/left-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.spread_n {
+ background: transparent url(spread/top-middle.gif) repeat-x 0 0;
+ height:25px;
+}
+
+.spread_ne {
+ background: transparent url(spread/right-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.spread_w {
+ background: transparent url(spread/frame-left.gif) repeat-y top left;
+ width:7px;
+}
+
+.spread_e {
+ background: transparent url(spread/frame-right.gif) repeat-y top right;
+ width:7px;
+}
+
+.spread_sw {
+ background: transparent url(spread/bottom-left-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.spread_s {
+ background: transparent url(spread/bottom-middle.gif) repeat-x 0 0;
+ height:7px;
+}
+
+.spread_se, .spread_sizer {
+ background: transparent url(spread/bottom-right-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.spread_sizer {
+ cursor:se-resize;
+}
+
+.spread_close {
+ width: 23px;
+ height: 23px;
+ background: transparent url(spread/button-close-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:11px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.spread_minimize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(spread/button-min-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:55px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.spread_maximize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(spread/button-max-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:33px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.spread_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:14px;
+ font-weight:bold;
+ text-align:left;
+ margin-top:2px;
+ width:100%;
+ color:#E47211;
+}
+
+.spread_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background:#A9EA00;
+}
+
diff --git a/js/prototype-window-1.3/documentation/themes/spread/.gif b/js/prototype-window-1.3/documentation/themes/spread/.gif
new file mode 100755
index 0000000..ff73824
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/bottom-left-c.gif b/js/prototype-window-1.3/documentation/themes/spread/bottom-left-c.gif
new file mode 100755
index 0000000..7cdf459
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/bottom-left-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/bottom-middle.gif b/js/prototype-window-1.3/documentation/themes/spread/bottom-middle.gif
new file mode 100755
index 0000000..b705091
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/bottom-middle.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/bottom-right-c.gif b/js/prototype-window-1.3/documentation/themes/spread/bottom-right-c.gif
new file mode 100755
index 0000000..08c44f9
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/bottom-right-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/button-close-focus.gif b/js/prototype-window-1.3/documentation/themes/spread/button-close-focus.gif
new file mode 100755
index 0000000..99f635c
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/button-close-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/button-max-focus.gif b/js/prototype-window-1.3/documentation/themes/spread/button-max-focus.gif
new file mode 100755
index 0000000..1708a1e
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/button-max-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/button-min-focus.gif b/js/prototype-window-1.3/documentation/themes/spread/button-min-focus.gif
new file mode 100755
index 0000000..ff69d1b
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/button-min-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/frame-left.gif b/js/prototype-window-1.3/documentation/themes/spread/frame-left.gif
new file mode 100755
index 0000000..ad257d3
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/frame-left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/frame-right.gif b/js/prototype-window-1.3/documentation/themes/spread/frame-right.gif
new file mode 100755
index 0000000..708e5fa
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/frame-right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/left-top.gif b/js/prototype-window-1.3/documentation/themes/spread/left-top.gif
new file mode 100755
index 0000000..23581d1
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/left-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/right-top.gif b/js/prototype-window-1.3/documentation/themes/spread/right-top.gif
new file mode 100755
index 0000000..e32d1fb
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/right-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/documentation/themes/spread/top-middle.gif b/js/prototype-window-1.3/documentation/themes/spread/top-middle.gif
new file mode 100755
index 0000000..53934d4
--- /dev/null
+++ b/js/prototype-window-1.3/documentation/themes/spread/top-middle.gif
Binary files differ
diff --git a/js/prototype-window-1.3/helper/prototype_window_class_helper.rb b/js/prototype-window-1.3/helper/prototype_window_class_helper.rb
new file mode 100755
index 0000000..00a34ce
--- /dev/null
+++ b/js/prototype-window-1.3/helper/prototype_window_class_helper.rb
@@ -0,0 +1,58 @@
+# Prototype Window Class Helper (http://pwc-helper.xurdeonrails.com)
+# by Jorge Díaz (http://xurde.info)
+# thanks to Sebastien Gruhier for his Prototype Window Class (http://prototype-window.xilinus.com/)
+
+#Quick use:
+#Reference this helper in your rails applicaction adding -> helper :prototype_window_class in your application.rb
+#You must include in the template header the prototype window class javascripts and the .css theme you want to use.
+#This code in your template might be enough:
+
+ # <%= stylesheet_link_tag 'default' %> (or theme you wanna use)
+ # <%= stylesheet_link_tag 'alert' %>
+ # <%= javascript_include_tag :defaults %>
+ # <%= javascript_include_tag 'window'%>
+
+
+module PrototypeWindowClassHelper
+
+ def params_for_javascript(params) #options_for_javascript doesn't works fine
+
+ '{' + params.map {|k, v| "#{k}: #{
+ case v
+ when Hash then params_for_javascript( v )
+ when String then "'#{v}'"
+ else v #Isn't neither Hash or String
+ end }"}.sort.join(', ') + '}'
+ end
+
+
+
+ def link_to_prototype_dialog( name, content, dialog_kind = 'alert', options = { :windowParameters => {} } , html_options = {} )
+
+ #dialog_kind: 'alert' (default), 'confirm' or 'info' (info dialogs should be destroyed with a javascript function call 'win.destroy')
+ #options for this helper depending the dialog_kind: http://prototype-window.xilinus.com/documentation.html#alert (#confirm or #info)
+
+ js_code ="Dialog.#{dialog_kind}( '#{content}', #{params_for_javascript(options) } ); "
+ content_tag(
+ "a", name,
+ html_options.merge({
+ :href => html_options[:href] || "#",
+ :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + js_code }))
+ end
+
+
+
+ def link_to_prototype_window( name, window_id, options = { :windowParameters => {} } , html_options = {} )
+
+ #window_id must be unique and it's destroyed on window close.
+ #options for this helper: http://prototype-window.xilinus.com/documentation.html#initialize
+
+ js_code ="var win = new Window( '#{window_id}', #{params_for_javascript(options) } ); win.show(); win.setDestroyOnClose();"
+ content_tag(
+ "a", name,
+ html_options.merge({
+ :href => html_options[:href] || "#",
+ :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + js_code }))
+ end
+
+end
diff --git a/js/prototype-window-1.3/javascripts/debug.js b/js/prototype-window-1.3/javascripts/debug.js
new file mode 100755
index 0000000..3d8f338
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/debug.js
@@ -0,0 +1,137 @@
+var debugWindow = null;
+function debug(text, reverse) {
+ if (debugWindow == null)
+ return;
+
+ time = "-"; //new Date();
+ if (reverse) {
+ $('debug').innerHTML = time + " " + text + "<br>"+ $('debug').innerHTML;
+ debugWindow.getContent().scrollTop=0;
+ }
+ else {
+ $('debug').innerHTML += time + " " + text + "<br>";
+ debugWindow.getContent().scrollTop=10000; // Far away
+ }
+}
+
+function hideDebug() {
+ if (debugWindow) {
+ debugWindow.destroy();
+ debugWindow = null;
+ }
+}
+
+function showDebug(bShow) {
+ if (debugWindow == null) {
+ debugWindow = new Window('debug_window', {className: 'dialog',width:250, height:100, right:4, bottom:42, zIndex:1000, opacity:1, showEffect: Element.show, resizable: true, title: "Debug"})
+ debugWindow.getContent().innerHTML = "<style>#debug_window .dialog_content {background:#000;}</style> <div id='debug'></div>";
+ date=new Date;
+ date.setMonth(date.getMonth()+3);
+
+ //debugWindow.setCookie(null, date);
+ }
+ if( typeof bShow == 'undefined' || bShow)debugWindow.show()
+}
+
+
+function clearDebug() {
+ if (debugWindow == null)
+ return;
+ $('debug').innerHTML = "";
+}
+
+/**
+ * document.createElement convenience wrapper
+ *
+ * The data parameter is an object that must have the "tag" key, containing
+ * a string with the tagname of the element to create. It can optionally have
+ * a "children" key which can be: a string, "data" object, or an array of "data"
+ * objects to append to this element as children. Any other key is taken as an
+ * attribute to be applied to this tag.
+ *
+ * Available under an MIT license:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * @param {Object} data The data representing the element to create
+ * @return {Element} The element created.
+ */
+function $E(data) {
+ var el;
+ if ('string'==typeof data) {
+ el=document.createTextNode(data);
+ } else {
+ //create the element
+ el=document.createElement(data.tag);
+ delete(data.tag);
+
+ //append the children
+ if ('undefined'!=typeof data.children) {
+ if ('string'==typeof data.children ||'undefined'==typeof data.children.length) {
+ //strings and single elements
+ el.appendChild($E(data.children));
+ } else {
+ //arrays of elements
+ for (var i=0, child=null; 'undefined'!=typeof (child=data.children[i]); i++) {
+ el.appendChild($E(child));
+ }
+ }
+ delete(data.children);
+ }
+
+ //any other data is attributes
+ for (attr in data) {
+ el[attr]=data[attr];
+ }
+ }
+
+ return el;
+}
+
+// FROM Nick Hemsley
+var Debug = {
+ inspectOutput: function (container, within) {
+ within = within || debugWindow.getContent()
+
+ if (debugWindow == null)
+ return;
+
+ within.appendChild(container)
+ },
+
+ inspect: function(object) {
+ var cont = $E({tag: "div", className: "inspector"})
+ Debug.inspectObj(object, cont)
+ debugWindow.getContent().appendChild(cont)
+ },
+
+ inspectObj: function (object, container) {
+ for (prop in object) {
+ Debug.inspectOutput(Debug.inspectable(object, prop), container)
+ }
+ },
+
+ inspectable: function(object, prop) {
+ cont = $E({tag: 'div', className: 'inspectable', children: [prop + " value: " + object[prop] ]})
+ cont.toInspect = object[prop]
+ Event.observe(cont, 'click', Debug.inspectClicked, false)
+ return cont
+ },
+
+ inspectClicked: function(e) {
+ Debug.inspectContained(Event.element(e))
+ Event.stop(e)
+ },
+
+ inspectContained: function(container) {
+ if (container.opened) {
+ container.parentNode.removeChild(container.opened)
+ delete(container.opened)
+ } else {
+ sibling = container.parentNode.insertBefore($E({tag: "div", className: "child"}), container.nextSibling)
+ if (container.toInspect)
+ Debug.inspectObj(container.toInspect, sibling)
+ container.opened = sibling
+ }
+ }
+}
+var inspect = Debug.inspect;
diff --git a/js/prototype-window-1.3/javascripts/effects.js b/js/prototype-window-1.3/javascripts/effects.js
new file mode 100755
index 0000000..8a4a4f9
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/effects.js
@@ -0,0 +1,1094 @@
+// script.aculo.us effects.js v1.7.1_beta1, Mon Mar 12 14:40:50 +0100 2007
+
+// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Contributors:
+// Justin Palmer (http://encytemedia.com/)
+// Mark Pilgrim (http://diveintomark.org/)
+// Martin Bialasinki
+//
+// script.aculo.us is freely distributable under the terms of an MIT-style license.
+// For details, see the script.aculo.us web site: http://script.aculo.us/
+
+// converts rgb() and #xxx to #xxxxxx format,
+// returns self (or first argument) if not convertable
+String.prototype.parseColor = function() {
+ var color = '#';
+ if(this.slice(0,4) == 'rgb(') {
+ var cols = this.slice(4,this.length-1).split(',');
+ var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
+ } else {
+ if(this.slice(0,1) == '#') {
+ if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
+ if(this.length==7) color = this.toLowerCase();
+ }
+ }
+ return(color.length==7 ? color : (arguments[0] || this));
+}
+
+/*--------------------------------------------------------------------------*/
+
+Element.collectTextNodes = function(element) {
+ return $A($(element).childNodes).collect( function(node) {
+ return (node.nodeType==3 ? node.nodeValue :
+ (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
+ }).flatten().join('');
+}
+
+Element.collectTextNodesIgnoreClass = function(element, className) {
+ return $A($(element).childNodes).collect( function(node) {
+ return (node.nodeType==3 ? node.nodeValue :
+ ((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
+ Element.collectTextNodesIgnoreClass(node, className) : ''));
+ }).flatten().join('');
+}
+
+Element.setContentZoom = function(element, percent) {
+ element = $(element);
+ element.setStyle({fontSize: (percent/100) + 'em'});
+ if(Prototype.Browser.WebKit) window.scrollBy(0,0);
+ return element;
+}
+
+Element.getInlineOpacity = function(element){
+ return $(element).style.opacity || '';
+}
+
+Element.forceRerendering = function(element) {
+ try {
+ element = $(element);
+ var n = document.createTextNode(' ');
+ element.appendChild(n);
+ element.removeChild(n);
+ } catch(e) { }
+};
+
+/*--------------------------------------------------------------------------*/
+
+Array.prototype.call = function() {
+ var args = arguments;
+ this.each(function(f){ f.apply(this, args) });
+}
+
+/*--------------------------------------------------------------------------*/
+
+var Effect = {
+ _elementDoesNotExistError: {
+ name: 'ElementDoesNotExistError',
+ message: 'The specified DOM element does not exist, but is required for this effect to operate'
+ },
+ tagifyText: function(element) {
+ if(typeof Builder == 'undefined')
+ throw("Effect.tagifyText requires including script.aculo.us' builder.js library");
+
+ var tagifyStyle = 'position:relative';
+ if(Prototype.Browser.IE) tagifyStyle += ';zoom:1';
+
+ element = $(element);
+ $A(element.childNodes).each( function(child) {
+ if(child.nodeType==3) {
+ child.nodeValue.toArray().each( function(character) {
+ element.insertBefore(
+ Builder.node('span',{style: tagifyStyle},
+ character == ' ' ? String.fromCharCode(160) : character),
+ child);
+ });
+ Element.remove(child);
+ }
+ });
+ },
+ multiple: function(element, effect) {
+ var elements;
+ if(((typeof element == 'object') ||
+ (typeof element == 'function')) &&
+ (element.length))
+ elements = element;
+ else
+ elements = $(element).childNodes;
+
+ var options = Object.extend({
+ speed: 0.1,
+ delay: 0.0
+ }, arguments[2] || {});
+ var masterDelay = options.delay;
+
+ $A(elements).each( function(element, index) {
+ new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
+ });
+ },
+ PAIRS: {
+ 'slide': ['SlideDown','SlideUp'],
+ 'blind': ['BlindDown','BlindUp'],
+ 'appear': ['Appear','Fade']
+ },
+ toggle: function(element, effect) {
+ element = $(element);
+ effect = (effect || 'appear').toLowerCase();
+ var options = Object.extend({
+ queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
+ }, arguments[2] || {});
+ Effect[element.visible() ?
+ Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
+ }
+};
+
+var Effect2 = Effect; // deprecated
+
+/* ------------- transitions ------------- */
+
+Effect.Transitions = {
+ linear: Prototype.K,
+ sinoidal: function(pos) {
+ return (-Math.cos(pos*Math.PI)/2) + 0.5;
+ },
+ reverse: function(pos) {
+ return 1-pos;
+ },
+ flicker: function(pos) {
+ var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
+ return (pos > 1 ? 1 : pos);
+ },
+ wobble: function(pos) {
+ return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
+ },
+ pulse: function(pos, pulses) {
+ pulses = pulses || 5;
+ return (
+ Math.round((pos % (1/pulses)) * pulses) == 0 ?
+ ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) :
+ 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2))
+ );
+ },
+ none: function(pos) {
+ return 0;
+ },
+ full: function(pos) {
+ return 1;
+ }
+};
+
+/* ------------- core effects ------------- */
+
+Effect.ScopedQueue = Class.create();
+Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
+ initialize: function() {
+ this.effects = [];
+ this.interval = null;
+ },
+ _each: function(iterator) {
+ this.effects._each(iterator);
+ },
+ add: function(effect) {
+ var timestamp = new Date().getTime();
+
+ var position = (typeof effect.options.queue == 'string') ?
+ effect.options.queue : effect.options.queue.position;
+
+ switch(position) {
+ case 'front':
+ // move unstarted effects after this effect
+ this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
+ e.startOn += effect.finishOn;
+ e.finishOn += effect.finishOn;
+ });
+ break;
+ case 'with-last':
+ timestamp = this.effects.pluck('startOn').max() || timestamp;
+ break;
+ case 'end':
+ // start effect after last queued effect has finished
+ timestamp = this.effects.pluck('finishOn').max() || timestamp;
+ break;
+ }
+
+ effect.startOn += timestamp;
+ effect.finishOn += timestamp;
+
+ if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
+ this.effects.push(effect);
+
+ if(!this.interval)
+ this.interval = setInterval(this.loop.bind(this), 15);
+ },
+ remove: function(effect) {
+ this.effects = this.effects.reject(function(e) { return e==effect });
+ if(this.effects.length == 0) {
+ clearInterval(this.interval);
+ this.interval = null;
+ }
+ },
+ loop: function() {
+ var timePos = new Date().getTime();
+ for(var i=0, len=this.effects.length;i<len;i++)
+ this.effects[i] && this.effects[i].loop(timePos);
+ }
+});
+
+Effect.Queues = {
+ instances: $H(),
+ get: function(queueName) {
+ if(typeof queueName != 'string') return queueName;
+
+ if(!this.instances[queueName])
+ this.instances[queueName] = new Effect.ScopedQueue();
+
+ return this.instances[queueName];
+ }
+}
+Effect.Queue = Effect.Queues.get('global');
+
+Effect.DefaultOptions = {
+ transition: Effect.Transitions.sinoidal,
+ duration: 1.0, // seconds
+ fps: 100, // 100= assume 66fps max.
+ sync: false, // true for combining
+ from: 0.0,
+ to: 1.0,
+ delay: 0.0,
+ queue: 'parallel'
+}
+
+Effect.Base = function() {};
+Effect.Base.prototype = {
+ position: null,
+ start: function(options) {
+ function codeForEvent(options,eventName){
+ return (
+ (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
+ (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
+ );
+ }
+ if(options.transition === false) options.transition = Effect.Transitions.linear;
+ this.options = Object.extend(Object.extend({},Effect.DefaultOptions), options || {});
+ this.currentFrame = 0;
+ this.state = 'idle';
+ this.startOn = this.options.delay*1000;
+ this.finishOn = this.startOn+(this.options.duration*1000);
+ this.fromToDelta = this.options.to-this.options.from;
+ this.totalTime = this.finishOn-this.startOn;
+ this.totalFrames = this.options.fps*this.options.duration;
+
+ eval('this.render = function(pos){ '+
+ 'if(this.state=="idle"){this.state="running";'+
+ codeForEvent(options,'beforeSetup')+
+ (this.setup ? 'this.setup();':'')+
+ codeForEvent(options,'afterSetup')+
+ '};if(this.state=="running"){'+
+ 'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
+ 'this.position=pos;'+
+ codeForEvent(options,'beforeUpdate')+
+ (this.update ? 'this.update(pos);':'')+
+ codeForEvent(options,'afterUpdate')+
+ '}}');
+
+ this.event('beforeStart');
+ if(!this.options.sync)
+ Effect.Queues.get(typeof this.options.queue == 'string' ?
+ 'global' : this.options.queue.scope).add(this);
+ },
+ loop: function(timePos) {
+ if(timePos >= this.startOn) {
+ if(timePos >= this.finishOn) {
+ this.render(1.0);
+ this.cancel();
+ this.event('beforeFinish');
+ if(this.finish) this.finish();
+ this.event('afterFinish');
+ return;
+ }
+ var pos = (timePos - this.startOn) / this.totalTime,
+ frame = Math.round(pos * this.totalFrames);
+ if(frame > this.currentFrame) {
+ this.render(pos);
+ this.currentFrame = frame;
+ }
+ }
+ },
+ cancel: function() {
+ if(!this.options.sync)
+ Effect.Queues.get(typeof this.options.queue == 'string' ?
+ 'global' : this.options.queue.scope).remove(this);
+ this.state = 'finished';
+ },
+ event: function(eventName) {
+ if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
+ if(this.options[eventName]) this.options[eventName](this);
+ },
+ inspect: function() {
+ var data = $H();
+ for(property in this)
+ if(typeof this[property] != 'function') data[property] = this[property];
+ return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
+ }
+}
+
+Effect.Parallel = Class.create();
+Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), {
+ initialize: function(effects) {
+ this.effects = effects || [];
+ this.start(arguments[1]);
+ },
+ update: function(position) {
+ this.effects.invoke('render', position);
+ },
+ finish: function(position) {
+ this.effects.each( function(effect) {
+ effect.render(1.0);
+ effect.cancel();
+ effect.event('beforeFinish');
+ if(effect.finish) effect.finish(position);
+ effect.event('afterFinish');
+ });
+ }
+});
+
+Effect.Event = Class.create();
+Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), {
+ initialize: function() {
+ var options = Object.extend({
+ duration: 0
+ }, arguments[0] || {});
+ this.start(options);
+ },
+ update: Prototype.emptyFunction
+});
+
+Effect.Opacity = Class.create();
+Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ // make this work on IE on elements without 'layout'
+ if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
+ this.element.setStyle({zoom: 1});
+ var options = Object.extend({
+ from: this.element.getOpacity() || 0.0,
+ to: 1.0
+ }, arguments[1] || {});
+ this.start(options);
+ },
+ update: function(position) {
+ this.element.setOpacity(position);
+ }
+});
+
+Effect.Move = Class.create();
+Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({
+ x: 0,
+ y: 0,
+ mode: 'relative'
+ }, arguments[1] || {});
+ this.start(options);
+ },
+ setup: function() {
+ // Bug in Opera: Opera returns the "real" position of a static element or
+ // relative element that does not have top/left explicitly set.
+ // ==> Always set top and left for position relative elements in your stylesheets
+ // (to 0 if you do not need them)
+ this.element.makePositioned();
+ this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
+ this.originalTop = parseFloat(this.element.getStyle('top') || '0');
+ if(this.options.mode == 'absolute') {
+ // absolute movement, so we need to calc deltaX and deltaY
+ this.options.x = this.options.x - this.originalLeft;
+ this.options.y = this.options.y - this.originalTop;
+ }
+ },
+ update: function(position) {
+ this.element.setStyle({
+ left: Math.round(this.options.x * position + this.originalLeft) + 'px',
+ top: Math.round(this.options.y * position + this.originalTop) + 'px'
+ });
+ }
+});
+
+// for backwards compatibility
+Effect.MoveBy = function(element, toTop, toLeft) {
+ return new Effect.Move(element,
+ Object.extend({ x: toLeft, y: toTop }, arguments[3] || {}));
+};
+
+Effect.Scale = Class.create();
+Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
+ initialize: function(element, percent) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({
+ scaleX: true,
+ scaleY: true,
+ scaleContent: true,
+ scaleFromCenter: false,
+ scaleMode: 'box', // 'box' or 'contents' or {} with provided values
+ scaleFrom: 100.0,
+ scaleTo: percent
+ }, arguments[2] || {});
+ this.start(options);
+ },
+ setup: function() {
+ this.restoreAfterFinish = this.options.restoreAfterFinish || false;
+ this.elementPositioning = this.element.getStyle('position');
+
+ this.originalStyle = {};
+ ['top','left','width','height','fontSize'].each( function(k) {
+ this.originalStyle[k] = this.element.style[k];
+ }.bind(this));
+
+ this.originalTop = this.element.offsetTop;
+ this.originalLeft = this.element.offsetLeft;
+
+ var fontSize = this.element.getStyle('font-size') || '100%';
+ ['em','px','%','pt'].each( function(fontSizeType) {
+ if(fontSize.indexOf(fontSizeType)>0) {
+ this.fontSize = parseFloat(fontSize);
+ this.fontSizeType = fontSizeType;
+ }
+ }.bind(this));
+
+ this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
+
+ this.dims = null;
+ if(this.options.scaleMode=='box')
+ this.dims = [this.element.offsetHeight, this.element.offsetWidth];
+ if(/^content/.test(this.options.scaleMode))
+ this.dims = [this.element.scrollHeight, this.element.scrollWidth];
+ if(!this.dims)
+ this.dims = [this.options.scaleMode.originalHeight,
+ this.options.scaleMode.originalWidth];
+ },
+ update: function(position) {
+ var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
+ if(this.options.scaleContent && this.fontSize)
+ this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
+ this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
+ },
+ finish: function(position) {
+ if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
+ },
+ setDimensions: function(height, width) {
+ var d = {};
+ if(this.options.scaleX) d.width = Math.round(width) + 'px';
+ if(this.options.scaleY) d.height = Math.round(height) + 'px';
+ if(this.options.scaleFromCenter) {
+ var topd = (height - this.dims[0])/2;
+ var leftd = (width - this.dims[1])/2;
+ if(this.elementPositioning == 'absolute') {
+ if(this.options.scaleY) d.top = this.originalTop-topd + 'px';
+ if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
+ } else {
+ if(this.options.scaleY) d.top = -topd + 'px';
+ if(this.options.scaleX) d.left = -leftd + 'px';
+ }
+ }
+ this.element.setStyle(d);
+ }
+});
+
+Effect.Highlight = Class.create();
+Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});
+ this.start(options);
+ },
+ setup: function() {
+ // Prevent executing on elements not in the layout flow
+ if(this.element.getStyle('display')=='none') { this.cancel(); return; }
+ // Disable background image during the effect
+ this.oldStyle = {};
+ if (!this.options.keepBackgroundImage) {
+ this.oldStyle.backgroundImage = this.element.getStyle('background-image');
+ this.element.setStyle({backgroundImage: 'none'});
+ }
+ if(!this.options.endcolor)
+ this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
+ if(!this.options.restorecolor)
+ this.options.restorecolor = this.element.getStyle('background-color');
+ // init color calculations
+ this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
+ this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
+ },
+ update: function(position) {
+ this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
+ return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) });
+ },
+ finish: function() {
+ this.element.setStyle(Object.extend(this.oldStyle, {
+ backgroundColor: this.options.restorecolor
+ }));
+ }
+});
+
+Effect.ScrollTo = Class.create();
+Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ this.start(arguments[1] || {});
+ },
+ setup: function() {
+ Position.prepare();
+ var offsets = Position.cumulativeOffset(this.element);
+ if(this.options.offset) offsets[1] += this.options.offset;
+ var max = window.innerHeight ?
+ window.height - window.innerHeight :
+ document.body.scrollHeight -
+ (document.documentElement.clientHeight ?
+ document.documentElement.clientHeight : document.body.clientHeight);
+ this.scrollStart = Position.deltaY;
+ this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart;
+ },
+ update: function(position) {
+ Position.prepare();
+ window.scrollTo(Position.deltaX,
+ this.scrollStart + (position*this.delta));
+ }
+});
+
+/* ------------- combination effects ------------- */
+
+Effect.Fade = function(element) {
+ element = $(element);
+ var oldOpacity = element.getInlineOpacity();
+ var options = Object.extend({
+ from: element.getOpacity() || 1.0,
+ to: 0.0,
+ afterFinishInternal: function(effect) {
+ if(effect.options.to!=0) return;
+ effect.element.hide().setStyle({opacity: oldOpacity});
+ }}, arguments[1] || {});
+ return new Effect.Opacity(element,options);
+}
+
+Effect.Appear = function(element) {
+ element = $(element);
+ var options = Object.extend({
+ from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
+ to: 1.0,
+ // force Safari to render floated elements properly
+ afterFinishInternal: function(effect) {
+ effect.element.forceRerendering();
+ },
+ beforeSetup: function(effect) {
+ effect.element.setOpacity(effect.options.from).show();
+ }}, arguments[1] || {});
+ return new Effect.Opacity(element,options);
+}
+
+Effect.Puff = function(element) {
+ element = $(element);
+ var oldStyle = {
+ opacity: element.getInlineOpacity(),
+ position: element.getStyle('position'),
+ top: element.style.top,
+ left: element.style.left,
+ width: element.style.width,
+ height: element.style.height
+ };
+ return new Effect.Parallel(
+ [ new Effect.Scale(element, 200,
+ { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }),
+ new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],
+ Object.extend({ duration: 1.0,
+ beforeSetupInternal: function(effect) {
+ Position.absolutize(effect.effects[0].element)
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.hide().setStyle(oldStyle); }
+ }, arguments[1] || {})
+ );
+}
+
+Effect.BlindUp = function(element) {
+ element = $(element);
+ element.makeClipping();
+ return new Effect.Scale(element, 0,
+ Object.extend({ scaleContent: false,
+ scaleX: false,
+ restoreAfterFinish: true,
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping();
+ }
+ }, arguments[1] || {})
+ );
+}
+
+Effect.BlindDown = function(element) {
+ element = $(element);
+ var elementDimensions = element.getDimensions();
+ return new Effect.Scale(element, 100, Object.extend({
+ scaleContent: false,
+ scaleX: false,
+ scaleFrom: 0,
+ scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
+ restoreAfterFinish: true,
+ afterSetup: function(effect) {
+ effect.element.makeClipping().setStyle({height: '0px'}).show();
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.undoClipping();
+ }
+ }, arguments[1] || {}));
+}
+
+Effect.SwitchOff = function(element) {
+ element = $(element);
+ var oldOpacity = element.getInlineOpacity();
+ return new Effect.Appear(element, Object.extend({
+ duration: 0.4,
+ from: 0,
+ transition: Effect.Transitions.flicker,
+ afterFinishInternal: function(effect) {
+ new Effect.Scale(effect.element, 1, {
+ duration: 0.3, scaleFromCenter: true,
+ scaleX: false, scaleContent: false, restoreAfterFinish: true,
+ beforeSetup: function(effect) {
+ effect.element.makePositioned().makeClipping();
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
+ }
+ })
+ }
+ }, arguments[1] || {}));
+}
+
+Effect.DropOut = function(element) {
+ element = $(element);
+ var oldStyle = {
+ top: element.getStyle('top'),
+ left: element.getStyle('left'),
+ opacity: element.getInlineOpacity() };
+ return new Effect.Parallel(
+ [ new Effect.Move(element, {x: 0, y: 100, sync: true }),
+ new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
+ Object.extend(
+ { duration: 0.5,
+ beforeSetup: function(effect) {
+ effect.effects[0].element.makePositioned();
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
+ }
+ }, arguments[1] || {}));
+}
+
+Effect.Shake = function(element) {
+ element = $(element);
+ var oldStyle = {
+ top: element.getStyle('top'),
+ left: element.getStyle('left') };
+ return new Effect.Move(element,
+ { x: 20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) {
+ new Effect.Move(effect.element,
+ { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
+ effect.element.undoPositioned().setStyle(oldStyle);
+ }}) }}) }}) }}) }}) }});
+}
+
+Effect.SlideDown = function(element) {
+ element = $(element).cleanWhitespace();
+ // SlideDown need to have the content of the element wrapped in a container element with fixed height!
+ var oldInnerBottom = element.down().getStyle('bottom');
+ var elementDimensions = element.getDimensions();
+ return new Effect.Scale(element, 100, Object.extend({
+ scaleContent: false,
+ scaleX: false,
+ scaleFrom: window.opera ? 0 : 1,
+ scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
+ restoreAfterFinish: true,
+ afterSetup: function(effect) {
+ effect.element.makePositioned();
+ effect.element.down().makePositioned();
+ if(window.opera) effect.element.setStyle({top: ''});
+ effect.element.makeClipping().setStyle({height: '0px'}).show();
+ },
+ afterUpdateInternal: function(effect) {
+ effect.element.down().setStyle({bottom:
+ (effect.dims[0] - effect.element.clientHeight) + 'px' });
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.undoClipping().undoPositioned();
+ effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
+ }, arguments[1] || {})
+ );
+}
+
+Effect.SlideUp = function(element) {
+ element = $(element).cleanWhitespace();
+ var oldInnerBottom = element.down().getStyle('bottom');
+ return new Effect.Scale(element, window.opera ? 0 : 1,
+ Object.extend({ scaleContent: false,
+ scaleX: false,
+ scaleMode: 'box',
+ scaleFrom: 100,
+ restoreAfterFinish: true,
+ beforeStartInternal: function(effect) {
+ effect.element.makePositioned();
+ effect.element.down().makePositioned();
+ if(window.opera) effect.element.setStyle({top: ''});
+ effect.element.makeClipping().show();
+ },
+ afterUpdateInternal: function(effect) {
+ effect.element.down().setStyle({bottom:
+ (effect.dims[0] - effect.element.clientHeight) + 'px' });
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom});
+ effect.element.down().undoPositioned();
+ }
+ }, arguments[1] || {})
+ );
+}
+
+// Bug in opera makes the TD containing this element expand for a instance after finish
+Effect.Squish = function(element) {
+ return new Effect.Scale(element, window.opera ? 1 : 0, {
+ restoreAfterFinish: true,
+ beforeSetup: function(effect) {
+ effect.element.makeClipping();
+ },
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping();
+ }
+ });
+}
+
+Effect.Grow = function(element) {
+ element = $(element);
+ var options = Object.extend({
+ direction: 'center',
+ moveTransition: Effect.Transitions.sinoidal,
+ scaleTransition: Effect.Transitions.sinoidal,
+ opacityTransition: Effect.Transitions.full
+ }, arguments[1] || {});
+ var oldStyle = {
+ top: element.style.top,
+ left: element.style.left,
+ height: element.style.height,
+ width: element.style.width,
+ opacity: element.getInlineOpacity() };
+
+ var dims = element.getDimensions();
+ var initialMoveX, initialMoveY;
+ var moveX, moveY;
+
+ switch (options.direction) {
+ case 'top-left':
+ initialMoveX = initialMoveY = moveX = moveY = 0;
+ break;
+ case 'top-right':
+ initialMoveX = dims.width;
+ initialMoveY = moveY = 0;
+ moveX = -dims.width;
+ break;
+ case 'bottom-left':
+ initialMoveX = moveX = 0;
+ initialMoveY = dims.height;
+ moveY = -dims.height;
+ break;
+ case 'bottom-right':
+ initialMoveX = dims.width;
+ initialMoveY = dims.height;
+ moveX = -dims.width;
+ moveY = -dims.height;
+ break;
+ case 'center':
+ initialMoveX = dims.width / 2;
+ initialMoveY = dims.height / 2;
+ moveX = -dims.width / 2;
+ moveY = -dims.height / 2;
+ break;
+ }
+
+ return new Effect.Move(element, {
+ x: initialMoveX,
+ y: initialMoveY,
+ duration: 0.01,
+ beforeSetup: function(effect) {
+ effect.element.hide().makeClipping().makePositioned();
+ },
+ afterFinishInternal: function(effect) {
+ new Effect.Parallel(
+ [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
+ new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
+ new Effect.Scale(effect.element, 100, {
+ scaleMode: { originalHeight: dims.height, originalWidth: dims.width },
+ sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
+ ], Object.extend({
+ beforeSetup: function(effect) {
+ effect.effects[0].element.setStyle({height: '0px'}).show();
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
+ }
+ }, options)
+ )
+ }
+ });
+}
+
+Effect.Shrink = function(element) {
+ element = $(element);
+ var options = Object.extend({
+ direction: 'center',
+ moveTransition: Effect.Transitions.sinoidal,
+ scaleTransition: Effect.Transitions.sinoidal,
+ opacityTransition: Effect.Transitions.none
+ }, arguments[1] || {});
+ var oldStyle = {
+ top: element.style.top,
+ left: element.style.left,
+ height: element.style.height,
+ width: element.style.width,
+ opacity: element.getInlineOpacity() };
+
+ var dims = element.getDimensions();
+ var moveX, moveY;
+
+ switch (options.direction) {
+ case 'top-left':
+ moveX = moveY = 0;
+ break;
+ case 'top-right':
+ moveX = dims.width;
+ moveY = 0;
+ break;
+ case 'bottom-left':
+ moveX = 0;
+ moveY = dims.height;
+ break;
+ case 'bottom-right':
+ moveX = dims.width;
+ moveY = dims.height;
+ break;
+ case 'center':
+ moveX = dims.width / 2;
+ moveY = dims.height / 2;
+ break;
+ }
+
+ return new Effect.Parallel(
+ [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
+ new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
+ new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
+ ], Object.extend({
+ beforeStartInternal: function(effect) {
+ effect.effects[0].element.makePositioned().makeClipping();
+ },
+ afterFinishInternal: function(effect) {
+ effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
+ }, options)
+ );
+}
+
+Effect.Pulsate = function(element) {
+ element = $(element);
+ var options = arguments[1] || {};
+ var oldOpacity = element.getInlineOpacity();
+ var transition = options.transition || Effect.Transitions.sinoidal;
+ var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
+ reverser.bind(transition);
+ return new Effect.Opacity(element,
+ Object.extend(Object.extend({ duration: 2.0, from: 0,
+ afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
+ }, options), {transition: reverser}));
+}
+
+Effect.Fold = function(element) {
+ element = $(element);
+ var oldStyle = {
+ top: element.style.top,
+ left: element.style.left,
+ width: element.style.width,
+ height: element.style.height };
+ element.makeClipping();
+ return new Effect.Scale(element, 5, Object.extend({
+ scaleContent: false,
+ scaleX: false,
+ afterFinishInternal: function(effect) {
+ new Effect.Scale(element, 1, {
+ scaleContent: false,
+ scaleY: false,
+ afterFinishInternal: function(effect) {
+ effect.element.hide().undoClipping().setStyle(oldStyle);
+ } });
+ }}, arguments[1] || {}));
+};
+
+Effect.Morph = Class.create();
+Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), {
+ initialize: function(element) {
+ this.element = $(element);
+ if(!this.element) throw(Effect._elementDoesNotExistError);
+ var options = Object.extend({
+ style: {}
+ }, arguments[1] || {});
+ if (typeof options.style == 'string') {
+ if(options.style.indexOf(':') == -1) {
+ var cssText = '', selector = '.' + options.style;
+ $A(document.styleSheets).reverse().each(function(styleSheet) {
+ if (styleSheet.cssRules) cssRules = styleSheet.cssRules;
+ else if (styleSheet.rules) cssRules = styleSheet.rules;
+ $A(cssRules).reverse().each(function(rule) {
+ if (selector == rule.selectorText) {
+ cssText = rule.style.cssText;
+ throw $break;
+ }
+ });
+ if (cssText) throw $break;
+ });
+ this.style = cssText.parseStyle();
+ options.afterFinishInternal = function(effect){
+ effect.element.addClassName(effect.options.style);
+ effect.transforms.each(function(transform) {
+ if(transform.style != 'opacity')
+ effect.element.style[transform.style] = '';
+ });
+ }
+ } else this.style = options.style.parseStyle();
+ } else this.style = $H(options.style)
+ this.start(options);
+ },
+ setup: function(){
+ function parseColor(color){
+ if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
+ color = color.parseColor();
+ return $R(0,2).map(function(i){
+ return parseInt( color.slice(i*2+1,i*2+3), 16 )
+ });
+ }
+ this.transforms = this.style.map(function(pair){
+ var property = pair[0], value = pair[1], unit = null;
+
+ if(value.parseColor('#zzzzzz') != '#zzzzzz') {
+ value = value.parseColor();
+ unit = 'color';
+ } else if(property == 'opacity') {
+ value = parseFloat(value);
+ if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
+ this.element.setStyle({zoom: 1});
+ } else if(Element.CSS_LENGTH.test(value)) {
+ var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+ value = parseFloat(components[1]);
+ unit = (components.length == 3) ? components[2] : null;
+ }
+
+ var originalValue = this.element.getStyle(property);
+ return {
+ style: property.camelize(),
+ originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),
+ targetValue: unit=='color' ? parseColor(value) : value,
+ unit: unit
+ };
+ }.bind(this)).reject(function(transform){
+ return (
+ (transform.originalValue == transform.targetValue) ||
+ (
+ transform.unit != 'color' &&
+ (isNaN(transform.originalValue) || isNaN(transform.targetValue))
+ )
+ )
+ });
+ },
+ update: function(position) {
+ var style = {}, transform, i = this.transforms.length;
+ while(i--)
+ style[(transform = this.transforms[i]).style] =
+ transform.unit=='color' ? '#'+
+ (Math.round(transform.originalValue[0]+
+ (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
+ (Math.round(transform.originalValue[1]+
+ (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() +
+ (Math.round(transform.originalValue[2]+
+ (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
+ transform.originalValue + Math.round(
+ ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit;
+ this.element.setStyle(style, true);
+ }
+});
+
+Effect.Transform = Class.create();
+Object.extend(Effect.Transform.prototype, {
+ initialize: function(tracks){
+ this.tracks = [];
+ this.options = arguments[1] || {};
+ this.addTracks(tracks);
+ },
+ addTracks: function(tracks){
+ tracks.each(function(track){
+ var data = $H(track).values().first();
+ this.tracks.push($H({
+ ids: $H(track).keys().first(),
+ effect: Effect.Morph,
+ options: { style: data }
+ }));
+ }.bind(this));
+ return this;
+ },
+ play: function(){
+ return new Effect.Parallel(
+ this.tracks.map(function(track){
+ var elements = [$(track.ids) || $$(track.ids)].flatten();
+ return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) });
+ }).flatten(),
+ this.options
+ );
+ }
+});
+
+Element.CSS_PROPERTIES = $w(
+ 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +
+ 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
+ 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
+ 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
+ 'fontSize fontWeight height left letterSpacing lineHeight ' +
+ 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
+ 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
+ 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
+ 'right textIndent top width wordSpacing zIndex');
+
+Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
+
+String.prototype.parseStyle = function(){
+ var element = document.createElement('div');
+ element.innerHTML = '<div style="' + this + '"></div>';
+ var style = element.childNodes[0].style, styleRules = $H();
+
+ Element.CSS_PROPERTIES.each(function(property){
+ if(style[property]) styleRules[property] = style[property];
+ });
+ if(Prototype.Browser.IE && this.indexOf('opacity') > -1) {
+ styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
+ }
+ return styleRules;
+};
+
+Element.morph = function(element, style) {
+ new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {}));
+ return element;
+};
+
+['getInlineOpacity','forceRerendering','setContentZoom',
+ 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each(
+ function(f) { Element.Methods[f] = Element[f]; }
+);
+
+Element.Methods.visualEffect = function(element, effect, options) {
+ s = effect.dasherize().camelize();
+ effect_class = s.charAt(0).toUpperCase() + s.substring(1);
+ new Effect[effect_class](element, options);
+ return $(element);
+};
+
+Element.addMethods(); \ No newline at end of file
diff --git a/js/prototype-window-1.3/javascripts/extended_debug.js b/js/prototype-window-1.3/javascripts/extended_debug.js
new file mode 100755
index 0000000..2b935b1
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/extended_debug.js
@@ -0,0 +1,113 @@
+var commandHistory;
+var historyIndex;
+
+function showExtendedDebug() {
+ if (debugWindow != null) {
+ hideDebug();
+ }
+
+ if (debugWindow == null) {
+ commandHistory = new Array();
+ historyIndex = 0;
+
+ debugWindow = new Window('debug_window', {className: 'dialog',width:250, height:100, right:4, minWidth:250, bottom:42, zIndex:1000, opacity:1, showEffect: Element.show, resizable: true, title: "Debug"})
+ debugWindow.getContent().innerHTML = "<style>#debug_window .dialog_content {background:#000;}</style> <div font='monaco' id='debug' style='padding:3px;color:#0F0;font-family:monaco'></div>";
+
+ //create hourglass icon and attach events to it.
+ var cont = "<div id=\"debug_window_inspect\" style=\"width: 15px; height: 15px; background: transparent url(themes/default/inspect.gif) no-repeat 0 0; position:absolute; top:5px; left:70px; cursor:pointer; z-index:3000;\"></div>";
+
+ new Insertion.After('debug_window_maximize', cont);
+ Event.observe('debug_window_inspect', 'click', enterInspectionMode, false);
+
+ //create command text box
+ cont = "Eval:<input id=\"debug_window_command\" type=\"textbox\" style=\"width:150px; height: 12px; color: black;\">"
+ debugWindow.setStatusBar(cont);
+
+ Event.observe('debug_window_command', 'mousedown', donothing);
+ Event.observe('debug_window_command', 'keypress', evalJS, false);
+ }
+ debugWindow.show();
+}
+
+function donothing(evt){
+ Field.activate('debug_window_command');
+ return false;
+}
+
+function evalJS(evt){
+ if(evt.keyCode == Event.KEY_RETURN){
+ var js = $F('debug_window_command');
+ try{
+ var ret = eval(js);
+ if(ret != null)
+ debug(ret);
+ }catch(e){
+ debug(e);
+ }
+ $('debug_window_command').value = '';
+
+ Field.activate('debug_window_command');
+ commandHistory.push(js);
+ historyIndex = 0;
+ }
+
+ if(evt.keyCode == Event.KEY_UP){
+ if(commandHistory.length > historyIndex){
+ historyIndex++;
+ var js = commandHistory[commandHistory.length-historyIndex];
+ $('debug_window_command').value = js;
+ Event.stop(evt);
+ Field.activate('debug_window_command');
+ }
+ }
+
+ if(evt.keyCode == Event.KEY_DOWN){
+ if(commandHistory.length >= historyIndex && historyIndex > 1){
+ historyIndex--;
+ var js = commandHistory[commandHistory.length-historyIndex];
+ $('debug_window_command').value = js;
+ Event.stop(evt);
+ Field.activate('debug_window_command');
+ }
+ }
+}
+
+function enterInspectionMode(evt){
+ //stop observing magnifying glass
+ Event.stopObserving('debug_window_inspect', 'click', enterInspectionMode, false);
+ //change pointer
+ document.body.style.cursor='help';
+ //start observing mouse clicks
+ Event.observe(window, 'click', inspectItem, false);
+}
+
+function inspectItem(evt){
+ // the element that triggered the event
+ var element = Event.element(evt);
+ if(element.id!="debug_window_inspect"){
+ clearDebug()
+ //change pointer
+ document.body.style.cursor='default';
+ debug(element.id);
+ inspect(element);
+ //stop observing mouse clicks
+ Event.stopObserving(window, 'click', inspectItem, false);
+ //alert('doing something');
+ //start observing mag
+ Event.observe('debug_window_inspect', 'click', enterInspectionMode, false);
+ }
+}
+
+function clearDebug() {
+ var win = $('debug');
+ if (win == null)
+ return;
+
+ win.innerHTML=" ";
+ //clear inspections too
+ var divs = document.getElementsByClassName('inspector');
+ divs.each(function(div){
+ Element.remove(div);
+ });
+}
+
diff --git a/js/prototype-window-1.3/javascripts/prototype.js b/js/prototype-window-1.3/javascripts/prototype.js
new file mode 100755
index 0000000..5906575
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/prototype.js
@@ -0,0 +1,3269 @@
+/* Prototype JavaScript framework, version 1.5.1_rc3
+ * (c) 2005-2007 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+/*--------------------------------------------------------------------------*/
+
+var Prototype = {
+ Version: '1.5.1_rc3',
+
+ Browser: {
+ IE: !!(window.attachEvent && !window.opera),
+ Opera: !!window.opera,
+ WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
+ Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
+ },
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+ ElementExtensions: !!window.HTMLElement,
+ SpecificElementExtensions:
+ (document.createElement('div').__proto__ !==
+ document.createElement('form').__proto__)
+ },
+
+ ScriptFragment: '<script[^>]*>([\u0001-\uFFFF]*?)</script>',
+ JSONFilter: /^\/\*-secure-\s*(.*)\s*\*\/\s*$/,
+
+ emptyFunction: function() { },
+ K: function(x) { return x }
+}
+
+var Class = {
+ create: function() {
+ return function() {
+ this.initialize.apply(this, arguments);
+ }
+ }
+}
+
+var Abstract = new Object();
+
+Object.extend = function(destination, source) {
+ for (var property in source) {
+ destination[property] = source[property];
+ }
+ return destination;
+}
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (object === undefined) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : object.toString();
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ toJSON: function(object) {
+ var type = typeof object;
+ switch(type) {
+ case 'undefined':
+ case 'function':
+ case 'unknown': return;
+ case 'boolean': return object.toString();
+ }
+ if (object === null) return 'null';
+ if (object.toJSON) return object.toJSON();
+ if (object.ownerDocument === document) return;
+ var results = [];
+ for (var property in object) {
+ var value = Object.toJSON(object[property]);
+ if (value !== undefined)
+ results.push(property.toJSON() + ': ' + value);
+ }
+ return '{' + results.join(', ') + '}';
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({}, object);
+ }
+});
+
+Function.prototype.bind = function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ return __method.apply(object, args.concat($A(arguments)));
+ }
+}
+
+Function.prototype.bindAsEventListener = function(object) {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function(event) {
+ return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments)));
+ }
+}
+
+Object.extend(Number.prototype, {
+ toColorPart: function() {
+ return this.toPaddedString(2, 16);
+ },
+
+ succ: function() {
+ return this + 1;
+ },
+
+ times: function(iterator) {
+ $R(0, this, true).each(iterator);
+ return this;
+ },
+
+ toPaddedString: function(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ },
+
+ toJSON: function() {
+ return isFinite(this) ? this.toString() : 'null';
+ }
+});
+
+Date.prototype.toJSON = function() {
+ return '"' + this.getFullYear() + '-' +
+ (this.getMonth() + 1).toPaddedString(2) + '-' +
+ this.getDate().toPaddedString(2) + 'T' +
+ this.getHours().toPaddedString(2) + ':' +
+ this.getMinutes().toPaddedString(2) + ':' +
+ this.getSeconds().toPaddedString(2) + '"';
+};
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) {}
+ }
+
+ return returnValue;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create();
+PeriodicalExecuter.prototype = {
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.callback(this);
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+}
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, {
+ gsub: function(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = arguments.callee.prepareReplacement(replacement);
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ },
+
+ sub: function(pattern, replacement, count) {
+ replacement = this.gsub.prepareReplacement(replacement);
+ count = count === undefined ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ },
+
+ scan: function(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return this;
+ },
+
+ truncate: function(length, truncation) {
+ length = length || 30;
+ truncation = truncation === undefined ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : this;
+ },
+
+ strip: function() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ },
+
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ },
+
+ escapeHTML: function() {
+ var self = arguments.callee;
+ self.text.data = this;
+ return self.div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = document.createElement('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0] ? (div.childNodes.length > 1 ?
+ $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
+ div.childNodes[0].nodeValue) : '';
+ },
+
+ toQueryParams: function(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return {};
+
+ return match[1].split(separator || '&').inject({}, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift());
+ var value = pair.length > 1 ? pair.join('=') : pair[0];
+ if (value != undefined) value = decodeURIComponent(value);
+
+ if (key in hash) {
+ if (hash[key].constructor != Array) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ },
+
+ toArray: function() {
+ return this.split('');
+ },
+
+ succ: function() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ },
+
+ times: function(count) {
+ var result = '';
+ for (var i = 0; i < count; i++) result += this;
+ return result;
+ },
+
+ camelize: function() {
+ var parts = this.split('-'), len = parts.length;
+ if (len == 1) return parts[0];
+
+ var camelized = this.charAt(0) == '-'
+ ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+ : parts[0];
+
+ for (var i = 1; i < len; i++)
+ camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+ return camelized;
+ },
+
+ capitalize: function() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ },
+
+ underscore: function() {
+ return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
+ },
+
+ dasherize: function() {
+ return this.gsub(/_/,'-');
+ },
+
+ inspect: function(useDoubleQuotes) {
+ var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
+ var character = String.specialChar[match[0]];
+ return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ },
+
+ toJSON: function() {
+ return this.inspect(true);
+ },
+
+ unfilterJSON: function(filter) {
+ return this.sub(filter || Prototype.JSONFilter, '#{1}');
+ },
+
+ evalJSON: function(sanitize) {
+ var json = this.unfilterJSON();
+ try {
+ if (!sanitize || (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json)))
+ return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ },
+
+ include: function(pattern) {
+ return this.indexOf(pattern) > -1;
+ },
+
+ startsWith: function(pattern) {
+ return this.indexOf(pattern) === 0;
+ },
+
+ endsWith: function(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.lastIndexOf(pattern) === d;
+ },
+
+ empty: function() {
+ return this == '';
+ },
+
+ blank: function() {
+ return /^\s*$/.test(this);
+ }
+});
+
+if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
+ escapeHTML: function() {
+ return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ },
+ unescapeHTML: function() {
+ return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+ }
+});
+
+String.prototype.gsub.prepareReplacement = function(replacement) {
+ if (typeof replacement == 'function') return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+}
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+Object.extend(String.prototype.escapeHTML, {
+ div: document.createElement('div'),
+ text: document.createTextNode('')
+});
+
+with (String.prototype.escapeHTML) div.appendChild(text);
+
+var Template = Class.create();
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+Template.prototype = {
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ return this.template.gsub(this.pattern, function(match) {
+ var before = match[1];
+ if (before == '\\') return match[2];
+ return before + String.interpret(object[match[3]]);
+ });
+ }
+}
+
+var $break = new Object();
+var $continue = new Object();
+
+var Enumerable = {
+ each: function(iterator) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ iterator(value, index++);
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ },
+
+ eachSlice: function(number, iterator) {
+ var index = -number, slices = [], array = this.toArray();
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.map(iterator);
+ },
+
+ all: function(iterator) {
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!(iterator || Prototype.K)(value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ },
+
+ any: function(iterator) {
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!(iterator || Prototype.K)(value, index))
+ throw $break;
+ });
+ return result;
+ },
+
+ collect: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push((iterator || Prototype.K)(value, index));
+ });
+ return results;
+ },
+
+ detect: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator(value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(pattern, iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ var stringValue = value.toString();
+ if (stringValue.match(pattern))
+ results.push((iterator || Prototype.K)(value, index));
+ })
+ return results;
+ },
+
+ include: function(object) {
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ },
+
+ inGroupsOf: function(number, fillWith) {
+ fillWith = fillWith === undefined ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ },
+
+ inject: function(memo, iterator) {
+ this.each(function(value, index) {
+ memo = iterator(memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (result == undefined || value >= result)
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (result == undefined || value < result)
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator) {
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ ((iterator || Prototype.K)(value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator) {
+ return this.map(function(value, index) {
+ return {value: value, criteria: iterator(value, index)};
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.map();
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (typeof args.last() == 'function')
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ },
+
+ size: function() {
+ return this.toArray().length;
+ },
+
+ inspect: function() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+}
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray
+});
+var $A = Array.from = function(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) {
+ return iterable.toArray();
+ } else {
+ var results = [];
+ for (var i = 0, length = iterable.length; i < length; i++)
+ results.push(iterable[i]);
+ return results;
+ }
+}
+
+if (Prototype.Browser.WebKit) {
+ $A = Array.from = function(iterable) {
+ if (!iterable) return [];
+ if (!(typeof iterable == 'function' && iterable == '[object NodeList]') &&
+ iterable.toArray) {
+ return iterable.toArray();
+ } else {
+ var results = [];
+ for (var i = 0, length = iterable.length; i < length; i++)
+ results.push(iterable[i]);
+ return results;
+ }
+ }
+}
+
+Object.extend(Array.prototype, Enumerable);
+
+if (!Array.prototype._reverse)
+ Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0, length = this.length; i < length; i++)
+ iterator(this[i]);
+ },
+
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ },
+
+ compact: function() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ },
+
+ flatten: function() {
+ return this.inject([], function(array, value) {
+ return array.concat(value && value.constructor == Array ?
+ value.flatten() : [value]);
+ });
+ },
+
+ without: function() {
+ var values = $A(arguments);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ },
+
+ indexOf: function(object) {
+ for (var i = 0, length = this.length; i < length; i++)
+ if (this[i] == object) return i;
+ return -1;
+ },
+
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
+ },
+
+ reduce: function() {
+ return this.length > 1 ? this : this[0];
+ },
+
+ uniq: function(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ },
+
+ clone: function() {
+ return [].concat(this);
+ },
+
+ size: function() {
+ return this.length;
+ },
+
+ inspect: function() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ },
+
+ toJSON: function() {
+ var results = [];
+ this.each(function(object) {
+ var value = Object.toJSON(object);
+ if (value !== undefined) results.push(value);
+ });
+ return '[' + results.join(', ') + ']';
+ }
+});
+
+Array.prototype.toArray = Array.prototype.clone;
+
+function $w(string) {
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+if (Prototype.Browser.Opera){
+ Array.prototype.concat = function() {
+ var array = [];
+ for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ if (arguments[i].constructor == Array) {
+ for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
+ array.push(arguments[i][j]);
+ } else {
+ array.push(arguments[i]);
+ }
+ }
+ return array;
+ }
+}
+var Hash = function(object) {
+ if (object instanceof Hash) this.merge(object);
+ else Object.extend(this, object || {});
+};
+
+Object.extend(Hash, {
+ toQueryString: function(obj) {
+ var parts = [];
+ parts.add = arguments.callee.addPair;
+
+ this.prototype._each.call(obj, function(pair) {
+ if (!pair.key) return;
+ var value = pair.value;
+
+ if (value && typeof value == 'object') {
+ if (value.constructor == Array) value.each(function(value) {
+ parts.add(pair.key, value);
+ });
+ return;
+ }
+ parts.add(pair.key, value);
+ });
+
+ return parts.join('&');
+ },
+
+ toJSON: function(object) {
+ var results = [];
+ this.prototype._each.call(object, function(pair) {
+ var value = Object.toJSON(pair.value);
+ if (value !== undefined) results.push(pair.key.toJSON() + ': ' + value);
+ });
+ return '{' + results.join(', ') + '}';
+ }
+});
+
+Hash.toQueryString.addPair = function(key, value, prefix) {
+ key = encodeURIComponent(key);
+ if (value === undefined) this.push(key);
+ else this.push(key + '=' + (value == null ? '' : encodeURIComponent(value)));
+}
+
+Object.extend(Hash.prototype, Enumerable);
+Object.extend(Hash.prototype, {
+ _each: function(iterator) {
+ for (var key in this) {
+ var value = this[key];
+ if (value && value == Hash.prototype[key]) continue;
+
+ var pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ },
+
+ keys: function() {
+ return this.pluck('key');
+ },
+
+ values: function() {
+ return this.pluck('value');
+ },
+
+ merge: function(hash) {
+ return $H(hash).inject(this, function(mergedHash, pair) {
+ mergedHash[pair.key] = pair.value;
+ return mergedHash;
+ });
+ },
+
+ remove: function() {
+ var result;
+ for(var i = 0, length = arguments.length; i < length; i++) {
+ var value = this[arguments[i]];
+ if (value !== undefined){
+ if (result === undefined) result = value;
+ else {
+ if (result.constructor != Array) result = [result];
+ result.push(value)
+ }
+ }
+ delete this[arguments[i]];
+ }
+ return result;
+ },
+
+ toQueryString: function() {
+ return Hash.toQueryString(this);
+ },
+
+ inspect: function() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ },
+
+ toJSON: function() {
+ return Hash.toJSON(this);
+ }
+});
+
+function $H(object) {
+ if (object instanceof Hash) return object;
+ return new Hash(object);
+};
+
+// Safari iterates over shadowed properties
+if (function() {
+ var i = 0, Test = function(value) { this.key = value };
+ Test.prototype.key = 'foo';
+ for (var property in new Test('bar')) i++;
+ return i > 1;
+}()) Hash.prototype._each = function(iterator) {
+ var cache = [];
+ for (var key in this) {
+ var value = this[key];
+ if ((value && value == Hash.prototype[key]) || cache.include(key)) continue;
+ cache.push(key);
+ var pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+};
+ObjectRange = Class.create();
+Object.extend(ObjectRange.prototype, Enumerable);
+Object.extend(ObjectRange.prototype, {
+ initialize: function(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ },
+
+ _each: function(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ },
+
+ include: function(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+});
+
+var $R = function(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+}
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+}
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (typeof responder[callback] == 'function') {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) {}
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() {
+ Ajax.activeRequestCount++;
+ },
+ onComplete: function() {
+ Ajax.activeRequestCount--;
+ }
+});
+
+Ajax.Base = function() {};
+Ajax.Base.prototype = {
+ setOptions: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: ''
+ }
+ Object.extend(this.options, options || {});
+
+ this.options.method = this.options.method.toLowerCase();
+ if (typeof this.options.parameters == 'string')
+ this.options.parameters = this.options.parameters.toQueryParams();
+ }
+}
+
+Ajax.Request = Class.create();
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
+ _complete: false,
+
+ initialize: function(url, options) {
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.clone(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ // simulate other verbs over post
+ params['_method'] = this.method;
+ this.method = 'post';
+ }
+
+ this.parameters = params;
+
+ if (params = Hash.toQueryString(params)) {
+ // when GET, append parameters to URL
+ if (this.method == 'get')
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ params += '&_=';
+ }
+
+ try {
+ if (this.options.onCreate) this.options.onCreate(this.transport);
+ Ajax.Responders.dispatch('onCreate', this, this.transport);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous)
+ setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ // user-defined headers
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (typeof extras.push == 'function')
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ return !this.transport.status
+ || (this.transport.status >= 200 && this.transport.status < 300);
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState];
+ var transport = this.transport, json = this.evalJSON();
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + this.transport.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = this.getHeader('Content-type');
+ if (contentType && contentType.strip().
+ match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(transport, json);
+ Ajax.Responders.dispatch('on' + state, this, transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ // avoid memory leak in MSIE: clean up
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name);
+ } catch (e) { return null }
+ },
+
+ evalJSON: function() {
+ try {
+ var json = this.getHeader('X-JSON');
+ return json ? json.evalJSON() : null;
+ } catch (e) { return null }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Updater = Class.create();
+
+Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
+ initialize: function(container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ }
+
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+
+ var onComplete = this.options.onComplete || Prototype.emptyFunction;
+ this.options.onComplete = (function(transport, param) {
+ this.updateContent();
+ onComplete(transport, param);
+ }).bind(this);
+
+ this.request(url);
+ },
+
+ updateContent: function() {
+ var receiver = this.container[this.success() ? 'success' : 'failure'];
+ var response = this.transport.responseText;
+
+ if (!this.options.evalScripts) response = response.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (this.options.insertion)
+ new this.options.insertion(receiver, response);
+ else
+ receiver.update(response);
+ }
+
+ if (this.success()) {
+ if (this.onComplete)
+ setTimeout(this.onComplete.bind(this), 10);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create();
+Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
+ initialize: function(container, url, options) {
+ this.setOptions(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = {};
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(request) {
+ if (this.options.decay) {
+ this.decay = (request.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = request.responseText;
+ }
+ this.timer = setTimeout(this.onTimerEvent.bind(this),
+ this.decay * this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (typeof element == 'string')
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(query.snapshotItem(i));
+ return results;
+ };
+
+ document.getElementsByClassName = function(className, parentElement) {
+ var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
+ return document._getElementsByXPath(q, parentElement);
+ }
+
+} else document.getElementsByClassName = function(className, parentElement) {
+ var children = ($(parentElement) || document.body).getElementsByTagName('*');
+ var elements = [], child;
+ for (var i = 0, length = children.length; i < length; i++) {
+ child = children[i];
+ if (Element.hasClassName(child, className))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Element) var Element = {};
+
+Element.extend = function(element) {
+ var F = Prototype.BrowserFeatures;
+ if (!element || !element.tagName || element.nodeType == 3 ||
+ element._extended || F.SpecificElementExtensions || element == window)
+ return element;
+
+ var methods = {}, tagName = element.tagName, cache = Element.extend.cache,
+ T = Element.Methods.ByTag;
+
+ // extend methods for all tags (Safari doesn't need this)
+ if (!F.ElementExtensions) {
+ Object.extend(methods, Element.Methods),
+ Object.extend(methods, Element.Methods.Simulated);
+ }
+
+ // extend methods for specific tags
+ if (T[tagName]) Object.extend(methods, T[tagName]);
+
+ for (var property in methods) {
+ var value = methods[property];
+ if (typeof value == 'function' && !(property in element))
+ element[property] = cache.findOrStore(value);
+ }
+
+ element._extended = Prototype.emptyFunction;
+ return element;
+};
+
+Element.extend.cache = {
+ findOrStore: function(value) {
+ return this[value] = this[value] || function() {
+ return value.apply(null, [this].concat($A(arguments)));
+ }
+ }
+};
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ $(element).style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ $(element).style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: function(element, html) {
+ html = typeof html == 'undefined' ? '' : html.toString();
+ $(element).innerHTML = html.stripScripts();
+ setTimeout(function() {html.evalScripts()}, 10);
+ return element;
+ },
+
+ replace: function(element, html) {
+ element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
+ if (element.outerHTML) {
+ element.outerHTML = html.stripScripts();
+ } else {
+ var range = element.ownerDocument.createRange();
+ range.selectNodeContents(element);
+ element.parentNode.replaceChild(
+ range.createContextualFragment(html.stripScripts()), element);
+ }
+ setTimeout(function() {html.evalScripts()}, 10);
+ return element;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(), attribute = pair.last();
+ var value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property) {
+ element = $(element);
+ var elements = [];
+ while (element = element[property])
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return $(element).recursivelyCollect('parentNode');
+ },
+
+ descendants: function(element) {
+ return $A($(element).getElementsByTagName('*')).each(Element.extend);
+ },
+
+ firstDescendant: function(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ return $(element);
+ },
+
+ immediateDescendants: function(element) {
+ if (!(element = $(element).firstChild)) return [];
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ if (element) return [element].concat($(element).nextSiblings());
+ return [];
+ },
+
+ previousSiblings: function(element) {
+ return $(element).recursivelyCollect('previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return $(element).recursivelyCollect('nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return element.previousSiblings().reverse().concat(element.nextSiblings());
+ },
+
+ match: function(element, selector) {
+ if (typeof selector == 'string')
+ selector = new Selector(selector);
+ return selector.match($(element));
+ },
+
+ up: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(element.parentNode);
+ var ancestors = element.ancestors();
+ return expression ? Selector.findElement(ancestors, expression, index) :
+ ancestors[index || 0];
+ },
+
+ down: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return element.firstDescendant();
+ var descendants = element.descendants();
+ return expression ? Selector.findElement(descendants, expression, index) :
+ descendants[index || 0];
+ },
+
+ previous: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
+ var previousSiblings = element.previousSiblings();
+ return expression ? Selector.findElement(previousSiblings, expression, index) :
+ previousSiblings[index || 0];
+ },
+
+ next: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
+ var nextSiblings = element.nextSiblings();
+ return expression ? Selector.findElement(nextSiblings, expression, index) :
+ nextSiblings[index || 0];
+ },
+
+ getElementsBySelector: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element, args);
+ },
+
+ getElementsByClassName: function(element, className) {
+ return document.getElementsByClassName(className, element);
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (Prototype.Browser.IE) {
+ if (!element.attributes) return null;
+ var t = Element._attributeTranslations;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ var attribute = element.attributes[name];
+ return attribute ? attribute.nodeValue : null;
+ }
+ return element.getAttribute(name);
+ },
+
+ getHeight: function(element) {
+ return $(element).getDimensions().height;
+ },
+
+ getWidth: function(element) {
+ return $(element).getDimensions().width;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ var elementClassName = element.className;
+ if (elementClassName.length == 0) return false;
+ if (elementClassName == className ||
+ elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
+ return true;
+ return false;
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element).add(className);
+ return element;
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element).remove(className);
+ return element;
+ },
+
+ toggleClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className);
+ return element;
+ },
+
+ observe: function() {
+ Event.observe.apply(Event, arguments);
+ return $A(arguments).first();
+ },
+
+ stopObserving: function() {
+ Event.stopObserving.apply(Event, arguments);
+ return $A(arguments).first();
+ },
+
+ // removes whitespace-only text node children
+ cleanWhitespace: function(element) {
+ element = $(element);
+ var node = element.firstChild;
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.blank();
+ },
+
+ descendantOf: function(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+ while (element = element.parentNode)
+ if (element == ancestor) return true;
+ return false;
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var pos = Position.cumulativeOffset(element);
+ window.scrollTo(pos[0], pos[1]);
+ return element;
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ style = style == 'float' ? 'cssFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value) {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+ if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+ return value == 'auto' ? null : value;
+ },
+
+ getOpacity: function(element) {
+ return $(element).getStyle('opacity');
+ },
+
+ setStyle: function(element, styles, camelized) {
+ element = $(element);
+ var elementStyle = element.style;
+
+ for (var property in styles)
+ if (property == 'opacity') element.setOpacity(styles[property])
+ else
+ elementStyle[(property == 'float' || property == 'cssFloat') ?
+ (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
+ (camelized ? property : property.camelize())] = styles[property];
+
+ return element;
+ },
+
+ setOpacity: function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+ return element;
+ },
+
+ getDimensions: function(element) {
+ element = $(element);
+ var display = $(element).getStyle('display');
+ if (display != 'none' && display != null) // Safari bug
+ return {width: element.offsetWidth, height: element.offsetHeight};
+
+ // All *Width and *Height properties give 0 on elements with display none,
+ // so enable the element temporarily
+ var els = element.style;
+ var originalVisibility = els.visibility;
+ var originalPosition = els.position;
+ var originalDisplay = els.display;
+ els.visibility = 'hidden';
+ els.position = 'absolute';
+ els.display = 'block';
+ var originalWidth = element.clientWidth;
+ var originalHeight = element.clientHeight;
+ els.display = originalDisplay;
+ els.position = originalPosition;
+ els.visibility = originalVisibility;
+ return {width: originalWidth, height: originalHeight};
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ // Opera returns the offset relative to the positioning context, when an
+ // element is position relative but top and left have not been defined
+ if (window.opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ return element;
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ return element;
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return element;
+ element._overflow = element.style.overflow || 'auto';
+ if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
+ element.style.overflow = 'hidden';
+ return element;
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (!element._overflow) return element;
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+ element._overflow = null;
+ return element;
+ }
+};
+
+Object.extend(Element.Methods, {
+ childOf: Element.Methods.descendantOf,
+ childElements: Element.Methods.immediateDescendants
+});
+
+if (Prototype.Browser.Opera) {
+ Element.Methods._getStyle = Element.Methods.getStyle;
+ Element.Methods.getStyle = function(element, style) {
+ switch(style) {
+ case 'left':
+ case 'top':
+ case 'right':
+ case 'bottom':
+ if (Element._getStyle(element, 'position') == 'static') return null;
+ default: return Element._getStyle(element, style);
+ }
+ };
+}
+else if (Prototype.Browser.IE) {
+ Element.Methods.getStyle = function(element, style) {
+ element = $(element);
+ style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value && element.currentStyle) value = element.currentStyle[style];
+
+ if (style == 'opacity') {
+ if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+ if (value[1]) return parseFloat(value[1]) / 100;
+ return 1.0;
+ }
+
+ if (value == 'auto') {
+ if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+ return element['offset'+style.capitalize()] + 'px';
+ return null;
+ }
+ return value;
+ };
+
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ var filter = element.getStyle('filter'), style = element.style;
+ if (value == 1 || value === '') {
+ style.filter = filter.replace(/alpha\([^\)]*\)/gi,'');
+ return element;
+ } else if (value < 0.00001) value = 0;
+ style.filter = filter.replace(/alpha\([^\)]*\)/gi, '') +
+ 'alpha(opacity=' + (value * 100) + ')';
+ return element;
+ };
+
+ // IE is missing .innerHTML support for TABLE-related elements
+ Element.Methods.update = function(element, html) {
+ element = $(element);
+ html = typeof html == 'undefined' ? '' : html.toString();
+ var tagName = element.tagName.toUpperCase();
+ if (['THEAD','TBODY','TR','TD'].include(tagName)) {
+ var div = document.createElement('div');
+ switch (tagName) {
+ case 'THEAD':
+ case 'TBODY':
+ div.innerHTML = '<table><tbody>' + html.stripScripts() + '</tbody></table>';
+ depth = 2;
+ break;
+ case 'TR':
+ div.innerHTML = '<table><tbody><tr>' + html.stripScripts() + '</tr></tbody></table>';
+ depth = 3;
+ break;
+ case 'TD':
+ div.innerHTML = '<table><tbody><tr><td>' + html.stripScripts() + '</td></tr></tbody></table>';
+ depth = 4;
+ }
+ $A(element.childNodes).each(function(node) { element.removeChild(node) });
+ depth.times(function() { div = div.firstChild });
+ $A(div.childNodes).each(function(node) { element.appendChild(node) });
+ } else {
+ element.innerHTML = html.stripScripts();
+ }
+ setTimeout(function() { html.evalScripts() }, 10);
+ return element;
+ }
+}
+else if (Prototype.Browser.Gecko) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1) ? 0.999999 :
+ (value === '') ? '' : (value < 0.00001) ? 0 : value;
+ return element;
+ };
+}
+
+Element._attributeTranslations = {
+ names: {
+ colspan: "colSpan",
+ rowspan: "rowSpan",
+ valign: "vAlign",
+ datetime: "dateTime",
+ accesskey: "accessKey",
+ tabindex: "tabIndex",
+ enctype: "encType",
+ maxlength: "maxLength",
+ readonly: "readOnly",
+ longdesc: "longDesc"
+ },
+ values: {
+ _getAttr: function(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ },
+ _flag: function(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ },
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+ title: function(element) {
+ var node = element.getAttributeNode('title');
+ return node.specified ? node.nodeValue : null;
+ }
+ }
+};
+
+(function() {
+ Object.extend(this, {
+ href: this._getAttr,
+ src: this._getAttr,
+ disabled: this._flag,
+ checked: this._flag,
+ readonly: this._flag,
+ multiple: this._flag
+ });
+}).call(Element._attributeTranslations.values);
+
+Element.Methods.Simulated = {
+ hasAttribute: function(element, attribute) {
+ var t = Element._attributeTranslations, node;
+ attribute = t.names[attribute] || attribute;
+ node = $(element).getAttributeNode(attribute);
+ return node && node.specified;
+ }
+};
+
+Element.Methods.ByTag = {};
+
+Object.extend(Element, Element.Methods);
+
+if (!Prototype.BrowserFeatures.ElementExtensions &&
+ document.createElement('div').__proto__) {
+ window.HTMLElement = {};
+ window.HTMLElement.prototype = document.createElement('div').__proto__;
+ Prototype.BrowserFeatures.ElementExtensions = true;
+}
+
+Element.hasAttribute = function(element, attribute) {
+ if (element.hasAttribute) return element.hasAttribute(attribute);
+ return Element.Methods.Simulated.hasAttribute(element, attribute);
+};
+
+Element.addMethods = function(methods) {
+ var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+ if (arguments.length == 2) {
+ var tagName = methods;
+ methods = arguments[1];
+ }
+
+ if (!tagName) Object.extend(Element.Methods, methods || {});
+ else {
+ if (tagName.constructor == Array) tagName.each(extend);
+ else extend(tagName);
+ }
+
+ function extend(tagName) {
+ tagName = tagName.toUpperCase();
+ if (!Element.Methods.ByTag[tagName])
+ Element.Methods.ByTag[tagName] = {};
+ Object.extend(Element.Methods.ByTag[tagName], methods);
+ }
+
+ function copy(methods, destination, onlyIfAbsent) {
+ onlyIfAbsent = onlyIfAbsent || false;
+ var cache = Element.extend.cache;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = cache.findOrStore(value);
+ }
+ }
+
+ function findDOMClass(tagName) {
+ var klass;
+ var trans = {
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+ "FrameSet", "IFRAME": "IFrame"
+ };
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName.capitalize() + 'Element';
+ if (window[klass]) return window[klass];
+
+ window[klass] = {};
+ window[klass].prototype = document.createElement(tagName).__proto__;
+ return window[klass];
+ }
+
+ if (F.ElementExtensions) {
+ copy(Element.Methods, HTMLElement.prototype);
+ copy(Element.Methods.Simulated, HTMLElement.prototype, true);
+ }
+
+ if (F.SpecificElementExtensions) {
+ for (var tag in Element.Methods.ByTag) {
+ var klass = findDOMClass(tag);
+ if (typeof klass == "undefined") continue;
+ copy(T[tag], klass.prototype);
+ }
+ }
+
+ Object.extend(Element, Element.Methods);
+ delete Element.ByTag;
+};
+
+var Toggle = { display: Element.toggle };
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.Insertion = function(adjacency) {
+ this.adjacency = adjacency;
+}
+
+Abstract.Insertion.prototype = {
+ initialize: function(element, content) {
+ this.element = $(element);
+ this.content = content.stripScripts();
+
+ if (this.adjacency && this.element.insertAdjacentHTML) {
+ try {
+ this.element.insertAdjacentHTML(this.adjacency, this.content);
+ } catch (e) {
+ var tagName = this.element.tagName.toUpperCase();
+ if (['TBODY', 'TR'].include(tagName)) {
+ this.insertContent(this.contentFromAnonymousTable());
+ } else {
+ throw e;
+ }
+ }
+ } else {
+ this.range = this.element.ownerDocument.createRange();
+ if (this.initializeRange) this.initializeRange();
+ this.insertContent([this.range.createContextualFragment(this.content)]);
+ }
+
+ setTimeout(function() {content.evalScripts()}, 10);
+ },
+
+ contentFromAnonymousTable: function() {
+ var div = document.createElement('div');
+ div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>';
+ return $A(div.childNodes[0].childNodes[0].childNodes);
+ }
+}
+
+var Insertion = new Object();
+
+Insertion.Before = Class.create();
+Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
+ initializeRange: function() {
+ this.range.setStartBefore(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment, this.element);
+ }).bind(this));
+ }
+});
+
+Insertion.Top = Class.create();
+Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(true);
+ },
+
+ insertContent: function(fragments) {
+ fragments.reverse(false).each((function(fragment) {
+ this.element.insertBefore(fragment, this.element.firstChild);
+ }).bind(this));
+ }
+});
+
+Insertion.Bottom = Class.create();
+Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.appendChild(fragment);
+ }).bind(this));
+ }
+});
+
+Insertion.After = Class.create();
+Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
+ initializeRange: function() {
+ this.range.setStartAfter(this.element);
+ },
+
+ insertContent: function(fragments) {
+ fragments.each((function(fragment) {
+ this.element.parentNode.insertBefore(fragment,
+ this.element.nextSibling);
+ }).bind(this));
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
+ * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
+ * license. Please see http://www.yui-ext.com/ for more information. */
+
+var Selector = Class.create();
+
+Selector.prototype = {
+ initialize: function(expression) {
+ this.expression = expression.strip();
+ this.compileMatcher();
+ },
+
+ compileMatcher: function() {
+ // Selectors with namespaced attributes can't use the XPath version
+ if (Prototype.BrowserFeatures.XPath && !(/\[[\w-]*?:/).test(this.expression))
+ return this.compileXPathMatcher();
+
+ var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
+ c = Selector.criteria, le, p, m;
+
+ if (Selector._cache[e]) {
+ this.matcher = Selector._cache[e]; return;
+ }
+ this.matcher = ["this.matcher = function(root) {",
+ "var r = root, h = Selector.handlers, c = false, n;"];
+
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ p = ps[i];
+ if (m = e.match(p)) {
+ this.matcher.push(typeof c[i] == 'function' ? c[i](m) :
+ new Template(c[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.matcher.push("return h.unique(n);\n}");
+ eval(this.matcher.join('\n'));
+ Selector._cache[this.expression] = this.matcher;
+ },
+
+ compileXPathMatcher: function() {
+ var e = this.expression, ps = Selector.patterns,
+ x = Selector.xpath, le, m;
+
+ if (Selector._cache[e]) {
+ this.xpath = Selector._cache[e]; return;
+ }
+
+ this.matcher = ['.//*'];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ if (m = e.match(ps[i])) {
+ this.matcher.push(typeof x[i] == 'function' ? x[i](m) :
+ new Template(x[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.xpath = this.matcher.join('');
+ Selector._cache[this.expression] = this.xpath;
+ },
+
+ findElements: function(root) {
+ root = root || document;
+ if (this.xpath) return document._getElementsByXPath(this.xpath, root);
+ return this.matcher(root);
+ },
+
+ match: function(element) {
+ return this.findElements(document).include(element);
+ },
+
+ toString: function() {
+ return this.expression;
+ },
+
+ inspect: function() {
+ return "#<Selector:" + this.expression.inspect() + ">";
+ }
+};
+
+Object.extend(Selector, {
+ _cache: {},
+
+ xpath: {
+ descendant: "//*",
+ child: "/*",
+ adjacent: "/following-sibling::*[1]",
+ laterSibling: '/following-sibling::*',
+ tagName: function(m) {
+ if (m[1] == '*') return '';
+ return "[local-name()='" + m[1].toLowerCase() +
+ "' or local-name()='" + m[1].toUpperCase() + "']";
+ },
+ className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",
+ id: "[@id='#{1}']",
+ attrPresence: "[@#{1}]",
+ attr: function(m) {
+ m[3] = m[5] || m[6];
+ return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
+ },
+ pseudo: function(m) {
+ var h = Selector.xpath.pseudos[m[1]];
+ if (!h) return '';
+ if (typeof h === 'function') return h(m);
+ return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
+ },
+ operators: {
+ '=': "[@#{1}='#{3}']",
+ '!=': "[@#{1}!='#{3}']",
+ '^=': "[starts-with(@#{1}, '#{3}')]",
+ '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
+ '*=': "[contains(@#{1}, '#{3}')]",
+ '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
+ '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
+ },
+ pseudos: {
+ 'first-child': '[not(preceding-sibling::*)]',
+ 'last-child': '[not(following-sibling::*)]',
+ 'only-child': '[not(preceding-sibling::* or following-sibling::*)]',
+ 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
+ 'checked': "[@checked]",
+ 'disabled': "[@disabled]",
+ 'enabled': "[not(@disabled)]",
+ 'not': function(m) {
+ var e = m[6], p = Selector.patterns,
+ x = Selector.xpath, le, m, v;
+
+ var exclusion = [];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in p) {
+ if (m = e.match(p[i])) {
+ v = typeof x[i] == 'function' ? x[i](m) : new Template(x[i]).evaluate(m);
+ exclusion.push("(" + v.substring(1, v.length - 1) + ")");
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+ return "[not(" + exclusion.join(" and ") + ")]";
+ },
+ 'nth-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
+ },
+ 'nth-last-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
+ },
+ 'nth-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("position() ", m);
+ },
+ 'nth-last-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
+ },
+ 'first-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
+ },
+ 'last-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
+ },
+ 'only-of-type': function(m) {
+ var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
+ },
+ nth: function(fragment, m) {
+ var mm, formula = m[6], predicate;
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ if (mm = formula.match(/^(\d+)$/)) // digit only
+ return '[' + fragment + "= " + mm[1] + ']';
+ if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (mm[1] == "-") mm[1] = -1;
+ var a = mm[1] ? Number(mm[1]) : 1;
+ var b = mm[2] ? Number(mm[2]) : 0;
+ predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
+ "((#{fragment} - #{b}) div #{a} >= 0)]";
+ return new Template(predicate).evaluate({
+ fragment: fragment, a: a, b: b });
+ }
+ }
+ }
+ },
+
+ criteria: {
+ tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',
+ className: 'n = h.className(n, r, "#{1}", c); c = false;',
+ id: 'n = h.id(n, r, "#{1}", c); c = false;',
+ attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;',
+ attr: function(m) {
+ m[3] = (m[5] || m[6]);
+ return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);
+ },
+ pseudo: function(m) {
+ if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
+ return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
+ },
+ descendant: 'c = "descendant";',
+ child: 'c = "child";',
+ adjacent: 'c = "adjacent";',
+ laterSibling: 'c = "laterSibling";'
+ },
+
+ patterns: {
+ // combinators must be listed first
+ // (and descendant needs to be last combinator)
+ laterSibling: /^\s*~\s*/,
+ child: /^\s*>\s*/,
+ adjacent: /^\s*\+\s*/,
+ descendant: /^\s/,
+
+ // selectors follow
+ tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,
+ id: /^#([\w\-\*]+)(\b|$)/,
+ className: /^\.([\w\-\*]+)(\b|$)/,
+ pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s)/,
+ attrPresence: /^\[([\w]+)\]/,
+ attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/
+ },
+
+ handlers: {
+ // UTILITY FUNCTIONS
+ // joins two collections
+ concat: function(a, b) {
+ for (var i = 0, node; node = b[i]; i++)
+ a.push(node);
+ return a;
+ },
+
+ // marks an array of nodes for counting
+ mark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._counted = true;
+ return nodes;
+ },
+
+ unmark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._counted = undefined;
+ return nodes;
+ },
+
+ // mark each child node with its position (for nth calls)
+ // "ofType" flag indicates whether we're indexing for nth-of-type
+ // rather than nth-child
+ index: function(parentNode, reverse, ofType) {
+ parentNode._counted = true;
+ if (reverse) {
+ for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
+ node = nodes[i];
+ if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
+ }
+ } else {
+ for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
+ if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
+ }
+ },
+
+ // filters out duplicates and extends all nodes
+ unique: function(nodes) {
+ if (nodes.length == 0) return nodes;
+ var results = [], n;
+ for (var i = 0, l = nodes.length; i < l; i++)
+ if (!(n = nodes[i])._counted) {
+ n._counted = true;
+ results.push(Element.extend(n));
+ }
+ return Selector.handlers.unmark(results);
+ },
+
+ // COMBINATOR FUNCTIONS
+ descendant: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName('*'));
+ return results;
+ },
+
+ child: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ for (var j = 0, children = [], child; child = node.childNodes[j]; j++)
+ if (child.nodeType == 1 && child.tagName != '!') results.push(child);
+ }
+ return results;
+ },
+
+ adjacent: function(nodes) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ var next = this.nextElementSibling(node);
+ if (next) results.push(next);
+ }
+ return results;
+ },
+
+ laterSibling: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, Element.nextSiblings(node));
+ return results;
+ },
+
+ nextElementSibling: function(node) {
+ while (node = node.nextSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ previousElementSibling: function(node) {
+ while (node = node.previousSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ // TOKEN FUNCTIONS
+ tagName: function(nodes, root, tagName, combinator) {
+ tagName = tagName.toUpperCase();
+ var results = [], h = Selector.handlers;
+ if (nodes) {
+ if (combinator) {
+ // fastlane for ordinary descendant combinators
+ if (combinator == "descendant") {
+ for (var i = 0, node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName(tagName));
+ return results;
+ } else nodes = this[combinator](nodes);
+ if (tagName == "*") return nodes;
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.tagName.toUpperCase() == tagName) results.push(node);
+ return results;
+ } else return root.getElementsByTagName(tagName);
+ },
+
+ id: function(nodes, root, id, combinator) {
+ var targetNode = $(id), h = Selector.handlers;
+ if (!nodes && root == document) return targetNode ? [targetNode] : [];
+ if (nodes) {
+ if (combinator) {
+ if (combinator == 'child') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (targetNode.parentNode == node) return [targetNode];
+ } else if (combinator == 'descendant') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.descendantOf(targetNode, node)) return [targetNode];
+ } else if (combinator == 'adjacent') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Selector.handlers.previousElementSibling(targetNode) == node)
+ return [targetNode];
+ } else nodes = h[combinator](nodes);
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node == targetNode) return [targetNode];
+ return [];
+ }
+ return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
+ },
+
+ className: function(nodes, root, className, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ return Selector.handlers.byClassName(nodes, root, className);
+ },
+
+ byClassName: function(nodes, root, className) {
+ if (!nodes) nodes = Selector.handlers.descendant([root]);
+ var needle = ' ' + className + ' ';
+ for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
+ nodeClassName = node.className;
+ if (nodeClassName.length == 0) continue;
+ if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
+ results.push(node);
+ }
+ return results;
+ },
+
+ attrPresence: function(nodes, root, attr) {
+ var results = [];
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.hasAttribute(node, attr)) results.push(node);
+ return results;
+ },
+
+ attr: function(nodes, root, attr, value, operator) {
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ var handler = Selector.operators[operator], results = [];
+ for (var i = 0, node; node = nodes[i]; i++) {
+ var nodeValue = Element.readAttribute(node, attr);
+ if (nodeValue === null) continue;
+ if (handler(nodeValue, value)) results.push(node);
+ }
+ return results;
+ },
+
+ pseudo: function(nodes, name, value, root, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ return Selector.pseudos[name](nodes, value, root);
+ }
+ },
+
+ pseudos: {
+ 'first-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.previousElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'last-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.nextElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'only-child': function(nodes, value, root) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
+ results.push(node);
+ return results;
+ },
+ 'nth-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root);
+ },
+ 'nth-last-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true);
+ },
+ 'nth-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, false, true);
+ },
+ 'nth-last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true, true);
+ },
+ 'first-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, false, true);
+ },
+ 'last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, true, true);
+ },
+ 'only-of-type': function(nodes, formula, root) {
+ var p = Selector.pseudos;
+ return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
+ },
+
+ // handles the an+b logic
+ getIndices: function(a, b, total) {
+ if (a == 0) return b > 0 ? [b] : [];
+ return $R(1, total).inject([], function(memo, i) {
+ if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
+ return memo;
+ });
+ },
+
+ // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
+ nth: function(nodes, formula, root, reverse, ofType) {
+ if (nodes.length == 0) return [];
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ var h = Selector.handlers, results = [], indexed = [], m;
+ h.mark(nodes);
+ for (var i = 0, node; node = nodes[i]; i++) {
+ if (!node.parentNode._counted) {
+ h.index(node.parentNode, reverse, ofType);
+ indexed.push(node.parentNode);
+ }
+ }
+ if (formula.match(/^\d+$/)) { // just a number
+ formula = Number(formula);
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.nodeIndex == formula) results.push(node);
+ } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (m[1] == "-") m[1] = -1;
+ var a = m[1] ? Number(m[1]) : 1;
+ var b = m[2] ? Number(m[2]) : 0;
+ var indices = Selector.pseudos.getIndices(a, b, nodes.length);
+ for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
+ for (var j = 0; j < l; j++)
+ if (node.nodeIndex == indices[j]) results.push(node);
+ }
+ }
+ h.unmark(nodes);
+ h.unmark(indexed);
+ return results;
+ },
+
+ 'empty': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ // IE treats comments as element nodes
+ if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue;
+ results.push(node);
+ }
+ return results;
+ },
+
+ 'not': function(nodes, selector, root) {
+ var h = Selector.handlers, selectorType, m;
+ var exclusions = new Selector(selector).findElements(root);
+ h.mark(exclusions);
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node._counted) results.push(node);
+ h.unmark(exclusions);
+ return results;
+ },
+
+ 'enabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node.disabled) results.push(node);
+ return results;
+ },
+
+ 'disabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.disabled) results.push(node);
+ return results;
+ },
+
+ 'checked': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.checked) results.push(node);
+ return results;
+ }
+ },
+
+ operators: {
+ '=': function(nv, v) { return nv == v; },
+ '!=': function(nv, v) { return nv != v; },
+ '^=': function(nv, v) { return nv.startsWith(v); },
+ '$=': function(nv, v) { return nv.endsWith(v); },
+ '*=': function(nv, v) { return nv.include(v); },
+ '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
+ '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); }
+ },
+
+ matchElements: function(elements, expression) {
+ var matches = new Selector(expression).findElements(), h = Selector.handlers;
+ h.mark(matches);
+ for (var i = 0, results = [], element; element = elements[i]; i++)
+ if (element._counted) results.push(element);
+ h.unmark(matches);
+ return results;
+ },
+
+ findElement: function(elements, expression, index) {
+ if (typeof expression == 'number') {
+ index = expression; expression = false;
+ }
+ return Selector.matchElements(elements, expression || '*')[index || 0];
+ },
+
+ findChildElements: function(element, expressions) {
+ var exprs = expressions.join(','), expressions = [];
+ exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
+ expressions.push(m[1].strip());
+ });
+ var results = [], h = Selector.handlers;
+ for (var i = 0, l = expressions.length, selector; i < l; i++) {
+ selector = new Selector(expressions[i].strip());
+ h.concat(results, selector.findElements(element));
+ }
+ return (l > 1) ? h.unique(results) : results;
+ }
+});
+
+function $$() {
+ return Selector.findChildElements(document, $A(arguments));
+}
+var Form = {
+ reset: function(form) {
+ $(form).reset();
+ return form;
+ },
+
+ serializeElements: function(elements, getHash) {
+ var data = elements.inject({}, function(result, element) {
+ if (!element.disabled && element.name) {
+ var key = element.name, value = $(element).getValue();
+ if (value != null) {
+ if (key in result) {
+ if (result[key].constructor != Array) result[key] = [result[key]];
+ result[key].push(value);
+ }
+ else result[key] = value;
+ }
+ }
+ return result;
+ });
+
+ return getHash ? data : Hash.toQueryString(data);
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, getHash) {
+ return Form.serializeElements(Form.getElements(form), getHash);
+ },
+
+ getElements: function(form) {
+ return $A($(form).getElementsByTagName('*')).inject([],
+ function(elements, child) {
+ if (Form.Element.Serializers[child.tagName.toLowerCase()])
+ elements.push(Element.extend(child));
+ return elements;
+ }
+ );
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('disable');
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('enable');
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ return $(form).getElements().find(function(element) {
+ return element.type != 'hidden' && !element.disabled &&
+ ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ form.findFirstElement().activate();
+ return form;
+ },
+
+ request: function(form, options) {
+ form = $(form), options = Object.clone(options || {});
+
+ var params = options.parameters;
+ options.parameters = form.serialize(true);
+
+ if (params) {
+ if (typeof params == 'string') params = params.toQueryParams();
+ Object.extend(options.parameters, params);
+ }
+
+ if (form.hasAttribute('method') && !options.method)
+ options.method = form.method;
+
+ return new Ajax.Request(form.readAttribute('action'), options);
+ }
+}
+
+Object.extend(Form, Form.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+}
+
+Form.Element.Methods = {
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = {};
+ pair[element.name] = value;
+ return Hash.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ try {
+ element.focus();
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
+ !['button', 'reset', 'submit'].include(element.type)))
+ element.select();
+ } catch (e) {}
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.blur();
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.disabled = false;
+ return element;
+ }
+}
+
+Object.extend(Form.Element, Form.Element.Methods);
+Object.extend(Element.Methods.ByTag, {
+ "FORM": Object.clone(Form.Methods),
+ "INPUT": Object.clone(Form.Element.Methods),
+ "SELECT": Object.clone(Form.Element.Methods),
+ "TEXTAREA": Object.clone(Form.Element.Methods)
+});
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+var $F = Form.Element.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = {
+ input: function(element) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return Form.Element.Serializers.inputSelector(element);
+ default:
+ return Form.Element.Serializers.textarea(element);
+ }
+ },
+
+ inputSelector: function(element) {
+ return element.checked ? element.value : null;
+ },
+
+ textarea: function(element) {
+ return element.value;
+ },
+
+ select: function(element) {
+ return this[element.type == 'select-one' ?
+ 'selectOne' : 'selectMany'](element);
+ },
+
+ selectOne: function(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? this.optionValue(element.options[index]) : null;
+ },
+
+ selectMany: function(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(this.optionValue(opt));
+ }
+ return values;
+ },
+
+ optionValue: function(opt) {
+ // extend element because hasAttribute may not be native
+ return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = function() {}
+Abstract.TimedObserver.prototype = {
+ initialize: function(element, frequency, callback) {
+ this.frequency = frequency;
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ var value = this.getValue();
+ var changed = ('string' == typeof this.lastValue && 'string' == typeof value
+ ? this.lastValue != value : String(this.lastValue) != String(value));
+ if (changed) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+}
+
+Form.Element.Observer = Class.create();
+Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create();
+Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = function() {}
+Abstract.EventObserver.prototype = {
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback.bind(this));
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+}
+
+Form.Element.EventObserver = Class.create();
+Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create();
+Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+if (!window.Event) {
+ var Event = new Object();
+}
+
+Object.extend(Event, {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+
+ element: function(event) {
+ return $(event.target || event.srcElement);
+ },
+
+ isLeftClick: function(event) {
+ return (((event.which) && (event.which == 1)) ||
+ ((event.button) && (event.button == 1)));
+ },
+
+ pointerX: function(event) {
+ return event.pageX || (event.clientX +
+ (document.documentElement.scrollLeft || document.body.scrollLeft));
+ },
+
+ pointerY: function(event) {
+ return event.pageY || (event.clientY +
+ (document.documentElement.scrollTop || document.body.scrollTop));
+ },
+
+ stop: function(event) {
+ if (event.preventDefault) {
+ event.preventDefault();
+ event.stopPropagation();
+ } else {
+ event.returnValue = false;
+ event.cancelBubble = true;
+ }
+ },
+
+ // find the first node with the given tagName, starting from the
+ // node the event was triggered on; traverses the DOM upwards
+ findElement: function(event, tagName) {
+ var element = Event.element(event);
+ while (element.parentNode && (!element.tagName ||
+ (element.tagName.toUpperCase() != tagName.toUpperCase())))
+ element = element.parentNode;
+ return element;
+ },
+
+ observers: false,
+
+ _observeAndCache: function(element, name, observer, useCapture) {
+ if (!this.observers) this.observers = [];
+ if (element.addEventListener) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.addEventListener(name, observer, useCapture);
+ } else if (element.attachEvent) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.attachEvent('on' + name, observer);
+ }
+ },
+
+ unloadCache: function() {
+ if (!Event.observers) return;
+ for (var i = 0, length = Event.observers.length; i < length; i++) {
+ Event.stopObserving.apply(this, Event.observers[i]);
+ Event.observers[i][0] = null;
+ }
+ Event.observers = false;
+ },
+
+ observe: function(element, name, observer, useCapture) {
+ element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (Prototype.Browser.WebKit || element.attachEvent))
+ name = 'keydown';
+
+ Event._observeAndCache(element, name, observer, useCapture);
+ },
+
+ stopObserving: function(element, name, observer, useCapture) {
+ element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ (Prototype.Browser.WebKit || element.attachEvent))
+ name = 'keydown';
+
+ if (element.removeEventListener) {
+ element.removeEventListener(name, observer, useCapture);
+ } else if (element.detachEvent) {
+ try {
+ element.detachEvent('on' + name, observer);
+ } catch (e) {}
+ }
+ }
+});
+
+/* prevent memory leaks in IE */
+if (Prototype.Browser.IE)
+ Event.observe(window, 'unload', Event.unloadCache, false);
+var Position = {
+ // set to true if needed, warning: firefox performance problems
+ // NOT neeeded for page scrolling, only if draggable contained in
+ // scrollable elements
+ includeScrollOffsets: false,
+
+ // must be called before calling withinIncludingScrolloffset, every time the
+ // page is scrolled
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ realOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ cumulativeOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ positionedOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if(element.tagName=='BODY') break;
+ var p = Element.getStyle(element, 'position');
+ if (p == 'relative' || p == 'absolute') break;
+ }
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ offsetParent: function(element) {
+ if (element.offsetParent) return element.offsetParent;
+ if (element == document.body) return element;
+
+ while ((element = element.parentNode) && element != document.body)
+ if (Element.getStyle(element, 'position') != 'static')
+ return element;
+
+ return document.body;
+ },
+
+ // caches x/y coordinate pair to use with overlap
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = this.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = this.realOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = this.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ // within must be called directly before
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+ page: function(forElement) {
+ var valueT = 0, valueL = 0;
+
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+
+ // Safari fix
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element,'position')=='absolute') break;
+
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (!window.opera || element.tagName=='BODY') {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+
+ return [valueL, valueT];
+ },
+
+ clone: function(source, target) {
+ var options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, arguments[2] || {})
+
+ // find page position of source
+ source = $(source);
+ var p = Position.page(source);
+
+ // find coordinate system to use
+ target = $(target);
+ var delta = [0, 0];
+ var parent = null;
+ // delta [0,0] will do fine with position: fixed elements,
+ // position:absolute needs offsetParent deltas
+ if (Element.getStyle(target,'position') == 'absolute') {
+ parent = Position.offsetParent(target);
+ delta = Position.page(parent);
+ }
+
+ // correct by body offsets (fixes Safari)
+ if (parent == document.body) {
+ delta[0] -= document.body.offsetLeft;
+ delta[1] -= document.body.offsetTop;
+ }
+
+ // set position
+ if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+ if(options.setWidth) target.style.width = source.offsetWidth + 'px';
+ if(options.setHeight) target.style.height = source.offsetHeight + 'px';
+ },
+
+ absolutize: function(element) {
+ element = $(element);
+ if (element.style.position == 'absolute') return;
+ Position.prepare();
+
+ var offsets = Position.positionedOffset(element);
+ var top = offsets[1];
+ var left = offsets[0];
+ var width = element.clientWidth;
+ var height = element.clientHeight;
+
+ element._originalLeft = left - parseFloat(element.style.left || 0);
+ element._originalTop = top - parseFloat(element.style.top || 0);
+ element._originalWidth = element.style.width;
+ element._originalHeight = element.style.height;
+
+ element.style.position = 'absolute';
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.width = width + 'px';
+ element.style.height = height + 'px';
+ },
+
+ relativize: function(element) {
+ element = $(element);
+ if (element.style.position == 'relative') return;
+ Position.prepare();
+
+ element.style.position = 'relative';
+ var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
+ var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.height = element._originalHeight;
+ element.style.width = element._originalWidth;
+ }
+}
+
+// Safari returns margins on body which is incorrect if the child is absolutely
+// positioned. For performance reasons, redefine Position.cumulativeOffset for
+// KHTML/WebKit only.
+if (Prototype.Browser.WebKit) {
+ Position.cumulativeOffset = function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+
+ element = element.offsetParent;
+ } while (element);
+
+ return [valueL, valueT];
+ }
+}
+
+Element.addMethods(); \ No newline at end of file
diff --git a/js/prototype-window-1.3/javascripts/tooltip.js b/js/prototype-window-1.3/javascripts/tooltip.js
new file mode 100755
index 0000000..65e6106
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/tooltip.js
@@ -0,0 +1,241 @@
+// Singleton class TooltipWindow
+// This class works with special className. The tooltip content could be in your HTML page as an hidden element or
+// can be retreive by an AJAX call.
+//
+// To work, You just need to set two class name on elements that should show tooltips
+// - One to say to TooltipManager that this element must have a tooltip ('tooltip' by default)
+// - Another to indicate how to find the tooltip content
+// It could be html_XXXX if tootltip content is somewhere hidden in your page, XXX must be DOM ID of this hidden element
+// It could be ajax_XXXX if tootltip content must be find by an ajax request, XXX will be the string send as id parameter to your server.
+// Check samples/tooltips/tooltip.html to see how it works
+//
+TooltipManager = {
+ options: {cssClassName: 'tooltip', delayOver: 200, delayOut: 1000, shiftX: 10, shiftY: 10,
+ className: 'alphacube', width: 200, height: null,
+ draggable: false, minimizable: false, maximizable: false, showEffect: Element.show, hideEffect: Element.hide},
+ ajaxInfo: null,
+ elements: null,
+ showTimer: null,
+ hideTimer: null,
+
+ // Init tooltip manager
+ // parameters:
+ // - cssClassName (string) : CSS class name where tooltip should be shown.
+ // - ajaxOptions (hash) : Ajax options for ajax tooltip.
+ // For examples {url: "/tooltip/get.php", options: {method: 'get'}}
+ // see Ajax.Request documentation for details
+ //- tooltipOptions (hash) : available keys
+ // - delayOver: int in ms (default 10) delay before showing tooltip
+ // - delayOut: int in ms (default 1000) delay before hidding tooltip
+ // - shiftX: int in pixels (default 10) left shift of the tooltip window
+ // - shiftY: int in pixels (default 10) top shift of the tooltip window
+ // and All window options like showEffect: Element.show, hideEffect: Element.hide to remove animation
+ // default: {className: 'alphacube', width: 200, height: null, draggable: false, minimizable: false, maximizable: false}
+
+ init: function(cssClassName, ajaxInfo, tooltipOptions) {
+ TooltipManager.options = Object.extend(TooltipManager.options, tooltipOptions || {});
+
+ cssClassName = TooltipManager.options.cssClassName || "tooltip";
+ TooltipManager.ajaxInfo = ajaxInfo;
+ TooltipManager.elements = $$("." + cssClassName);
+ TooltipManager.elements.each(function(element) {
+ element = $(element)
+ var info = TooltipManager._getInfo(element);
+ if (info.ajax) {
+ element.ajaxId = info.id;
+ element.ajaxInfo = ajaxInfo;
+ }
+ else {
+ element.tooltipElement = $(info.id);
+ }
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ });
+ Windows.addObserver(this);
+ },
+
+ addHTML: function(element, tooltipElement) {
+ element = $(element);
+ tooltipElement = $(tooltipElement);
+ element.tooltipElement = tooltipElement;
+
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ },
+
+ addAjax: function(element, ajaxInfo) {
+ element = $(element);
+ element.ajaxInfo = ajaxInfo;
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ },
+
+ addURL: function(element, url, width, height) {
+ element = $(element);
+ element.url = url;
+ element.frameWidth = width;
+ element.frameHeight = height;
+ element.observe("mouseover", TooltipManager._mouseOver);
+ element.observe("mouseout", TooltipManager._mouseOut);
+ },
+
+ close: function() {
+ if (TooltipManager.tooltipWindow)
+ TooltipManager.tooltipWindow.hide();
+ },
+
+ preloadImages: function(path, images, extension) {
+ if (!extension)
+ extension = ".gif";
+
+ //preload images
+ $A(images).each(function(i) {
+ var image = new Image();
+ image.src= path + "/" + i + extension;
+ });
+ },
+
+ _showTooltip: function(element) {
+ if (this.element == element)
+ return;
+ // Get original element
+ while (element && (!element.tooltipElement && !element.ajaxInfo && !element.url))
+ element = element.parentNode;
+ this.element = element;
+
+ TooltipManager.showTimer = null;
+ if (TooltipManager.hideTimer)
+ clearTimeout(TooltipManager.hideTimer);
+
+ var position = Position.cumulativeOffset(element);
+ var dimension = element.getDimensions();
+
+ if (! this.tooltipWindow)
+ this.tooltipWindow = new Window("__tooltip__", TooltipManager.options);
+
+ this.tooltipWindow.hide();
+ this.tooltipWindow.setLocation(position[1] + dimension.height + TooltipManager.options.shiftY, position[0] + TooltipManager.options.shiftX);
+
+ Event.observe(this.tooltipWindow.element, "mouseover", function(event) {TooltipManager._tooltipOver(event, element)});
+ Event.observe(this.tooltipWindow.element, "mouseout", function(event) {TooltipManager._tooltipOut(event, element)});
+
+ // Reset width/height for computation
+ this.tooltipWindow.height = TooltipManager.options.height;
+ this.tooltipWindow.width = TooltipManager.options.width;
+
+ // Ajax content
+ if (element.ajaxInfo) {
+ var p = element.ajaxInfo.options.parameters;
+ var saveParam = p;
+
+ // Set by CSS
+ if (element.ajaxId) {
+ if (p)
+ p += "&id=" + element.ajaxId;
+ else
+ p = "id=" + element.ajaxId;
+ }
+ element.ajaxInfo.options.parameters = p || "";
+ this.tooltipWindow.setHTMLContent("");
+ this.tooltipWindow.setAjaxContent(element.ajaxInfo.url, element.ajaxInfo.options);
+ element.ajaxInfo.options.parameters = saveParam;
+ }
+ // URL content
+ else if (element.url) {
+ this.tooltipWindow.setURL(element.url);
+ this.tooltipWindow.setSize(element.frameWidth, element.frameHeight);
+
+ // Set tooltip size
+ this.tooltipWindow.height = element.frameHeight;
+ this.tooltipWindow.width = element.frameWidth;
+ }
+ // HTML content
+ else
+ this.tooltipWindow.setHTMLContent(element.tooltipElement.innerHTML);
+
+ if (!element.ajaxInfo) {
+ this.tooltipWindow.show();
+ this.tooltipWindow.toFront();
+ }
+ },
+
+ _hideTooltip: function(element) {
+ if (this.tooltipWindow) {
+ this.tooltipWindow.hide();
+ this.element = null;
+ }
+ },
+
+ _mouseOver: function (event) {
+ var element = Event.element(event);
+ if (TooltipManager.showTimer)
+ clearTimeout(TooltipManager.showTimer);
+
+ TooltipManager.showTimer = setTimeout(function() {TooltipManager._showTooltip(element)}, TooltipManager.options.delayOver)
+ },
+
+ _mouseOut: function(event) {
+ var element = Event.element(event);
+ if (TooltipManager.showTimer) {
+ clearTimeout(TooltipManager.showTimer);
+ TooltipManager.showTimer = null;
+ return;
+ }
+ if (TooltipManager.tooltipWindow)
+ TooltipManager.hideTimer = setTimeout(function() {TooltipManager._hideTooltip(element)}, TooltipManager.options.delayOut)
+ },
+
+ _tooltipOver: function(event, element) {
+ if (TooltipManager.hideTimer) {
+ clearTimeout(TooltipManager.hideTimer);
+ TooltipManager.hideTimer = null;
+ }
+ },
+
+ _tooltipOut: function(event, element) {
+ if (TooltipManager.hideTimer == null)
+ TooltipManager.hideTimer = setTimeout(function() {TooltipManager._hideTooltip(element)}, TooltipManager.options.delayOut)
+ },
+
+ _getInfo: function(element) {
+ // Find html_ for static content
+ var id = element.className.split(' ').detect(function(name) {return name.indexOf("html_") == 0});
+ var ajax = true;
+ if (id)
+ ajax = false;
+ else
+ // Find ajax_ for ajax content
+ id = element.className.split(' ').detect(function(name) {return name.indexOf("ajax_") == 0});
+
+ id = id.substr(id.indexOf('_')+1, id.length)
+ return id ? {ajax: ajax, id: id} : null;
+ },
+
+ onBeforeShow: function(eventName, win) {
+ var top = parseFloat(win.getLocation().top);
+ var dim = win.element.getDimensions();
+
+ if (top + dim.height > TooltipManager._getScrollTop() + TooltipManager._getPageHeight()) {
+ var position = Position.cumulativeOffset(this.element);
+
+ var top = position[1] - TooltipManager.options.shiftY - dim.height;
+ win.setLocation(top, position[0] + TooltipManager.options.shiftX)
+ }
+ },
+
+ _getPageWidth: function(){
+ return window.innerWidth || document.documentElement.clientWidth || 0;
+ },
+
+ _getPageHeight: function(){
+ return window.innerHeight || document.documentElement.clientHeight || 0;
+ },
+
+ _getScrollTop: function(){
+ return document.documentElement.scrollTop || window.pageYOffset || 0;
+ },
+
+ _getScrollLeft: function(){
+ return document.documentElement.scrollLeft || window.pageXOffset || 0;
+ }
+};
diff --git a/js/prototype-window-1.3/javascripts/window.js b/js/prototype-window-1.3/javascripts/window.js
new file mode 100755
index 0000000..5fc2533
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/window.js
@@ -0,0 +1,1843 @@
+// Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.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.
+//
+// VERSION 1.3
+
+var Window = Class.create();
+
+Window.keepMultiModalWindow = false;
+Window.hasEffectLib = (typeof Effect != 'undefined');
+Window.resizeEffectDuration = 0.4;
+
+Window.prototype = {
+ // Constructor
+ // Available parameters : className, blurClassName, title, minWidth, minHeight, maxWidth, maxHeight, width, height, top, left, bottom, right, resizable, zIndex, opacity, recenterAuto, wiredDrag
+ // hideEffect, showEffect, showEffectOptions, hideEffectOptions, effectOptions, url, draggable, closable, minimizable, maximizable, parent, onload
+ // add all callbacks (if you do not use an observer)
+ // onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
+
+ initialize: function() {
+ var id;
+ var optionIndex = 0;
+ // For backward compatibility like win= new Window("id", {...}) instead of win = new Window({id: "id", ...})
+ if (arguments.length > 0) {
+ if (typeof arguments[0] == "string" ) {
+ id = arguments[0];
+ optionIndex = 1;
+ }
+ else
+ id = arguments[0] ? arguments[0].id : null;
+ }
+
+ // Generate unique ID if not specified
+ if (!id)
+ id = "window_" + new Date().getTime();
+
+ if ($(id))
+ alert("Window " + id + " is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");
+
+ this.options = Object.extend({
+ className: "dialog",
+ blurClassName: null,
+ minWidth: 100,
+ minHeight: 20,
+ resizable: true,
+ closable: true,
+ minimizable: true,
+ maximizable: true,
+ draggable: true,
+ userData: null,
+ showEffect: (Window.hasEffectLib ? Effect.Appear : Element.show),
+ hideEffect: (Window.hasEffectLib ? Effect.Fade : Element.hide),
+ showEffectOptions: {},
+ hideEffectOptions: {},
+ effectOptions: null,
+ parent: document.body,
+ title: "&nbsp;",
+ url: null,
+ onload: Prototype.emptyFunction,
+ width: 200,
+ height: 300,
+ opacity: 1,
+ recenterAuto: true,
+ wiredDrag: false,
+ closeCallback: null,
+ destroyOnClose: false,
+ gridX: 1,
+ gridY: 1
+ }, arguments[optionIndex] || {});
+ if (this.options.blurClassName)
+ this.options.focusClassName = this.options.className;
+
+ if (typeof this.options.top == "undefined" && typeof this.options.bottom == "undefined")
+ this.options.top = this._round(Math.random()*500, this.options.gridY);
+ if (typeof this.options.left == "undefined" && typeof this.options.right == "undefined")
+ this.options.left = this._round(Math.random()*500, this.options.gridX);
+
+ if (this.options.effectOptions) {
+ Object.extend(this.options.hideEffectOptions, this.options.effectOptions);
+ Object.extend(this.options.showEffectOptions, this.options.effectOptions);
+ if (this.options.showEffect == Element.Appear)
+ this.options.showEffectOptions.to = this.options.opacity;
+ }
+ if (Window.hasEffectLib) {
+ if (this.options.showEffect == Effect.Appear)
+ this.options.showEffectOptions.to = this.options.opacity;
+
+ if (this.options.hideEffect == Effect.Fade)
+ this.options.hideEffectOptions.from = this.options.opacity;
+ }
+ if (this.options.hideEffect == Element.hide)
+ this.options.hideEffect = function(){ Element.hide(this.element); if (this.options.destroyOnClose) this.destroy(); }.bind(this)
+
+ if (this.options.parent != document.body)
+ this.options.parent = $(this.options.parent);
+
+ this.element = this._createWindow(id);
+ this.element.win = this;
+
+ // Bind event listener
+ this.eventMouseDown = this._initDrag.bindAsEventListener(this);
+ this.eventMouseUp = this._endDrag.bindAsEventListener(this);
+ this.eventMouseMove = this._updateDrag.bindAsEventListener(this);
+ this.eventOnLoad = this._getWindowBorderSize.bindAsEventListener(this);
+ this.eventMouseDownContent = this.toFront.bindAsEventListener(this);
+ this.eventResize = this._recenter.bindAsEventListener(this);
+
+ this.topbar = $(this.element.id + "_top");
+ this.bottombar = $(this.element.id + "_bottom");
+ this.content = $(this.element.id + "_content");
+
+ Event.observe(this.topbar, "mousedown", this.eventMouseDown);
+ Event.observe(this.bottombar, "mousedown", this.eventMouseDown);
+ Event.observe(this.content, "mousedown", this.eventMouseDownContent);
+ Event.observe(window, "load", this.eventOnLoad);
+ Event.observe(window, "resize", this.eventResize);
+ Event.observe(window, "scroll", this.eventResize);
+ Event.observe(this.options.parent, "scroll", this.eventResize);
+
+ if (this.options.draggable) {
+ var that = this;
+ [this.topbar, this.topbar.up().previous(), this.topbar.up().next()].each(function(element) {
+ element.observe("mousedown", that.eventMouseDown);
+ element.addClassName("top_draggable");
+ });
+ [this.bottombar.up(), this.bottombar.up().previous(), this.bottombar.up().next()].each(function(element) {
+ element.observe("mousedown", that.eventMouseDown);
+ element.addClassName("bottom_draggable");
+ });
+
+ }
+
+ if (this.options.resizable) {
+ this.sizer = $(this.element.id + "_sizer");
+ Event.observe(this.sizer, "mousedown", this.eventMouseDown);
+ }
+
+ this.useLeft = null;
+ this.useTop = null;
+ if (typeof this.options.left != "undefined") {
+ this.element.setStyle({left: parseFloat(this.options.left) + 'px'});
+ this.useLeft = true;
+ }
+ else {
+ this.element.setStyle({right: parseFloat(this.options.right) + 'px'});
+ this.useLeft = false;
+ }
+
+ if (typeof this.options.top != "undefined") {
+ this.element.setStyle({top: parseFloat(this.options.top) + 'px'});
+ this.useTop = true;
+ }
+ else {
+ this.element.setStyle({bottom: parseFloat(this.options.bottom) + 'px'});
+ this.useTop = false;
+ }
+
+ this.storedLocation = null;
+
+ this.setOpacity(this.options.opacity);
+ if (this.options.zIndex)
+ this.setZIndex(this.options.zIndex)
+
+ if (this.options.destroyOnClose)
+ this.setDestroyOnClose(true);
+
+ this._getWindowBorderSize();
+ this.width = this.options.width;
+ this.height = this.options.height;
+ this.visible = false;
+
+ this.constraint = false;
+ this.constraintPad = {top: 0, left:0, bottom:0, right:0};
+
+ if (this.width && this.height)
+ this.setSize(this.options.width, this.options.height);
+ this.setTitle(this.options.title)
+ Windows.register(this);
+ },
+
+ // Destructor
+ destroy: function() {
+ this._notify("onDestroy");
+ Event.stopObserving(this.topbar, "mousedown", this.eventMouseDown);
+ Event.stopObserving(this.bottombar, "mousedown", this.eventMouseDown);
+ Event.stopObserving(this.content, "mousedown", this.eventMouseDownContent);
+
+ Event.stopObserving(window, "load", this.eventOnLoad);
+ Event.stopObserving(window, "resize", this.eventResize);
+ Event.stopObserving(window, "scroll", this.eventResize);
+
+ Event.stopObserving(this.content, "load", this.options.onload);
+
+ if (this._oldParent) {
+ var content = this.getContent();
+ var originalContent = null;
+ for(var i = 0; i < content.childNodes.length; i++) {
+ originalContent = content.childNodes[i];
+ if (originalContent.nodeType == 1)
+ break;
+ originalContent = null;
+ }
+ if (originalContent)
+ this._oldParent.appendChild(originalContent);
+ this._oldParent = null;
+ }
+
+ if (this.sizer)
+ Event.stopObserving(this.sizer, "mousedown", this.eventMouseDown);
+
+ if (this.options.url)
+ this.content.src = null
+
+ if(this.iefix)
+ Element.remove(this.iefix);
+
+ Element.remove(this.element);
+ Windows.unregister(this);
+ },
+
+ // Sets close callback, if it sets, it should return true to be able to close the window.
+ setCloseCallback: function(callback) {
+ this.options.closeCallback = callback;
+ },
+
+ // Gets window content
+ getContent: function () {
+ return this.content;
+ },
+
+ // Sets the content with an element id
+ setContent: function(id, autoresize, autoposition) {
+ var element = $(id);
+ if (null == element) throw "Unable to find element '" + id + "' in DOM";
+ this._oldParent = element.parentNode;
+
+ var d = null;
+ var p = null;
+
+ if (autoresize)
+ d = Element.getDimensions(element);
+ if (autoposition)
+ p = Position.cumulativeOffset(element);
+
+ var content = this.getContent();
+ // Clear HTML (and even iframe)
+ this.setHTMLContent("");
+ content = this.getContent();
+
+ content.appendChild(element);
+ element.show();
+ if (autoresize)
+ this.setSize(d.width, d.height);
+ if (autoposition)
+ this.setLocation(p[1] - this.heightN, p[0] - this.widthW);
+ },
+
+ setHTMLContent: function(html) {
+ // It was an url (iframe), recreate a div content instead of iframe content
+ if (this.options.url) {
+ this.content.src = null;
+ this.options.url = null;
+
+ var content ="<div id=\"" + this.getId() + "_content\" class=\"" + this.options.className + "_content\"> </div>";
+ $(this.getId() +"_table_content").innerHTML = content;
+
+ this.content = $(this.element.id + "_content");
+ }
+
+ this.getContent().innerHTML = html;
+ },
+
+ setAjaxContent: function(url, options, showCentered, showModal) {
+ this.showFunction = showCentered ? "showCenter" : "show";
+ this.showModal = showModal || false;
+
+ options = options || {};
+
+ // Clear HTML (and even iframe)
+ this.setHTMLContent("");
+
+ this.onComplete = options.onComplete;
+ if (! this._onCompleteHandler)
+ this._onCompleteHandler = this._setAjaxContent.bind(this);
+ options.onComplete = this._onCompleteHandler;
+
+ new Ajax.Request(url, options);
+ options.onComplete = this.onComplete;
+ },
+
+ _setAjaxContent: function(originalRequest) {
+ Element.update(this.getContent(), originalRequest.responseText);
+ if (this.onComplete)
+ this.onComplete(originalRequest);
+ this.onComplete = null;
+ this[this.showFunction](this.showModal)
+ },
+
+ setURL: function(url) {
+ // Not an url content, change div to iframe
+ if (this.options.url)
+ this.content.src = null;
+ this.options.url = url;
+ var content= "<iframe frameborder='0' name='" + this.getId() + "_content' id='" + this.getId() + "_content' src='" + url + "' width='" + this.width + "' height='" + this.height + "'> </iframe>";
+ $(this.getId() +"_table_content").innerHTML = content;
+
+ this.content = $(this.element.id + "_content");
+ },
+
+ getURL: function() {
+ return this.options.url ? this.options.url : null;
+ },
+
+ refresh: function() {
+ if (this.options.url)
+ $(this.element.getAttribute('id') + '_content').src = this.options.url;
+ },
+
+ // Stores position/size in a cookie, by default named with window id
+ setCookie: function(name, expires, path, domain, secure) {
+ name = name || this.element.id;
+ this.cookie = [name, expires, path, domain, secure];
+
+ // Get cookie
+ var value = WindowUtilities.getCookie(name)
+ // If exists
+ if (value) {
+ var values = value.split(',');
+ var x = values[0].split(':');
+ var y = values[1].split(':');
+
+ var w = parseFloat(values[2]), h = parseFloat(values[3]);
+ var mini = values[4];
+ var maxi = values[5];
+
+ this.setSize(w, h);
+ if (mini == "true")
+ this.doMinimize = true; // Minimize will be done at onload window event
+ else if (maxi == "true")
+ this.doMaximize = true; // Maximize will be done at onload window event
+
+ this.useLeft = x[0] == "l";
+ this.useTop = y[0] == "t";
+
+ this.element.setStyle(this.useLeft ? {left: x[1]} : {right: x[1]});
+ this.element.setStyle(this.useTop ? {top: y[1]} : {bottom: y[1]});
+ }
+ },
+
+ // Gets window ID
+ getId: function() {
+ return this.element.id;
+ },
+
+ // Detroys itself when closing
+ setDestroyOnClose: function() {
+ this.options.destroyOnClose = true;
+ },
+
+ setConstraint: function(bool, padding) {
+ this.constraint = bool;
+ this.constraintPad = Object.extend(this.constraintPad, padding || {});
+ // Reset location to apply constraint
+ if (this.useTop && this.useLeft)
+ this.setLocation(parseFloat(this.element.style.top), parseFloat(this.element.style.left));
+ },
+
+ // initDrag event
+
+ _initDrag: function(event) {
+ // No resize on minimized window
+ if (Event.element(event) == this.sizer && this.isMinimized())
+ return;
+
+ // No move on maximzed window
+ if (Event.element(event) != this.sizer && this.isMaximized())
+ return;
+
+ if (Prototype.Browser.IE && this.heightN == 0)
+ this._getWindowBorderSize();
+
+ // Get pointer X,Y
+ this.pointer = [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];
+ if (this.options.wiredDrag)
+ this.currentDrag = this._createWiredElement();
+ else
+ this.currentDrag = this.element;
+
+ // Resize
+ if (Event.element(event) == this.sizer) {
+ this.doResize = true;
+ this.widthOrg = this.width;
+ this.heightOrg = this.height;
+ this.bottomOrg = parseFloat(this.element.getStyle('bottom'));
+ this.rightOrg = parseFloat(this.element.getStyle('right'));
+ this._notify("onStartResize");
+ }
+ else {
+ this.doResize = false;
+
+ // Check if click on close button,
+ var closeButton = $(this.getId() + '_close');
+ if (closeButton && Position.within(closeButton, this.pointer[0], this.pointer[1])) {
+ this.currentDrag = null;
+ return;
+ }
+
+ this.toFront();
+
+ if (! this.options.draggable)
+ return;
+ this._notify("onStartMove");
+ }
+ // Register global event to capture mouseUp and mouseMove
+ Event.observe(document, "mouseup", this.eventMouseUp, false);
+ Event.observe(document, "mousemove", this.eventMouseMove, false);
+
+ // Add an invisible div to keep catching mouse event over iframes
+ WindowUtilities.disableScreen('__invisible__', '__invisible__', this.overlayOpacity);
+
+ // Stop selection while dragging
+ document.body.ondrag = function () { return false; };
+ document.body.onselectstart = function () { return false; };
+
+ this.currentDrag.show();
+ Event.stop(event);
+ },
+
+ _round: function(val, round) {
+ return round == 1 ? val : val = Math.floor(val / round) * round;
+ },
+
+ // updateDrag event
+ _updateDrag: function(event) {
+ var pointer = [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];
+ var dx = pointer[0] - this.pointer[0];
+ var dy = pointer[1] - this.pointer[1];
+
+ // Resize case, update width/height
+ if (this.doResize) {
+ var w = this.widthOrg + dx;
+ var h = this.heightOrg + dy;
+
+ dx = this.width - this.widthOrg
+ dy = this.height - this.heightOrg
+
+ // Check if it's a right position, update it to keep upper-left corner at the same position
+ if (this.useLeft)
+ w = this._updateWidthConstraint(w)
+ else
+ this.currentDrag.setStyle({right: (this.rightOrg -dx) + 'px'});
+ // Check if it's a bottom position, update it to keep upper-left corner at the same position
+ if (this.useTop)
+ h = this._updateHeightConstraint(h)
+ else
+ this.currentDrag.setStyle({bottom: (this.bottomOrg -dy) + 'px'});
+
+ this.setSize(w , h);
+ this._notify("onResize");
+ }
+ // Move case, update top/left
+ else {
+ this.pointer = pointer;
+
+ if (this.useLeft) {
+ var left = parseFloat(this.currentDrag.getStyle('left')) + dx;
+ var newLeft = this._updateLeftConstraint(left);
+ // Keep mouse pointer correct
+ this.pointer[0] += newLeft-left;
+ this.currentDrag.setStyle({left: newLeft + 'px'});
+ }
+ else
+ this.currentDrag.setStyle({right: parseFloat(this.currentDrag.getStyle('right')) - dx + 'px'});
+
+ if (this.useTop) {
+ var top = parseFloat(this.currentDrag.getStyle('top')) + dy;
+ var newTop = this._updateTopConstraint(top);
+ // Keep mouse pointer correct
+ this.pointer[1] += newTop - top;
+ this.currentDrag.setStyle({top: newTop + 'px'});
+ }
+ else
+ this.currentDrag.setStyle({bottom: parseFloat(this.currentDrag.getStyle('bottom')) - dy + 'px'});
+
+ this._notify("onMove");
+ }
+ if (this.iefix)
+ this._fixIEOverlapping();
+
+ this._removeStoreLocation();
+ Event.stop(event);
+ },
+
+ // endDrag callback
+ _endDrag: function(event) {
+ // Remove temporary div over iframes
+ WindowUtilities.enableScreen('__invisible__');
+
+ if (this.doResize)
+ this._notify("onEndResize");
+ else
+ this._notify("onEndMove");
+
+ // Release event observing
+ Event.stopObserving(document, "mouseup", this.eventMouseUp,false);
+ Event.stopObserving(document, "mousemove", this.eventMouseMove, false);
+
+ Event.stop(event);
+
+ this._hideWiredElement();
+
+ // Store new location/size if need be
+ this._saveCookie()
+
+ // Restore selection
+ document.body.ondrag = null;
+ document.body.onselectstart = null;
+ },
+
+ _updateLeftConstraint: function(left) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;
+
+ if (left < this.constraintPad.left)
+ left = this.constraintPad.left;
+ if (left + this.width + this.widthE + this.widthW > width - this.constraintPad.right)
+ left = width - this.constraintPad.right - this.width - this.widthE - this.widthW;
+ }
+ return left;
+ },
+
+ _updateTopConstraint: function(top) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
+
+ var h = this.height + this.heightN + this.heightS;
+
+ if (top < this.constraintPad.top)
+ top = this.constraintPad.top;
+ if (top + h > height - this.constraintPad.bottom)
+ top = height - this.constraintPad.bottom - h;
+ }
+ return top;
+ },
+
+ _updateWidthConstraint: function(w) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;
+ var left = parseFloat(this.element.getStyle("left"));
+
+ if (left + w + this.widthE + this.widthW > width - this.constraintPad.right)
+ w = width - this.constraintPad.right - left - this.widthE - this.widthW;
+ }
+ return w;
+ },
+
+ _updateHeightConstraint: function(h) {
+ if (this.constraint && this.useLeft && this.useTop) {
+ var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
+ var top = parseFloat(this.element.getStyle("top"));
+
+ if (top + h + this.heightN + this.heightS > height - this.constraintPad.bottom)
+ h = height - this.constraintPad.bottom - top - this.heightN - this.heightS;
+ }
+ return h;
+ },
+
+
+ // Creates HTML window code
+ _createWindow: function(id) {
+ var className = this.options.className;
+ var win = document.createElement("div");
+ win.setAttribute('id', id);
+ win.className = "dialog";
+
+ var content;
+ if (this.options.url)
+ content= "<iframe frameborder=\"0\" name=\"" + id + "_content\" id=\"" + id + "_content\" src=\"" + this.options.url + "\"> </iframe>";
+ else
+ content ="<div id=\"" + id + "_content\" class=\"" +className + "_content\"> </div>";
+
+ var closeDiv = this.options.closable ? "<div class='"+ className +"_close' id='"+ id +"_close' onclick='Windows.close(\""+ id +"\", event)'> </div>" : "";
+ var minDiv = this.options.minimizable ? "<div class='"+ className + "_minimize' id='"+ id +"_minimize' onclick='Windows.minimize(\""+ id +"\", event)'> </div>" : "";
+ var maxDiv = this.options.maximizable ? "<div class='"+ className + "_maximize' id='"+ id +"_maximize' onclick='Windows.maximize(\""+ id +"\", event)'> </div>" : "";
+ var seAttributes = this.options.resizable ? "class='" + className + "_sizer' id='" + id + "_sizer'" : "class='" + className + "_se'";
+ var blank = "../themes/default/blank.gif";
+
+ win.innerHTML = closeDiv + minDiv + maxDiv + "\
+ <table id='"+ id +"_row1' class=\"top table_window\">\
+ <tr>\
+ <td class='"+ className +"_nw'></td>\
+ <td class='"+ className +"_n'><div id='"+ id +"_top' class='"+ className +"_title title_window'>"+ this.options.title +"</div></td>\
+ <td class='"+ className +"_ne'></td>\
+ </tr>\
+ </table>\
+ <table id='"+ id +"_row2' class=\"mid table_window\">\
+ <tr>\
+ <td class='"+ className +"_w'></td>\
+ <td id='"+ id +"_table_content' class='"+ className +"_content' valign='top'>" + content + "</td>\
+ <td class='"+ className +"_e'></td>\
+ </tr>\
+ </table>\
+ <table id='"+ id +"_row3' class=\"bot table_window\">\
+ <tr>\
+ <td class='"+ className +"_sw'></td>\
+ <td class='"+ className +"_s'><div id='"+ id +"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>\
+ <td " + seAttributes + "></td>\
+ </tr>\
+ </table>\
+ ";
+ Element.hide(win);
+ this.options.parent.insertBefore(win, this.options.parent.firstChild);
+ Event.observe($(id + "_content"), "load", this.options.onload);
+ return win;
+ },
+
+
+ changeClassName: function(newClassName) {
+ var className = this.options.className;
+ var id = this.getId();
+ $A(["_close", "_minimize", "_maximize", "_sizer", "_content"]).each(function(value) { this._toggleClassName($(id + value), className + value, newClassName + value) }.bind(this));
+ this._toggleClassName($(id + "_top"), className + "_title", newClassName + "_title");
+ $$("#" + id + " td").each(function(td) {td.className = td.className.sub(className,newClassName); });
+ this.options.className = newClassName;
+ },
+
+ _toggleClassName: function(element, oldClassName, newClassName) {
+ if (element) {
+ element.removeClassName(oldClassName);
+ element.addClassName(newClassName);
+ }
+ },
+
+ // Sets window location
+ setLocation: function(top, left) {
+ top = this._updateTopConstraint(top);
+ left = this._updateLeftConstraint(left);
+
+ var e = this.currentDrag || this.element;
+ e.setStyle({top: top + 'px'});
+ e.setStyle({left: left + 'px'});
+
+ this.useLeft = true;
+ this.useTop = true;
+ },
+
+ getLocation: function() {
+ var location = {};
+ if (this.useTop)
+ location = Object.extend(location, {top: this.element.getStyle("top")});
+ else
+ location = Object.extend(location, {bottom: this.element.getStyle("bottom")});
+ if (this.useLeft)
+ location = Object.extend(location, {left: this.element.getStyle("left")});
+ else
+ location = Object.extend(location, {right: this.element.getStyle("right")});
+
+ return location;
+ },
+
+ // Gets window size
+ getSize: function() {
+ return {width: this.width, height: this.height};
+ },
+
+ // Sets window size
+ setSize: function(width, height, useEffect) {
+ width = parseFloat(width);
+ height = parseFloat(height);
+
+ // Check min and max size
+ if (!this.minimized && width < this.options.minWidth)
+ width = this.options.minWidth;
+
+ if (!this.minimized && height < this.options.minHeight)
+ height = this.options.minHeight;
+
+ if (this.options. maxHeight && height > this.options. maxHeight)
+ height = this.options. maxHeight;
+
+ if (this.options. maxWidth && width > this.options. maxWidth)
+ width = this.options. maxWidth;
+
+
+ if (this.useTop && this.useLeft && Window.hasEffectLib && Effect.ResizeWindow && useEffect) {
+ new Effect.ResizeWindow(this, null, null, width, height, {duration: Window.resizeEffectDuration});
+ } else {
+ this.width = width;
+ this.height = height;
+ var e = this.currentDrag ? this.currentDrag : this.element;
+
+ e.setStyle({width: width + this.widthW + this.widthE + "px"})
+ e.setStyle({height: height + this.heightN + this.heightS + "px"})
+
+ // Update content size
+ if (!this.currentDrag || this.currentDrag == this.element) {
+ var content = $(this.element.id + '_content');
+ content.setStyle({height: height + 'px'});
+ content.setStyle({width: width + 'px'});
+ }
+ }
+ },
+
+ updateHeight: function() {
+ this.setSize(this.width, this.content.scrollHeight, true);
+ },
+
+ updateWidth: function() {
+ this.setSize(this.content.scrollWidth, this.height, true);
+ },
+
+ // Brings window to front
+ toFront: function() {
+ if (this.element.style.zIndex < Windows.maxZIndex)
+ this.setZIndex(Windows.maxZIndex + 1);
+ if (this.iefix)
+ this._fixIEOverlapping();
+ },
+
+ getBounds: function(insideOnly) {
+ if (! this.width || !this.height || !this.visible)
+ this.computeBounds();
+ var w = this.width;
+ var h = this.height;
+
+ if (!insideOnly) {
+ w += this.widthW + this.widthE;
+ h += this.heightN + this.heightS;
+ }
+ var bounds = Object.extend(this.getLocation(), {width: w + "px", height: h + "px"});
+ return bounds;
+ },
+
+ computeBounds: function() {
+ if (! this.width || !this.height) {
+ var size = WindowUtilities._computeSize(this.content.innerHTML, this.content.id, this.width, this.height, 0, this.options.className)
+ if (this.height)
+ this.width = size + 5
+ else
+ this.height = size + 5
+ }
+
+ this.setSize(this.width, this.height);
+ if (this.centered)
+ this._center(this.centerTop, this.centerLeft);
+ },
+
+ // Displays window modal state or not
+ show: function(modal) {
+ this.visible = true;
+ if (modal) {
+ // Hack for Safari !!
+ if (typeof this.overlayOpacity == "undefined") {
+ var that = this;
+ setTimeout(function() {that.show(modal)}, 10);
+ return;
+ }
+ Windows.addModalWindow(this);
+
+ this.modal = true;
+ this.setZIndex(Windows.maxZIndex + 1);
+ Windows.unsetOverflow(this);
+ }
+ else
+ if (!this.element.style.zIndex)
+ this.setZIndex(Windows.maxZIndex + 1);
+
+ // To restore overflow if need be
+ if (this.oldStyle)
+ this.getContent().setStyle({overflow: this.oldStyle});
+
+ this.computeBounds();
+
+ this._notify("onBeforeShow");
+ if (this.options.showEffect != Element.show && this.options.showEffectOptions)
+ this.options.showEffect(this.element, this.options.showEffectOptions);
+ else
+ this.options.showEffect(this.element);
+
+ this._checkIEOverlapping();
+ WindowUtilities.focusedWindow = this
+ this._notify("onShow");
+ },
+
+ // Displays window modal state or not at the center of the page
+ showCenter: function(modal, top, left) {
+ this.centered = true;
+ this.centerTop = top;
+ this.centerLeft = left;
+
+ this.show(modal);
+ },
+
+ isVisible: function() {
+ return this.visible;
+ },
+
+ _center: function(top, left) {
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
+ if (typeof top == "undefined")
+ top = (pageSize.windowHeight - (this.height + this.heightN + this.heightS))/2;
+ top += windowScroll.top
+
+ if (typeof left == "undefined")
+ left = (pageSize.windowWidth - (this.width + this.widthW + this.widthE))/2;
+ left += windowScroll.left
+ this.setLocation(top, left);
+ this.toFront();
+ },
+
+ _recenter: function(event) {
+ if (this.centered) {
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
+
+ // Check for this stupid IE that sends dumb events
+ if (this.pageSize && this.pageSize.windowWidth == pageSize.windowWidth && this.pageSize.windowHeight == pageSize.windowHeight &&
+ this.windowScroll.left == windowScroll.left && this.windowScroll.top == windowScroll.top)
+ return;
+ this.pageSize = pageSize;
+ this.windowScroll = windowScroll;
+ // set height of Overlay to take up whole page and show
+ if ($('overlay_modal'))
+ $('overlay_modal').setStyle({height: (pageSize.pageHeight + 'px')});
+
+ if (this.options.recenterAuto)
+ this._center(this.centerTop, this.centerLeft);
+ }
+ },
+
+ // Hides window
+ hide: function() {
+ this.visible = false;
+ if (this.modal) {
+ Windows.removeModalWindow(this);
+ Windows.resetOverflow();
+ }
+ // To avoid bug on scrolling bar
+ this.oldStyle = this.getContent().getStyle('overflow') || "auto"
+ this.getContent().setStyle({overflow: "hidden"});
+
+ this.options.hideEffect(this.element, this.options.hideEffectOptions);
+
+ if(this.iefix)
+ this.iefix.hide();
+
+ if (!this.doNotNotifyHide)
+ this._notify("onHide");
+ },
+
+ close: function() {
+ // Asks closeCallback if exists
+ if (this.visible) {
+ if (this.options.closeCallback && ! this.options.closeCallback(this))
+ return;
+
+ if (this.options.destroyOnClose) {
+ var destroyFunc = this.destroy.bind(this);
+ if (this.options.hideEffectOptions.afterFinish) {
+ var func = this.options.hideEffectOptions.afterFinish;
+ this.options.hideEffectOptions.afterFinish = function() {func();destroyFunc() }
+ }
+ else
+ this.options.hideEffectOptions.afterFinish = function() {destroyFunc() }
+ }
+ Windows.updateFocusedWindow();
+
+ this.doNotNotifyHide = true;
+ this.hide();
+ this.doNotNotifyHide = false;
+ this._notify("onClose");
+ }
+ },
+
+ minimize: function() {
+ if (this.resizing)
+ return;
+
+ var r2 = $(this.getId() + "_row2");
+
+ if (!this.minimized) {
+ this.minimized = true;
+
+ var dh = r2.getDimensions().height;
+ this.r2Height = dh;
+ var h = this.element.getHeight() - dh;
+
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
+ new Effect.ResizeWindow(this, null, null, null, this.height -dh, {duration: Window.resizeEffectDuration});
+ } else {
+ this.height -= dh;
+ this.element.setStyle({height: h + "px"});
+ r2.hide();
+ }
+
+ if (! this.useTop) {
+ var bottom = parseFloat(this.element.getStyle('bottom'));
+ this.element.setStyle({bottom: (bottom + dh) + 'px'});
+ }
+ }
+ else {
+ this.minimized = false;
+
+ var dh = this.r2Height;
+ this.r2Height = null;
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
+ new Effect.ResizeWindow(this, null, null, null, this.height + dh, {duration: Window.resizeEffectDuration});
+ }
+ else {
+ var h = this.element.getHeight() + dh;
+ this.height += dh;
+ this.element.setStyle({height: h + "px"})
+ r2.show();
+ }
+ if (! this.useTop) {
+ var bottom = parseFloat(this.element.getStyle('bottom'));
+ this.element.setStyle({bottom: (bottom - dh) + 'px'});
+ }
+ this.toFront();
+ }
+ this._notify("onMinimize");
+
+ // Store new location/size if need be
+ this._saveCookie()
+ },
+
+ maximize: function() {
+ if (this.isMinimized() || this.resizing)
+ return;
+
+ if (Prototype.Browser.IE && this.heightN == 0)
+ this._getWindowBorderSize();
+
+ if (this.storedLocation != null) {
+ this._restoreLocation();
+ if(this.iefix)
+ this.iefix.hide();
+ }
+ else {
+ this._storeLocation();
+ Windows.unsetOverflow(this);
+
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
+ var left = windowScroll.left;
+ var top = windowScroll.top;
+
+ if (this.options.parent != document.body) {
+ windowScroll = {top:0, left:0, bottom:0, right:0};
+ var dim = this.options.parent.getDimensions();
+ pageSize.windowWidth = dim.width;
+ pageSize.windowHeight = dim.height;
+ top = 0;
+ left = 0;
+ }
+
+ if (this.constraint) {
+ pageSize.windowWidth -= Math.max(0, this.constraintPad.left) + Math.max(0, this.constraintPad.right);
+ pageSize.windowHeight -= Math.max(0, this.constraintPad.top) + Math.max(0, this.constraintPad.bottom);
+ left += Math.max(0, this.constraintPad.left);
+ top += Math.max(0, this.constraintPad.top);
+ }
+
+ var width = pageSize.windowWidth - this.widthW - this.widthE;
+ var height= pageSize.windowHeight - this.heightN - this.heightS;
+
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
+ new Effect.ResizeWindow(this, top, left, width, height, {duration: Window.resizeEffectDuration});
+ }
+ else {
+ this.setSize(width, height);
+ this.element.setStyle(this.useLeft ? {left: left} : {right: left});
+ this.element.setStyle(this.useTop ? {top: top} : {bottom: top});
+ }
+
+ this.toFront();
+ if (this.iefix)
+ this._fixIEOverlapping();
+ }
+ this._notify("onMaximize");
+
+ // Store new location/size if need be
+ this._saveCookie()
+ },
+
+ isMinimized: function() {
+ return this.minimized;
+ },
+
+ isMaximized: function() {
+ return (this.storedLocation != null);
+ },
+
+ setOpacity: function(opacity) {
+ if (Element.setOpacity)
+ Element.setOpacity(this.element, opacity);
+ },
+
+ setZIndex: function(zindex) {
+ this.element.setStyle({zIndex: zindex});
+ Windows.updateZindex(zindex, this);
+ },
+
+ setTitle: function(newTitle) {
+ if (!newTitle || newTitle == "")
+ newTitle = "&nbsp;";
+
+ Element.update(this.element.id + '_top', newTitle);
+ },
+
+ getTitle: function() {
+ return $(this.element.id + '_top').innerHTML;
+ },
+
+ setStatusBar: function(element) {
+ var statusBar = $(this.getId() + "_bottom");
+
+ if (typeof(element) == "object") {
+ if (this.bottombar.firstChild)
+ this.bottombar.replaceChild(element, this.bottombar.firstChild);
+ else
+ this.bottombar.appendChild(element);
+ }
+ else
+ this.bottombar.innerHTML = element;
+ },
+
+ _checkIEOverlapping: function() {
+ if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (navigator.userAgent.indexOf('Opera')<0) && (this.element.getStyle('position')=='absolute')) {
+ new Insertion.After(this.element.id, '<iframe id="' + this.element.id + '_iefix" '+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
+ this.iefix = $(this.element.id+'_iefix');
+ }
+ if(this.iefix)
+ setTimeout(this._fixIEOverlapping.bind(this), 50);
+ },
+
+ _fixIEOverlapping: function() {
+ Position.clone(this.element, this.iefix);
+ this.iefix.style.zIndex = this.element.style.zIndex - 1;
+ this.iefix.show();
+ },
+
+ _getWindowBorderSize: function(event) {
+ // Hack to get real window border size!!
+ var div = this._createHiddenDiv(this.options.className + "_n")
+ this.heightN = Element.getDimensions(div).height;
+ div.parentNode.removeChild(div)
+
+ var div = this._createHiddenDiv(this.options.className + "_s")
+ this.heightS = Element.getDimensions(div).height;
+ div.parentNode.removeChild(div)
+
+ var div = this._createHiddenDiv(this.options.className + "_e")
+ this.widthE = Element.getDimensions(div).width;
+ div.parentNode.removeChild(div)
+
+ var div = this._createHiddenDiv(this.options.className + "_w")
+ this.widthW = Element.getDimensions(div).width;
+ div.parentNode.removeChild(div);
+
+ var div = document.createElement("div");
+ div.className = "overlay_" + this.options.className ;
+ document.body.appendChild(div);
+ //alert("no timeout:\nopacity: " + div.getStyle("opacity") + "\nwidth: " + document.defaultView.getComputedStyle(div, null).width);
+ var that = this;
+
+ // Workaround for Safari!!
+ setTimeout(function() {that.overlayOpacity = ($(div).getStyle("opacity")); div.parentNode.removeChild(div);}, 10);
+
+ // Workaround for IE!!
+ if (Prototype.Browser.IE) {
+ this.heightS = $(this.getId() +"_row3").getDimensions().height;
+ this.heightN = $(this.getId() +"_row1").getDimensions().height;
+ }
+
+ // Safari size fix
+ if (Prototype.Browser.WebKit && Prototype.Browser.WebKitVersion < 420)
+ this.setSize(this.width, this.height);
+ if (this.doMaximize)
+ this.maximize();
+ if (this.doMinimize)
+ this.minimize();
+ },
+
+ _createHiddenDiv: function(className) {
+ var objBody = document.body;
+ var win = document.createElement("div");
+ win.setAttribute('id', this.element.id+ "_tmp");
+ win.className = className;
+ win.style.display = 'none';
+ win.innerHTML = '';
+ objBody.insertBefore(win, objBody.firstChild);
+ return win;
+ },
+
+ _storeLocation: function() {
+ if (this.storedLocation == null) {
+ this.storedLocation = {useTop: this.useTop, useLeft: this.useLeft,
+ top: this.element.getStyle('top'), bottom: this.element.getStyle('bottom'),
+ left: this.element.getStyle('left'), right: this.element.getStyle('right'),
+ width: this.width, height: this.height };
+ }
+ },
+
+ _restoreLocation: function() {
+ if (this.storedLocation != null) {
+ this.useLeft = this.storedLocation.useLeft;
+ this.useTop = this.storedLocation.useTop;
+
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow)
+ new Effect.ResizeWindow(this, this.storedLocation.top, this.storedLocation.left, this.storedLocation.width, this.storedLocation.height, {duration: Window.resizeEffectDuration});
+ else {
+ this.element.setStyle(this.useLeft ? {left: this.storedLocation.left} : {right: this.storedLocation.right});
+ this.element.setStyle(this.useTop ? {top: this.storedLocation.top} : {bottom: this.storedLocation.bottom});
+ this.setSize(this.storedLocation.width, this.storedLocation.height);
+ }
+
+ Windows.resetOverflow();
+ this._removeStoreLocation();
+ }
+ },
+
+ _removeStoreLocation: function() {
+ this.storedLocation = null;
+ },
+
+ _saveCookie: function() {
+ if (this.cookie) {
+ var value = "";
+ if (this.useLeft)
+ value += "l:" + (this.storedLocation ? this.storedLocation.left : this.element.getStyle('left'))
+ else
+ value += "r:" + (this.storedLocation ? this.storedLocation.right : this.element.getStyle('right'))
+ if (this.useTop)
+ value += ",t:" + (this.storedLocation ? this.storedLocation.top : this.element.getStyle('top'))
+ else
+ value += ",b:" + (this.storedLocation ? this.storedLocation.bottom :this.element.getStyle('bottom'))
+
+ value += "," + (this.storedLocation ? this.storedLocation.width : this.width);
+ value += "," + (this.storedLocation ? this.storedLocation.height : this.height);
+ value += "," + this.isMinimized();
+ value += "," + this.isMaximized();
+ WindowUtilities.setCookie(value, this.cookie)
+ }
+ },
+
+ _createWiredElement: function() {
+ if (! this.wiredElement) {
+ if (Prototype.Browser.IE)
+ this._getWindowBorderSize();
+ var div = document.createElement("div");
+ div.className = "wired_frame " + this.options.className + "_wired_frame";
+
+ div.style.position = 'absolute';
+ this.options.parent.insertBefore(div, this.options.parent.firstChild);
+ this.wiredElement = $(div);
+ }
+ if (this.useLeft)
+ this.wiredElement.setStyle({left: this.element.getStyle('left')});
+ else
+ this.wiredElement.setStyle({right: this.element.getStyle('right')});
+
+ if (this.useTop)
+ this.wiredElement.setStyle({top: this.element.getStyle('top')});
+ else
+ this.wiredElement.setStyle({bottom: this.element.getStyle('bottom')});
+
+ var dim = this.element.getDimensions();
+ this.wiredElement.setStyle({width: dim.width + "px", height: dim.height +"px"});
+
+ this.wiredElement.setStyle({zIndex: Windows.maxZIndex+30});
+ return this.wiredElement;
+ },
+
+ _hideWiredElement: function() {
+ if (! this.wiredElement || ! this.currentDrag)
+ return;
+ if (this.currentDrag == this.element)
+ this.currentDrag = null;
+ else {
+ if (this.useLeft)
+ this.element.setStyle({left: this.currentDrag.getStyle('left')});
+ else
+ this.element.setStyle({right: this.currentDrag.getStyle('right')});
+
+ if (this.useTop)
+ this.element.setStyle({top: this.currentDrag.getStyle('top')});
+ else
+ this.element.setStyle({bottom: this.currentDrag.getStyle('bottom')});
+
+ this.currentDrag.hide();
+ this.currentDrag = null;
+ if (this.doResize)
+ this.setSize(this.width, this.height);
+ }
+ },
+
+ _notify: function(eventName) {
+ if (this.options[eventName])
+ this.options[eventName](this);
+ else
+ Windows.notify(eventName, this);
+ }
+};
+
+// Windows containers, register all page windows
+var Windows = {
+ windows: [],
+ modalWindows: [],
+ observers: [],
+ focusedWindow: null,
+ maxZIndex: 0,
+ overlayShowEffectOptions: {duration: 0.5},
+ overlayHideEffectOptions: {duration: 0.5},
+
+ addObserver: function(observer) {
+ this.removeObserver(observer);
+ this.observers.push(observer);
+ },
+
+ removeObserver: function(observer) {
+ this.observers = this.observers.reject( function(o) { return o==observer });
+ },
+
+ // onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
+ notify: function(eventName, win) {
+ this.observers.each( function(o) {if(o[eventName]) o[eventName](eventName, win);});
+ },
+
+ // Gets window from its id
+ getWindow: function(id) {
+ return this.windows.detect(function(d) { return d.getId() ==id });
+ },
+
+ // Gets the last focused window
+ getFocusedWindow: function() {
+ return this.focusedWindow;
+ },
+
+ updateFocusedWindow: function() {
+ this.focusedWindow = this.windows.length >=2 ? this.windows[this.windows.length-2] : null;
+ },
+
+ // Registers a new window (called by Windows constructor)
+ register: function(win) {
+ this.windows.push(win);
+ },
+
+ // Add a modal window in the stack
+ addModalWindow: function(win) {
+ // Disable screen if first modal window
+ if (this.modalWindows.length == 0) {
+ WindowUtilities.disableScreen(win.options.className, 'overlay_modal', win.overlayOpacity, win.getId(), win.options.parent);
+ }
+ else {
+ // Move overlay over all windows
+ if (Window.keepMultiModalWindow) {
+ $('overlay_modal').style.zIndex = Windows.maxZIndex + 1;
+ Windows.maxZIndex += 1;
+ WindowUtilities._hideSelect(this.modalWindows.last().getId());
+ }
+ // Hide current modal window
+ else
+ this.modalWindows.last().element.hide();
+ // Fucking IE select issue
+ WindowUtilities._showSelect(win.getId());
+ }
+ this.modalWindows.push(win);
+ },
+
+ removeModalWindow: function(win) {
+ this.modalWindows.pop();
+
+ // No more modal windows
+ if (this.modalWindows.length == 0)
+ WindowUtilities.enableScreen();
+ else {
+ if (Window.keepMultiModalWindow) {
+ this.modalWindows.last().toFront();
+ WindowUtilities._showSelect(this.modalWindows.last().getId());
+ }
+ else
+ this.modalWindows.last().element.show();
+ }
+ },
+
+ // Registers a new window (called by Windows constructor)
+ register: function(win) {
+ this.windows.push(win);
+ },
+
+ // Unregisters a window (called by Windows destructor)
+ unregister: function(win) {
+ this.windows = this.windows.reject(function(d) { return d==win });
+ },
+
+ // Closes all windows
+ closeAll: function() {
+ this.windows.each( function(w) {Windows.close(w.getId())} );
+ },
+
+ closeAllModalWindows: function() {
+ WindowUtilities.enableScreen();
+ this.modalWindows.each( function(win) {if (win) win.close()});
+ },
+
+ // Minimizes a window with its id
+ minimize: function(id, event) {
+ var win = this.getWindow(id)
+ if (win && win.visible)
+ win.minimize();
+ Event.stop(event);
+ },
+
+ // Maximizes a window with its id
+ maximize: function(id, event) {
+ var win = this.getWindow(id)
+ if (win && win.visible)
+ win.maximize();
+ Event.stop(event);
+ },
+
+ // Closes a window with its id
+ close: function(id, event) {
+ var win = this.getWindow(id);
+ if (win)
+ win.close();
+ if (event)
+ Event.stop(event);
+ },
+
+ blur: function(id) {
+ var win = this.getWindow(id);
+ if (!win)
+ return;
+ if (win.options.blurClassName)
+ win.changeClassName(win.options.blurClassName);
+ if (this.focusedWindow == win)
+ this.focusedWindow = null;
+ win._notify("onBlur");
+ },
+
+ focus: function(id) {
+ var win = this.getWindow(id);
+ if (!win)
+ return;
+ if (this.focusedWindow)
+ this.blur(this.focusedWindow.getId())
+
+ if (win.options.focusClassName)
+ win.changeClassName(win.options.focusClassName);
+ this.focusedWindow = win;
+ win._notify("onFocus");
+ },
+
+ unsetOverflow: function(except) {
+ this.windows.each(function(d) { d.oldOverflow = d.getContent().getStyle("overflow") || "auto" ; d.getContent().setStyle({overflow: "hidden"}) });
+ if (except && except.oldOverflow)
+ except.getContent().setStyle({overflow: except.oldOverflow});
+ },
+
+ resetOverflow: function() {
+ this.windows.each(function(d) { if (d.oldOverflow) d.getContent().setStyle({overflow: d.oldOverflow}) });
+ },
+
+ updateZindex: function(zindex, win) {
+ if (zindex > this.maxZIndex) {
+ this.maxZIndex = zindex;
+ if (this.focusedWindow)
+ this.blur(this.focusedWindow.getId())
+ }
+ this.focusedWindow = win;
+ if (this.focusedWindow)
+ this.focus(this.focusedWindow.getId())
+ }
+};
+
+var Dialog = {
+ dialogId: null,
+ onCompleteFunc: null,
+ callFunc: null,
+ parameters: null,
+
+ confirm: function(content, parameters) {
+ // Get Ajax return before
+ if (content && typeof content != "string") {
+ Dialog._runAjaxRequest(content, parameters, Dialog.confirm);
+ return
+ }
+ content = content || "";
+
+ parameters = parameters || {};
+ var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";
+ var cancelLabel = parameters.cancelLabel ? parameters.cancelLabel : "Cancel";
+
+ // Backward compatibility
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
+ parameters.windowParameters = parameters.windowParameters || {};
+
+ parameters.className = parameters.className || "alert";
+
+ var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
+ var cancelButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " cancel_button'"
+ var content = "\
+ <div class='" + parameters.className + "_message'>" + content + "</div>\
+ <div class='" + parameters.className + "_buttons'>\
+ <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
+ <input type='button' value='" + cancelLabel + "' onclick='Dialog.cancelCallback()' " + cancelButtonClass + "/>\
+ </div>\
+ ";
+ return this._openDialog(content, parameters)
+ },
+
+ alert: function(content, parameters) {
+ // Get Ajax return before
+ if (content && typeof content != "string") {
+ Dialog._runAjaxRequest(content, parameters, Dialog.alert);
+ return
+ }
+ content = content || "";
+
+ parameters = parameters || {};
+ var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";
+
+ // Backward compatibility
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
+ parameters.windowParameters = parameters.windowParameters || {};
+
+ parameters.className = parameters.className || "alert";
+
+ var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
+ var content = "\
+ <div class='" + parameters.className + "_message'>" + content + "</div>\
+ <div class='" + parameters.className + "_buttons'>\
+ <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
+ </div>";
+ return this._openDialog(content, parameters)
+ },
+
+ info: function(content, parameters) {
+ // Get Ajax return before
+ if (content && typeof content != "string") {
+ Dialog._runAjaxRequest(content, parameters, Dialog.info);
+ return
+ }
+ content = content || "";
+
+ // Backward compatibility
+ parameters = parameters || {};
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
+ parameters.windowParameters = parameters.windowParameters || {};
+
+ parameters.className = parameters.className || "alert";
+
+ var content = "<div id='modal_dialog_message' class='" + parameters.className + "_message'>" + content + "</div>";
+ if (parameters.showProgress)
+ content += "<div id='modal_dialog_progress' class='" + parameters.className + "_progress'> </div>";
+
+ parameters.ok = null;
+ parameters.cancel = null;
+
+ return this._openDialog(content, parameters)
+ },
+
+ setInfoMessage: function(message) {
+ $('modal_dialog_message').update(message);
+ },
+
+ closeInfo: function() {
+ Windows.close(this.dialogId);
+ },
+
+ _openDialog: function(content, parameters) {
+ var className = parameters.className;
+
+ if (! parameters.height && ! parameters.width) {
+ parameters.width = WindowUtilities.getPageSize(parameters.options.parent || document.body).pageWidth / 2;
+ }
+ if (parameters.id)
+ this.dialogId = parameters.id;
+ else {
+ var t = new Date();
+ this.dialogId = 'modal_dialog_' + t.getTime();
+ parameters.id = this.dialogId;
+ }
+
+ // compute height or width if need be
+ if (! parameters.height || ! parameters.width) {
+ var size = WindowUtilities._computeSize(content, this.dialogId, parameters.width, parameters.height, 5, className)
+ if (parameters.height)
+ parameters.width = size + 5
+ else
+ parameters.height = size + 5
+ }
+ parameters.effectOptions = parameters.effectOptions ;
+ parameters.resizable = parameters.resizable || false;
+ parameters.minimizable = parameters.minimizable || false;
+ parameters.maximizable = parameters.maximizable || false;
+ parameters.draggable = parameters.draggable || false;
+ parameters.closable = parameters.closable || false;
+
+ var win = new Window(parameters);
+ win.getContent().innerHTML = content;
+
+ win.showCenter(true, parameters.top, parameters.left);
+ win.setDestroyOnClose();
+
+ win.cancelCallback = parameters.onCancel || parameters.cancel;
+ win.okCallback = parameters.onOk || parameters.ok;
+
+ return win;
+ },
+
+ _getAjaxContent: function(originalRequest) {
+ Dialog.callFunc(originalRequest.responseText, Dialog.parameters)
+ },
+
+ _runAjaxRequest: function(message, parameters, callFunc) {
+ if (message.options == null)
+ message.options = {}
+ Dialog.onCompleteFunc = message.options.onComplete;
+ Dialog.parameters = parameters;
+ Dialog.callFunc = callFunc;
+
+ message.options.onComplete = Dialog._getAjaxContent;
+ new Ajax.Request(message.url, message.options);
+ },
+
+ okCallback: function() {
+ var win = Windows.focusedWindow;
+ if (!win.okCallback || win.okCallback(win)) {
+ // Remove onclick on button
+ $$("#" + win.getId()+" input").each(function(element) {element.onclick=null;})
+ win.close();
+ }
+ },
+
+ cancelCallback: function() {
+ var win = Windows.focusedWindow;
+ // Remove onclick on button
+ $$("#" + win.getId()+" input").each(function(element) {element.onclick=null})
+ win.close();
+ if (win.cancelCallback)
+ win.cancelCallback(win);
+ }
+}
+/*
+ Based on Lightbox JS: Fullsize Image Overlays
+ by Lokesh Dhakar - http://www.huddletogether.com
+
+ For more information on this script, visit:
+ http://huddletogether.com/projects/lightbox/
+
+ Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
+ (basically, do anything you want, just leave my name and link)
+*/
+
+if (Prototype.Browser.WebKit) {
+ var array = navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));
+ Prototype.Browser.WebKitVersion = parseFloat(array[1]);
+}
+
+var WindowUtilities = {
+ // From dragdrop.js
+ getWindowScroll: function(parent) {
+ var T, L, W, H;
+ parent = parent || document.body;
+ if (parent != document.body) {
+ T = parent.scrollTop;
+ L = parent.scrollLeft;
+ W = parent.scrollWidth;
+ H = parent.scrollHeight;
+ }
+ else {
+ var w = window;
+ with (w.document) {
+ if (w.document.documentElement && documentElement.scrollTop) {
+ T = documentElement.scrollTop;
+ L = documentElement.scrollLeft;
+ } else if (w.document.body) {
+ T = body.scrollTop;
+ L = body.scrollLeft;
+ }
+ if (w.innerWidth) {
+ W = w.innerWidth;
+ H = w.innerHeight;
+ } else if (w.document.documentElement && documentElement.clientWidth) {
+ W = documentElement.clientWidth;
+ H = documentElement.clientHeight;
+ } else {
+ W = body.offsetWidth;
+ H = body.offsetHeight
+ }
+ }
+ }
+ return { top: T, left: L, width: W, height: H };
+ },
+ //
+ // getPageSize()
+ // Returns array with page width, height and window width, height
+ // Core code from - quirksmode.org
+ // Edit for Firefox by pHaez
+ //
+ getPageSize: function(parent){
+ parent = parent || document.body;
+ var windowWidth, windowHeight;
+ var pageHeight, pageWidth;
+ if (parent != document.body) {
+ windowWidth = parent.getWidth();
+ windowHeight = parent.getHeight();
+ pageWidth = parent.scrollWidth;
+ pageHeight = parent.scrollHeight;
+ }
+ else {
+ var xScroll, yScroll;
+
+ if (window.innerHeight && window.scrollMaxY) {
+ xScroll = document.body.scrollWidth;
+ yScroll = window.innerHeight + window.scrollMaxY;
+ } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
+ xScroll = document.body.scrollWidth;
+ yScroll = document.body.scrollHeight;
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
+ xScroll = document.body.offsetWidth;
+ yScroll = document.body.offsetHeight;
+ }
+
+
+ if (self.innerHeight) { // all except Explorer
+ windowWidth = self.innerWidth;
+ windowHeight = self.innerHeight;
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
+ windowWidth = document.documentElement.clientWidth;
+ windowHeight = document.documentElement.clientHeight;
+ } else if (document.body) { // other Explorers
+ windowWidth = document.body.clientWidth;
+ windowHeight = document.body.clientHeight;
+ }
+
+ // for small pages with total height less then height of the viewport
+ if(yScroll < windowHeight){
+ pageHeight = windowHeight;
+ } else {
+ pageHeight = yScroll;
+ }
+
+ // for small pages with total width less then width of the viewport
+ if(xScroll < windowWidth){
+ pageWidth = windowWidth;
+ } else {
+ pageWidth = xScroll;
+ }
+ }
+ return {pageWidth: pageWidth ,pageHeight: pageHeight , windowWidth: windowWidth, windowHeight: windowHeight};
+ },
+
+ disableScreen: function(className, overlayId, overlayOpacity, contentId, parent) {
+ WindowUtilities.initLightbox(overlayId, className, function() {this._disableScreen(className, overlayId, overlayOpacity, contentId)}.bind(this), parent || document.body);
+ },
+
+ _disableScreen: function(className, overlayId, overlayOpacity, contentId) {
+ // prep objects
+ var objOverlay = $(overlayId);
+
+ var pageSize = WindowUtilities.getPageSize(objOverlay.parentNode);
+
+ // Hide select boxes as they will 'peek' through the image in IE, store old value
+ if (contentId && Prototype.Browser.IE) {
+ WindowUtilities._hideSelect();
+ WindowUtilities._showSelect(contentId);
+ }
+
+ // set height of Overlay to take up whole page and show
+ objOverlay.style.height = (pageSize.pageHeight + 'px');
+ objOverlay.style.display = 'none';
+ if (overlayId == "overlay_modal" && Window.hasEffectLib && Windows.overlayShowEffectOptions) {
+ objOverlay.overlayOpacity = overlayOpacity;
+ new Effect.Appear(objOverlay, Object.extend({from: 0, to: overlayOpacity}, Windows.overlayShowEffectOptions));
+ }
+ else
+ objOverlay.style.display = "block";
+ },
+
+ enableScreen: function(id) {
+ id = id || 'overlay_modal';
+ var objOverlay = $(id);
+ if (objOverlay) {
+ // hide lightbox and overlay
+ if (id == "overlay_modal" && Window.hasEffectLib && Windows.overlayHideEffectOptions)
+ new Effect.Fade(objOverlay, Object.extend({from: objOverlay.overlayOpacity, to:0}, Windows.overlayHideEffectOptions));
+ else {
+ objOverlay.style.display = 'none';
+ objOverlay.parentNode.removeChild(objOverlay);
+ }
+
+ // make select boxes visible using old value
+ if (id != "__invisible__")
+ WindowUtilities._showSelect();
+ }
+ },
+
+ _hideSelect: function(id) {
+ if (Prototype.Browser.IE) {
+ id = id == null ? "" : "#" + id + " ";
+ $$(id + 'select').each(function(element) {
+ if (! WindowUtilities.isDefined(element.oldVisibility)) {
+ element.oldVisibility = element.style.visibility ? element.style.visibility : "visible";
+ element.style.visibility = "hidden";
+ }
+ });
+ }
+ },
+
+ _showSelect: function(id) {
+ if (Prototype.Browser.IE) {
+ id = id == null ? "" : "#" + id + " ";
+ $$(id + 'select').each(function(element) {
+ if (WindowUtilities.isDefined(element.oldVisibility)) {
+ // Why?? Ask IE
+ try {
+ element.style.visibility = element.oldVisibility;
+ } catch(e) {
+ element.style.visibility = "visible";
+ }
+ element.oldVisibility = null;
+ }
+ else {
+ if (element.style.visibility)
+ element.style.visibility = "visible";
+ }
+ });
+ }
+ },
+
+ isDefined: function(object) {
+ return typeof(object) != "undefined" && object != null;
+ },
+
+ // initLightbox()
+ // Function runs on window load, going through link tags looking for rel="lightbox".
+ // These links receive onclick events that enable the lightbox display for their targets.
+ // The function also inserts html markup at the top of the page which will be used as a
+ // container for the overlay pattern and the inline image.
+ initLightbox: function(id, className, doneHandler, parent) {
+ // Already done, just update zIndex
+ if ($(id)) {
+ Element.setStyle(id, {zIndex: Windows.maxZIndex + 1});
+ Windows.maxZIndex++;
+ doneHandler();
+ }
+ // create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
+ else {
+ var objOverlay = document.createElement("div");
+ objOverlay.setAttribute('id', id);
+ objOverlay.className = "overlay_" + className
+ objOverlay.style.display = 'none';
+ objOverlay.style.position = 'absolute';
+ objOverlay.style.top = '0';
+ objOverlay.style.left = '0';
+ objOverlay.style.zIndex = Windows.maxZIndex + 1;
+ Windows.maxZIndex++;
+ objOverlay.style.width = '100%';
+ parent.insertBefore(objOverlay, parent.firstChild);
+ if (Prototype.Browser.WebKit && id == "overlay_modal") {
+ setTimeout(function() {doneHandler()}, 10);
+ }
+ else
+ doneHandler();
+ }
+ },
+
+ setCookie: function(value, parameters) {
+ document.cookie= parameters[0] + "=" + escape(value) +
+ ((parameters[1]) ? "; expires=" + parameters[1].toGMTString() : "") +
+ ((parameters[2]) ? "; path=" + parameters[2] : "") +
+ ((parameters[3]) ? "; domain=" + parameters[3] : "") +
+ ((parameters[4]) ? "; secure" : "");
+ },
+
+ getCookie: function(name) {
+ var dc = document.cookie;
+ var prefix = name + "=";
+ var begin = dc.indexOf("; " + prefix);
+ if (begin == -1) {
+ begin = dc.indexOf(prefix);
+ if (begin != 0) return null;
+ } else {
+ begin += 2;
+ }
+ var end = document.cookie.indexOf(";", begin);
+ if (end == -1) {
+ end = dc.length;
+ }
+ return unescape(dc.substring(begin + prefix.length, end));
+ },
+
+ _computeSize: function(content, id, width, height, margin, className) {
+ var objBody = document.body;
+ var tmpObj = document.createElement("div");
+ tmpObj.setAttribute('id', id);
+ tmpObj.className = className + "_content";
+
+ if (height)
+ tmpObj.style.height = height + "px"
+ else
+ tmpObj.style.width = width + "px"
+
+ tmpObj.style.position = 'absolute';
+ tmpObj.style.top = '0';
+ tmpObj.style.left = '0';
+ tmpObj.style.display = 'none';
+
+ tmpObj.innerHTML = content;
+ objBody.insertBefore(tmpObj, objBody.firstChild);
+
+ var size;
+ if (height)
+ size = $(tmpObj).getDimensions().width + margin;
+ else
+ size = $(tmpObj).getDimensions().height + margin;
+ objBody.removeChild(tmpObj);
+ return size;
+ }
+}
+
diff --git a/js/prototype-window-1.3/javascripts/window_effects.js b/js/prototype-window-1.3/javascripts/window_effects.js
new file mode 100755
index 0000000..6ad73cc
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/window_effects.js
@@ -0,0 +1,157 @@
+Effect.ResizeWindow = Class.create();
+Object.extend(Object.extend(Effect.ResizeWindow.prototype, Effect.Base.prototype), {
+ initialize: function(win, top, left, width, height) {
+ this.window = win;
+ this.window.resizing = true;
+
+ var size = win.getSize();
+ this.initWidth = parseFloat(size.width);
+ this.initHeight = parseFloat(size.height);
+
+ var location = win.getLocation();
+ this.initTop = parseFloat(location.top);
+ this.initLeft = parseFloat(location.left);
+
+ this.width = width != null ? parseFloat(width) : this.initWidth;
+ this.height = height != null ? parseFloat(height) : this.initHeight;
+ this.top = top != null ? parseFloat(top) : this.initTop;
+ this.left = left != null ? parseFloat(left) : this.initLeft;
+
+ this.dx = this.left - this.initLeft;
+ this.dy = this.top - this.initTop;
+ this.dw = this.width - this.initWidth;
+ this.dh = this.height - this.initHeight;
+
+ this.r2 = $(this.window.getId() + "_row2");
+ this.content = $(this.window.getId() + "_content");
+
+ this.contentOverflow = this.content.getStyle("overflow") || "auto";
+ this.content.setStyle({overflow: "hidden"});
+
+ // Wired mode
+ if (this.window.options.wiredDrag) {
+ this.window.currentDrag = win._createWiredElement();
+ this.window.currentDrag.show();
+ this.window.element.hide();
+ }
+
+ this.start(arguments[5]);
+ },
+
+ update: function(position) {
+ var width = Math.floor(this.initWidth + this.dw * position);
+ var height = Math.floor(this.initHeight + this.dh * position);
+ var top = Math.floor(this.initTop + this.dy * position);
+ var left = Math.floor(this.initLeft + this.dx * position);
+
+ if (window.ie) {
+ if (Math.floor(height) == 0)
+ this.r2.hide();
+ else if (Math.floor(height) >1)
+ this.r2.show();
+ }
+ this.r2.setStyle({height: height});
+ this.window.setSize(width, height);
+ this.window.setLocation(top, left);
+ },
+
+ finish: function(position) {
+ // Wired mode
+ if (this.window.options.wiredDrag) {
+ this.window._hideWiredElement();
+ this.window.element.show();
+ }
+
+ this.window.setSize(this.width, this.height);
+ this.window.setLocation(this.top, this.left);
+ this.r2.setStyle({height: null});
+
+ this.content.setStyle({overflow: this.contentOverflow});
+
+ this.window.resizing = false;
+ }
+});
+
+Effect.ModalSlideDown = function(element) {
+ var windowScroll = WindowUtilities.getWindowScroll();
+ var height = element.getStyle("height");
+ element.setStyle({top: - (parseFloat(height) - windowScroll.top) + "px"});
+
+ element.show();
+ return new Effect.Move(element, Object.extend({ x: 0, y: parseFloat(height) }, arguments[1] || {}));
+};
+
+
+Effect.ModalSlideUp = function(element) {
+ var height = element.getStyle("height");
+ return new Effect.Move(element, Object.extend({ x: 0, y: -parseFloat(height) }, arguments[1] || {}));
+};
+
+PopupEffect = Class.create();
+PopupEffect.prototype = {
+ initialize: function(htmlElement) {
+ this.html = $(htmlElement);
+ this.options = Object.extend({className: "popup_effect", duration: 0.4}, arguments[1] || {});
+
+ },
+ show: function(element, options) {
+ var position = Position.cumulativeOffset(this.html);
+ var size = this.html.getDimensions();
+ var bounds = element.win.getBounds();
+ this.window = element.win;
+ // Create a div
+ if (!this.div) {
+ this.div = document.createElement("div");
+ this.div.className = this.options.className;
+ this.div.style.height = size.height + "px";
+ this.div.style.width = size.width + "px";
+ this.div.style.top = position[1] + "px";
+ this.div.style.left = position[0] + "px";
+ this.div.style.position = "absolute"
+ document.body.appendChild(this.div);
+ }
+ if (this.options.fromOpacity)
+ this.div.setStyle({opacity: this.options.fromOpacity})
+ this.div.show();
+ var style = "top:" + bounds.top + ";left:" +bounds.left + ";width:" + bounds.width +";height:" + bounds.height;
+ if (this.options.toOpacity)
+ style += ";opacity:" + this.options.toOpacity;
+
+ new Effect.Morph(this.div ,{style: style, duration: this.options.duration, afterFinish: this._showWindow.bind(this)});
+ },
+
+ hide: function(element, options) {
+ var position = Position.cumulativeOffset(this.html);
+ var size = this.html.getDimensions();
+ this.window.visible = true;
+ var bounds = this.window.getBounds();
+ this.window.visible = false;
+
+ this.window.element.hide();
+
+ this.div.style.height = bounds.height;
+ this.div.style.width = bounds.width;
+ this.div.style.top = bounds.top;
+ this.div.style.left = bounds.left;
+
+ if (this.options.toOpacity)
+ this.div.setStyle({opacity: this.options.toOpacity})
+
+ this.div.show();
+ var style = "top:" + position[1] + "px;left:" + position[0] + "px;width:" + size.width +"px;height:" + size.height + "px";
+
+ if (this.options.fromOpacity)
+ style += ";opacity:" + this.options.fromOpacity;
+ new Effect.Morph(this.div ,{style: style, duration: this.options.duration, afterFinish: this._hideDiv.bind(this)});
+ },
+
+ _showWindow: function() {
+ this.div.hide();
+ this.window.element.show();
+ },
+
+ _hideDiv: function() {
+ this.div.hide();
+ }
+}
+
diff --git a/js/prototype-window-1.3/javascripts/window_ext.js b/js/prototype-window-1.3/javascripts/window_ext.js
new file mode 100755
index 0000000..60efac6
--- /dev/null
+++ b/js/prototype-window-1.3/javascripts/window_ext.js
@@ -0,0 +1,115 @@
+// Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.com)
+// YOU MUST INCLUDE window.js BEFORE
+//
+// Object to store hide/show windows status in a cookie
+// Just add at the end of your HTML file this javascript line: WindowStore.init()
+WindowStore = {
+ doSetCookie: false,
+ cookieName: "__window_store__",
+ expired: null,
+
+ // Init function with two optional parameters
+ // - cookieName (default = __window_store__)
+ // - expiration date (default 3 years from now)
+ init: function(cookieName, expired) {
+ WindowStore.cookieName = cookieName || WindowStore.cookieName
+
+ if (! expired) {
+ var today = new Date();
+ today.setYear(today.getYear()+1903);
+ WindowStore.expired = today;
+ }
+ else
+ WindowStore.expired = expired;
+
+ Windows.windows.each(function(win) {
+ win.setCookie(win.getId(), WindowStore.expired);
+ });
+
+ // Create observer on show/hide events
+ var myObserver = {
+ onShow: function(eventName, win) {
+ WindowStore._saveCookie();
+ },
+
+ onClose: function(eventName, win) {
+ WindowStore._saveCookie();
+ },
+
+ onHide: function(eventName, win) {
+ WindowStore._saveCookie();
+ }
+ }
+ Windows.addObserver(myObserver);
+
+ WindowStore._restoreWindows();
+ WindowStore._saveCookie();
+ },
+
+ show: function(win) {
+ eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName));
+ if (cookie != null) {
+ if (cookie[win.getId()])
+ win.show();
+ }
+ else
+ win.show();
+ },
+
+ // Function to store windows show/hide status in a cookie
+ _saveCookie: function() {
+ if (!doSetCookie)
+ return;
+
+ var cookieValue = "{";
+ Windows.windows.each(function(win) {
+ if (cookieValue != "{")
+ cookieValue += ","
+ cookieValue += win.getId() + ": " + win.isVisible();
+ });
+ cookieValue += "}"
+
+ WindowUtilities.setCookie(cookieValue, [WindowStore.cookieName, WindowStore.expired]);
+ },
+
+ // Function to restore windows show/hide status from a cookie if exists
+ _restoreWindows: function() {
+ eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName));
+ if (cookie != null) {
+ doSetCookie = false;
+ Windows.windows.each(function(win) {
+ if (cookie[win.getId()])
+ win.show();
+ });
+ }
+ doSetCookie = true;
+ }
+}
+
+// Object to set a close key an all windows
+WindowCloseKey = {
+ keyCode: Event.KEY_ESC,
+
+ init: function(keyCode) {
+ if (keyCode)
+ WindowCloseKey.keyCode = keyCode;
+
+ Event.observe(document, 'keydown', this._closeCurrentWindow.bindAsEventListener(this));
+ },
+
+ _closeCurrentWindow: function(event) {
+ var e = event || window.event
+ var characterCode = e.which || e.keyCode;
+
+ // Check if there is a top window (it means it's an URL content)
+ var win = top.Windows.focusedWindow;
+ if (characterCode == WindowCloseKey.keyCode && win) {
+ if (win.cancelCallback)
+ top.Dialog.cancelCallback();
+ else if (win.okCallback)
+ top.Dialog.okCallback();
+ else
+ top.Windows.close(top.Windows.focusedWindow.getId());
+ }
+ }
+} \ No newline at end of file
diff --git a/js/prototype-window-1.3/samples/constraint.html b/js/prototype-window-1.3/samples/constraint.html
new file mode 100755
index 0000000..f69935b
--- /dev/null
+++ b/js/prototype-window-1.3/samples/constraint.html
@@ -0,0 +1,83 @@
+<html>
+ <head>
+
+ <link href="../themes/default.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/alphacube.css" rel="stylesheet" type="text/css"/>
+
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/window_effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+
+<script type="text/javascript">
+function win1()
+{
+ var win = new Window({id: "win1", className: "alphacube", title: "Sample", width:250, height:150, top:0, left: 1, parent:$('container')});
+ win.getContent().innerHTML = "<h1>Constraint inside a div !!</h1>constraint: {left:10, right:20}<br><a href='#' onclick='Windows.getWindow(\"win1\").maximize()'>Maximize me</a>";
+
+ win.setDestroyOnClose();
+ win.show();
+ win.setConstraint(true, {left:10, right:20})
+ win.toFront();
+}
+
+function win2()
+{
+ var win = new Window({id: "win2", className: "alphacube", title: "Sample", width:200, height:150});
+ win.getContent().innerHTML = "<h1>Constraint inside page !!</h1>constraint: {top: 30, bottom:10}<br><a href='#' onclick='Windows.getWindow(\"win2\").maximize()'>Maximize me</a>";
+
+ win.setDestroyOnClose();
+ win.showCenter();
+ win.setConstraint(true, {left:0, right:0, top: 30, bottom:10})
+ win.toFront();
+}
+
+function win3()
+{
+ var win = new Window({id: "win3", className: "alphacube", title: "Sample", width:250, height:150, wiredDrag: true});
+ win.getContent().innerHTML = "<h1>No Constraint</h1>Wired mode<br><a href='#' onclick='Windows.getWindow(\"win3\").maximize()'>Maximize me</a>";
+ win.setDestroyOnClose();
+ win.setLocation(10, 500);
+ win.show();
+ win.toFront();
+}
+
+</script>
+<style>
+body {
+ background: #363636;
+}
+#border {
+ position:absolute;
+ top:10px;
+ left:10px;
+ width:500px;
+ height:500px;
+ border: 1px solid #000;
+ overflow:hidden;
+}
+#container {
+ position:absolute;
+ top:0px;
+ left:0px;
+ width:500px;
+ height:500px;
+ overflow:hidden;
+ background:#DAEE9B;
+ z-index:0;
+}
+</style>
+</head>
+<body>
+
+<div id="border">
+ <div id="container"></div>
+</div>
+
+<script>
+ win1();
+ win2();
+ win3();
+</script>
+</body></html> \ No newline at end of file
diff --git a/js/prototype-window-1.3/samples/dialog.html b/js/prototype-window-1.3/samples/dialog.html
new file mode 100755
index 0000000..7b75a46
--- /dev/null
+++ b/js/prototype-window-1.3/samples/dialog.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <link href="../themes/default.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/alert.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/alphacube.css" rel="stylesheet" type="text/css"/>
+
+ <title>dialog</title>
+
+</head>
+
+<body>
+<a href="#" onclick="Dialog.alert()">empty alert dialog</a>
+<br/>
+<a href="#" onclick="Dialog.confirm()">empty confirm dialog</a>
+<br/>
+<a href="#" onclick="Dialog.info()">empty info dialog</a> (does not make sense because you will have to reload the page)
+<br/>
+<br/>
+<br/>
+<br/>
+<a href="#" onclick="openAlert()">open alert dialog</a><br/>
+<a href="#" onclick="openConfirm()">open confirm dialog</a><br/>
+<a href="#" onclick="openAjaxConfirm()">open confirm dialog, dialog content is filled by an ajax call</a><br/>
+
+
+<script type="text/javascript">
+ function openAlert() {
+ Dialog.alert("Add your <b>HTML</b> message here", {windowParameters: {className: "alphacube"}})
+ }
+
+ function openConfirm() {
+ Dialog.confirm("Add your <b>HTML</b> message here<br/>Better than a classic javascript alert?",
+ {top: 10, width:250, className: "alphacube", okLabel: "Yes", cancelLabel:"No"})
+ }
+
+ function openAjaxConfirm() {
+ Dialog.confirm({url: "dialog_ajax.html", options: {method: 'get'}},
+ {top: 10, width:250, className: "alphacube", okLabel: "Yes", cancelLabel:"No"})
+ }
+</script>
+
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/dialog_ajax.html b/js/prototype-window-1.3/samples/dialog_ajax.html
new file mode 100755
index 0000000..bc34082
--- /dev/null
+++ b/js/prototype-window-1.3/samples/dialog_ajax.html
@@ -0,0 +1,4 @@
+<h1>Ajax content</h1>
+This dialog has been loaded by ajax.<br/>
+Once loaded, dialog shows up and update its height to fit content when width is specified.<br/>
+Of course if you set height, Dialog will compute its width.
diff --git a/js/prototype-window-1.3/samples/inframe.html b/js/prototype-window-1.3/samples/inframe.html
new file mode 100755
index 0000000..a6f9389
--- /dev/null
+++ b/js/prototype-window-1.3/samples/inframe.html
@@ -0,0 +1,54 @@
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Test</title>
+
+ <style>
+
+ * {
+ margin: 0px;
+ padding: 0px;
+ }
+ </style>
+
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <link href="../themes/default.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/theme1.css" rel="stylesheet" type="text/css" > </link>
+ <title>Sample Windows</title>
+</head>
+<body>
+<script>
+// Martys cascade test
+var idx = 0;
+var xidx = 0;
+var cascade = 0;
+var cOffset = 23;
+var cWins = new Array();
+function showWin(ajaxArgs) {
+ foo = new Window('dialog'+xidx, {className: "dialog", title: "Yahoo"+idx, top:(0+(cascade*cOffset)), left:(0+(cascade*cOffset)), width:300, height:200, zIndex:100, opacity:1, resizable: true, xurl:'http://www.yahoo.com'});
+ foo.getContent().innerHTML='stubbed:getAjax(ajaxArgs)';
+ foo.show();
+ foo.toFront();
+ cascade++;
+ idx++;
+ xidx++;
+ cWins.push(foo);
+}
+
+function closeAll() {
+ var x = 0;
+ var lag=250;
+ for(var i=(cWins.length-1); i>=0; i--) {
+ setTimeout('cWins['+i+'].hide()',(x*lag));
+ x++;
+ }
+ setTimeout('cWins.length=0; idx=0; cascade=0;',x*lag);
+}
+</script>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/inset.html b/js/prototype-window-1.3/samples/inset.html
new file mode 100755
index 0000000..6fd8003
--- /dev/null
+++ b/js/prototype-window-1.3/samples/inset.html
@@ -0,0 +1,11 @@
+
+<body>
+
+<input type="button" onclick="myFrame.showWin()" value="create()">
+
+<input type="button" onclick="myFrame.closeAll()" value="closeAll()">
+<br />
+<br />
+<br />
+<p>&nbsp;<iframe src="inframe.html" name="myFrame" style="width:600px ; height: 600px;"></iframe></p>
+</body>
diff --git a/js/prototype-window-1.3/samples/multi_modal.html b/js/prototype-window-1.3/samples/multi_modal.html
new file mode 100755
index 0000000..66d32dd
--- /dev/null
+++ b/js/prototype-window-1.3/samples/multi_modal.html
@@ -0,0 +1,84 @@
+<!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=iso-8859-1" />
+<title>Untitled Document</title>
+<script>
+ var cssPath ="../themes/"
+</script>
+<link href="../themes/default.css" rel="stylesheet" type="text/css" > </link>
+<link href="../themes/alphacube.css" rel="stylesheet" type="text/css" > </link>
+
+<script type="text/javascript" src="../javascripts/prototype.js"> </script>
+<script type="text/javascript" src="../javascripts/effects.js"> </script>
+<script type="text/javascript" src="../javascripts/window.js"> </script>
+<script type="text/javascript" src="../javascripts/window_effects.js"> </script>
+<script type="text/javascript" src="../javascripts/debug.js"> </script>
+
+<style>
+.alphacube_buttons input {
+ width:40%;
+ }
+
+</style>
+</head>
+
+<body>
+<a href="#" onclick="openDialog('content')"><span style="font-size:16px">Open a modal window</span></a><br/>
+<input type="checkbox" checked="checked" value="1" onchange="Window.keepMultiModalWindow = ! this.checked" >Hide modal window when on new one is open
+<div id="content" style="display:none">
+ <a href="#" onclick="openDialog('content2')"><span style="font-size:16px">Open another modal window</span></a>
+ Test select for IE <SELECT NAME="partnumber1">
+ <OPTION VALUE="1"> One
+ <OPTION VALUE="2"> Two
+ <OPTION VALUE="3"> Three
+ <OPTION VALUE="5"> Five
+ <OPTION VALUE="4"> Oooopppppppps I forgot four
+ </SELECT>
+</div>
+<div id="content2" style="display:none">
+ <br /><br />
+ <a href="#" onclick="lastDialog('content3')"><span style="font-size:16px">Open one more modal window</span></a>
+ <br /><br />
+ Test select for IE <SELECT NAME="partnumber2">
+ <OPTION VALUE="1"> One
+ <OPTION VALUE="2"> Two
+ <OPTION VALUE="3"> Three
+ <OPTION VALUE="5"> Five
+ <OPTION VALUE="4"> Oooopppppppps I forgot four
+ </SELECT>
+</div>
+<div id="content3" style="display:none">
+ <br /><br />
+ Last one
+ <br /><br />
+ Test select for IE <SELECT NAME="partnumber3">
+ <OPTION VALUE="1"> One
+ <OPTION VALUE="2"> Two
+ <OPTION VALUE="3"> Three
+ <OPTION VALUE="5"> Five
+ <OPTION VALUE="4"> Oooopppppppps I forgot four
+ </SELECT>
+</div>
+
+
+<script type="text/javascript">
+ var win = null;
+ var index = 1;
+ function openDialog(id) {
+ Dialog.alert($(id).innerHTML, {className: "alphacube", width:250, id: "d" + index})
+ index++;
+ }
+
+ function lastDialog(id) {
+ Dialog.confirm($(id).innerHTML, {className: "alphacube", width:250, okLabel: "Close All", ok: closeAllModalWindows})
+ }
+
+ function closeAllModalWindows() {
+ Windows.closeAllModalWindows();
+ return true;
+ }
+</script>
+
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/oldFirstSampleCode.html b/js/prototype-window-1.3/samples/oldFirstSampleCode.html
new file mode 100755
index 0000000..71ed0d0
--- /dev/null
+++ b/js/prototype-window-1.3/samples/oldFirstSampleCode.html
@@ -0,0 +1,198 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Test</title>
+
+ <style>
+
+ * {
+ margin: 0px;
+ padding: 0px;
+ }
+ body {
+ background:#DDD;
+ font-family: verdana, arial, sans-serif;
+ font-size:14px;
+ }
+ #container {
+ float:left;
+ margin-top:100px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ }
+ </style>
+
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/window_effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <link href="../themes/default.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/theme1.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/mac_os_x.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/alphacube.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/darkX.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/spread.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/alert.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/alert_lite.css" rel="stylesheet" type="text/css" > </link>
+ <title>Sample Windows</title>
+</head>
+<body>
+ <div class="dialog_n" id="tmp" style="display:none">toto</div>
+ The window with rubyonrails.org in it has a close callback to prevent closing. That's why you cannot close it. Check out the code to see how to do it.<br>
+ Open a <a href="javascript:openConfirmDialog()">confirm dialog</a>,
+ an <a href="javascript:openAlertDialog()">alert dialog</a>
+ or an <a href="javascript:openInfoDialog()">info dialog</a> (with alert_lite.css)
+ <br/>
+ <a href="javascript:openModalDialog()">Click here to open a modal window</a>
+ <br/>
+ <div id="select">
+ Test select for IE <SELECT NAME="partnumber">
+ <OPTION VALUE="1"> One
+ <OPTION VALUE="2"> Two
+ <OPTION VALUE="3"> Three
+ <OPTION VALUE="5"> Five
+ <OPTION VALUE="4"> Oooopppppppps I forgot four
+ </SELECT>
+ <br/>
+ </div>
+ <a href="javascript:openContentWindow()">Click here to open a window with the div below at the exact same size and position</a>
+ <br/>
+ <a href="javascript:Windows.closeAll()">Close all windows</a> (if it's possible)
+
+ <div style="clear:both"></div>
+ <div id="container">
+ <div style="float:left; width:150px"> &nbsp;</div> <!-- margin -->
+ <div id="test_content" style="float:left;width:100px; height:150px;background:#DFA; color:#000; font-size:12px;">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit
+ </div>
+ </div>
+<script>
+ var index= 0;
+ var contentWin = null;
+
+ // Debug window
+ showDebug();
+
+ // Window with scrollable text
+ win = new Window('dialog1', {className: "alphacube", width:300, height:400, zIndex: 100, resizable: true, title: "Not draggable!!", showEffect:Element.show, hideEffect: Effect.SwitchOff, draggable:false})
+ win.getContent().innerHTML= "<div style='padding:10px'> Lorem ipsum dolor sit amet, consectetur adipiscing elit, set eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incom dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda et tam. \
+ At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon. Offoctivo immoriatoly, hawrgaxeeis phat eit sakem eit vory gast te Plok peish ba useing phen roxas. Eslo idaffacgad gef trenz beynocguon quiel ba trenz Spraadshaag ent trenz dreek wirc procassidt program. Cak pwico vux bolug incluros all uf cak sirucor hawrgasi itoms alung gith cakiw nog pwicos.\
+ Lor sum amet, commy nulputat. Duipit lum ipisl eros dolortionsed tin hent aliquis illam volor in ea feum in ut adipsustrud elent ulluptat. Duisl ullan ex et am vulputem augiam doloreet amet enibh eui te dipit acillutat acilis amet, suscil er iuscilla con utat, quisis eu feugait ad dolore commy nullam iuscilisl iureril ilisl del ut pratuer iliquis acipissit accum quis nulluptat. Dui bla faccumsan velis auguero con henis duismolor sumsandrem quat vulluptat alit er iniamcore exeriure vero core te dit ut nulla feummolore commod dipis augiamcommod tem ese dolestrud do odo odiamco eetummy nis aliquamcommy nonse eu feugue del eugiamconsed ming estrud magnis exero eumsandio enisim del dio od tat.sumsan et pratum velit ing etue te consequis alis nullan et, quis am iusci bla feummy.</div>"
+ win.showCenter();
+
+ // Windows with an URL as content
+ win2 = new Window('dialog2', {title: "Ruby on Rails",
+ bottom:70, left:0, width:300, height:200,
+ resizable: true, url: "http://www.rubyonrails.com/", showEffectOptions: {duration:3}})
+ win2.show();
+ win2.setDestroyOnClose();
+
+ win3 = new Window('dialog3', {className: "spread", title: "Not Closable",
+ top:10, right:20, width:300, height:200,
+ closable: false, url: "http://www.google.com/", showEffectOptions: {duration:3}})
+ win3.show();
+
+ function openConfirmDialog() {
+ Dialog.confirm("Test of confirm panel, check out debug window after closing it<br>Test select for IE <SELECT NAME='partnumber'><OPTION VALUE='1'> One<OPTION VALUE='2'> Two<OPTION VALUE='3'> Three<OPTION VALUE='5'> Five<OPTION VALUE='4'> Oooopppppppps I forgot four</SELECT>",
+ {windowParameters: {width:300, height:100}, okLabel: "close",
+ cancel:function(win) {debug("cancel confirm panel")},
+ ok:function(win) {debug("validate confirm panel"); return true}
+ });
+ }
+
+ function openAlertDialog() {
+ Dialog.alert("Test of alert panel, check out debug window after closing it",
+ {windowParameters: {width:300, height:100}, okLabel: "close",
+ ok:function(win) {debug("validate alert panel"); return true}
+ });
+ }
+
+ var timeout;
+ function openInfoDialog() {
+ Dialog.info("Test of info panel, it will close <br>in 3s ...",
+ {windowParameters: {className: "alert_lite",width:250, height:100}, showProgress: true});
+ // timeout=3;
+ // setTimeout("infoTimeout()", 1000)
+ Dialog.closeInfo()
+
+ }
+
+ function infoTimeout() {
+ timeout--;
+ if (timeout >0) {
+ Dialog.setInfoMessage("Test of info panel, it will close <br>in " + timeout + "s ...")
+ setTimeout("infoTimeout()", 1000)
+ }
+ else
+ Dialog.closeInfo()
+ }
+
+ function openModalDialog() {
+ debug($('modal_window_content'))
+ var win = new Window('modal_window', {className: "dialog", title: "Ruby on Rails",top:100, left:100, width:300, height:200, zIndex:150, opacity:1, resizable: true})
+ //win.getContent().innerHTML = "Hi"
+ win.setContent("select")
+ win.setDestroyOnClose();
+ win.show(true);
+ }
+
+ function openContentWindow() {
+ if (contentWin != null) {
+ Dialog.alert("Close the window 'Test' before opening it again!", {windowParameters:{ width:200, height:130}});
+ }
+ else {
+ contentWin = new Window('content_win', {className: "darkX", resizable: false, hideEffect:Element.hide, showEffect:Element.show})
+ contentWin.setContent('test_content', true, true)
+ contentWin.toFront();
+ contentWin.setDestroyOnClose();
+ contentWin.show();
+ }
+ }
+
+ // Sample code to see how to implement a closeCallback
+ function canClose(win) {
+ debug("You cannot close " + win.getId());
+ // return false, the window cannot be closed
+ return false;
+ }
+
+ // Set up a deleagte for win2 (the one with rubyonrails.org in it)
+ win2.setCloseCallback(canClose);
+ date=new Date();
+ date.setMonth(date.getMonth()+3);
+ win2.setCookie("test", date);
+
+ // Set up a windows observer, check ou debug window to get messages
+ var myObserver = {
+ onStartMove: function(eventName, win) {
+ debug(eventName + " on " + win.getId())
+ },
+ onEndMove: function(eventName, win) {
+ debug(eventName + " on " + win.getId())
+ },
+ onStartResize: function(eventName, win) {
+ debug(eventName + " on " + win.getId())
+ },
+ onEndResize: function(eventName, win) {
+ debug(eventName + " on " + win.getId())
+ },
+ onClose: function(eventName, win) {
+ debug(eventName + " on " + win.getId())
+ },
+ onDestroy: function(eventName, win) {
+ if (win == contentWin) {
+ $('container').appendChild($('test_content'));
+ contentWin = null;
+ }
+
+ debug(eventName + " on " + win.getId())
+ }
+ }
+ Windows.addObserver(myObserver);
+</script>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/openInside.html b/js/prototype-window-1.3/samples/openInside.html
new file mode 100755
index 0000000..52ffc86
--- /dev/null
+++ b/js/prototype-window-1.3/samples/openInside.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Test</title>
+
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+
+ <link href="../themes/default.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../themes/alphacube.css" rel="stylesheet" type="text/css" > </link>
+ <title>Test</title>
+ <style>
+ #master_content {
+ position:relative;
+ overflow:hidden;
+ }
+ a {
+ color:#333;
+ font-size: 16px;
+ }
+ </style>
+
+</head>
+<body>
+ <div id="content" style="display:none">
+ <a href="#" onclick="insideWindow()">open a window inside this window</a><br/></br/>
+ <a href="#" onclick="outsideWindow()">open a window outside this window</a>
+ </div>
+
+ <script>
+ function openPopup(){
+ var master = new Window("master", {className: "alphacube", width:350, height:400,title:"Master Window"});
+ master.setContent("content");
+ master.setDestroyOnClose();
+ master.showCenter();
+ }
+
+ function insideWindow() {
+ var win = new Window("win1", {className: "alphacube", top:40, left:0, width:200, height:100,title:"Inside Window",
+ maximizable: false, minimizable: false, parent: Windows.getWindow("master").getContent()});
+ win.setDestroyOnClose();
+ win.show();
+ }
+
+ function outsideWindow() {
+ var win = new Window("win2", {className: "alphacube", top:40, left:0, width:200, height:100, title:"Outside Window",
+ maximizable: false, minimizable: false});
+ win.setDestroyOnClose();
+ win.show();
+ }
+
+ openPopup();
+
+ </script>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/parent.html b/js/prototype-window-1.3/samples/parent.html
new file mode 100755
index 0000000..2f8b0ea
--- /dev/null
+++ b/js/prototype-window-1.3/samples/parent.html
@@ -0,0 +1,37 @@
+<html>
+ <head>
+ <link href="../themes/default.css" rel="stylesheet" type="text/css" />
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"></script>
+ <script type="text/javascript">
+ function init() {
+ var win = new Window('Works', {top:100, left:100, zIndex:150, resizable: true, title: "Body as parent"})
+ win.setContent("f");
+ win.show();
+
+ var win2 = new Window('Does Not Work', {top:100, left:400, zIndex:150, resizable:true, parent:$('f2'), title: "Specific element as parent"});
+ win2.setContent("d2");
+ win2.show();
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <form id="f" name="f" action="http://prototype.conio.net/">
+ <div id="d">
+ The form works because it is inside the window content<br />
+ <input type="text" name="key" value="value" />
+ <input type="submit" value="Submit" />
+ </div>
+ </form>
+
+ <form id="f2" name="f2" action="http://blogus.xilinus.com/pages/javawin">
+ <div id="d2">
+ The form also work even if it's not inside the window content but the parent's window is the form itself<br />
+ <input type="text" name="key" value="value" />
+ <input type="submit" value="Submit" />
+ </div>
+ </form>
+ </body>
+</html>
+
+
diff --git a/js/prototype-window-1.3/samples/popup_open.html b/js/prototype-window-1.3/samples/popup_open.html
new file mode 100755
index 0000000..d643251
--- /dev/null
+++ b/js/prototype-window-1.3/samples/popup_open.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/window_effects.js"> </script>
+ <script type="text/javascript" src="../javascripts/debug.js"> </script>
+ <link href="../themes/default.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/alert.css" rel="stylesheet" type="text/css"/>
+ <link href="../themes/alphacube.css" rel="stylesheet" type="text/css"/>
+
+ <title>nice_open</title>
+
+ <style type="text/css">
+ .popup_effect1 {
+ background:#11455A;
+ opacity: 0.2;
+ }
+ .popup_effect2 {
+ background:#FF0041;
+ border: 3px dashed #000;
+ }
+
+ </style>
+</head>
+
+<body>
+
+<input type=button onclick="openDialog2(this)" value="open"/> a window with <tt>className: "popup_effect1"</tt> <br/> <br/>
+<a href="#" onclick="openDialog1(this)">Open a window</a> with: <tt>className: "popup_effect2", duration: 2, fromOpacity: 0.2, toOpacity: 0.4</tt> <br/><br/>
+<input type=button onclick="openDialog3(this)" value="Modal window"/> It works also with moodal window<br/>
+
+<script type="text/javascript">
+ function openDialog1(html) {
+ var effect = new PopupEffect(html, {className: "popup_effect2", duration: 2, fromOpacity: 0.2, toOpacity: 0.4});
+ var win = new Window({className:"alphacube", width: 200, height:null, showEffect:effect.show.bind(effect), hideEffect:effect.hide.bind(effect)})
+ win.getContent().update("<h1>Hello</h1>Word");
+
+ win.showCenter();
+ }
+
+ function openDialog2(html) {
+ var effect = new PopupEffect(html, {className: "popup_effect1"});
+ var win = new Window({className:"alphacube", width: 200, height:null, showEffect:effect.show.bind(effect), hideEffect:effect.hide.bind(effect)})
+ win.getContent().update("<h1>Hello</h1>Word");
+
+ win.show();
+ }
+
+ function openDialog3(html) {
+ var effect = new PopupEffect(html, {className: "popup_effect1"});
+ Dialog.confirm("Do you like this effect?",{className:"alphacube", width: 400, height:null, showEffect:effect.show.bind(effect), hideEffect:effect.hide.bind(effect)})
+ }
+
+</script>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/rico/index.html b/js/prototype-window-1.3/samples/rico/index.html
new file mode 100755
index 0000000..7966955
--- /dev/null
+++ b/js/prototype-window-1.3/samples/rico/index.html
@@ -0,0 +1,73 @@
+<!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=iso-8859-1" />
+<title>Untitled Document</title>
+<SCRIPT type="text/javascript" LANGUAGE="JavaScript" src="../../javascripts/prototype.js"> </SCRIPT>
+<SCRIPT type="text/javascript" LANGUAGE="JavaScript" src="../../javascripts/window.js"> </SCRIPT>
+<SCRIPT type="text/javascript" LANGUAGE="JavaScript" src="rico_change.js"> </SCRIPT>
+<LINK href="../../themes/default.css" rel="stylesheet" type="text/css" />
+<LINK rel="stylesheet" type="text/css" href="rico.css" />
+
+<script language="JavaScript" type="text/javascript">
+//dump multi dimensional array to page
+function dumpArray(trialArray) {
+
+ var win = new Window('window_id', {className: "dialog", title: "dumpArray",top:100, left:100, width:400, height:575, zIndex:150, opacity:1, resizable: false, minimizable: true, maximizable: false});
+
+ win.getContent().innerHTML = accordian();
+ win.setDestroyOnClose();
+ win.showCenter();
+ win.toFront();
+
+ var myAccordion2 = new Rico.Accordion( $('accordionDiv'), {panelHeight:300} );
+
+}
+function accordian(){
+ var htmlString = '';
+ htmlString += '<div id="accordionDiv">';
+ htmlString += '<div id="help2Panel">';
+ htmlString += '<div id="help2Header" class="accordionTabTitleBar">';
+ htmlString += 'Help +';
+ htmlString += '</div>';
+ htmlString += '<div id="helpContent2" class="accordionTabContentBox">';
+ htmlString += 'Click on the blue title bars below to view ';
+ htmlString += 'additional content';
+ htmlString += '</div>';
+ htmlString += '</div>';
+ htmlString += '<div id="addcomment2Panel">';
+ htmlString += '<div id="addcomment2Header" class="accordionTabTitleBar">';
+ htmlString += 'Add Comment Form';
+ htmlString += '</div>';
+ htmlString += '<div id="addcomment2Content" class="accordionTabContentBox">';
+ htmlString += 'Use the Add a comment tool to add ';
+ htmlString += 'a comment';
+ htmlString += '</div>';
+ htmlString += '</div> ';
+ htmlString += '<div id="disclaimer2Panel">';
+ htmlString += '<div id="disclaimer2Header" class="accordionTabTitleBar">';
+ htmlString += 'Disclaimer-NOTICE-';
+ htmlString += '</div>';
+ htmlString += '<div id="disclaimer2Content" class="accordionTabContentBox">';
+ htmlString += '-NOTICE-<BR/>';
+ htmlString += 'DRAFT preliminary floodplain data is being provided solely for community review and';
+ htmlString += ' comment and is not to be used for flood insurance determination purposes of any kind. ';
+ htmlString += ' This data is currently being modified as a result of comments received by community ';
+ htmlString += ' officials and other mapping partners in Wayne County and may change substantially without ';
+ htmlString += ' notice before the Preliminary maps are published.';
+ htmlString += '</div>';
+ htmlString += '</div>';
+ htmlString += '</div>';
+
+return htmlString;
+
+}
+</script>
+
+
+</head>
+
+<body>
+<img src="properties_1.gif" width="160" height="160" onclick="javascript:dumpArray();"/>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/rico/properties_1.gif b/js/prototype-window-1.3/samples/rico/properties_1.gif
new file mode 100755
index 0000000..ef7bad6
--- /dev/null
+++ b/js/prototype-window-1.3/samples/rico/properties_1.gif
Binary files differ
diff --git a/js/prototype-window-1.3/samples/rico/rico.css b/js/prototype-window-1.3/samples/rico/rico.css
new file mode 100755
index 0000000..adfc072
--- /dev/null
+++ b/js/prototype-window-1.3/samples/rico/rico.css
@@ -0,0 +1,30 @@
+.accordionTabTitleBar {
+ font-size : 12px;
+ padding : 4px 6px 4px 6px;
+ border-style : solid none solid none;
+ border-top-color : #BDC7E7;
+ border-bottom-color : #182052;
+ border-width : 1px 0px 1px 0px;
+}
+
+.accordionTabTitleBarHover {
+ font-size : 11px;
+ background-color : #1f669b;
+ color : #000000;
+}
+
+.accordionTabContentBox {
+ font-size : 12px;
+ border : 1px solid #1f669b;
+ border-top-width : 0px;
+ padding : 0px 8px 0px 8px;
+}
+.instructions {
+ font-family: Arial, Helvetica, sans-serif;
+}
+.step {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ list-style-position: inside;
+ list-style-type: disc;
+}
diff --git a/js/prototype-window-1.3/samples/rico/rico_change.js b/js/prototype-window-1.3/samples/rico/rico_change.js
new file mode 100755
index 0000000..78504d0
--- /dev/null
+++ b/js/prototype-window-1.3/samples/rico/rico_change.js
@@ -0,0 +1,2818 @@
+/**
+ *
+ * Copyright 2005 Sabre Airline Solutions
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
+ * file except in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ **/
+
+
+//-------------------- rico.js
+var Rico = {
+ Version: '1.1.2',
+ prototypeVersion: parseFloat(Prototype.Version.split(".")[0] + "." + Prototype.Version.split(".")[1])
+}
+
+if((typeof Prototype=='undefined') || Rico.prototypeVersion < 1.3)
+ throw("Rico requires the Prototype JavaScript framework >= 1.3");
+
+Rico.ArrayExtensions = new Array();
+
+if (Object.prototype.extend) {
+ Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Object.prototype.extend;
+}else{
+ Object.prototype.extend = function(object) {
+ return Object.extend.apply(this, [this, object]);
+ }
+ Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Object.prototype.extend;
+}
+
+if (Array.prototype.push) {
+ Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.push;
+}
+
+if (!Array.prototype.remove) {
+ Array.prototype.remove = function(dx) {
+ if( isNaN(dx) || dx > this.length )
+ return false;
+ for( var i=0,n=0; i<this.length; i++ )
+ if( i != dx )
+ this[n++]=this[i];
+ this.length-=1;
+ };
+ Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.remove;
+}
+
+if (!Array.prototype.removeItem) {
+ Array.prototype.removeItem = function(item) {
+ for ( var i = 0 ; i < this.length ; i++ )
+ if ( this[i] == item ) {
+ this.remove(i);
+ break;
+ }
+ };
+ Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.removeItem;
+}
+
+if (!Array.prototype.indices) {
+ Array.prototype.indices = function() {
+ var indexArray = new Array();
+ for ( index in this ) {
+ var ignoreThis = false;
+ for ( var i = 0 ; i < Rico.ArrayExtensions.length ; i++ ) {
+ if ( this[index] == Rico.ArrayExtensions[i] ) {
+ ignoreThis = true;
+ break;
+ }
+ }
+ if ( !ignoreThis )
+ indexArray[ indexArray.length ] = index;
+ }
+ return indexArray;
+ }
+ Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Array.prototype.indices;
+}
+
+// Create the loadXML method and xml getter for Mozilla
+if ( window.DOMParser &&
+ window.XMLSerializer &&
+ window.Node && Node.prototype && Node.prototype.__defineGetter__ ) {
+
+ if (!Document.prototype.loadXML) {
+ Document.prototype.loadXML = function (s) {
+ var doc2 = (new DOMParser()).parseFromString(s, "text/xml");
+ while (this.hasChildNodes())
+ this.removeChild(this.lastChild);
+
+ for (var i = 0; i < doc2.childNodes.length; i++) {
+ this.appendChild(this.importNode(doc2.childNodes[i], true));
+ }
+ };
+ }
+
+ Document.prototype.__defineGetter__( "xml",
+ function () {
+ return (new XMLSerializer()).serializeToString(this);
+ }
+ );
+}
+
+document.getElementsByTagAndClassName = function(tagName, className) {
+ if ( tagName == null )
+ tagName = '*';
+
+ var children = document.getElementsByTagName(tagName) || document.all;
+ var elements = new Array();
+
+ if ( className == null )
+ return children;
+
+ for (var i = 0; i < children.length; i++) {
+ var child = children[i];
+ var classNames = child.className.split(' ');
+ for (var j = 0; j < classNames.length; j++) {
+ if (classNames[j] == className) {
+ elements.push(child);
+ break;
+ }
+ }
+ }
+
+ return elements;
+}
+
+
+//-------------------- ricoAccordion.js
+Rico.Accordion = Class.create();
+
+Rico.Accordion.prototype = {
+
+ initialize: function(container, options) {
+ this.container = $(container);
+ this.lastExpandedTab = null;
+ this.accordionTabs = new Array();
+ this.setOptions(options);
+ this._attachBehaviors();
+ if(!container) return;
+
+ this.container.style.borderBottom = '1px solid ' + this.options.borderColor;
+ // validate onloadShowTab
+ if (this.options.onLoadShowTab >= this.accordionTabs.length)
+ this.options.onLoadShowTab = 0;
+
+ // set the initial visual state...
+ for ( var i=0 ; i < this.accordionTabs.length ; i++ )
+ {
+ if (i != this.options.onLoadShowTab){
+ this.accordionTabs[i].collapse();
+ this.accordionTabs[i].content.style.display = 'none';
+ }
+ }
+ this.lastExpandedTab = this.accordionTabs[this.options.onLoadShowTab];
+ if (this.options.panelHeight == 'auto'){
+ var tabToCheck = (this.options.onloadShowTab === 0)? 1 : 0;
+ var titleBarSize = parseInt(RicoUtil.getElementsComputedStyle(this.accordionTabs[tabToCheck].titleBar, 'height'));
+ if (isNaN(titleBarSize))
+ titleBarSize = this.accordionTabs[tabToCheck].titleBar.offsetHeight;
+
+ var totalTitleBarSize = this.accordionTabs.length * titleBarSize;
+ var parentHeight = parseInt(RicoUtil.getElementsComputedStyle(this.container.parentNode, 'height'));
+ if (isNaN(parentHeight))
+ parentHeight = this.container.parentNode.offsetHeight;
+
+ this.options.panelHeight = parentHeight - totalTitleBarSize-2;
+ }
+
+ this.lastExpandedTab.content.style.height = this.options.panelHeight + "px";
+ this.lastExpandedTab.showExpanded();
+ this.lastExpandedTab.titleBar.style.fontWeight = this.options.expandedFontWeight;
+
+ },
+
+ setOptions: function(options) {
+ this.options = {
+ expandedBg : '#545985',
+ hoverBg : '#63699c',
+ collapsedBg : '#6b79a5',
+ expandedTextColor : '#ffffff',
+ expandedFontWeight : 'bold',
+ hoverTextColor : '#ffffff',
+ collapsedTextColor : '#ced7ef',
+ collapsedFontWeight : 'normal',
+ hoverTextColor : '#ffffff',
+ borderColor : '#ffffff',
+ panelHeight : 200,
+ onHideTab : null,
+ onShowTab : null,
+ onLoadShowTab : 0
+ }
+ Object.extend(this.options, options || {});
+ },
+
+ showTabByIndex: function( anIndex, animate ) {
+ var doAnimate = arguments.length == 1 ? true : animate;
+ this.showTab( this.accordionTabs[anIndex], doAnimate );
+ },
+
+ showTab: function( accordionTab, animate ) {
+ if ( this.lastExpandedTab == accordionTab )
+ return;
+
+ var doAnimate = arguments.length == 1 ? true : animate;
+
+ if ( this.options.onHideTab )
+ this.options.onHideTab(this.lastExpandedTab);
+
+ this.lastExpandedTab.showCollapsed();
+ var accordion = this;
+ var lastExpandedTab = this.lastExpandedTab;
+
+ this.lastExpandedTab.content.style.height = (this.options.panelHeight - 1) + 'px';
+ accordionTab.content.style.display = '';
+
+ accordionTab.titleBar.style.fontWeight = this.options.expandedFontWeight;
+
+ if ( doAnimate ) {
+ new Rico.Effect.AccordionSize( this.lastExpandedTab.content,
+ accordionTab.content,
+ 1,
+ this.options.panelHeight,
+ 100, 10,
+ { complete: function() {accordion.showTabDone(lastExpandedTab)} } );
+ this.lastExpandedTab = accordionTab;
+ }
+ else {
+ this.lastExpandedTab.content.style.height = "1px";
+ accordionTab.content.style.height = this.options.panelHeight + "px";
+ this.lastExpandedTab = accordionTab;
+ this.showTabDone(lastExpandedTab);
+ }
+ },
+
+ showTabDone: function(collapsedTab) {
+ collapsedTab.content.style.display = 'none';
+ this.lastExpandedTab.showExpanded();
+ if ( this.options.onShowTab )
+ this.options.onShowTab(this.lastExpandedTab);
+ },
+
+ _attachBehaviors: function() {
+ var panels = this._getDirectChildrenByTag(this.container, 'DIV');
+ for ( var i = 0 ; i < panels.length ; i++ ) {
+
+ var tabChildren = this._getDirectChildrenByTag(panels[i],'DIV');
+ if ( tabChildren.length != 2 )
+ continue; // unexpected
+
+ var tabTitleBar = tabChildren[0];
+ var tabContentBox = tabChildren[1];
+ this.accordionTabs.push( new Rico.Accordion.Tab(this,tabTitleBar,tabContentBox) );
+ }
+ },
+
+ _getDirectChildrenByTag: function(e, tagName) {
+ var kids = new Array();
+ var allKids = e.childNodes;
+ for( var i = 0 ; i < allKids.length ; i++ )
+ if ( allKids[i] && allKids[i].tagName && allKids[i].tagName == tagName )
+ kids.push(allKids[i]);
+ return kids;
+ }
+
+};
+
+Rico.Accordion.Tab = Class.create();
+
+Rico.Accordion.Tab.prototype = {
+
+ initialize: function(accordion, titleBar, content) {
+ this.accordion = accordion;
+ this.titleBar = titleBar;
+ this.content = content;
+ this._attachBehaviors();
+ },
+
+ collapse: function() {
+ this.showCollapsed();
+ this.content.style.height = "1px";
+ },
+
+ showCollapsed: function() {
+ this.expanded = false;
+ this.titleBar.style.backgroundColor = this.accordion.options.collapsedBg;
+ this.titleBar.style.color = this.accordion.options.collapsedTextColor;
+ this.titleBar.style.fontWeight = this.accordion.options.collapsedFontWeight;
+ this.content.style.overflow = "hidden";
+ },
+
+ showExpanded: function() {
+ this.expanded = true;
+ this.titleBar.style.backgroundColor = this.accordion.options.expandedBg;
+ this.titleBar.style.color = this.accordion.options.expandedTextColor;
+ this.content.style.overflow = "auto";
+ },
+
+ titleBarClicked: function(e) {
+ if ( this.accordion.lastExpandedTab == this )
+ return;
+ this.accordion.showTab(this);
+ },
+
+ hover: function(e) {
+ this.titleBar.style.backgroundColor = this.accordion.options.hoverBg;
+ this.titleBar.style.color = this.accordion.options.hoverTextColor;
+ },
+
+ unhover: function(e) {
+ if ( this.expanded ) {
+ this.titleBar.style.backgroundColor = this.accordion.options.expandedBg;
+ this.titleBar.style.color = this.accordion.options.expandedTextColor;
+ }
+ else {
+ this.titleBar.style.backgroundColor = this.accordion.options.collapsedBg;
+ this.titleBar.style.color = this.accordion.options.collapsedTextColor;
+ }
+ },
+
+ _attachBehaviors: function() {
+ this.content.style.border = "1px solid " + this.accordion.options.borderColor;
+ this.content.style.borderTopWidth = "0px";
+ this.content.style.borderBottomWidth = "0px";
+ this.content.style.margin = "0px";
+
+ this.titleBar.onclick = this.titleBarClicked.bindAsEventListener(this);
+ this.titleBar.onmouseover = this.hover.bindAsEventListener(this);
+ this.titleBar.onmouseout = this.unhover.bindAsEventListener(this);
+ }
+
+};
+
+
+//-------------------- ricoAjaxEngine.js
+Rico.AjaxEngine = Class.create();
+
+Rico.AjaxEngine.prototype = {
+
+ initialize: function() {
+ this.ajaxElements = new Array();
+ this.ajaxObjects = new Array();
+ this.requestURLS = new Array();
+ this.options = {};
+ },
+
+ registerAjaxElement: function( anId, anElement ) {
+ if ( !anElement )
+ anElement = $(anId);
+ this.ajaxElements[anId] = anElement;
+ },
+
+ registerAjaxObject: function( anId, anObject ) {
+ this.ajaxObjects[anId] = anObject;
+ },
+
+ registerRequest: function (requestLogicalName, requestURL) {
+ this.requestURLS[requestLogicalName] = requestURL;
+ },
+
+ sendRequest: function(requestName, options) {
+ // Allow for backwards Compatibility
+ if ( arguments.length >= 2 )
+ if (typeof arguments[1] == 'string')
+ options = {parameters: this._createQueryString(arguments, 1)};
+ this.sendRequestWithData(requestName, null, options);
+ },
+
+ sendRequestWithData: function(requestName, xmlDocument, options) {
+ var requestURL = this.requestURLS[requestName];
+ if ( requestURL == null )
+ return;
+
+ // Allow for backwards Compatibility
+ if ( arguments.length >= 3 )
+ if (typeof arguments[2] == 'string')
+ options.parameters = this._createQueryString(arguments, 2);
+
+ new Ajax.Request(requestURL, this._requestOptions(options,xmlDocument));
+ },
+
+ sendRequestAndUpdate: function(requestName,container,options) {
+ // Allow for backwards Compatibility
+ if ( arguments.length >= 3 )
+ if (typeof arguments[2] == 'string')
+ options.parameters = this._createQueryString(arguments, 2);
+
+ this.sendRequestWithDataAndUpdate(requestName, null, container, options);
+ },
+
+ sendRequestWithDataAndUpdate: function(requestName,xmlDocument,container,options) {
+ var requestURL = this.requestURLS[requestName];
+ if ( requestURL == null )
+ return;
+
+ // Allow for backwards Compatibility
+ if ( arguments.length >= 4 )
+ if (typeof arguments[3] == 'string')
+ options.parameters = this._createQueryString(arguments, 3);
+
+ var updaterOptions = this._requestOptions(options,xmlDocument);
+
+ new Ajax.Updater(container, requestURL, updaterOptions);
+ },
+
+ // Private -- not part of intended engine API --------------------------------------------------------------------
+
+ _requestOptions: function(options,xmlDoc) {
+ var requestHeaders = ['X-Rico-Version', Rico.Version ];
+ var sendMethod = 'post';
+ if ( xmlDoc == null )
+ if (Rico.prototypeVersion < 1.4)
+ requestHeaders.push( 'Content-type', 'text/xml' );
+ else
+ sendMethod = 'get';
+ (!options) ? options = {} : '';
+
+ if (!options._RicoOptionsProcessed){
+ // Check and keep any user onComplete functions
+ if (options.onComplete)
+ options.onRicoComplete = options.onComplete;
+ // Fix onComplete
+ if (options.overrideOnComplete)
+ options.onComplete = options.overrideOnComplete;
+ else
+ options.onComplete = this._onRequestComplete.bind(this);
+ options._RicoOptionsProcessed = true;
+ }
+
+ // Set the default options and extend with any user options
+ this.options = {
+ requestHeaders: requestHeaders,
+ parameters: options.parameters,
+ postBody: xmlDoc,
+ method: sendMethod,
+ onComplete: options.onComplete
+ };
+ // Set any user options:
+ Object.extend(this.options, options);
+ return this.options;
+ },
+
+ _createQueryString: function( theArgs, offset ) {
+ var queryString = ""
+ for ( var i = offset ; i < theArgs.length ; i++ ) {
+ if ( i != offset )
+ queryString += "&";
+
+ var anArg = theArgs[i];
+
+ if ( anArg.name != undefined && anArg.value != undefined ) {
+ queryString += anArg.name + "=" + escape(anArg.value);
+ }
+ else {
+ var ePos = anArg.indexOf('=');
+ var argName = anArg.substring( 0, ePos );
+ var argValue = anArg.substring( ePos + 1 );
+ queryString += argName + "=" + escape(argValue);
+ }
+ }
+ return queryString;
+ },
+
+ _onRequestComplete : function(request) {
+ if(!request)
+ return;
+ // User can set an onFailure option - which will be called by prototype
+ if (request.status != 200)
+ return;
+
+ var response = request.responseXML.getElementsByTagName("ajax-response");
+ if (response == null || response.length != 1)
+ return;
+ this._processAjaxResponse( response[0].childNodes );
+
+ // Check if user has set a onComplete function
+ var onRicoComplete = this.options.onRicoComplete;
+ if (onRicoComplete != null)
+ onRicoComplete();
+ },
+
+ _processAjaxResponse: function( xmlResponseElements ) {
+ for ( var i = 0 ; i < xmlResponseElements.length ; i++ ) {
+ var responseElement = xmlResponseElements[i];
+
+ // only process nodes of type element.....
+ if ( responseElement.nodeType != 1 )
+ continue;
+
+ var responseType = responseElement.getAttribute("type");
+ var responseId = responseElement.getAttribute("id");
+
+ if ( responseType == "object" )
+ this._processAjaxObjectUpdate( this.ajaxObjects[ responseId ], responseElement );
+ else if ( responseType == "element" )
+ this._processAjaxElementUpdate( this.ajaxElements[ responseId ], responseElement );
+ else
+ alert('unrecognized AjaxResponse type : ' + responseType );
+ }
+ },
+
+ _processAjaxObjectUpdate: function( ajaxObject, responseElement ) {
+ ajaxObject.ajaxUpdate( responseElement );
+ },
+
+ _processAjaxElementUpdate: function( ajaxElement, responseElement ) {
+ ajaxElement.innerHTML = RicoUtil.getContentAsString(responseElement);
+ }
+
+}
+
+var ajaxEngine = new Rico.AjaxEngine();
+
+
+//-------------------- ricoColor.js
+Rico.Color = Class.create();
+
+Rico.Color.prototype = {
+
+ initialize: function(red, green, blue) {
+ this.rgb = { r: red, g : green, b : blue };
+ },
+
+ setRed: function(r) {
+ this.rgb.r = r;
+ },
+
+ setGreen: function(g) {
+ this.rgb.g = g;
+ },
+
+ setBlue: function(b) {
+ this.rgb.b = b;
+ },
+
+ setHue: function(h) {
+
+ // get an HSB model, and set the new hue...
+ var hsb = this.asHSB();
+ hsb.h = h;
+
+ // convert back to RGB...
+ this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
+ },
+
+ setSaturation: function(s) {
+ // get an HSB model, and set the new hue...
+ var hsb = this.asHSB();
+ hsb.s = s;
+
+ // convert back to RGB and set values...
+ this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
+ },
+
+ setBrightness: function(b) {
+ // get an HSB model, and set the new hue...
+ var hsb = this.asHSB();
+ hsb.b = b;
+
+ // convert back to RGB and set values...
+ this.rgb = Rico.Color.HSBtoRGB( hsb.h, hsb.s, hsb.b );
+ },
+
+ darken: function(percent) {
+ var hsb = this.asHSB();
+ this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.max(hsb.b - percent,0));
+ },
+
+ brighten: function(percent) {
+ var hsb = this.asHSB();
+ this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.min(hsb.b + percent,1));
+ },
+
+ blend: function(other) {
+ this.rgb.r = Math.floor((this.rgb.r + other.rgb.r)/2);
+ this.rgb.g = Math.floor((this.rgb.g + other.rgb.g)/2);
+ this.rgb.b = Math.floor((this.rgb.b + other.rgb.b)/2);
+ },
+
+ isBright: function() {
+ var hsb = this.asHSB();
+ return this.asHSB().b > 0.5;
+ },
+
+ isDark: function() {
+ return ! this.isBright();
+ },
+
+ asRGB: function() {
+ return "rgb(" + this.rgb.r + "," + this.rgb.g + "," + this.rgb.b + ")";
+ },
+
+ asHex: function() {
+ return "#" + this.rgb.r.toColorPart() + this.rgb.g.toColorPart() + this.rgb.b.toColorPart();
+ },
+
+ asHSB: function() {
+ return Rico.Color.RGBtoHSB(this.rgb.r, this.rgb.g, this.rgb.b);
+ },
+
+ toString: function() {
+ return this.asHex();
+ }
+
+};
+
+Rico.Color.createFromHex = function(hexCode) {
+ if(hexCode.length==4) {
+ var shortHexCode = hexCode;
+ var hexCode = '#';
+ for(var i=1;i<4;i++) hexCode += (shortHexCode.charAt(i) +
+shortHexCode.charAt(i));
+ }
+ if ( hexCode.indexOf('#') == 0 )
+ hexCode = hexCode.substring(1);
+ var red = hexCode.substring(0,2);
+ var green = hexCode.substring(2,4);
+ var blue = hexCode.substring(4,6);
+ return new Rico.Color( parseInt(red,16), parseInt(green,16), parseInt(blue,16) );
+}
+
+/**
+ * Factory method for creating a color from the background of
+ * an HTML element.
+ */
+Rico.Color.createColorFromBackground = function(elem) {
+
+ var actualColor = RicoUtil.getElementsComputedStyle($(elem), "backgroundColor", "background-color");
+
+ if ( actualColor == "transparent" && elem.parentNode )
+ return Rico.Color.createColorFromBackground(elem.parentNode);
+
+ if ( actualColor == null )
+ return new Rico.Color(255,255,255);
+
+ if ( actualColor.indexOf("rgb(") == 0 ) {
+ var colors = actualColor.substring(4, actualColor.length - 1 );
+ var colorArray = colors.split(",");
+ return new Rico.Color( parseInt( colorArray[0] ),
+ parseInt( colorArray[1] ),
+ parseInt( colorArray[2] ) );
+
+ }
+ else if ( actualColor.indexOf("#") == 0 ) {
+ return Rico.Color.createFromHex(actualColor);
+ }
+ else
+ return new Rico.Color(255,255,255);
+}
+
+Rico.Color.HSBtoRGB = function(hue, saturation, brightness) {
+
+ var red = 0;
+ var green = 0;
+ var blue = 0;
+
+ if (saturation == 0) {
+ red = parseInt(brightness * 255.0 + 0.5);
+ green = red;
+ blue = red;
+ }
+ else {
+ var h = (hue - Math.floor(hue)) * 6.0;
+ var f = h - Math.floor(h);
+ var p = brightness * (1.0 - saturation);
+ var q = brightness * (1.0 - saturation * f);
+ var t = brightness * (1.0 - (saturation * (1.0 - f)));
+
+ switch (parseInt(h)) {
+ case 0:
+ red = (brightness * 255.0 + 0.5);
+ green = (t * 255.0 + 0.5);
+ blue = (p * 255.0 + 0.5);
+ break;
+ case 1:
+ red = (q * 255.0 + 0.5);
+ green = (brightness * 255.0 + 0.5);
+ blue = (p * 255.0 + 0.5);
+ break;
+ case 2:
+ red = (p * 255.0 + 0.5);
+ green = (brightness * 255.0 + 0.5);
+ blue = (t * 255.0 + 0.5);
+ break;
+ case 3:
+ red = (p * 255.0 + 0.5);
+ green = (q * 255.0 + 0.5);
+ blue = (brightness * 255.0 + 0.5);
+ break;
+ case 4:
+ red = (t * 255.0 + 0.5);
+ green = (p * 255.0 + 0.5);
+ blue = (brightness * 255.0 + 0.5);
+ break;
+ case 5:
+ red = (brightness * 255.0 + 0.5);
+ green = (p * 255.0 + 0.5);
+ blue = (q * 255.0 + 0.5);
+ break;
+ }
+ }
+
+ return { r : parseInt(red), g : parseInt(green) , b : parseInt(blue) };
+}
+
+Rico.Color.RGBtoHSB = function(r, g, b) {
+
+ var hue;
+ var saturation;
+ var brightness;
+
+ var cmax = (r > g) ? r : g;
+ if (b > cmax)
+ cmax = b;
+
+ var cmin = (r < g) ? r : g;
+ if (b < cmin)
+ cmin = b;
+
+ brightness = cmax / 255.0;
+ if (cmax != 0)
+ saturation = (cmax - cmin)/cmax;
+ else
+ saturation = 0;
+
+ if (saturation == 0)
+ hue = 0;
+ else {
+ var redc = (cmax - r)/(cmax - cmin);
+ var greenc = (cmax - g)/(cmax - cmin);
+ var bluec = (cmax - b)/(cmax - cmin);
+
+ if (r == cmax)
+ hue = bluec - greenc;
+ else if (g == cmax)
+ hue = 2.0 + redc - bluec;
+ else
+ hue = 4.0 + greenc - redc;
+
+ hue = hue / 6.0;
+ if (hue < 0)
+ hue = hue + 1.0;
+ }
+
+ return { h : hue, s : saturation, b : brightness };
+}
+
+
+//-------------------- ricoCorner.js
+Rico.Corner = {
+
+ round: function(e, options) {
+ var e = $(e);
+ this._setOptions(options);
+
+ var color = this.options.color;
+ if ( this.options.color == "fromElement" )
+ color = this._background(e);
+
+ var bgColor = this.options.bgColor;
+ if ( this.options.bgColor == "fromParent" )
+ bgColor = this._background(e.offsetParent);
+
+ this._roundCornersImpl(e, color, bgColor);
+ },
+
+ _roundCornersImpl: function(e, color, bgColor) {
+ if(this.options.border)
+ this._renderBorder(e,bgColor);
+ if(this._isTopRounded())
+ this._roundTopCorners(e,color,bgColor);
+ if(this._isBottomRounded())
+ this._roundBottomCorners(e,color,bgColor);
+ },
+
+ _renderBorder: function(el,bgColor) {
+ var borderValue = "1px solid " + this._borderColor(bgColor);
+ var borderL = "border-left: " + borderValue;
+ var borderR = "border-right: " + borderValue;
+ var style = "style='" + borderL + ";" + borderR + "'";
+ el.innerHTML = "<div " + style + ">" + el.innerHTML + "</div>"
+ },
+
+ _roundTopCorners: function(el, color, bgColor) {
+ var corner = this._createCorner(bgColor);
+ for(var i=0 ; i < this.options.numSlices ; i++ )
+ corner.appendChild(this._createCornerSlice(color,bgColor,i,"top"));
+ el.style.paddingTop = 0;
+ el.insertBefore(corner,el.firstChild);
+ },
+
+ _roundBottomCorners: function(el, color, bgColor) {
+ var corner = this._createCorner(bgColor);
+ for(var i=(this.options.numSlices-1) ; i >= 0 ; i-- )
+ corner.appendChild(this._createCornerSlice(color,bgColor,i,"bottom"));
+ el.style.paddingBottom = 0;
+ el.appendChild(corner);
+ },
+
+ _createCorner: function(bgColor) {
+ var corner = document.createElement("div");
+ corner.style.backgroundColor = (this._isTransparent() ? "transparent" : bgColor);
+ return corner;
+ },
+
+ _createCornerSlice: function(color,bgColor, n, position) {
+ var slice = document.createElement("span");
+
+ var inStyle = slice.style;
+ inStyle.backgroundColor = color;
+ inStyle.display = "block";
+ inStyle.height = "1px";
+ inStyle.overflow = "hidden";
+ inStyle.fontSize = "1px";
+
+ var borderColor = this._borderColor(color,bgColor);
+ if ( this.options.border && n == 0 ) {
+ inStyle.borderTopStyle = "solid";
+ inStyle.borderTopWidth = "1px";
+ inStyle.borderLeftWidth = "0px";
+ inStyle.borderRightWidth = "0px";
+ inStyle.borderBottomWidth = "0px";
+ inStyle.height = "0px"; // assumes css compliant box model
+ inStyle.borderColor = borderColor;
+ }
+ else if(borderColor) {
+ inStyle.borderColor = borderColor;
+ inStyle.borderStyle = "solid";
+ inStyle.borderWidth = "0px 1px";
+ }
+
+ if ( !this.options.compact && (n == (this.options.numSlices-1)) )
+ inStyle.height = "2px";
+
+ this._setMargin(slice, n, position);
+ this._setBorder(slice, n, position);
+ return slice;
+ },
+
+ _setOptions: function(options) {
+ this.options = {
+ corners : "all",
+ color : "fromElement",
+ bgColor : "fromParent",
+ blend : true,
+ border : false,
+ compact : false
+ }
+ Object.extend(this.options, options || {});
+
+ this.options.numSlices = this.options.compact ? 2 : 4;
+ if ( this._isTransparent() )
+ this.options.blend = false;
+ },
+
+ _whichSideTop: function() {
+ if ( this._hasString(this.options.corners, "all", "top") )
+ return "";
+
+ if ( this.options.corners.indexOf("tl") >= 0 && this.options.corners.indexOf("tr") >= 0 )
+ return "";
+
+ if (this.options.corners.indexOf("tl") >= 0)
+ return "left";
+ else if (this.options.corners.indexOf("tr") >= 0)
+ return "right";
+ return "";
+ },
+
+ _whichSideBottom: function() {
+ if ( this._hasString(this.options.corners, "all", "bottom") )
+ return "";
+
+ if ( this.options.corners.indexOf("bl")>=0 && this.options.corners.indexOf("br")>=0 )
+ return "";
+
+ if(this.options.corners.indexOf("bl") >=0)
+ return "left";
+ else if(this.options.corners.indexOf("br")>=0)
+ return "right";
+ return "";
+ },
+
+ _borderColor : function(color,bgColor) {
+ if ( color == "transparent" )
+ return bgColor;
+ else if ( this.options.border )
+ return this.options.border;
+ else if ( this.options.blend )
+ return this._blend( bgColor, color );
+ else
+ return "";
+ },
+
+
+ _setMargin: function(el, n, corners) {
+ var marginSize = this._marginSize(n);
+ var whichSide = corners == "top" ? this._whichSideTop() : this._whichSideBottom();
+
+ if ( whichSide == "left" ) {
+ el.style.marginLeft = marginSize + "px"; el.style.marginRight = "0px";
+ }
+ else if ( whichSide == "right" ) {
+ el.style.marginRight = marginSize + "px"; el.style.marginLeft = "0px";
+ }
+ else {
+ el.style.marginLeft = marginSize + "px"; el.style.marginRight = marginSize + "px";
+ }
+ },
+
+ _setBorder: function(el,n,corners) {
+ var borderSize = this._borderSize(n);
+ var whichSide = corners == "top" ? this._whichSideTop() : this._whichSideBottom();
+ if ( whichSide == "left" ) {
+ el.style.borderLeftWidth = borderSize + "px"; el.style.borderRightWidth = "0px";
+ }
+ else if ( whichSide == "right" ) {
+ el.style.borderRightWidth = borderSize + "px"; el.style.borderLeftWidth = "0px";
+ }
+ else {
+ el.style.borderLeftWidth = borderSize + "px"; el.style.borderRightWidth = borderSize + "px";
+ }
+ if (this.options.border != false)
+ el.style.borderLeftWidth = borderSize + "px"; el.style.borderRightWidth = borderSize + "px";
+ },
+
+ _marginSize: function(n) {
+ if ( this._isTransparent() )
+ return 0;
+
+ var marginSizes = [ 5, 3, 2, 1 ];
+ var blendedMarginSizes = [ 3, 2, 1, 0 ];
+ var compactMarginSizes = [ 2, 1 ];
+ var smBlendedMarginSizes = [ 1, 0 ];
+
+ if ( this.options.compact && this.options.blend )
+ return smBlendedMarginSizes[n];
+ else if ( this.options.compact )
+ return compactMarginSizes[n];
+ else if ( this.options.blend )
+ return blendedMarginSizes[n];
+ else
+ return marginSizes[n];
+ },
+
+ _borderSize: function(n) {
+ var transparentBorderSizes = [ 5, 3, 2, 1 ];
+ var blendedBorderSizes = [ 2, 1, 1, 1 ];
+ var compactBorderSizes = [ 1, 0 ];
+ var actualBorderSizes = [ 0, 2, 0, 0 ];
+
+ if ( this.options.compact && (this.options.blend || this._isTransparent()) )
+ return 1;
+ else if ( this.options.compact )
+ return compactBorderSizes[n];
+ else if ( this.options.blend )
+ return blendedBorderSizes[n];
+ else if ( this.options.border )
+ return actualBorderSizes[n];
+ else if ( this._isTransparent() )
+ return transparentBorderSizes[n];
+ return 0;
+ },
+
+ _hasString: function(str) { for(var i=1 ; i<arguments.length ; i++) if (str.indexOf(arguments[i]) >= 0) return true; return false; },
+ _blend: function(c1, c2) { var cc1 = Rico.Color.createFromHex(c1); cc1.blend(Rico.Color.createFromHex(c2)); return cc1; },
+ _background: function(el) { try { return Rico.Color.createColorFromBackground(el).asHex(); } catch(err) { return "#ffffff"; } },
+ _isTransparent: function() { return this.options.color == "transparent"; },
+ _isTopRounded: function() { return this._hasString(this.options.corners, "all", "top", "tl", "tr"); },
+ _isBottomRounded: function() { return this._hasString(this.options.corners, "all", "bottom", "bl", "br"); },
+ _hasSingleTextChild: function(el) { return el.childNodes.length == 1 && el.childNodes[0].nodeType == 3; }
+}
+
+
+//-------------------- ricoDragAndDrop.js
+Rico.DragAndDrop = Class.create();
+
+Rico.DragAndDrop.prototype = {
+
+ initialize: function() {
+ this.dropZones = new Array();
+ this.draggables = new Array();
+ this.currentDragObjects = new Array();
+ this.dragElement = null;
+ this.lastSelectedDraggable = null;
+ this.currentDragObjectVisible = false;
+ this.interestedInMotionEvents = false;
+ this._mouseDown = this._mouseDownHandler.bindAsEventListener(this);
+ this._mouseMove = this._mouseMoveHandler.bindAsEventListener(this);
+ this._mouseUp = this._mouseUpHandler.bindAsEventListener(this);
+ },
+
+ registerDropZone: function(aDropZone) {
+ this.dropZones[ this.dropZones.length ] = aDropZone;
+ },
+
+ deregisterDropZone: function(aDropZone) {
+ var newDropZones = new Array();
+ var j = 0;
+ for ( var i = 0 ; i < this.dropZones.length ; i++ ) {
+ if ( this.dropZones[i] != aDropZone )
+ newDropZones[j++] = this.dropZones[i];
+ }
+
+ this.dropZones = newDropZones;
+ },
+
+ clearDropZones: function() {
+ this.dropZones = new Array();
+ },
+
+ registerDraggable: function( aDraggable ) {
+ this.draggables[ this.draggables.length ] = aDraggable;
+ this._addMouseDownHandler( aDraggable );
+ },
+
+ clearSelection: function() {
+ for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+ this.currentDragObjects[i].deselect();
+ this.currentDragObjects = new Array();
+ this.lastSelectedDraggable = null;
+ },
+
+ hasSelection: function() {
+ return this.currentDragObjects.length > 0;
+ },
+
+ setStartDragFromElement: function( e, mouseDownElement ) {
+ this.origPos = RicoUtil.toDocumentPosition(mouseDownElement);
+ this.startx = e.screenX - this.origPos.x
+ this.starty = e.screenY - this.origPos.y
+ //this.startComponentX = e.layerX ? e.layerX : e.offsetX;
+ //this.startComponentY = e.layerY ? e.layerY : e.offsetY;
+ //this.adjustedForDraggableSize = false;
+
+ this.interestedInMotionEvents = this.hasSelection();
+ this._terminateEvent(e);
+ },
+
+ updateSelection: function( draggable, extendSelection ) {
+ if ( ! extendSelection )
+ this.clearSelection();
+
+ if ( draggable.isSelected() ) {
+ this.currentDragObjects.removeItem(draggable);
+ draggable.deselect();
+ if ( draggable == this.lastSelectedDraggable )
+ this.lastSelectedDraggable = null;
+ }
+ else {
+ this.currentDragObjects[ this.currentDragObjects.length ] = draggable;
+ draggable.select();
+ this.lastSelectedDraggable = draggable;
+ }
+ },
+
+ _mouseDownHandler: function(e) {
+ if ( arguments.length == 0 )
+ e = event;
+
+ // if not button 1 ignore it...
+ var nsEvent = e.which != undefined;
+ if ( (nsEvent && e.which != 1) || (!nsEvent && e.button != 1))
+ return;
+
+ var eventTarget = e.target ? e.target : e.srcElement;
+ var draggableObject = eventTarget.draggable;
+
+ var candidate = eventTarget;
+ while (draggableObject == null && candidate.parentNode) {
+ candidate = candidate.parentNode;
+ draggableObject = candidate.draggable;
+ }
+
+ if ( draggableObject == null )
+ return;
+
+ this.updateSelection( draggableObject, e.ctrlKey );
+
+ // clear the drop zones postion cache...
+ if ( this.hasSelection() )
+ for ( var i = 0 ; i < this.dropZones.length ; i++ )
+ this.dropZones[i].clearPositionCache();
+
+ this.setStartDragFromElement( e, draggableObject.getMouseDownHTMLElement() );
+ },
+
+
+ _mouseMoveHandler: function(e) {
+ var nsEvent = e.which != undefined;
+ if ( !this.interestedInMotionEvents ) {
+ //this._terminateEvent(e);
+ return;
+ }
+
+ if ( ! this.hasSelection() )
+ return;
+
+ if ( ! this.currentDragObjectVisible )
+ this._startDrag(e);
+
+ if ( !this.activatedDropZones )
+ this._activateRegisteredDropZones();
+
+ //if ( !this.adjustedForDraggableSize )
+ // this._adjustForDraggableSize(e);
+
+ this._updateDraggableLocation(e);
+ this._updateDropZonesHover(e);
+
+ this._terminateEvent(e);
+ },
+
+ _makeDraggableObjectVisible: function(e)
+ {
+ if ( !this.hasSelection() )
+ return;
+
+ var dragElement;
+ if ( this.currentDragObjects.length > 1 )
+ dragElement = this.currentDragObjects[0].getMultiObjectDragGUI(this.currentDragObjects);
+ else
+ dragElement = this.currentDragObjects[0].getSingleObjectDragGUI();
+
+ // go ahead and absolute position it...
+ if ( RicoUtil.getElementsComputedStyle(dragElement, "position") != "absolute" )
+ dragElement.style.position = "absolute";
+
+ // need to parent him into the document...
+ if ( dragElement.parentNode == null || dragElement.parentNode.nodeType == 11 )
+ document.body.appendChild(dragElement);
+
+ this.dragElement = dragElement;
+ this._updateDraggableLocation(e);
+
+ this.currentDragObjectVisible = true;
+ },
+
+ /**
+ _adjustForDraggableSize: function(e) {
+ var dragElementWidth = this.dragElement.offsetWidth;
+ var dragElementHeight = this.dragElement.offsetHeight;
+ if ( this.startComponentX > dragElementWidth )
+ this.startx -= this.startComponentX - dragElementWidth + 2;
+ if ( e.offsetY ) {
+ if ( this.startComponentY > dragElementHeight )
+ this.starty -= this.startComponentY - dragElementHeight + 2;
+ }
+ this.adjustedForDraggableSize = true;
+ },
+ **/
+
+ _leftOffset: function(e) {
+ return e.offsetX ? document.body.scrollLeft : 0
+ },
+
+ _topOffset: function(e) {
+ return e.offsetY ? document.body.scrollTop:0
+ },
+
+
+ _updateDraggableLocation: function(e) {
+ var dragObjectStyle = this.dragElement.style;
+ dragObjectStyle.left = (e.screenX + this._leftOffset(e) - this.startx) + "px"
+ dragObjectStyle.top = (e.screenY + this._topOffset(e) - this.starty) + "px";
+ },
+
+ _updateDropZonesHover: function(e) {
+ var n = this.dropZones.length;
+ for ( var i = 0 ; i < n ; i++ ) {
+ if ( ! this._mousePointInDropZone( e, this.dropZones[i] ) )
+ this.dropZones[i].hideHover();
+ }
+
+ for ( var i = 0 ; i < n ; i++ ) {
+ if ( this._mousePointInDropZone( e, this.dropZones[i] ) ) {
+ if ( this.dropZones[i].canAccept(this.currentDragObjects) )
+ this.dropZones[i].showHover();
+ }
+ }
+ },
+
+ _startDrag: function(e) {
+ for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+ this.currentDragObjects[i].startDrag();
+
+ this._makeDraggableObjectVisible(e);
+ },
+
+ _mouseUpHandler: function(e) {
+ if ( ! this.hasSelection() )
+ return;
+
+ var nsEvent = e.which != undefined;
+ if ( (nsEvent && e.which != 1) || (!nsEvent && e.button != 1))
+ return;
+
+ this.interestedInMotionEvents = false;
+
+ if ( this.dragElement == null ) {
+ this._terminateEvent(e);
+ return;
+ }
+
+ if ( this._placeDraggableInDropZone(e) )
+ this._completeDropOperation(e);
+ else {
+ this._terminateEvent(e);
+ new Rico.Effect.Position( this.dragElement,
+ this.origPos.x,
+ this.origPos.y,
+ 200,
+ 20,
+ { complete : this._doCancelDragProcessing.bind(this) } );
+ }
+
+ Event.stopObserving(document.body, "mousemove", this._mouseMove);
+ Event.stopObserving(document.body, "mouseup", this._mouseUp);
+ },
+
+ _retTrue: function () {
+ return true;
+ },
+
+ _completeDropOperation: function(e) {
+ if ( this.dragElement != this.currentDragObjects[0].getMouseDownHTMLElement() ) {
+ if ( this.dragElement.parentNode != null )
+ this.dragElement.parentNode.removeChild(this.dragElement);
+ }
+
+ this._deactivateRegisteredDropZones();
+ this._endDrag();
+ this.clearSelection();
+ this.dragElement = null;
+ this.currentDragObjectVisible = false;
+ this._terminateEvent(e);
+ },
+
+ _doCancelDragProcessing: function() {
+ this._cancelDrag();
+
+ if ( this.dragElement != this.currentDragObjects[0].getMouseDownHTMLElement() && this.dragElement)
+ if ( this.dragElement.parentNode != null )
+ this.dragElement.parentNode.removeChild(this.dragElement);
+
+
+ this._deactivateRegisteredDropZones();
+ this.dragElement = null;
+ this.currentDragObjectVisible = false;
+ },
+
+ _placeDraggableInDropZone: function(e) {
+ var foundDropZone = false;
+ var n = this.dropZones.length;
+ for ( var i = 0 ; i < n ; i++ ) {
+ if ( this._mousePointInDropZone( e, this.dropZones[i] ) ) {
+ if ( this.dropZones[i].canAccept(this.currentDragObjects) ) {
+ this.dropZones[i].hideHover();
+ this.dropZones[i].accept(this.currentDragObjects);
+ foundDropZone = true;
+ break;
+ }
+ }
+ }
+
+ return foundDropZone;
+ },
+
+ _cancelDrag: function() {
+ for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+ this.currentDragObjects[i].cancelDrag();
+ },
+
+ _endDrag: function() {
+ for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
+ this.currentDragObjects[i].endDrag();
+ },
+
+ _mousePointInDropZone: function( e, dropZone ) {
+
+ var absoluteRect = dropZone.getAbsoluteRect();
+
+ return e.clientX > absoluteRect.left + this._leftOffset(e) &&
+ e.clientX < absoluteRect.right + this._leftOffset(e) &&
+ e.clientY > absoluteRect.top + this._topOffset(e) &&
+ e.clientY < absoluteRect.bottom + this._topOffset(e);
+ },
+
+ _addMouseDownHandler: function( aDraggable )
+ {
+ htmlElement = aDraggable.getMouseDownHTMLElement();
+ if ( htmlElement != null ) {
+ htmlElement.draggable = aDraggable;
+ Event.observe(htmlElement , "mousedown", this._onmousedown.bindAsEventListener(this));
+ Event.observe(htmlElement, "mousedown", this._mouseDown);
+ }
+ },
+
+ _activateRegisteredDropZones: function() {
+ var n = this.dropZones.length;
+ for ( var i = 0 ; i < n ; i++ ) {
+ var dropZone = this.dropZones[i];
+ if ( dropZone.canAccept(this.currentDragObjects) )
+ dropZone.activate();
+ }
+
+ this.activatedDropZones = true;
+ },
+
+ _deactivateRegisteredDropZones: function() {
+ var n = this.dropZones.length;
+ for ( var i = 0 ; i < n ; i++ )
+ this.dropZones[i].deactivate();
+ this.activatedDropZones = false;
+ },
+
+ _onmousedown: function () {
+ Event.observe(document.body, "mousemove", this._mouseMove);
+ Event.observe(document.body, "mouseup", this._mouseUp);
+ },
+
+ _terminateEvent: function(e) {
+ if ( e.stopPropagation != undefined )
+ e.stopPropagation();
+ else if ( e.cancelBubble != undefined )
+ e.cancelBubble = true;
+
+ if ( e.preventDefault != undefined )
+ e.preventDefault();
+ else
+ e.returnValue = false;
+ },
+
+
+ initializeEventHandlers: function() {
+ if ( typeof document.implementation != "undefined" &&
+ document.implementation.hasFeature("HTML", "1.0") &&
+ document.implementation.hasFeature("Events", "2.0") &&
+ document.implementation.hasFeature("CSS", "2.0") ) {
+ document.addEventListener("mouseup", this._mouseUpHandler.bindAsEventListener(this), false);
+ document.addEventListener("mousemove", this._mouseMoveHandler.bindAsEventListener(this), false);
+ }
+ else {
+ document.attachEvent( "onmouseup", this._mouseUpHandler.bindAsEventListener(this) );
+ document.attachEvent( "onmousemove", this._mouseMoveHandler.bindAsEventListener(this) );
+ }
+ }
+ }
+
+ var dndMgr = new Rico.DragAndDrop();
+ dndMgr.initializeEventHandlers();
+
+
+//-------------------- ricoDraggable.js
+Rico.Draggable = Class.create();
+
+Rico.Draggable.prototype = {
+
+ initialize: function( type, htmlElement ) {
+ this.type = type;
+ this.htmlElement = $(htmlElement);
+ this.selected = false;
+ },
+
+ /**
+ * Returns the HTML element that should have a mouse down event
+ * added to it in order to initiate a drag operation
+ *
+ **/
+ getMouseDownHTMLElement: function() {
+ return this.htmlElement;
+ },
+
+ select: function() {
+ this.selected = true;
+
+ if ( this.showingSelected )
+ return;
+
+ var htmlElement = this.getMouseDownHTMLElement();
+
+ var color = Rico.Color.createColorFromBackground(htmlElement);
+ color.isBright() ? color.darken(0.033) : color.brighten(0.033);
+
+ this.saveBackground = RicoUtil.getElementsComputedStyle(htmlElement, "backgroundColor", "background-color");
+ htmlElement.style.backgroundColor = color.asHex();
+ this.showingSelected = true;
+ },
+
+ deselect: function() {
+ this.selected = false;
+ if ( !this.showingSelected )
+ return;
+
+ var htmlElement = this.getMouseDownHTMLElement();
+
+ htmlElement.style.backgroundColor = this.saveBackground;
+ this.showingSelected = false;
+ },
+
+ isSelected: function() {
+ return this.selected;
+ },
+
+ startDrag: function() {
+ },
+
+ cancelDrag: function() {
+ },
+
+ endDrag: function() {
+ },
+
+ getSingleObjectDragGUI: function() {
+ return this.htmlElement;
+ },
+
+ getMultiObjectDragGUI: function( draggables ) {
+ return this.htmlElement;
+ },
+
+ getDroppedGUI: function() {
+ return this.htmlElement;
+ },
+
+ toString: function() {
+ return this.type + ":" + this.htmlElement + ":";
+ }
+
+}
+
+
+//-------------------- ricoDropzone.js
+Rico.Dropzone = Class.create();
+
+Rico.Dropzone.prototype = {
+
+ initialize: function( htmlElement ) {
+ this.htmlElement = $(htmlElement);
+ this.absoluteRect = null;
+ },
+
+ getHTMLElement: function() {
+ return this.htmlElement;
+ },
+
+ clearPositionCache: function() {
+ this.absoluteRect = null;
+ },
+
+ getAbsoluteRect: function() {
+ if ( this.absoluteRect == null ) {
+ var htmlElement = this.getHTMLElement();
+ var pos = RicoUtil.toViewportPosition(htmlElement);
+
+ this.absoluteRect = {
+ top: pos.y,
+ left: pos.x,
+ bottom: pos.y + htmlElement.offsetHeight,
+ right: pos.x + htmlElement.offsetWidth
+ };
+ }
+ return this.absoluteRect;
+ },
+
+ activate: function() {
+ var htmlElement = this.getHTMLElement();
+ if (htmlElement == null || this.showingActive)
+ return;
+
+ this.showingActive = true;
+ this.saveBackgroundColor = htmlElement.style.backgroundColor;
+
+ var fallbackColor = "#ffea84";
+ var currentColor = Rico.Color.createColorFromBackground(htmlElement);
+ if ( currentColor == null )
+ htmlElement.style.backgroundColor = fallbackColor;
+ else {
+ currentColor.isBright() ? currentColor.darken(0.2) : currentColor.brighten(0.2);
+ htmlElement.style.backgroundColor = currentColor.asHex();
+ }
+ },
+
+ deactivate: function() {
+ var htmlElement = this.getHTMLElement();
+ if (htmlElement == null || !this.showingActive)
+ return;
+
+ htmlElement.style.backgroundColor = this.saveBackgroundColor;
+ this.showingActive = false;
+ this.saveBackgroundColor = null;
+ },
+
+ showHover: function() {
+ var htmlElement = this.getHTMLElement();
+ if ( htmlElement == null || this.showingHover )
+ return;
+
+ this.saveBorderWidth = htmlElement.style.borderWidth;
+ this.saveBorderStyle = htmlElement.style.borderStyle;
+ this.saveBorderColor = htmlElement.style.borderColor;
+
+ this.showingHover = true;
+ htmlElement.style.borderWidth = "1px";
+ htmlElement.style.borderStyle = "solid";
+ //htmlElement.style.borderColor = "#ff9900";
+ htmlElement.style.borderColor = "#ffff00";
+ },
+
+ hideHover: function() {
+ var htmlElement = this.getHTMLElement();
+ if ( htmlElement == null || !this.showingHover )
+ return;
+
+ htmlElement.style.borderWidth = this.saveBorderWidth;
+ htmlElement.style.borderStyle = this.saveBorderStyle;
+ htmlElement.style.borderColor = this.saveBorderColor;
+ this.showingHover = false;
+ },
+
+ canAccept: function(draggableObjects) {
+ return true;
+ },
+
+ accept: function(draggableObjects) {
+ var htmlElement = this.getHTMLElement();
+ if ( htmlElement == null )
+ return;
+
+ n = draggableObjects.length;
+ for ( var i = 0 ; i < n ; i++ )
+ {
+ var theGUI = draggableObjects[i].getDroppedGUI();
+ if ( RicoUtil.getElementsComputedStyle( theGUI, "position" ) == "absolute" )
+ {
+ theGUI.style.position = "static";
+ theGUI.style.top = "";
+ theGUI.style.top = "";
+ }
+ htmlElement.appendChild(theGUI);
+ }
+ }
+}
+
+
+//-------------------- ricoEffects.js
+
+Rico.Effect = {};
+
+Rico.Effect.SizeAndPosition = Class.create();
+Rico.Effect.SizeAndPosition.prototype = {
+
+ initialize: function(element, x, y, w, h, duration, steps, options) {
+ this.element = $(element);
+ this.x = x;
+ this.y = y;
+ this.w = w;
+ this.h = h;
+ this.duration = duration;
+ this.steps = steps;
+ this.options = arguments[7] || {};
+
+ this.sizeAndPosition();
+ },
+
+ sizeAndPosition: function() {
+ if (this.isFinished()) {
+ if(this.options.complete) this.options.complete(this);
+ return;
+ }
+
+ if (this.timer)
+ clearTimeout(this.timer);
+
+ var stepDuration = Math.round(this.duration/this.steps) ;
+
+ // Get original values: x,y = top left corner; w,h = width height
+ var currentX = this.element.offsetLeft;
+ var currentY = this.element.offsetTop;
+ var currentW = this.element.offsetWidth;
+ var currentH = this.element.offsetHeight;
+
+ // If values not set, or zero, we do not modify them, and take original as final as well
+ this.x = (this.x) ? this.x : currentX;
+ this.y = (this.y) ? this.y : currentY;
+ this.w = (this.w) ? this.w : currentW;
+ this.h = (this.h) ? this.h : currentH;
+
+ // how much do we need to modify our values for each step?
+ var difX = this.steps > 0 ? (this.x - currentX)/this.steps : 0;
+ var difY = this.steps > 0 ? (this.y - currentY)/this.steps : 0;
+ var difW = this.steps > 0 ? (this.w - currentW)/this.steps : 0;
+ var difH = this.steps > 0 ? (this.h - currentH)/this.steps : 0;
+
+ this.moveBy(difX, difY);
+ this.resizeBy(difW, difH);
+
+ this.duration -= stepDuration;
+ this.steps--;
+
+ this.timer = setTimeout(this.sizeAndPosition.bind(this), stepDuration);
+ },
+
+ isFinished: function() {
+ return this.steps <= 0;
+ },
+
+ moveBy: function( difX, difY ) {
+ var currentLeft = this.element.offsetLeft;
+ var currentTop = this.element.offsetTop;
+ var intDifX = parseInt(difX);
+ var intDifY = parseInt(difY);
+
+ var style = this.element.style;
+ if ( intDifX != 0 )
+ style.left = (currentLeft + intDifX) + "px";
+ if ( intDifY != 0 )
+ style.top = (currentTop + intDifY) + "px";
+ },
+
+ resizeBy: function( difW, difH ) {
+ var currentWidth = this.element.offsetWidth;
+ var currentHeight = this.element.offsetHeight;
+ var intDifW = parseInt(difW);
+ var intDifH = parseInt(difH);
+
+ var style = this.element.style;
+ if ( intDifW != 0 )
+ style.width = (currentWidth + intDifW) + "px";
+ if ( intDifH != 0 )
+ style.height = (currentHeight + intDifH) + "px";
+ }
+}
+
+Rico.Effect.Size = Class.create();
+Rico.Effect.Size.prototype = {
+
+ initialize: function(element, w, h, duration, steps, options) {
+ new Rico.Effect.SizeAndPosition(element, null, null, w, h, duration, steps, options);
+ }
+}
+
+Rico.Effect.Position = Class.create();
+Rico.Effect.Position.prototype = {
+
+ initialize: function(element, x, y, duration, steps, options) {
+ new Rico.Effect.SizeAndPosition(element, x, y, null, null, duration, steps, options);
+ }
+}
+
+Rico.Effect.Round = Class.create();
+Rico.Effect.Round.prototype = {
+
+ initialize: function(tagName, className, options) {
+ var elements = document.getElementsByTagAndClassName(tagName,className);
+ for ( var i = 0 ; i < elements.length ; i++ )
+ Rico.Corner.round( elements[i], options );
+ }
+};
+
+Rico.Effect.FadeTo = Class.create();
+Rico.Effect.FadeTo.prototype = {
+
+ initialize: function( element, opacity, duration, steps, options) {
+ this.element = $(element);
+ this.opacity = opacity;
+ this.duration = duration;
+ this.steps = steps;
+ this.options = arguments[4] || {};
+ this.fadeTo();
+ },
+
+ fadeTo: function() {
+ if (this.isFinished()) {
+ if(this.options.complete) this.options.complete(this);
+ return;
+ }
+
+ if (this.timer)
+ clearTimeout(this.timer);
+
+ var stepDuration = Math.round(this.duration/this.steps) ;
+ var currentOpacity = this.getElementOpacity();
+ var delta = this.steps > 0 ? (this.opacity - currentOpacity)/this.steps : 0;
+
+ this.changeOpacityBy(delta);
+ this.duration -= stepDuration;
+ this.steps--;
+
+ this.timer = setTimeout(this.fadeTo.bind(this), stepDuration);
+ },
+
+ changeOpacityBy: function(v) {
+ var currentOpacity = this.getElementOpacity();
+ var newOpacity = Math.max(0, Math.min(currentOpacity+v, 1));
+ this.element.ricoOpacity = newOpacity;
+
+ this.element.style.filter = "alpha(opacity:"+Math.round(newOpacity*100)+")";
+ this.element.style.opacity = newOpacity; /*//*/;
+ },
+
+ isFinished: function() {
+ return this.steps <= 0;
+ },
+
+ getElementOpacity: function() {
+ if ( this.element.ricoOpacity == undefined ) {
+ var opacity = RicoUtil.getElementsComputedStyle(this.element, 'opacity');
+ this.element.ricoOpacity = opacity != undefined ? opacity : 1.0;
+ }
+ return parseFloat(this.element.ricoOpacity);
+ }
+}
+
+Rico.Effect.AccordionSize = Class.create();
+
+Rico.Effect.AccordionSize.prototype = {
+
+ initialize: function(e1, e2, start, end, duration, steps, options) {
+ this.e1 = $(e1);
+ this.e2 = $(e2);
+ this.start = start;
+ this.end = end;
+ this.duration = duration;
+ this.steps = steps;
+ this.options = arguments[6] || {};
+
+ this.accordionSize();
+ },
+
+ accordionSize: function() {
+
+ if (this.isFinished()) {
+ // just in case there are round errors or such...
+ this.e1.style.height = this.start + "px";
+ this.e2.style.height = this.end + "px";
+
+ if(this.options.complete)
+ this.options.complete(this);
+ return;
+ }
+
+ if (this.timer)
+ clearTimeout(this.timer);
+
+ var stepDuration = Math.round(this.duration/this.steps) ;
+
+ var diff = this.steps > 0 ? (parseInt(this.e1.offsetHeight) - this.start)/this.steps : 0;
+ this.resizeBy(diff);
+
+ this.duration -= stepDuration;
+ this.steps--;
+
+ this.timer = setTimeout(this.accordionSize.bind(this), stepDuration);
+ },
+
+ isFinished: function() {
+ return this.steps <= 0;
+ },
+
+ resizeBy: function(diff) {
+ var h1Height = this.e1.offsetHeight;
+ var h2Height = this.e2.offsetHeight;
+ var intDiff = parseInt(diff);
+ if ( diff != 0 ) {
+ this.e1.style.height = (h1Height - intDiff) + "px";
+ this.e2.style.height = (h2Height + intDiff) + "px";
+ }
+ }
+
+};
+
+
+//-------------------- ricoLiveGrid.js
+// Rico.LiveGridMetaData -----------------------------------------------------
+
+Rico.LiveGridMetaData = Class.create();
+
+Rico.LiveGridMetaData.prototype = {
+
+ initialize: function( pageSize, totalRows, columnCount, options ) {
+ this.pageSize = pageSize;
+ this.totalRows = totalRows;
+ this.setOptions(options);
+ this.ArrowHeight = 16;
+ this.columnCount = columnCount;
+ },
+
+ setOptions: function(options) {
+ this.options = {
+ largeBufferSize : 7.0, // 7 pages
+ nearLimitFactor : 0.2 // 20% of buffer
+ };
+ Object.extend(this.options, options || {});
+ },
+
+ getPageSize: function() {
+ return this.pageSize;
+ },
+
+ getTotalRows: function() {
+ return this.totalRows;
+ },
+
+ setTotalRows: function(n) {
+ this.totalRows = n;
+ },
+
+ getLargeBufferSize: function() {
+ return parseInt(this.options.largeBufferSize * this.pageSize);
+ },
+
+ getLimitTolerance: function() {
+ return parseInt(this.getLargeBufferSize() * this.options.nearLimitFactor);
+ }
+};
+
+// Rico.LiveGridScroller -----------------------------------------------------
+
+Rico.LiveGridScroller = Class.create();
+
+Rico.LiveGridScroller.prototype = {
+
+ initialize: function(liveGrid, viewPort) {
+ this.isIE = navigator.userAgent.toLowerCase().indexOf("msie") >= 0;
+ this.liveGrid = liveGrid;
+ this.metaData = liveGrid.metaData;
+ this.createScrollBar();
+ this.scrollTimeout = null;
+ this.lastScrollPos = 0;
+ this.viewPort = viewPort;
+ this.rows = new Array();
+ },
+
+ isUnPlugged: function() {
+ return this.scrollerDiv.onscroll == null;
+ },
+
+ plugin: function() {
+ this.scrollerDiv.onscroll = this.handleScroll.bindAsEventListener(this);
+ },
+
+ unplug: function() {
+ this.scrollerDiv.onscroll = null;
+ },
+
+ sizeIEHeaderHack: function() {
+ if ( !this.isIE ) return;
+ var headerTable = $(this.liveGrid.tableId + "_header");
+ if ( headerTable )
+ headerTable.rows[0].cells[0].style.width =
+ (headerTable.rows[0].cells[0].offsetWidth + 1) + "px";
+ },
+
+ createScrollBar: function() {
+ var visibleHeight = this.liveGrid.viewPort.visibleHeight();
+ // create the outer div...
+ this.scrollerDiv = document.createElement("div");
+ var scrollerStyle = this.scrollerDiv.style;
+ scrollerStyle.borderRight = this.liveGrid.options.scrollerBorderRight;
+ scrollerStyle.position = "relative";
+ scrollerStyle.left = this.isIE ? "-6px" : "-3px";
+ scrollerStyle.width = "19px";
+ scrollerStyle.height = visibleHeight + "px";
+ scrollerStyle.overflow = "auto";
+
+ // create the inner div...
+ this.heightDiv = document.createElement("div");
+ this.heightDiv.style.width = "1px";
+
+ this.heightDiv.style.height = parseInt(visibleHeight *
+ this.metaData.getTotalRows()/this.metaData.getPageSize()) + "px" ;
+ this.scrollerDiv.appendChild(this.heightDiv);
+ this.scrollerDiv.onscroll = this.handleScroll.bindAsEventListener(this);
+
+ var table = this.liveGrid.table;
+ table.parentNode.parentNode.insertBefore( this.scrollerDiv, table.parentNode.nextSibling );
+ var eventName = this.isIE ? "mousewheel" : "DOMMouseScroll";
+ Event.observe(table, eventName,
+ function(evt) {
+ if (evt.wheelDelta>=0 || evt.detail < 0) //wheel-up
+ this.scrollerDiv.scrollTop -= (2*this.viewPort.rowHeight);
+ else
+ this.scrollerDiv.scrollTop += (2*this.viewPort.rowHeight);
+ this.handleScroll(false);
+ }.bindAsEventListener(this),
+ false);
+ },
+
+ updateSize: function() {
+ var table = this.liveGrid.table;
+ var visibleHeight = this.viewPort.visibleHeight();
+ this.heightDiv.style.height = parseInt(visibleHeight *
+ this.metaData.getTotalRows()/this.metaData.getPageSize()) + "px";
+ },
+
+ rowToPixel: function(rowOffset) {
+ return (rowOffset / this.metaData.getTotalRows()) * this.heightDiv.offsetHeight
+ },
+
+ moveScroll: function(rowOffset) {
+ this.scrollerDiv.scrollTop = this.rowToPixel(rowOffset);
+ if ( this.metaData.options.onscroll )
+ this.metaData.options.onscroll( this.liveGrid, rowOffset );
+ },
+
+ handleScroll: function() {
+ if ( this.scrollTimeout )
+ clearTimeout( this.scrollTimeout );
+
+ var scrollDiff = this.lastScrollPos-this.scrollerDiv.scrollTop;
+ if (scrollDiff != 0.00) {
+ var r = this.scrollerDiv.scrollTop % this.viewPort.rowHeight;
+ if (r != 0) {
+ this.unplug();
+ if ( scrollDiff < 0 ) {
+ this.scrollerDiv.scrollTop += (this.viewPort.rowHeight-r);
+ } else {
+ this.scrollerDiv.scrollTop -= r;
+ }
+ this.plugin();
+ }
+ }
+ var contentOffset = parseInt(this.scrollerDiv.scrollTop / this.viewPort.rowHeight);
+ this.liveGrid.requestContentRefresh(contentOffset);
+ this.viewPort.scrollTo(this.scrollerDiv.scrollTop);
+
+ if ( this.metaData.options.onscroll )
+ this.metaData.options.onscroll( this.liveGrid, contentOffset );
+
+ this.scrollTimeout = setTimeout(this.scrollIdle.bind(this), 1200 );
+ this.lastScrollPos = this.scrollerDiv.scrollTop;
+
+ },
+
+ scrollIdle: function() {
+ if ( this.metaData.options.onscrollidle )
+ this.metaData.options.onscrollidle();
+ }
+};
+
+// Rico.LiveGridBuffer -----------------------------------------------------
+
+Rico.LiveGridBuffer = Class.create();
+
+Rico.LiveGridBuffer.prototype = {
+
+ initialize: function(metaData, viewPort) {
+ this.startPos = 0;
+ this.size = 0;
+ this.metaData = metaData;
+ this.rows = new Array();
+ this.updateInProgress = false;
+ this.viewPort = viewPort;
+ this.maxBufferSize = metaData.getLargeBufferSize() * 2;
+ this.maxFetchSize = metaData.getLargeBufferSize();
+ this.lastOffset = 0;
+ },
+
+ getBlankRow: function() {
+ if (!this.blankRow ) {
+ this.blankRow = new Array();
+ for ( var i=0; i < this.metaData.columnCount ; i++ )
+ this.blankRow[i] = "&nbsp;";
+ }
+ return this.blankRow;
+ },
+
+ loadRows: function(ajaxResponse) {
+ var rowsElement = ajaxResponse.getElementsByTagName('rows')[0];
+ this.updateUI = rowsElement.getAttribute("update_ui") == "true"
+ var newRows = new Array()
+ var trs = rowsElement.getElementsByTagName("tr");
+ for ( var i=0 ; i < trs.length; i++ ) {
+ var row = newRows[i] = new Array();
+ var cells = trs[i].getElementsByTagName("td");
+ for ( var j=0; j < cells.length ; j++ ) {
+ var cell = cells[j];
+ var convertSpaces = cell.getAttribute("convert_spaces") == "true";
+ var cellContent = RicoUtil.getContentAsString(cell);
+ row[j] = convertSpaces ? this.convertSpaces(cellContent) : cellContent;
+ if (!row[j])
+ row[j] = '&nbsp;';
+ }
+ }
+ return newRows;
+ },
+
+ update: function(ajaxResponse, start) {
+ var newRows = this.loadRows(ajaxResponse);
+ if (this.rows.length == 0) { // initial load
+ this.rows = newRows;
+ this.size = this.rows.length;
+ this.startPos = start;
+ return;
+ }
+ if (start > this.startPos) { //appending
+ if (this.startPos + this.rows.length < start) {
+ this.rows = newRows;
+ this.startPos = start;//
+ } else {
+ this.rows = this.rows.concat( newRows.slice(0, newRows.length));
+ if (this.rows.length > this.maxBufferSize) {
+ var fullSize = this.rows.length;
+ this.rows = this.rows.slice(this.rows.length - this.maxBufferSize, this.rows.length)
+ this.startPos = this.startPos + (fullSize - this.rows.length);
+ }
+ }
+ } else { //prepending
+ if (start + newRows.length < this.startPos) {
+ this.rows = newRows;
+ } else {
+ this.rows = newRows.slice(0, this.startPos).concat(this.rows);
+ if (this.rows.length > this.maxBufferSize)
+ this.rows = this.rows.slice(0, this.maxBufferSize)
+ }
+ this.startPos = start;
+ }
+ this.size = this.rows.length;
+ },
+
+ clear: function() {
+ this.rows = new Array();
+ this.startPos = 0;
+ this.size = 0;
+ },
+
+ isOverlapping: function(start, size) {
+ return ((start < this.endPos()) && (this.startPos < start + size)) || (this.endPos() == 0)
+ },
+
+ isInRange: function(position) {
+ return (position >= this.startPos) && (position + this.metaData.getPageSize() <= this.endPos());
+ //&& this.size() != 0;
+ },
+
+ isNearingTopLimit: function(position) {
+ return position - this.startPos < this.metaData.getLimitTolerance();
+ },
+
+ endPos: function() {
+ return this.startPos + this.rows.length;
+ },
+
+ isNearingBottomLimit: function(position) {
+ return this.endPos() - (position + this.metaData.getPageSize()) < this.metaData.getLimitTolerance();
+ },
+
+ isAtTop: function() {
+ return this.startPos == 0;
+ },
+
+ isAtBottom: function() {
+ return this.endPos() == this.metaData.getTotalRows();
+ },
+
+ isNearingLimit: function(position) {
+ return ( !this.isAtTop() && this.isNearingTopLimit(position)) ||
+ ( !this.isAtBottom() && this.isNearingBottomLimit(position) )
+ },
+
+ getFetchSize: function(offset) {
+ var adjustedOffset = this.getFetchOffset(offset);
+ var adjustedSize = 0;
+ if (adjustedOffset >= this.startPos) { //apending
+ var endFetchOffset = this.maxFetchSize + adjustedOffset;
+ if (endFetchOffset > this.metaData.totalRows)
+ endFetchOffset = this.metaData.totalRows;
+ adjustedSize = endFetchOffset - adjustedOffset;
+ if(adjustedOffset == 0 && adjustedSize < this.maxFetchSize){
+ adjustedSize = this.maxFetchSize;
+ }
+ } else {//prepending
+ var adjustedSize = this.startPos - adjustedOffset;
+ if (adjustedSize > this.maxFetchSize)
+ adjustedSize = this.maxFetchSize;
+ }
+ return adjustedSize;
+ },
+
+ getFetchOffset: function(offset) {
+ var adjustedOffset = offset;
+ if (offset > this.startPos) //apending
+ adjustedOffset = (offset > this.endPos()) ? offset : this.endPos();
+ else { //prepending
+ if (offset + this.maxFetchSize >= this.startPos) {
+ var adjustedOffset = this.startPos - this.maxFetchSize;
+ if (adjustedOffset < 0)
+ adjustedOffset = 0;
+ }
+ }
+ this.lastOffset = adjustedOffset;
+ return adjustedOffset;
+ },
+
+ getRows: function(start, count) {
+ var begPos = start - this.startPos
+ var endPos = begPos + count
+
+ // er? need more data...
+ if ( endPos > this.size )
+ endPos = this.size
+
+ var results = new Array()
+ var index = 0;
+ for ( var i=begPos ; i < endPos; i++ ) {
+ results[index++] = this.rows[i]
+ }
+ return results
+ },
+
+ convertSpaces: function(s) {
+ return s.split(" ").join("&nbsp;");
+ }
+
+};
+
+
+//Rico.GridViewPort --------------------------------------------------
+Rico.GridViewPort = Class.create();
+
+Rico.GridViewPort.prototype = {
+
+ initialize: function(table, rowHeight, visibleRows, buffer, liveGrid) {
+ this.lastDisplayedStartPos = 0;
+ this.div = table.parentNode;
+ this.table = table
+ this.rowHeight = rowHeight;
+ this.div.style.height = (this.rowHeight * visibleRows) + "px";
+ this.div.style.overflow = "hidden";
+ this.buffer = buffer;
+ this.liveGrid = liveGrid;
+ this.visibleRows = visibleRows + 1;
+ this.lastPixelOffset = 0;
+ this.startPos = 0;
+ },
+
+ populateRow: function(htmlRow, row) {
+ for (var j=0; j < row.length; j++) {
+ htmlRow.cells[j].innerHTML = row[j]
+ }
+ },
+
+ bufferChanged: function() {
+ this.refreshContents( parseInt(this.lastPixelOffset / this.rowHeight));
+ },
+
+ clearRows: function() {
+ if (!this.isBlank) {
+ this.liveGrid.table.className = this.liveGrid.options.loadingClass;
+ for (var i=0; i < this.visibleRows; i++)
+ this.populateRow(this.table.rows[i], this.buffer.getBlankRow());
+ this.isBlank = true;
+ }
+ },
+
+ clearContents: function() {
+ this.clearRows();
+ this.scrollTo(0);
+ this.startPos = 0;
+ this.lastStartPos = -1;
+ },
+
+ refreshContents: function(startPos) {
+ if (startPos == this.lastRowPos && !this.isPartialBlank && !this.isBlank) {
+ return;
+ }
+ if ((startPos + this.visibleRows < this.buffer.startPos)
+ || (this.buffer.startPos + this.buffer.size < startPos)
+ || (this.buffer.size == 0)) {
+ this.clearRows();
+ return;
+ }
+ this.isBlank = false;
+ var viewPrecedesBuffer = this.buffer.startPos > startPos
+ var contentStartPos = viewPrecedesBuffer ? this.buffer.startPos: startPos;
+ var contentEndPos = (this.buffer.startPos + this.buffer.size < startPos + this.visibleRows)
+ ? this.buffer.startPos + this.buffer.size
+ : startPos + this.visibleRows;
+ var rowSize = contentEndPos - contentStartPos;
+ var rows = this.buffer.getRows(contentStartPos, rowSize );
+ var blankSize = this.visibleRows - rowSize;
+ var blankOffset = viewPrecedesBuffer ? 0: rowSize;
+ var contentOffset = viewPrecedesBuffer ? blankSize: 0;
+
+ for (var i=0; i < rows.length; i++) {//initialize what we have
+ this.populateRow(this.table.rows[i + contentOffset], rows[i]);
+ }
+ for (var i=0; i < blankSize; i++) {// blank out the rest
+ this.populateRow(this.table.rows[i + blankOffset], this.buffer.getBlankRow());
+ }
+ this.isPartialBlank = blankSize > 0;
+ this.lastRowPos = startPos;
+
+ this.liveGrid.table.className = this.liveGrid.options.tableClass;
+ // Check if user has set a onRefreshComplete function
+ var onRefreshComplete = this.liveGrid.options.onRefreshComplete;
+ if (onRefreshComplete != null)
+ onRefreshComplete();
+ },
+
+ scrollTo: function(pixelOffset) {
+ if (this.lastPixelOffset == pixelOffset)
+ return;
+
+ this.refreshContents(parseInt(pixelOffset / this.rowHeight))
+ this.div.scrollTop = pixelOffset % this.rowHeight
+
+ this.lastPixelOffset = pixelOffset;
+ },
+
+ visibleHeight: function() {
+ return parseInt(RicoUtil.getElementsComputedStyle(this.div, 'height'));
+ }
+
+};
+
+
+Rico.LiveGridRequest = Class.create();
+Rico.LiveGridRequest.prototype = {
+ initialize: function( requestOffset, options ) {
+ this.requestOffset = requestOffset;
+ }
+};
+
+// Rico.LiveGrid -----------------------------------------------------
+
+Rico.LiveGrid = Class.create();
+
+Rico.LiveGrid.prototype = {
+
+ initialize: function( tableId, visibleRows, totalRows, url, options, ajaxOptions ) {
+
+ this.options = {
+ tableClass: $(tableId).className,
+ loadingClass: $(tableId).className,
+ scrollerBorderRight: '1px solid #ababab',
+ bufferTimeout: 20000,
+ sortAscendImg: 'images/sort_asc.gif',
+ sortDescendImg: 'images/sort_desc.gif',
+ sortImageWidth: 9,
+ sortImageHeight: 5,
+ ajaxSortURLParms: [],
+ onRefreshComplete: null,
+ requestParameters: null,
+ inlineStyles: true
+ };
+ Object.extend(this.options, options || {});
+
+ this.ajaxOptions = {parameters: null};
+ Object.extend(this.ajaxOptions, ajaxOptions || {});
+
+ this.tableId = tableId;
+ this.table = $(tableId);
+
+ this.addLiveGridHtml();
+
+ var columnCount = this.table.rows[0].cells.length;
+ this.metaData = new Rico.LiveGridMetaData(visibleRows, totalRows, columnCount, options);
+ this.buffer = new Rico.LiveGridBuffer(this.metaData);
+
+ var rowCount = this.table.rows.length;
+ this.viewPort = new Rico.GridViewPort(this.table,
+ this.table.offsetHeight/rowCount,
+ visibleRows,
+ this.buffer, this);
+ this.scroller = new Rico.LiveGridScroller(this,this.viewPort);
+ this.options.sortHandler = this.sortHandler.bind(this);
+
+ if ( $(tableId + '_header') )
+ this.sort = new Rico.LiveGridSort(tableId + '_header', this.options)
+
+ this.processingRequest = null;
+ this.unprocessedRequest = null;
+
+ this.initAjax(url);
+ if ( this.options.prefetchBuffer || this.options.prefetchOffset > 0) {
+ var offset = 0;
+ if (this.options.offset ) {
+ offset = this.options.offset;
+ this.scroller.moveScroll(offset);
+ this.viewPort.scrollTo(this.scroller.rowToPixel(offset));
+ }
+ if (this.options.sortCol) {
+ this.sortCol = options.sortCol;
+ this.sortDir = options.sortDir;
+ }
+ this.requestContentRefresh(offset);
+ }
+ },
+
+ addLiveGridHtml: function() {
+ // Check to see if need to create a header table.
+ if (this.table.getElementsByTagName("thead").length > 0){
+ // Create Table this.tableId+'_header'
+ var tableHeader = this.table.cloneNode(true);
+ tableHeader.setAttribute('id', this.tableId+'_header');
+ tableHeader.setAttribute('class', this.table.className+'_header');
+
+ // Clean up and insert
+ for( var i = 0; i < tableHeader.tBodies.length; i++ )
+ tableHeader.removeChild(tableHeader.tBodies[i]);
+ this.table.deleteTHead();
+ this.table.parentNode.insertBefore(tableHeader,this.table);
+ }
+
+ new Insertion.Before(this.table, "<div id='"+this.tableId+"_container'></div>");
+ this.table.previousSibling.appendChild(this.table);
+ new Insertion.Before(this.table,"<div id='"+this.tableId+"_viewport' style='float:left;'></div>");
+ this.table.previousSibling.appendChild(this.table);
+ },
+
+
+ resetContents: function() {
+ this.scroller.moveScroll(0);
+ this.buffer.clear();
+ this.viewPort.clearContents();
+ },
+
+ sortHandler: function(column) {
+ if(!column) return ;
+ this.sortCol = column.name;
+ this.sortDir = column.currentSort;
+
+ this.resetContents();
+ this.requestContentRefresh(0)
+ },
+
+ adjustRowSize: function() {
+
+ },
+
+ setTotalRows: function( newTotalRows ) {
+ this.resetContents();
+ this.metaData.setTotalRows(newTotalRows);
+ this.scroller.updateSize();
+ },
+
+ initAjax: function(url) {
+ ajaxEngine.registerRequest( this.tableId + '_request', url );
+ ajaxEngine.registerAjaxObject( this.tableId + '_updater', this );
+ },
+
+ invokeAjax: function() {
+ },
+
+ handleTimedOut: function() {
+ //server did not respond in 4 seconds... assume that there could have been
+ //an error or something, and allow requests to be processed again...
+ this.processingRequest = null;
+ this.processQueuedRequest();
+ },
+
+ fetchBuffer: function(offset) {
+ if ( this.buffer.isInRange(offset) &&
+ !this.buffer.isNearingLimit(offset)) {
+ return;
+ }
+ if (this.processingRequest) {
+ this.unprocessedRequest = new Rico.LiveGridRequest(offset);
+ return;
+ }
+ var bufferStartPos = this.buffer.getFetchOffset(offset);
+ this.processingRequest = new Rico.LiveGridRequest(offset);
+ this.processingRequest.bufferOffset = bufferStartPos;
+ var fetchSize = this.buffer.getFetchSize(offset);
+ var partialLoaded = false;
+
+ var queryString
+ if (this.options.requestParameters)
+ queryString = this._createQueryString(this.options.requestParameters, 0);
+
+ queryString = (queryString == null) ? '' : queryString+'&';
+ queryString = queryString+'id='+this.tableId+'&page_size='+fetchSize+'&offset='+bufferStartPos;
+ if (this.sortCol)
+ queryString = queryString+'&sort_col='+escape(this.sortCol)+'&sort_dir='+this.sortDir;
+
+ this.ajaxOptions.parameters = queryString;
+
+ ajaxEngine.sendRequest( this.tableId + '_request', this.ajaxOptions );
+
+ this.timeoutHandler = setTimeout( this.handleTimedOut.bind(this), this.options.bufferTimeout);
+
+ },
+
+ setRequestParams: function() {
+ this.options.requestParameters = [];
+ for ( var i=0 ; i < arguments.length ; i++ )
+ this.options.requestParameters[i] = arguments[i];
+ },
+
+ requestContentRefresh: function(contentOffset) {
+ this.fetchBuffer(contentOffset);
+ },
+
+ ajaxUpdate: function(ajaxResponse) {
+ try {
+ clearTimeout( this.timeoutHandler );
+ this.buffer.update(ajaxResponse,this.processingRequest.bufferOffset);
+ this.viewPort.bufferChanged();
+ }
+ catch(err) {}
+ finally {this.processingRequest = null; }
+ this.processQueuedRequest();
+ },
+
+ _createQueryString: function( theArgs, offset ) {
+ var queryString = ""
+ if (!theArgs)
+ return queryString;
+
+ for ( var i = offset ; i < theArgs.length ; i++ ) {
+ if ( i != offset )
+ queryString += "&";
+
+ var anArg = theArgs[i];
+
+ if ( anArg.name != undefined && anArg.value != undefined ) {
+ queryString += anArg.name + "=" + escape(anArg.value);
+ }
+ else {
+ var ePos = anArg.indexOf('=');
+ var argName = anArg.substring( 0, ePos );
+ var argValue = anArg.substring( ePos + 1 );
+ queryString += argName + "=" + escape(argValue);
+ }
+ }
+ return queryString;
+ },
+
+ processQueuedRequest: function() {
+ if (this.unprocessedRequest != null) {
+ this.requestContentRefresh(this.unprocessedRequest.requestOffset);
+ this.unprocessedRequest = null
+ }
+ }
+};
+
+
+//-------------------- ricoLiveGridSort.js
+Rico.LiveGridSort = Class.create();
+
+Rico.LiveGridSort.prototype = {
+
+ initialize: function(headerTableId, options) {
+ this.headerTableId = headerTableId;
+ this.headerTable = $(headerTableId);
+ this.options = options;
+ this.setOptions();
+ this.applySortBehavior();
+
+ if ( this.options.sortCol ) {
+ this.setSortUI( this.options.sortCol, this.options.sortDir );
+ }
+ },
+
+ setSortUI: function( columnName, sortDirection ) {
+ var cols = this.options.columns;
+ for ( var i = 0 ; i < cols.length ; i++ ) {
+ if ( cols[i].name == columnName ) {
+ this.setColumnSort(i, sortDirection);
+ break;
+ }
+ }
+ },
+
+ setOptions: function() {
+ // preload the images...
+ new Image().src = this.options.sortAscendImg;
+ new Image().src = this.options.sortDescendImg;
+
+ this.sort = this.options.sortHandler;
+ if ( !this.options.columns )
+ this.options.columns = this.introspectForColumnInfo();
+ else {
+ // allow client to pass { columns: [ ["a", true], ["b", false] ] }
+ // and convert to an array of Rico.TableColumn objs...
+ this.options.columns = this.convertToTableColumns(this.options.columns);
+ }
+ },
+
+ applySortBehavior: function() {
+ var headerRow = this.headerTable.rows[0];
+ var headerCells = headerRow.cells;
+ for ( var i = 0 ; i < headerCells.length ; i++ ) {
+ this.addSortBehaviorToColumn( i, headerCells[i] );
+ }
+ },
+
+ addSortBehaviorToColumn: function( n, cell ) {
+ if ( this.options.columns[n].isSortable() ) {
+ cell.id = this.headerTableId + '_' + n;
+ cell.style.cursor = 'pointer';
+ cell.onclick = this.headerCellClicked.bindAsEventListener(this);
+ cell.innerHTML = cell.innerHTML + '<span id="' + this.headerTableId + '_img_' + n + '">'
+ + '&nbsp;&nbsp;&nbsp;</span>';
+ }
+ },
+
+ // event handler....
+ headerCellClicked: function(evt) {
+ var eventTarget = evt.target ? evt.target : evt.srcElement;
+ var cellId = eventTarget.id;
+ var columnNumber = parseInt(cellId.substring( cellId.lastIndexOf('_') + 1 ));
+ var sortedColumnIndex = this.getSortedColumnIndex();
+ if ( sortedColumnIndex != -1 ) {
+ if ( sortedColumnIndex != columnNumber ) {
+ this.removeColumnSort(sortedColumnIndex);
+ this.setColumnSort(columnNumber, Rico.TableColumn.SORT_ASC);
+ }
+ else
+ this.toggleColumnSort(sortedColumnIndex);
+ }
+ else
+ this.setColumnSort(columnNumber, Rico.TableColumn.SORT_ASC);
+
+ if (this.options.sortHandler) {
+ this.options.sortHandler(this.options.columns[columnNumber]);
+ }
+ },
+
+ removeColumnSort: function(n) {
+ this.options.columns[n].setUnsorted();
+ this.setSortImage(n);
+ },
+
+ setColumnSort: function(n, direction) {
+ if(isNaN(n)) return ;
+ this.options.columns[n].setSorted(direction);
+ this.setSortImage(n);
+ },
+
+ toggleColumnSort: function(n) {
+ this.options.columns[n].toggleSort();
+ this.setSortImage(n);
+ },
+
+ setSortImage: function(n) {
+ var sortDirection = this.options.columns[n].getSortDirection();
+
+ var sortImageSpan = $( this.headerTableId + '_img_' + n );
+ if ( sortDirection == Rico.TableColumn.UNSORTED )
+ sortImageSpan.innerHTML = '&nbsp;&nbsp;';
+ else if ( sortDirection == Rico.TableColumn.SORT_ASC )
+ sortImageSpan.innerHTML = '&nbsp;&nbsp;<img width="' + this.options.sortImageWidth + '" ' +
+ 'height="'+ this.options.sortImageHeight + '" ' +
+ 'src="' + this.options.sortAscendImg + '"/>';
+ else if ( sortDirection == Rico.TableColumn.SORT_DESC )
+ sortImageSpan.innerHTML = '&nbsp;&nbsp;<img width="' + this.options.sortImageWidth + '" ' +
+ 'height="'+ this.options.sortImageHeight + '" ' +
+ 'src="' + this.options.sortDescendImg + '"/>';
+ },
+
+ getSortedColumnIndex: function() {
+ var cols = this.options.columns;
+ for ( var i = 0 ; i < cols.length ; i++ ) {
+ if ( cols[i].isSorted() )
+ return i;
+ }
+
+ return -1;
+ },
+
+ introspectForColumnInfo: function() {
+ var columns = new Array();
+ var headerRow = this.headerTable.rows[0];
+ var headerCells = headerRow.cells;
+ for ( var i = 0 ; i < headerCells.length ; i++ )
+ columns.push( new Rico.TableColumn( this.deriveColumnNameFromCell(headerCells[i],i), true ) );
+ return columns;
+ },
+
+ convertToTableColumns: function(cols) {
+ var columns = new Array();
+ for ( var i = 0 ; i < cols.length ; i++ )
+ columns.push( new Rico.TableColumn( cols[i][0], cols[i][1] ) );
+ return columns;
+ },
+
+ deriveColumnNameFromCell: function(cell,columnNumber) {
+ var cellContent = cell.innerText != undefined ? cell.innerText : cell.textContent;
+ return cellContent ? cellContent.toLowerCase().split(' ').join('_') : "col_" + columnNumber;
+ }
+};
+
+Rico.TableColumn = Class.create();
+
+Rico.TableColumn.UNSORTED = 0;
+Rico.TableColumn.SORT_ASC = "ASC";
+Rico.TableColumn.SORT_DESC = "DESC";
+
+Rico.TableColumn.prototype = {
+ initialize: function(name, sortable) {
+ this.name = name;
+ this.sortable = sortable;
+ this.currentSort = Rico.TableColumn.UNSORTED;
+ },
+
+ isSortable: function() {
+ return this.sortable;
+ },
+
+ isSorted: function() {
+ return this.currentSort != Rico.TableColumn.UNSORTED;
+ },
+
+ getSortDirection: function() {
+ return this.currentSort;
+ },
+
+ toggleSort: function() {
+ if ( this.currentSort == Rico.TableColumn.UNSORTED || this.currentSort == Rico.TableColumn.SORT_DESC )
+ this.currentSort = Rico.TableColumn.SORT_ASC;
+ else if ( this.currentSort == Rico.TableColumn.SORT_ASC )
+ this.currentSort = Rico.TableColumn.SORT_DESC;
+ },
+
+ setUnsorted: function(direction) {
+ this.setSorted(Rico.TableColumn.UNSORTED);
+ },
+
+ setSorted: function(direction) {
+ // direction must by one of Rico.TableColumn.UNSORTED, .SORT_ASC, or .SORT_DESC...
+ this.currentSort = direction;
+ }
+
+};
+
+
+//-------------------- ricoUtil.js
+var RicoUtil = {
+
+ getElementsComputedStyle: function ( htmlElement, cssProperty, mozillaEquivalentCSS) {
+ if ( arguments.length == 2 )
+ mozillaEquivalentCSS = cssProperty;
+
+ var el = $(htmlElement);
+ if ( el.currentStyle )
+ return el.currentStyle[cssProperty];
+ else
+ return document.defaultView.getComputedStyle(el, null).getPropertyValue(mozillaEquivalentCSS);
+ },
+
+ createXmlDocument : function() {
+ if (document.implementation && document.implementation.createDocument) {
+ var doc = document.implementation.createDocument("", "", null);
+
+ if (doc.readyState == null) {
+ doc.readyState = 1;
+ doc.addEventListener("load", function () {
+ doc.readyState = 4;
+ if (typeof doc.onreadystatechange == "function")
+ doc.onreadystatechange();
+ }, false);
+ }
+
+ return doc;
+ }
+
+ if (window.ActiveXObject)
+ return Try.these(
+ function() { return new ActiveXObject('MSXML2.DomDocument') },
+ function() { return new ActiveXObject('Microsoft.DomDocument')},
+ function() { return new ActiveXObject('MSXML.DomDocument') },
+ function() { return new ActiveXObject('MSXML3.DomDocument') }
+ ) || false;
+
+ return null;
+ },
+
+ getContentAsString: function( parentNode ) {
+ return parentNode.xml != undefined ?
+ this._getContentAsStringIE(parentNode) :
+ this._getContentAsStringMozilla(parentNode);
+ },
+
+ _getContentAsStringIE: function(parentNode) {
+ var contentStr = "";
+ for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
+ var n = parentNode.childNodes[i];
+ if (n.nodeType == 4) {
+ contentStr += n.nodeValue;
+ }
+ else {
+ contentStr += n.xml;
+ }
+ }
+ return contentStr;
+ },
+
+ _getContentAsStringMozilla: function(parentNode) {
+ var xmlSerializer = new XMLSerializer();
+ var contentStr = "";
+ for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) {
+ var n = parentNode.childNodes[i];
+ if (n.nodeType == 4) { // CDATA node
+ contentStr += n.nodeValue;
+ }
+ else {
+ contentStr += xmlSerializer.serializeToString(n);
+ }
+ }
+ return contentStr;
+ },
+
+ toViewportPosition: function(element) {
+ return this._toAbsolute(element,true);
+ },
+
+ toDocumentPosition: function(element) {
+ return this._toAbsolute(element,false);
+ },
+
+ /**
+ * Compute the elements position in terms of the window viewport
+ * so that it can be compared to the position of the mouse (dnd)
+ * This is additions of all the offsetTop,offsetLeft values up the
+ * offsetParent hierarchy, ...taking into account any scrollTop,
+ * scrollLeft values along the way...
+ *
+ * IE has a bug reporting a correct offsetLeft of elements within a
+ * a relatively positioned parent!!!
+ **/
+ _toAbsolute: function(element,accountForDocScroll) {
+
+ if ( navigator.userAgent.toLowerCase().indexOf("msie") == -1 )
+ return this._toAbsoluteMozilla(element,accountForDocScroll);
+
+ var x = 0;
+ var y = 0;
+ var parent = element;
+ while ( parent ) {
+
+ var borderXOffset = 0;
+ var borderYOffset = 0;
+ if ( parent != element ) {
+ var borderXOffset = parseInt(this.getElementsComputedStyle(parent, "borderLeftWidth" ));
+ var borderYOffset = parseInt(this.getElementsComputedStyle(parent, "borderTopWidth" ));
+ borderXOffset = isNaN(borderXOffset) ? 0 : borderXOffset;
+ borderYOffset = isNaN(borderYOffset) ? 0 : borderYOffset;
+ }
+
+ x += parent.offsetLeft - parent.scrollLeft + borderXOffset;
+ y += parent.offsetTop - parent.scrollTop + borderYOffset;
+ parent = parent.offsetParent;
+ }
+
+ if ( accountForDocScroll ) {
+ x -= this.docScrollLeft();
+ y -= this.docScrollTop();
+ }
+
+ return { x:x, y:y };
+ },
+
+ /**
+ * Mozilla did not report all of the parents up the hierarchy via the
+ * offsetParent property that IE did. So for the calculation of the
+ * offsets we use the offsetParent property, but for the calculation of
+ * the scrollTop/scrollLeft adjustments we navigate up via the parentNode
+ * property instead so as to get the scroll offsets...
+ *
+ **/
+ _toAbsoluteMozilla: function(element,accountForDocScroll) {
+ var x = 0;
+ var y = 0;
+ var parent = element;
+ while ( parent ) {
+ x += parent.offsetLeft;
+ y += parent.offsetTop;
+ parent = parent.offsetParent;
+ }
+
+ parent = element;
+ while ( parent &&
+ parent != document.body &&
+ parent != document.documentElement ) {
+ if ( parent.scrollLeft )
+ x -= parent.scrollLeft;
+ if ( parent.scrollTop )
+ y -= parent.scrollTop;
+ parent = parent.parentNode;
+ }
+
+ if ( accountForDocScroll ) {
+ x -= this.docScrollLeft();
+ y -= this.docScrollTop();
+ }
+
+ return { x:x, y:y };
+ },
+
+ docScrollLeft: function() {
+ if ( window.pageXOffset )
+ return window.pageXOffset;
+ else if ( document.documentElement && document.documentElement.scrollLeft )
+ return document.documentElement.scrollLeft;
+ else if ( document.body )
+ return document.body.scrollLeft;
+ else
+ return 0;
+ },
+
+ docScrollTop: function() {
+ if ( window.pageYOffset )
+ return window.pageYOffset;
+ else if ( document.documentElement && document.documentElement.scrollTop )
+ return document.documentElement.scrollTop;
+ else if ( document.body )
+ return document.body.scrollTop;
+ else
+ return 0;
+ }
+
+};
diff --git a/js/prototype-window-1.3/samples/tooltips/tooltip.html b/js/prototype-window-1.3/samples/tooltips/tooltip.html
new file mode 100755
index 0000000..fb3b897
--- /dev/null
+++ b/js/prototype-window-1.3/samples/tooltips/tooltip.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <script type="text/javascript" src="../../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../../javascripts/effects.js"> </script>
+ <script type="text/javascript" src="../../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../../javascripts/debug.js"> </script>
+ <script type="text/javascript" src="../../javascripts/tooltip.js"> </script>
+
+ <link href="../../themes/default.css" rel="stylesheet" type="text/css" > </link>
+ <link href="../../themes/alphacube.css" rel="stylesheet" type="text/css" > </link>
+
+ <title>Tooltip</title>
+ <style>
+ body {
+ background:#ECECEC;
+ }
+ .tooltip, .green {
+ color:#191;
+ text-decoration: underline;
+ }
+ .tooltip_content{
+ font: 14px "Trebuchet MS",Verdana,Arial,sans-serif;
+ overflow:hidden;
+ margin:0;
+ padding:0;
+ }
+ .tooltip_content h3 {
+ margin:0;
+ padding:0;
+ }
+ .alphacube_content {
+ overflow:hidden;
+ }
+ </style>
+</head>
+
+<body>
+<h1> Lorem ipsum dolor sit amet</h1>
+
+<h2> Consectetur adipiscing elit</h2>
+ Eset eiusmod tempor incidunt et <span class="tooltip html_tooltip_content1">html content by css class</span> magna aliquam. Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incommod quae egen ium improb fugiend. Officia deserunt mollit anim id est laborum Et harumd dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda et tam. Neque pecun modut est neque nonor et imper ned libidig met, consectetur adipiscing elit, sed ut labore et dolore magna aliquam is nostrud exercitation ullam mmodo consequet.
+
+<h2> Duis aute in voluptate velit esse</h2>
+ Cillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est <span class="tooltip html_tooltip_content2">html content by css class</span>. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon. Offoctivo immoriatoly, hawrgasi pwicos asi sirucor. Thas <span id="tooltip1" class="green">content set by addHTML</span> applios tyu thuso itoms ghuso pwicos gosi sirucor in mixent gosi sirucor ic mixent ples cak ontisi sowios uf Zerm hawr rwivos. Unte af phen neige pheings atoot Prexs eis phat eit sakem eit vory gast te Plok peish ba useing phen roxas. Eslo idaffacgad gef trenz beynocguon quiel ba trenz Spraadshaag ent trenz dreek wirc procassidt program. Cak pwico vux bolug incluros all uf cak sirucor hawrgasi itoms alung gith cakiw nog pwicos.
+
+<h2> Plloaso mako nuto uf cakso dodtos</h2>
+ Koop a cupy uf cak vux noaw yerw phuno. Whag <span class="tooltip ajax_123">ajax content by css class</span>., uf efed, quiel ba mada su otrenzr swipontgwook proudgs hus yag su ba dagarmidad. Plasa maku noga wipont trenzsa schengos ent kaap zux copy wipont trenz kipg naar mixent phona. Cak pwico siructiun ruos nust apoply tyu cak UCU sisulutiun munityuw uw cak UCU-TGU jot scannow. Trens roxas eis ti Plokeing quert loppe eis yop prexs. Piy opher hawers, eit yaggles orn ti sumbloat alohe plok. Su havo loasor cakso tgu pwuructs tyu InfuBwain, ghu gill nug bo suloly sispunsiblo fuw cakiw salo anr ristwibutiun. Hei muk neme eis loppe. Treas em wankeing ont sime ploked <span id="tooltip2" class="green">content set by addAjax</span> rof phen sumbloat syug si phat phey gavet peish ta paat ein pheeir sumbloats. Aslu unaffoctor gef cak siructiun gill bo cak spiarshoot anet cak GurGanglo gur pwucossing pwutwam. Ghat dodtos, ig pany, gill bo maro tyu ucakw suftgasi pwuructs hod yot tyubo rotowminor. Plloaso mako nuto uf <span id="tooltip3" class="green">content set by addURL</span> dodtos anr koop a cupy uf cak vux noaw yerw phuno. Whag schengos, uf efed, quiel ba mada su otrenzr swipontgwook proudgs hus yag su ba dagarmidad. Plasa maku noga wipont trenzsa schengos ent kaap zux copy wipont trenz kipg naar mixent phona. Cak pwico siructiun ruos nust apoply tyu cak UCU sisulutiun munityuw uw cak UCU-TGU jot scannow. Trens roxas eis ti Plokeing quert loppe eis yop prexs. Piy opher hawers, eit yaggles orn ti sumbloat alohe plok. Su havo loasor cakso tgu pwuructs tyu.
+ <span id="tooltip4" class="green">wizzard
+ <a class="hover" href="#onClickURL"><img src="../_img/user-thumb.png" alt="toto" height="12" width="12" style="border:0px;" />wizzard</a>
+ </span>
+
+<div id="tooltip_content1" style="display:none">
+ <div class="tooltip_content">
+ <h3>HTML Tooltip</h3>
+Cillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon.
+ </div>
+</div>
+<div id="tooltip_content2" style="display:none">
+ <div class="tooltip_content">
+ <h3>HTML Tooltip</h3>
+Cillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est praesent.
+ </div>
+</div>
+
+<script>
+ TooltipManager.init("tooltip", {url: "tooltip_ajax.html", options: {method: 'get'}}, {showEffect: Element.show, hideEffect: Element.hide});
+
+ TooltipManager.addHTML("tooltip1", "tooltip_content2");
+ TooltipManager.addAjax("tooltip2", {url: "tooltip_ajax.html", options: {method: 'get'}});
+ TooltipManager.addURL("tooltip3", "tooltip_url.html", 250, 300);
+
+ TooltipManager.addAjax("tooltip4", {url: "tooltip_ajax.html", options: {method: 'get'}});
+</script>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/tooltips/tooltip_ajax.html b/js/prototype-window-1.3/samples/tooltips/tooltip_ajax.html
new file mode 100755
index 0000000..212ae4c
--- /dev/null
+++ b/js/prototype-window-1.3/samples/tooltips/tooltip_ajax.html
@@ -0,0 +1,4 @@
+ <div class="tooltip_content">
+ <h3>AJAX Tooltip</h3>
+Cillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon.
+ </div>
diff --git a/js/prototype-window-1.3/samples/tooltips/tooltip_url.html b/js/prototype-window-1.3/samples/tooltips/tooltip_url.html
new file mode 100755
index 0000000..0634621
--- /dev/null
+++ b/js/prototype-window-1.3/samples/tooltips/tooltip_url.html
@@ -0,0 +1,21 @@
+<!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" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>tooltip_url</title>
+
+</head>
+
+<body>
+ <div class="tooltip_content">
+ <h3>URL Tooltip</h3>
+ Cillum dolore eu fugiat nulla pariatur. At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon.
+ </div>
+ <script>
+ console.dir(top)
+ </script>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/window_key.html b/js/prototype-window-1.3/samples/window_key.html
new file mode 100755
index 0000000..8786ea6
--- /dev/null
+++ b/js/prototype-window-1.3/samples/window_key.html
@@ -0,0 +1,38 @@
+<html>
+
+<head>
+<title>WindowCloseKey example</title>
+<script type="text/javascript" src="../javascripts/prototype.js"> </script>
+<script type="text/javascript" src="../javascripts/window.js"> </script>
+<script type="text/javascript" src="../javascripts/window_ext.js"> </script>
+<script type="text/javascript" src="../javascripts/effects.js"> </script>
+<script type="text/javascript" src="../javascripts/debug.js"> </script>
+<link href="../themes/default.css" rel="stylesheet" type="text/css">
+<!-- Add this to have a specific theme-->
+<link href="../themes/alphacube.css" rel="stylesheet" type="text/css">
+
+
+</head>
+
+<body>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<center><a href="#" onclick="dialog();">open dialog (and close it with escape key)</a></center>
+
+<script type="text/javascript">
+
+function dialog() {
+ Dialog.alert("You can close this panel with escape key or by clicking on the close button below.",
+ {windowParameters: {className: "alphacube", width:300, height:100}, okLabel: "close",
+ ok:function(win) {debug("validate alert panel"); return true;}, cancel:function(win) {debug("validate cancel panel"); return true;}});
+}
+new Window({url: "window_key_url_content.html", className: "alphacube" }).show()
+WindowCloseKey.init();
+</script>
+</body>
+
+</html> \ No newline at end of file
diff --git a/js/prototype-window-1.3/samples/window_key_url_content.html b/js/prototype-window-1.3/samples/window_key_url_content.html
new file mode 100755
index 0000000..8525f5e
--- /dev/null
+++ b/js/prototype-window-1.3/samples/window_key_url_content.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+
+ <title>window_store_url_content</title>
+ <script type="text/javascript" src="../javascripts/prototype.js"> </script>
+ <script type="text/javascript" src="../javascripts/window.js"> </script>
+ <script type="text/javascript" src="../javascripts/window_ext.js"> </script>
+
+</head>
+
+<body>
+Url Content
+
+<script type="text/javascript">
+ WindowCloseKey.init();
+</script>
+</body>
+</html>
diff --git a/js/prototype-window-1.3/samples/window_store.html b/js/prototype-window-1.3/samples/window_store.html
new file mode 100755
index 0000000..b6c3221
--- /dev/null
+++ b/js/prototype-window-1.3/samples/window_store.html
@@ -0,0 +1,51 @@
+<html>
+
+<head>
+<title>WindowStore example</title>
+<script type="text/javascript" src="../javascripts/prototype.js"> </script>
+<script type="text/javascript" src="../javascripts/effects.js"> </script>
+<script type="text/javascript" src="../javascripts/window.js"> </script>
+<script type="text/javascript" src="../javascripts/window_ext.js"> </script>
+<script type="text/javascript" src="../javascripts/debug.js"> </script>
+<link href="../themes/default.css" rel="stylesheet" type="text/css">
+<!-- Add this to have a specific theme-->
+<link href="../themes/alphacube.css" rel="stylesheet" type="text/css">
+
+
+</head>
+
+<body>
+<b>My personal configuration of the windows:</b><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<center><a href="#" onclick="win1.show();">open window1</a></center>
+<center><a href="#" onclick="win2.show();">open window2</a></center>
+<center><a href="#" onclick="win3.show();">open window3</a></center>
+<center><a href="#" onclick="win4.show();">open window4</a></center>
+
+<script type="text/javascript">
+
+
+win1 = new Window('1', {className: "alphacube", title: "Sample1", width:200, height:150, top:70, left:100}); win1.getContent().innerHTML = "<h1>1</h1>";
+</script>
+
+<script type="text/javascript">
+win2 = new Window('2', {className: "alphacube", title: "Sample2", width:200, height:150, top:270, left:100}); win2.getContent().innerHTML = "<h1>2</h1>";
+</script>
+
+<script type="text/javascript">
+win3 = new Window('3', {className: "alphacube", title: "Sample3", width:200, height:150, top:270, left:400}); win3.getContent().innerHTML = "<h1>3</h1>";
+</script>
+
+<script type="text/javascript">
+win4 = new Window('4', {className: "alphacube", title: "Sample4", width:200, height:150, top:70, left:800}); win4.getContent().innerHTML = "<h1>4</h1>";
+WindowStore.show(win4);
+WindowStore.init();
+</script>
+</body>
+
+</html> \ No newline at end of file
diff --git a/js/prototype-window-1.3/themes/alert.css b/js/prototype-window-1.3/themes/alert.css
new file mode 100755
index 0000000..432d14e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert.css
@@ -0,0 +1,119 @@
+.overlay_alert {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.alert_nw {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/top_left.gif) no-repeat bottom left;
+}
+
+.alert_n {
+ height: 5px;
+ background: transparent url(alert/top.gif) repeat-x bottom left;
+}
+
+.alert_ne {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/top_right.gif) no-repeat bottom left
+}
+
+.alert_e {
+ width: 5px;
+ background: transparent url(alert/right.gif) repeat-y 0 0;
+}
+
+.alert_w {
+ width: 5px;
+ background: transparent url(alert/left.gif) repeat-y 0 0;
+}
+
+.alert_sw {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/bottom_left.gif) no-repeat 0 0;
+}
+
+.alert_s {
+ height: 5px;
+ background: transparent url(alert/bottom.gif) repeat-x 0 0;
+}
+
+.alert_se, .alert_sizer {
+ width: 5px;
+ height: 5px;
+ background: transparent url(alert/bottom_right.gif) no-repeat 0 0;
+}
+
+.alert_close {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_minimize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_maximize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_title {
+ float:left;
+ height:1px;
+ width:100%;
+}
+
+.alert_content {
+ overflow:visible;
+ color: #000;
+ font-family: Tahoma, Arial, sans-serif;
+ font: 12px arial;
+ background: #FFF;
+}
+
+/* For alert/confirm dialog */
+.alert_window {
+ background: #FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.alert_message {
+ font: 12px arial;
+ width:100%;
+ color:#F00;
+ padding-bottom:10px;
+}
+
+.alert_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.alert_buttons input {
+ width:20%;
+ margin:10px;
+}
+
+.alert_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background: #FFF url('alert/progress.gif') no-repeat center center
+}
+
+
diff --git a/js/prototype-window-1.3/themes/alert/bottom.gif b/js/prototype-window-1.3/themes/alert/bottom.gif
new file mode 100755
index 0000000..9870f52
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/bottom.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/bottom_left.gif b/js/prototype-window-1.3/themes/alert/bottom_left.gif
new file mode 100755
index 0000000..583f113
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/bottom_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/bottom_right.gif b/js/prototype-window-1.3/themes/alert/bottom_right.gif
new file mode 100755
index 0000000..230ba12
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/bottom_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/left.gif b/js/prototype-window-1.3/themes/alert/left.gif
new file mode 100755
index 0000000..4a3fab5
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/overlay.png b/js/prototype-window-1.3/themes/alert/overlay.png
new file mode 100755
index 0000000..2f3344e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/overlay.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/progress.gif b/js/prototype-window-1.3/themes/alert/progress.gif
new file mode 100755
index 0000000..529e72f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/progress.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/right.gif b/js/prototype-window-1.3/themes/alert/right.gif
new file mode 100755
index 0000000..85ba9e2
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/top.gif b/js/prototype-window-1.3/themes/alert/top.gif
new file mode 100755
index 0000000..8f61936
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/top_left.gif b/js/prototype-window-1.3/themes/alert/top_left.gif
new file mode 100755
index 0000000..fabb33a
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/top_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert/top_right.gif b/js/prototype-window-1.3/themes/alert/top_right.gif
new file mode 100755
index 0000000..9fec6fa
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert/top_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alert_lite.css b/js/prototype-window-1.3/themes/alert_lite.css
new file mode 100755
index 0000000..c2ad538
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alert_lite.css
@@ -0,0 +1,88 @@
+.overlay_alert_lite {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.alert_lite_sizer {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_close {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_minimize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_maximize {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_title {
+ width:0px;
+ height:0px;
+ display:none;
+}
+
+.alert_lite_content {
+ overflow:auto;
+ color: #000;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background: #FFF;
+}
+
+
+/* For alert/confirm dialog */
+.alert_lite_window {
+ border:1px solid #F00;
+ background: #FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.alert_lite_message {
+ font-size:16px;
+ text-align:center;
+ width:100%;
+ color:#F00;
+ padding-bottom:10px;
+}
+
+.alert_lite_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.alert_lite_buttons input {
+ width:20%;
+ margin:10px;
+}
+
+.alert_lite_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background: #FFF url('alert/progress.gif') no-repeat center center
+}
+
+table.alert_lite_header {
+ border:1px solid #F00;
+ background:#FFF
+}
+
diff --git a/js/prototype-window-1.3/themes/alphacube.css b/js/prototype-window-1.3/themes/alphacube.css
new file mode 100755
index 0000000..7d2790e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube.css
@@ -0,0 +1,150 @@
+.overlay_alphacube {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.alphacube_nw {
+ background: transparent url(alphacube/left-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.alphacube_n {
+ background: transparent url(alphacube/top-middle.gif) repeat-x 0 0;
+ height:25px;
+}
+
+.alphacube_ne {
+ background: transparent url(alphacube/right-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.alphacube_w {
+ background: transparent url(alphacube/frame-left.gif) repeat-y top left;
+ width:7px;
+}
+
+.alphacube_e {
+ background: transparent url(alphacube/frame-right.gif) repeat-y top right;
+ width:7px;
+}
+
+.alphacube_sw {
+ background: transparent url(alphacube/bottom-left-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.alphacube_s {
+ background: transparent url(alphacube/bottom-middle.gif) repeat-x 0 0;
+ height:7px;
+}
+
+.alphacube_se, .alphacube_sizer {
+ background: transparent url(alphacube/bottom-right-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.alphacube_sizer {
+ cursor:se-resize;
+}
+
+.alphacube_close {
+ width: 23px;
+ height: 23px;
+ background: transparent url(alphacube/button-close-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:11px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.alphacube_minimize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(alphacube/button-min-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:55px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.alphacube_maximize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(alphacube/button-max-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:33px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.alphacube_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#123456;
+}
+
+.alphacube_content {
+ overflow:auto;
+ color: #000;
+ font-family: Tahoma, Arial, sans-serif;
+ font: 12px arial;
+ background:#FDFDFD;
+}
+
+/* For alert/confirm dialog */
+.alphacube_window {
+ border:1px solid #F00;
+ background: #FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.alphacube_message {
+ font: 12px arial;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.alphacube_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.alphacube_buttons input {
+ width:20%;
+ margin:10px;
+}
+
+.alphacube_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background: #FFF url('alert/progress.gif') no-repeat center center
+}
+
+.alphacube_wired_frame {
+ background: #FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+
diff --git a/js/prototype-window-1.3/themes/alphacube/bottom-left-c.gif b/js/prototype-window-1.3/themes/alphacube/bottom-left-c.gif
new file mode 100755
index 0000000..531acdc
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/bottom-left-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/bottom-middle.gif b/js/prototype-window-1.3/themes/alphacube/bottom-middle.gif
new file mode 100755
index 0000000..d4ce3be
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/bottom-middle.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/bottom-right-c.gif b/js/prototype-window-1.3/themes/alphacube/bottom-right-c.gif
new file mode 100755
index 0000000..2164c22
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/bottom-right-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/button-close-focus.gif b/js/prototype-window-1.3/themes/alphacube/button-close-focus.gif
new file mode 100755
index 0000000..99f635c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/button-close-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/button-max-focus.gif b/js/prototype-window-1.3/themes/alphacube/button-max-focus.gif
new file mode 100755
index 0000000..1708a1e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/button-max-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/button-min-focus.gif b/js/prototype-window-1.3/themes/alphacube/button-min-focus.gif
new file mode 100755
index 0000000..ff69d1b
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/button-min-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/frame-left.gif b/js/prototype-window-1.3/themes/alphacube/frame-left.gif
new file mode 100755
index 0000000..543f13d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/frame-left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/frame-right.gif b/js/prototype-window-1.3/themes/alphacube/frame-right.gif
new file mode 100755
index 0000000..5d7afef
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/frame-right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/left-top.gif b/js/prototype-window-1.3/themes/alphacube/left-top.gif
new file mode 100755
index 0000000..8373aaa
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/left-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/right-top.gif b/js/prototype-window-1.3/themes/alphacube/right-top.gif
new file mode 100755
index 0000000..77cf65e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/right-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/alphacube/top-middle.gif b/js/prototype-window-1.3/themes/alphacube/top-middle.gif
new file mode 100755
index 0000000..9cab17d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/alphacube/top-middle.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/behavior.htc b/js/prototype-window-1.3/themes/behavior.htc
new file mode 100755
index 0000000..437c5ec
--- /dev/null
+++ b/js/prototype-window-1.3/themes/behavior.htc
@@ -0,0 +1,51 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="propertyChanged()" />
+<script>
+
+var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32";
+var realSrc;
+var blankSrc = "blank.gif";
+
+if (supported) fixImage();
+
+function propertyChanged() {
+ if (!supported) return;
+
+ var pName = event.propertyName;
+ if (pName != "src") return;
+ // if not set to blank
+ if ( ! new RegExp(blankSrc).test(src))
+ fixImage();
+};
+
+function fixImage() {
+ // get src
+ var src = element.src;
+
+ // check for real change
+ if (src == realSrc) {
+ element.src = blankSrc;
+ return;
+ }
+
+ if ( ! new RegExp(blankSrc).test(src)) {
+ // backup old src
+ realSrc = src;
+ }
+
+ // test for png
+ if ( /\.png$/.test( realSrc.toLowerCase() ) ) {
+ // set blank image
+ element.src = blankSrc;
+ // set filter
+ element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
+ src + "',sizingMethod='scale')";
+ }
+ else {
+ // remove filter
+ element.runtimeStyle.filter = "";
+ }
+}
+
+</script>
+</public:component> \ No newline at end of file
diff --git a/js/prototype-window-1.3/themes/darkX.css b/js/prototype-window-1.3/themes/darkX.css
new file mode 100755
index 0000000..2f83cfd
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX.css
@@ -0,0 +1,121 @@
+.overlay_darkX {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.darkX_nw {
+ background: transparent url(darkX/titlebar-left-focused.png) no-repeat 0 0;
+ width:6px;
+ height:21px;
+}
+.darkX_n {
+ background: transparent url(darkX/titlebar-mid-focused.png) repeat-x 0 0;
+ height:21px;
+}
+.darkX_ne {
+ background: transparent url(darkX/titlebar-right-focused.png) no-repeat 0 0;
+ width:6px;
+ height:21px;
+}
+.darkX_w {
+ background: transparent url(darkX/frame-left-focused.png) repeat-y top left;
+ width:3px;
+}
+
+.darkX_e {
+ background: transparent url(darkX/frame-right-focused.png) repeat-y top right;
+ width:3px;
+}
+
+.darkX_sw {
+ background: transparent url(darkX/frame-bottom-left-focused.png) no-repeat 0 0;
+ width:5px;
+ height:3px;
+}
+.darkX_s {
+ background: transparent url(darkX/frame-bottom-mid-focused.png) repeat-x 0 0;
+ height:3px;
+}
+.darkX_se, .darkX_sizer {
+ background: transparent url(darkX/frame-bottom-right-focused.png) no-repeat 0 0;
+ width:5px;
+ height:3px;
+}
+
+.darkX_sizer {
+ cursor:se-resize;
+}
+
+.darkX_close {
+ width: 21px;
+ height: 21px;
+ background: transparent url(darkX/button-close-focused.png) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:5px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkX_minimize {
+ width: 21px;
+ height: 21px;
+ background: transparent url(darkX/button-minimize-focused.png) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:26px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkX_maximize {
+ width: 21px;
+ height: 21px;
+ background: transparent url(darkX/button-maximize-focused.png) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:47px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+
+.darkX_title {
+ float:left;
+ height:14px;
+ font-size:12px;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#FFF;
+}
+
+.darkX_content {
+ overflow:auto;
+ color: #E6DF2A;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 14px;
+ background:#5E5148;
+}
+
+
+/* FOR IE */
+* html .darkX_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-minimize-focused.png", sizingMethod="crop");
+}
+
+* html .darkX_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-maximize-focused.png", sizingMethod="scale");
+}
+
+* html .darkX_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-close-focused.png", sizingMethod="crop");
+}
diff --git a/js/prototype-window-1.3/themes/darkX/button-close-focused.png b/js/prototype-window-1.3/themes/darkX/button-close-focused.png
new file mode 100755
index 0000000..da5a8ac
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/button-close-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/button-maximize-focused.png b/js/prototype-window-1.3/themes/darkX/button-maximize-focused.png
new file mode 100755
index 0000000..b0bd9cd
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/button-maximize-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/button-minimize-focused.png b/js/prototype-window-1.3/themes/darkX/button-minimize-focused.png
new file mode 100755
index 0000000..b04e18f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/button-minimize-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/frame-bottom-left-focused.png b/js/prototype-window-1.3/themes/darkX/frame-bottom-left-focused.png
new file mode 100755
index 0000000..7d89f7b
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/frame-bottom-left-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/frame-bottom-mid-focused.png b/js/prototype-window-1.3/themes/darkX/frame-bottom-mid-focused.png
new file mode 100755
index 0000000..e50eacc
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/frame-bottom-mid-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/frame-bottom-right-focused.png b/js/prototype-window-1.3/themes/darkX/frame-bottom-right-focused.png
new file mode 100755
index 0000000..8915659
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/frame-bottom-right-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/frame-left-focused.png b/js/prototype-window-1.3/themes/darkX/frame-left-focused.png
new file mode 100755
index 0000000..ff9f336
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/frame-left-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/frame-right-focused.png b/js/prototype-window-1.3/themes/darkX/frame-right-focused.png
new file mode 100755
index 0000000..f69ea00
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/frame-right-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/titlebar-left-focused.png b/js/prototype-window-1.3/themes/darkX/titlebar-left-focused.png
new file mode 100755
index 0000000..1436e84
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/titlebar-left-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/titlebar-mid-focused.png b/js/prototype-window-1.3/themes/darkX/titlebar-mid-focused.png
new file mode 100755
index 0000000..f7be50b
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/titlebar-mid-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/darkX/titlebar-right-focused.png b/js/prototype-window-1.3/themes/darkX/titlebar-right-focused.png
new file mode 100755
index 0000000..ae23785
--- /dev/null
+++ b/js/prototype-window-1.3/themes/darkX/titlebar-right-focused.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/debug.css b/js/prototype-window-1.3/themes/debug.css
new file mode 100755
index 0000000..69e3b7f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/debug.css
@@ -0,0 +1,25 @@
+div.inspector div.inspectable {
+ padding: 0.25em 0 0.25em 1em;
+ background-color: Gray;
+ color: white;
+ border: outset 2px white;
+ cursor: pointer;
+}
+
+div.inspector div.child {
+ margin: 0 0 0 1em;
+}
+
+#debug_window_content { /* DIV container for debug sizing*/
+ width:250px;
+ height:100px;
+ background-color:#000;
+}
+
+#debug { /* DIV container for debug contents*/
+ padding:3px;
+ color:#0f0;
+ font-family:monaco, Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-size:10px;
+}
+
diff --git a/js/prototype-window-1.3/themes/default.css b/js/prototype-window-1.3/themes/default.css
new file mode 100755
index 0000000..6ab1378
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default.css
@@ -0,0 +1,155 @@
+.overlay_dialog {
+ background-color: #666666;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.overlay___invisible__ {
+ background-color: #666666;
+ filter:alpha(opacity=0);
+ -moz-opacity: 0;
+ opacity: 0;
+}
+
+.dialog_nw {
+ width: 9px;
+ height: 23px;
+ background: transparent url(default/top_left.gif) no-repeat 0 0;
+}
+
+.dialog_n {
+ background: transparent url(default/top_mid.gif) repeat-x 0 0;
+ height: 23px;
+}
+
+.dialog_ne {
+ width: 9px;
+ height: 23px;
+ background: transparent url(default/top_right.gif) no-repeat 0 0;
+}
+
+.dialog_e {
+ width: 2px;
+ background: transparent url(default/center_right.gif) repeat-y 0 0;
+}
+
+.dialog_w {
+ width: 2px;
+ background: transparent url(default/center_left.gif) repeat-y 0 0;
+}
+
+.dialog_sw {
+ width: 9px;
+ height: 19px;
+ background: transparent url(default/bottom_left.gif) no-repeat 0 0;
+}
+
+.dialog_s {
+ background: transparent url(default/bottom_mid.gif) repeat-x 0 0;
+ height: 19px;
+}
+
+.dialog_se {
+ width: 9px;
+ height: 19px;
+ background: transparent url(default/bottom_right.gif) no-repeat 0 0;
+}
+
+.dialog_sizer {
+ width: 9px;
+ height: 19px;
+ background: transparent url(default/sizer.gif) no-repeat 0 0;
+ cursor:se-resize;
+}
+
+.dialog_close {
+ width: 14px;
+ height: 14px;
+ background: transparent url(default/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:5px;
+ left:8px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.dialog_minimize {
+ width: 14px;
+ height: 15px;
+ background: transparent url(default/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:5px;
+ left:28px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.dialog_maximize {
+ width: 14px;
+ height: 15px;
+ background: transparent url(default/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:5px;
+ left:49px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.dialog_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ color:#000;
+}
+
+.dialog_content {
+ overflow:auto;
+ color: #DDD;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background-color:#123;
+}
+
+.top_draggable, .bottom_draggable {
+ cursor:move;
+}
+
+.status_bar {
+ font-size:12px;
+}
+.status_bar input{
+ font-size:12px;
+}
+
+.wired_frame {
+ display: block;
+ position: absolute;
+ border: 1px #000 dashed;
+}
+
+/* DO NOT CHANGE THESE VALUES*/
+.dialog {
+ display: block;
+ position: absolute;
+}
+
+.dialog table.table_window {
+ border-collapse: collapse;
+ border-spacing: 0;
+ width: 100%;
+ margin: 0px;
+ padding:0px;
+}
+
+.dialog table.table_window td , .dialog table.table_window th {
+ padding: 0;
+}
+
+.dialog .title_window {
+ -moz-user-select:none;
+}
+
diff --git a/js/prototype-window-1.3/themes/default/bottom_left.gif b/js/prototype-window-1.3/themes/default/bottom_left.gif
new file mode 100755
index 0000000..4c73d35
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/bottom_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/bottom_mid.gif b/js/prototype-window-1.3/themes/default/bottom_mid.gif
new file mode 100755
index 0000000..9205d30
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/bottom_mid.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/bottom_right.gif b/js/prototype-window-1.3/themes/default/bottom_right.gif
new file mode 100755
index 0000000..8d002ee
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/bottom_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/bottom_right_resize.gif b/js/prototype-window-1.3/themes/default/bottom_right_resize.gif
new file mode 100755
index 0000000..649b0d8
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/bottom_right_resize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/center_left.gif b/js/prototype-window-1.3/themes/default/center_left.gif
new file mode 100755
index 0000000..79e7a1c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/center_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/center_right.gif b/js/prototype-window-1.3/themes/default/center_right.gif
new file mode 100755
index 0000000..554c55c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/center_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/clear.gif b/js/prototype-window-1.3/themes/default/clear.gif
new file mode 100755
index 0000000..c10b166
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/clear.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/close.gif b/js/prototype-window-1.3/themes/default/close.gif
new file mode 100755
index 0000000..31ef5a3
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/close.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/inspect.gif b/js/prototype-window-1.3/themes/default/inspect.gif
new file mode 100755
index 0000000..ebeeb02
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/inspect.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/maximize.gif b/js/prototype-window-1.3/themes/default/maximize.gif
new file mode 100755
index 0000000..892a0f0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/maximize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/minimize.gif b/js/prototype-window-1.3/themes/default/minimize.gif
new file mode 100755
index 0000000..a721416
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/minimize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/overlay.png b/js/prototype-window-1.3/themes/default/overlay.png
new file mode 100755
index 0000000..648e71e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/overlay.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/resize.gif b/js/prototype-window-1.3/themes/default/resize.gif
new file mode 100755
index 0000000..c440702
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/resize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/sizer.gif b/js/prototype-window-1.3/themes/default/sizer.gif
new file mode 100755
index 0000000..649b0d8
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/sizer.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/top_left.gif b/js/prototype-window-1.3/themes/default/top_left.gif
new file mode 100755
index 0000000..774538a
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/top_left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/top_mid.gif b/js/prototype-window-1.3/themes/default/top_mid.gif
new file mode 100755
index 0000000..6124e78
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/top_mid.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/default/top_right.gif b/js/prototype-window-1.3/themes/default/top_right.gif
new file mode 100755
index 0000000..fbc94bf
--- /dev/null
+++ b/js/prototype-window-1.3/themes/default/top_right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/iefix/blank.gif b/js/prototype-window-1.3/themes/iefix/blank.gif
new file mode 100755
index 0000000..75b945d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/iefix/blank.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/iefix/iepngfix.css b/js/prototype-window-1.3/themes/iefix/iepngfix.css
new file mode 100755
index 0000000..257a1b1
--- /dev/null
+++ b/js/prototype-window-1.3/themes/iefix/iepngfix.css
@@ -0,0 +1,3 @@
+/* PNG fix for all themes that uses PNG images on IE */
+td, div { behavior: url(../themes/iefix/iepngfix.htc) }
+
diff --git a/js/prototype-window-1.3/themes/iefix/iepngfix.htc b/js/prototype-window-1.3/themes/iefix/iepngfix.htc
new file mode 100755
index 0000000..a6c683b
--- /dev/null
+++ b/js/prototype-window-1.3/themes/iefix/iepngfix.htc
@@ -0,0 +1,54 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="doFix()" />
+
+<script type="text/javascript">
+
+// IE5.5+ PNG Alpha Fix v1.0RC4
+// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the CC-GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+// Modified/Simplified on 04/23/2007 by Sebastien Gruhier (http://www.xilinus.com)
+// To work only on background and to handle repeat bg
+
+// This must be a path to a blank image. That's all the configuration you need.
+if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
+
+var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+
+function filt(s, m)
+{
+ if (filters[f])
+ {
+ filters[f].enabled = s ? true : false;
+ if (s) with (filters[f]) { src = s; sizingMethod = m }
+ }
+ else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
+}
+
+function doFix()
+{
+ // Assume IE7 is OK.
+ if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
+ (event && !/(background|src)/.test(event.propertyName))) return;
+
+ var bgImg = currentStyle.backgroundImage || style.backgroundImage;
+ var bgRepeat = currentStyle.backgroundRepeat || style.backgroundRepeat;
+ if (bgImg && bgImg != 'none')
+ {
+ if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
+ {
+ var s = RegExp.$1;
+ if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ style.width = offsetWidth + 'px';
+ style.backgroundImage = 'none';
+ filt(s, bgRepeat == "no-repeat" ? 'crop' : 'scale');
+ }
+ }
+}
+
+doFix();
+
+</script>
+</public:component> \ No newline at end of file
diff --git a/js/prototype-window-1.3/themes/lighting.css b/js/prototype-window-1.3/themes/lighting.css
new file mode 100755
index 0000000..95ec287
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting.css
@@ -0,0 +1,960 @@
+.overlay___invisible__ {
+ background-color: #666;
+ filter:alpha(opacity=0);
+ -moz-opacity: 0;
+ opacity: 0;
+}
+
+.top_draggable, .bottom_draggable {
+ cursor:move;
+}
+
+.status_bar {
+ font-size:12px;
+}
+.status_bar input{
+ font-size:12px;
+}
+
+.wired_frame {
+ display:block;
+ position:absolute;
+ border:1px #000 dashed;
+}
+
+
+
+.overlay_bluelighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.bluelighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.bluelighting_nw {
+ background:transparent url(lighting/top-left-blue.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.bluelighting_n {
+ background:transparent url(lighting/top-middle-blue.png) repeat-x 0 0;
+ height:28px;
+}
+
+.bluelighting_ne {
+ background:transparent url(lighting/top-right-blue.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.bluelighting_w {
+ background:transparent url(lighting/left-blue.png) repeat-y top left;
+ width:9px;
+}
+
+.bluelighting_e {
+ background:transparent url(lighting/right-blue.png) repeat-y top right;
+ width:15px;
+}
+
+.bluelighting_sw {
+ background:transparent url(lighting/bottom-left-blue.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.bluelighting_s {
+ background:transparent url(lighting/bottom-middle-blue.png) repeat-x 0 0;
+ height:15px;
+}
+
+.bluelighting_se, .bluelighting_sizer {
+ background:transparent url(lighting/bottom-right-blue.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.bluelighting_sizer {
+ cursor:se-resize;
+}
+
+.bluelighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-blue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.bluelighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-blue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.bluelighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-blue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.bluelighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#17385B;
+}
+
+.bluelighting_content {
+ overflow:auto;
+ color:#000;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#BFDBFF;
+}
+
+/* For alert/confirm dialog */
+.bluelighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.bluelighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.bluelighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.bluelighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.bluelighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .bluelighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-blue.png", sizingMethod="scale");
+}
+
+* html .bluelighting_se, * html .bluelighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-blue.png", sizingMethod="crop");
+}
+
+* html .bluelighting_content {
+ background:#B8D7FF;
+}
+
+
+
+.overlay_greylighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greylighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greylighting_nw {
+ background:transparent url(lighting/top-left-grey.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.greylighting_n {
+ background:transparent url(lighting/top-middle-grey.png) repeat-x 0 0;
+ height:28px;
+}
+
+.greylighting_ne {
+ background:transparent url(lighting/top-right-grey.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.greylighting_w {
+ background:transparent url(lighting/left-grey.png) repeat-y top left;
+ width:9px;
+}
+
+.greylighting_e {
+ background:transparent url(lighting/right-grey.png) repeat-y top right;
+ width:15px;
+}
+
+.greylighting_sw {
+ background:transparent url(lighting/bottom-left-grey.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.greylighting_s {
+ background:transparent url(lighting/bottom-middle-grey.png) repeat-x 0 0;
+ height:15px;
+}
+
+.greylighting_se, .greylighting_sizer {
+ background:transparent url(lighting/bottom-right-grey.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.greylighting_sizer {
+ cursor:se-resize;
+}
+
+.greylighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-grey.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greylighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-grey.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greylighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-grey.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greylighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#525252;
+}
+
+.greylighting_content {
+ overflow:auto;
+ color:#000;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#CDCDCD;
+}
+
+/* For alert/confirm dialog */
+.greylighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.greylighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.greylighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.greylighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.greylighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .greylighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-grey.png", sizingMethod="scale");
+}
+
+* html .greylighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-grey.png", sizingMethod="scale");
+}
+
+* html .greylighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-grey.png", sizingMethod="scale");
+}
+
+* html .greylighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-grey.png", sizingMethod="scale");
+}
+
+* html greylighting_se, * html .greylighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-grey.png", sizingMethod="crop");
+}
+
+* html .greylighting_content {
+ background:#C7C7C7;
+}
+
+
+
+.overlay_greenlighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greenlighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.greenlighting_nw {
+ background:transparent url(lighting/top-left-green.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.greenlighting_n {
+ background:transparent url(lighting/top-middle-green.png) repeat-x 0 0;
+ height:28px;
+}
+
+.greenlighting_ne {
+ background:transparent url(lighting/top-right-green.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.greenlighting_w {
+ background:transparent url(lighting/left-green.png) repeat-y top left;
+ width:9px;
+}
+
+.greenlighting_e {
+ background:transparent url(lighting/right-green.png) repeat-y top right;
+ width:15px;
+}
+
+.greenlighting_sw {
+ background:transparent url(lighting/bottom-left-green.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.greenlighting_s {
+ background:transparent url(lighting/bottom-middle-green.png) repeat-x 0 0;
+ height:15px;
+}
+
+.greenlighting_se, .greenlighting_sizer {
+ background:transparent url(lighting/bottom-right-green.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.greenlighting_sizer {
+ cursor:se-resize;
+}
+
+.greenlighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-green.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greenlighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-green.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greenlighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-green.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.greenlighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#2A6002;
+}
+
+.greenlighting_content {
+ overflow:auto;
+ color:#000;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#ACFCAF;
+}
+
+/* For alert/confirm dialog */
+.greenlighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.greenlighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.greenlighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.greenlighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.greenlighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .greenlighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-green.png", sizingMethod="scale");
+}
+
+* html .greenlighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-green.png", sizingMethod="scale");
+}
+
+* html .greenlighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-green.png", sizingMethod="scale");
+}
+
+* html .greenlighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-green.png", sizingMethod="scale");
+}
+
+* html greenlighting_se, * html .greenlighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-green.png", sizingMethod="crop");
+}
+
+* html .greenlighting_content {
+ background:#A4FCA7;
+}
+
+
+
+.overlay_darkbluelighting {
+ background-color:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.darkbluelighting_wired_frame {
+ background:#FFF;
+ filter:alpha(opacity=60);
+ -moz-opacity:0.6;
+ opacity:0.6;
+}
+
+.darkbluelighting_nw {
+ background:transparent url(lighting/top-left-darkblue.png) no-repeat 0 0;
+ width:9px;
+ height:28px;
+}
+
+.darkbluelighting_n {
+ background:transparent url(lighting/top-middle-darkblue.png) repeat-x 0 0;
+ height:28px;
+}
+
+.darkbluelighting_ne {
+ background:transparent url(lighting/top-right-darkblue.png) no-repeat 0 0;
+ width:15px;
+ height:28px;
+}
+
+.darkbluelighting_w {
+ background:transparent url(lighting/left-darkblue.png) repeat-y top left;
+ width:9px;
+}
+
+.darkbluelighting_e {
+ background:transparent url(lighting/right-darkblue.png) repeat-y top right;
+ width:15px;
+}
+
+.darkbluelighting_sw {
+ background:transparent url(lighting/bottom-left-darkblue.png) no-repeat 0 0;
+ width:9px;
+ height:15px;
+}
+
+.darkbluelighting_s {
+ background:transparent url(lighting/bottom-middle-darkblue.png) repeat-x 0 0;
+ height:15px;
+}
+
+.darkbluelighting_se, .darkbluelighting_sizer {
+ background:transparent url(lighting/bottom-right-darkblue.png) no-repeat 0 0;
+ width:15px;
+ height:15px;
+}
+
+.darkbluelighting_sizer {
+ cursor:se-resize;
+}
+
+.darkbluelighting_close {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-close-darkblue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:10px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkbluelighting_maximize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-maximize-darkblue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkbluelighting_minimize {
+ width:15px;
+ height:9px;
+ background:transparent url(lighting/button-minimize-darkblue.png) no-repeat 0 0;
+ position:absolute;
+ top:11px;
+ right:40px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.darkbluelighting_title {
+ float:left;
+ height:14px;
+ font-size:14px;
+ font-weight:bold;
+ font-family:Verdana, Arial, sans-serif;
+ text-align:center;
+ margin-top:2px;
+ width:100%;
+ color:#E4EFFD;
+}
+
+.darkbluelighting_content {
+ overflow:auto;
+ color:#FFF;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:12px;
+ background:#0413C0;
+}
+
+/* For alert/confirm dialog */
+.darkbluelighting_window {
+ border:1px solid #F00;
+ background:#FFF;
+ padding:20px;
+ margin-left:auto;
+ margin-right:auto;
+ width:400px;
+}
+
+.darkbluelighting_message {
+ font-size:12px;
+ text-align:center;
+ width:100%;
+ padding-bottom:10px;
+}
+
+.darkbluelighting_buttons {
+ text-align:center;
+ width:100%;
+}
+
+.darkbluelighting_buttons input {
+ border:1px solid #999;
+ border-top-color:#CCC;
+ border-left-color:#CCC;
+ padding:2px;
+ background-color:#FFF;
+ color:#333;
+ background-image:url(lighting/background_buttons.gif);
+ background-repeat:repeat-x;
+ font-family:Verdana, Arial, sans-serif;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+}
+
+.darkbluelighting_progress {
+ float:left;
+ margin:auto;
+ text-align:center;
+ width:100%;
+ height:16px;
+ background:transparent url('lighting/spinner.gif') no-repeat center center
+}
+
+/* FOR IE */
+* html .darkbluelighting_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-darkblue.png", sizingMethod="scale");
+}
+
+* html .darkbluelighting_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-darkblue.png", sizingMethod="scale");
+}
+
+* html .darkbluelighting_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-darkblue.png", sizingMethod="scale");
+}
+
+* html .darkbluelighting_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-darkblue.png", sizingMethod="scale");
+}
+
+* html darkbluelighting_se, * html .darkbluelighting_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_maximize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-darkblue.png", sizingMethod="crop");
+}
+
+* html .darkbluelighting_content {
+ background:#020EBA;
+}
+
diff --git a/js/prototype-window-1.3/themes/lighting/background_buttons.gif b/js/prototype-window-1.3/themes/lighting/background_buttons.gif
new file mode 100755
index 0000000..2fa58b2
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/background_buttons.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-left-blue.png b/js/prototype-window-1.3/themes/lighting/bottom-left-blue.png
new file mode 100755
index 0000000..4592c19
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-left-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-left-darkblue.png b/js/prototype-window-1.3/themes/lighting/bottom-left-darkblue.png
new file mode 100755
index 0000000..ce238f1
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-left-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-left-green.png b/js/prototype-window-1.3/themes/lighting/bottom-left-green.png
new file mode 100755
index 0000000..38f9e9e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-left-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-left-grey.png b/js/prototype-window-1.3/themes/lighting/bottom-left-grey.png
new file mode 100755
index 0000000..2ace75e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-left-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-middle-blue.png b/js/prototype-window-1.3/themes/lighting/bottom-middle-blue.png
new file mode 100755
index 0000000..439bcaa
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-middle-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-middle-darkblue.png b/js/prototype-window-1.3/themes/lighting/bottom-middle-darkblue.png
new file mode 100755
index 0000000..3fae972
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-middle-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-middle-green.png b/js/prototype-window-1.3/themes/lighting/bottom-middle-green.png
new file mode 100755
index 0000000..89a732f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-middle-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-middle-grey.png b/js/prototype-window-1.3/themes/lighting/bottom-middle-grey.png
new file mode 100755
index 0000000..52bfee0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-middle-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-right-blue.png b/js/prototype-window-1.3/themes/lighting/bottom-right-blue.png
new file mode 100755
index 0000000..dffb75f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-right-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-right-darkblue.png b/js/prototype-window-1.3/themes/lighting/bottom-right-darkblue.png
new file mode 100755
index 0000000..62a4d8b
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-right-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-right-green.png b/js/prototype-window-1.3/themes/lighting/bottom-right-green.png
new file mode 100755
index 0000000..4aee20f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-right-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/bottom-right-grey.png b/js/prototype-window-1.3/themes/lighting/bottom-right-grey.png
new file mode 100755
index 0000000..caa27fe
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/bottom-right-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-close-blue.png b/js/prototype-window-1.3/themes/lighting/button-close-blue.png
new file mode 100755
index 0000000..523e0db
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-close-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-close-darkblue.png b/js/prototype-window-1.3/themes/lighting/button-close-darkblue.png
new file mode 100755
index 0000000..a7b8daa
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-close-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-close-green.png b/js/prototype-window-1.3/themes/lighting/button-close-green.png
new file mode 100755
index 0000000..63f755b
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-close-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-close-grey.png b/js/prototype-window-1.3/themes/lighting/button-close-grey.png
new file mode 100755
index 0000000..0c5375f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-close-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-maximize-blue.png b/js/prototype-window-1.3/themes/lighting/button-maximize-blue.png
new file mode 100755
index 0000000..2cdf404
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-maximize-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-maximize-darkblue.png b/js/prototype-window-1.3/themes/lighting/button-maximize-darkblue.png
new file mode 100755
index 0000000..4ef5758
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-maximize-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-maximize-green.png b/js/prototype-window-1.3/themes/lighting/button-maximize-green.png
new file mode 100755
index 0000000..d4c1e57
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-maximize-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-maximize-grey.png b/js/prototype-window-1.3/themes/lighting/button-maximize-grey.png
new file mode 100755
index 0000000..35da0e0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-maximize-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-minimize-blue.png b/js/prototype-window-1.3/themes/lighting/button-minimize-blue.png
new file mode 100755
index 0000000..92db9a0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-minimize-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-minimize-darkblue.png b/js/prototype-window-1.3/themes/lighting/button-minimize-darkblue.png
new file mode 100755
index 0000000..e3d8654
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-minimize-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-minimize-green.png b/js/prototype-window-1.3/themes/lighting/button-minimize-green.png
new file mode 100755
index 0000000..4846e2f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-minimize-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/button-minimize-grey.png b/js/prototype-window-1.3/themes/lighting/button-minimize-grey.png
new file mode 100755
index 0000000..310bcbb
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/button-minimize-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/left-blue.png b/js/prototype-window-1.3/themes/lighting/left-blue.png
new file mode 100755
index 0000000..30275bb
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/left-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/left-darkblue.png b/js/prototype-window-1.3/themes/lighting/left-darkblue.png
new file mode 100755
index 0000000..36c10e0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/left-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/left-green.png b/js/prototype-window-1.3/themes/lighting/left-green.png
new file mode 100755
index 0000000..c8aee73
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/left-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/left-grey.png b/js/prototype-window-1.3/themes/lighting/left-grey.png
new file mode 100755
index 0000000..acc2af0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/left-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/pngbehavior.htc b/js/prototype-window-1.3/themes/lighting/pngbehavior.htc
new file mode 100755
index 0000000..36ea182
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/pngbehavior.htc
@@ -0,0 +1,67 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="doFix()" />
+
+<script type="text/javascript">
+
+// IE5.5+ PNG Alpha Fix v1.0RC4
+// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the CC-GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+
+// This must be a path to a blank image. That's all the configuration you need.
+if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
+
+
+var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+
+function filt(s, m)
+{
+ if (filters[f])
+ {
+ filters[f].enabled = s ? true : false;
+ if (s) with (filters[f]) { src = s; sizingMethod = m }
+ }
+ else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
+}
+
+function doFix()
+{
+ alert('ok')
+
+ // Assume IE7 is OK.
+ if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
+ (event && !/(background|src)/.test(event.propertyName))) return;
+
+ var bgImg = currentStyle.backgroundImage || style.backgroundImage;
+
+ if (tagName == 'IMG')
+ {
+ if ((/\.png$/i).test(src))
+ {
+ if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ style.width = offsetWidth + 'px';
+ filt(src, 'scale');
+ src = blankImg;
+ }
+ else if (src.indexOf(blankImg) < 0) filt();
+ }
+ else if (bgImg && bgImg != 'none')
+ {
+ if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
+ {
+ var s = RegExp.$1;
+ if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ style.width = offsetWidth + 'px';
+ style.backgroundImage = 'none';
+ filt(s, 'crop');
+ // IE link fix.
+ for (var n = 0; n < childNodes.length; n++)
+ if (childNodes[n].style) childNodes[n].style.position = 'relative';
+ }
+ else filt();
+ }
+}
+
+doFix();
diff --git a/js/prototype-window-1.3/themes/lighting/right-blue.png b/js/prototype-window-1.3/themes/lighting/right-blue.png
new file mode 100755
index 0000000..9df1b29
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/right-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/right-darkblue.png b/js/prototype-window-1.3/themes/lighting/right-darkblue.png
new file mode 100755
index 0000000..10c19c7
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/right-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/right-green.png b/js/prototype-window-1.3/themes/lighting/right-green.png
new file mode 100755
index 0000000..fbe6c5e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/right-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/right-grey.png b/js/prototype-window-1.3/themes/lighting/right-grey.png
new file mode 100755
index 0000000..33ef9d9
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/right-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/spinner.gif b/js/prototype-window-1.3/themes/lighting/spinner.gif
new file mode 100755
index 0000000..1ed786f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/spinner.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-left-blue.png b/js/prototype-window-1.3/themes/lighting/top-left-blue.png
new file mode 100755
index 0000000..805a7d9
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-left-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-left-darkblue.png b/js/prototype-window-1.3/themes/lighting/top-left-darkblue.png
new file mode 100755
index 0000000..3ed3e12
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-left-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-left-green.png b/js/prototype-window-1.3/themes/lighting/top-left-green.png
new file mode 100755
index 0000000..f6eb735
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-left-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-left-grey.png b/js/prototype-window-1.3/themes/lighting/top-left-grey.png
new file mode 100755
index 0000000..53411cb
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-left-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-middle-blue.png b/js/prototype-window-1.3/themes/lighting/top-middle-blue.png
new file mode 100755
index 0000000..93862ff
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-middle-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-middle-darkblue.png b/js/prototype-window-1.3/themes/lighting/top-middle-darkblue.png
new file mode 100755
index 0000000..20516e0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-middle-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-middle-green.png b/js/prototype-window-1.3/themes/lighting/top-middle-green.png
new file mode 100755
index 0000000..1352d33
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-middle-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-middle-grey.png b/js/prototype-window-1.3/themes/lighting/top-middle-grey.png
new file mode 100755
index 0000000..f353828
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-middle-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-right-blue.png b/js/prototype-window-1.3/themes/lighting/top-right-blue.png
new file mode 100755
index 0000000..a95bdb5
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-right-blue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-right-darkblue.png b/js/prototype-window-1.3/themes/lighting/top-right-darkblue.png
new file mode 100755
index 0000000..992070c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-right-darkblue.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-right-green.png b/js/prototype-window-1.3/themes/lighting/top-right-green.png
new file mode 100755
index 0000000..1ee91d4
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-right-green.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/lighting/top-right-grey.png b/js/prototype-window-1.3/themes/lighting/top-right-grey.png
new file mode 100755
index 0000000..2149502
--- /dev/null
+++ b/js/prototype-window-1.3/themes/lighting/top-right-grey.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x.css b/js/prototype-window-1.3/themes/mac_os_x.css
new file mode 100755
index 0000000..24751f8
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x.css
@@ -0,0 +1,333 @@
+/* Focused windows */
+.overlay_mac_os_x {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.mac_os_x_nw {
+ background: transparent url(mac_os_x/TL_Main.png) no-repeat 0 0;
+ width:24px;
+ height:30px;
+}
+
+.mac_os_x_n {
+ background: transparent url(mac_os_x/T_Main.png) repeat-x 0 0;
+ height:30px;
+}
+
+.mac_os_x_ne {
+ background: transparent url(mac_os_x/TR_Main.png) no-repeat 0 0;
+ width:31px;
+ height:30px;
+}
+
+.mac_os_x_w {
+ background: transparent url(mac_os_x/L_Main.png) repeat-y top left;
+ width:16px;
+}
+
+.mac_os_x_e {
+ background: transparent url(mac_os_x/R_Main.png) repeat-y top right;
+ width:16px;
+}
+
+.mac_os_x_sw {
+ background: transparent url(mac_os_x/BL_Main.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_s {
+ background: transparent url(mac_os_x/B_Main.png) repeat-x 0 0;
+ height:40px;
+}
+
+.mac_os_x_se, .mac_os_x_sizer {
+ background: transparent url(mac_os_x/BR_Main.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_sizer {
+ cursor:se-resize;
+}
+
+.mac_os_x_close {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_minimize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:45px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_maximize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:65px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ margin-top:8px;
+ width:100%;
+ color:#000;
+}
+
+.mac_os_x_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background:#FFF;
+}
+.mac_os_x_s .status_bar {
+ padding-bottom:24px;
+}
+
+/* FOR IE */
+* html .mac_os_x_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B_Main.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop");
+}
+
+
+/* Focused windows */
+.overlay_blur_os_x {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.blur_os_x_nw {
+ background: transparent url(mac_os_x/TL.png) no-repeat 0 0;
+ width:24px;
+ height:30px;
+}
+
+.blur_os_x_n {
+ background: transparent url(mac_os_x/T.png) repeat-x 0 0;
+ height:30px;
+}
+
+.blur_os_x_ne {
+ background: transparent url(mac_os_x/TR.png) no-repeat 0 0;
+ width:31px;
+ height:30px;
+}
+
+.blur_os_x_w {
+ background: transparent url(mac_os_x/L.png) repeat-y top left;
+ width:16px;
+}
+
+.blur_os_x_e {
+ background: transparent url(mac_os_x/R.png) repeat-y top right;
+ width:16px;
+}
+
+.blur_os_x_sw {
+ background: transparent url(mac_os_x/BL.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.blur_os_x_s {
+ background: transparent url(mac_os_x/B.png) repeat-x 0 0;
+ height:40px;
+}
+
+.blur_os_x_se, .blur_os_x_sizer {
+ background: transparent url(mac_os_x/BR.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.blur_os_x_sizer {
+ cursor:se-resize;
+}
+
+.blur_os_x_close {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.blur_os_x_minimize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:45px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.blur_os_x_maximize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:65px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.blur_os_x_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ margin-top:8px;
+ width:100%;
+ color:#000;
+}
+
+.blur_os_x_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background:#FFF;
+}
+.blur_os_x_s .status_bar {
+ padding-bottom:24px;
+}
+
+/* FOR IE */
+* html .blur_os_x_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B.png", sizingMethod="scale");
+}
+
+* html .blur_os_x_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop");
+}
+
+* html .blur_os_x_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop");
+}
+
diff --git a/js/prototype-window-1.3/themes/mac_os_x/B.png b/js/prototype-window-1.3/themes/mac_os_x/B.png
new file mode 100755
index 0000000..9d771ce
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/B.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/BL.png b/js/prototype-window-1.3/themes/mac_os_x/BL.png
new file mode 100755
index 0000000..fdca3eb
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/BL.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/BL_Main.png b/js/prototype-window-1.3/themes/mac_os_x/BL_Main.png
new file mode 100755
index 0000000..4b34136
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/BL_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/BR.png b/js/prototype-window-1.3/themes/mac_os_x/BR.png
new file mode 100755
index 0000000..7c1cf2c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/BR.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/BR_Main.png b/js/prototype-window-1.3/themes/mac_os_x/BR_Main.png
new file mode 100755
index 0000000..9fb2481
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/BR_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/B_Main.png b/js/prototype-window-1.3/themes/mac_os_x/B_Main.png
new file mode 100755
index 0000000..6dc4041
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/B_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/L.png b/js/prototype-window-1.3/themes/mac_os_x/L.png
new file mode 100755
index 0000000..6882cc5
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/L.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/L_Main.png b/js/prototype-window-1.3/themes/mac_os_x/L_Main.png
new file mode 100755
index 0000000..f3a8322
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/L_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/R.png b/js/prototype-window-1.3/themes/mac_os_x/R.png
new file mode 100755
index 0000000..8080ad8
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/R.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/R_Main.png b/js/prototype-window-1.3/themes/mac_os_x/R_Main.png
new file mode 100755
index 0000000..890bcd6
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/R_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/T.png b/js/prototype-window-1.3/themes/mac_os_x/T.png
new file mode 100755
index 0000000..63c265c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/T.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/TL.png b/js/prototype-window-1.3/themes/mac_os_x/TL.png
new file mode 100755
index 0000000..5fbd409
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/TL.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/TL_Main.png b/js/prototype-window-1.3/themes/mac_os_x/TL_Main.png
new file mode 100755
index 0000000..dd21126
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/TL_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/TR.png b/js/prototype-window-1.3/themes/mac_os_x/TR.png
new file mode 100755
index 0000000..aff657d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/TR.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/TR_Main.png b/js/prototype-window-1.3/themes/mac_os_x/TR_Main.png
new file mode 100755
index 0000000..3bde7f9
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/TR_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/T_Main.png b/js/prototype-window-1.3/themes/mac_os_x/T_Main.png
new file mode 100755
index 0000000..0efba3d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/T_Main.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/close.gif b/js/prototype-window-1.3/themes/mac_os_x/close.gif
new file mode 100755
index 0000000..31ef5a3
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/close.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/maximize.gif b/js/prototype-window-1.3/themes/mac_os_x/maximize.gif
new file mode 100755
index 0000000..892a0f0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/maximize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x/minimize.gif b/js/prototype-window-1.3/themes/mac_os_x/minimize.gif
new file mode 100755
index 0000000..a721416
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x/minimize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog.css b/js/prototype-window-1.3/themes/mac_os_x_dialog.css
new file mode 100755
index 0000000..e663e3c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog.css
@@ -0,0 +1,160 @@
+.overlay_mac_os_x_dialog {
+ background-color: #FF7224;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.mac_os_x_dialog_nw {
+ background: transparent url(mac_os_x_dialog/L.png) repeat-y top left;
+ width:16px;
+ height:16px;
+}
+
+.mac_os_x_dialog_n {
+ background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0;
+ height:18px;
+}
+
+.mac_os_x_dialog_ne {
+ background: transparent url(mac_os_x_dialog/R.png) repeat-y top left;
+ width:16px;
+ height:16px;
+}
+
+.mac_os_x_dialog_w {
+ background: transparent url(mac_os_x_dialog/L.png) repeat-y top left;
+ width:16px;
+}
+
+.mac_os_x_dialog_e {
+ background: transparent url(mac_os_x_dialog/R.png) repeat-y top right;
+ width:16px;
+}
+
+.mac_os_x_dialog_sw {
+ background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_dialog_s {
+ background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0;
+ height:40px;
+}
+
+.mac_os_x_dialog_se, .mac_os_x_dialog_sizer {
+ background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0;
+ width:31px;
+ height:40px;
+}
+
+.mac_os_x_dialog_sizer {
+ cursor:se-resize;
+}
+
+.mac_os_x_dialog_close {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:25px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_dialog_minimize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:45px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_dialog_maximize {
+ width: 19px;
+ height: 19px;
+ background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0;
+ position:absolute;
+ top:12px;
+ left:65px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.mac_os_x_dialog_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:12px;
+ text-align:center;
+ margin-top:6px;
+ width:100%;
+ color:#000;
+}
+
+.mac_os_x_dialog_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0;
+}
+
+.mac_os_x_dialog_buttons {
+ text-align: center;
+}
+/* FOR IE */
+* html .mac_os_x_dialog_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale");
+}
+
+
+* html .mac_os_x_dialog_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_dialog_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale");
+}
+
+* html .mac_os_x_dialog_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop");
+}
+
+* html .mac_os_x_dialog_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop");
+}
+
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/B.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/B.png
new file mode 100755
index 0000000..1549937
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/B.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/BL.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/BL.png
new file mode 100755
index 0000000..b80261f
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/BL.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/BR.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/BR.png
new file mode 100755
index 0000000..d20b654
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/BR.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/L.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/L.png
new file mode 100755
index 0000000..6882cc5
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/L.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/R.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/R.png
new file mode 100755
index 0000000..8080ad8
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/R.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/T.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/T.png
new file mode 100755
index 0000000..63c265c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/T.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/TL.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/TL.png
new file mode 100755
index 0000000..5fbd409
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/TL.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/TR.png b/js/prototype-window-1.3/themes/mac_os_x_dialog/TR.png
new file mode 100755
index 0000000..aff657d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/TR.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/bg.gif b/js/prototype-window-1.3/themes/mac_os_x_dialog/bg.gif
new file mode 100755
index 0000000..cb9b3f3
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/bg.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/close.gif b/js/prototype-window-1.3/themes/mac_os_x_dialog/close.gif
new file mode 100755
index 0000000..31ef5a3
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/close.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/maximize.gif b/js/prototype-window-1.3/themes/mac_os_x_dialog/maximize.gif
new file mode 100755
index 0000000..892a0f0
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/maximize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/mac_os_x_dialog/minimize.gif b/js/prototype-window-1.3/themes/mac_os_x_dialog/minimize.gif
new file mode 100755
index 0000000..a721416
--- /dev/null
+++ b/js/prototype-window-1.3/themes/mac_os_x_dialog/minimize.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio.css b/js/prototype-window-1.3/themes/nuncio.css
new file mode 100755
index 0000000..2c439bd
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio.css
@@ -0,0 +1,164 @@
+.overlay_nuncio img { border: none; }
+
+.overlay_nuncio {
+ background-color: #666666;
+}
+
+.nuncio_nw {
+ width: 12px;
+ height: 28px;
+ background: url(nuncio/top_left.png) no-repeat;
+}
+
+.nuncio_n {
+ background: url(nuncio/top_mid.png) repeat-x;
+ height: 28px;
+}
+
+.nuncio_ne {
+ width: 21px;
+ height: 28px;
+ background: url(nuncio/top_right.png) no-repeat;
+}
+
+.nuncio_e {
+ width: 21px;
+ background: url(nuncio/center_right.png) repeat-y top right;
+}
+
+.nuncio_w {
+ width: 12px;
+ background: url(nuncio/center_left.png) repeat-y top left;
+}
+
+.nuncio_sw {
+ width: 12px;
+ height: 18px;
+ background: url(nuncio/bottom_left.png) no-repeat;
+}
+
+.nuncio_s {
+ background: url(nuncio/bottom_mid.png) repeat-x 0 0;
+ height: 18px;
+}
+
+.nuncio_se, .nuncio_sizer {
+ width: 21px;
+ height: 18px;
+ background: url(nuncio/bottom_right.png) no-repeat;
+}
+
+.nuncio_close {
+ width: 14px;
+ height: 14px;
+ background: url(nuncio/close.png) no-repeat;
+ position:absolute;
+ top:10px;
+ right:22px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.nuncio_minimize {
+ width: 14px;
+ height: 15px;
+ background: url(nuncio/minimize.png) no-repeat;
+ position:absolute;
+ top:10px;
+ right:40px;
+ cursor:pointer;
+ z-index:2000;
+}
+
+.nuncio_title {
+ float:left;
+ font-size:11px;
+ font-weight: bold;
+ font-style: italic;
+ color: #fff;
+ width: 100%
+}
+
+.nuncio_content {
+ background: url(nuncio/overlay.png) repeat;
+ overflow:auto;
+ color: #ddd;
+ font-family: Tahoma, Arial, "sans-serif";
+ font-size: 10px;
+}
+
+.nuncio_sizer {
+ cursor:se-resize;
+}
+
+
+.top_draggable, .bottom_draggable {
+ cursor:move
+}
+/* FOR IE */
+* html .nuncio_nw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_left.png", sizingMethod="crop");
+}
+
+* html .nuncio_n {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_mid.png", sizingMethod="scale");
+}
+
+* html .nuncio_ne {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_right.png", sizingMethod="crop");
+}
+
+* html .nuncio_w {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_left.png", sizingMethod="scale");
+}
+
+* html .nuncio_e {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_right.png", sizingMethod="scale");
+}
+
+* html .nuncio_sw {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_left.png", sizingMethod="crop");
+}
+
+* html .nuncio_s {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_mid.png", sizingMethod="scale");
+}
+
+* html .nuncio_se {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop");
+}
+
+* html .nuncio_sizer {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop");
+}
+
+* html .nuncio_close {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/close.png", sizingMethod="crop");
+}
+
+* html .nuncio_minimize {
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/minimize.png", sizingMethod="crop");
+}
+
diff --git a/js/prototype-window-1.3/themes/nuncio/bottom_left.png b/js/prototype-window-1.3/themes/nuncio/bottom_left.png
new file mode 100755
index 0000000..0b6ad03
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/bottom_left.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/bottom_mid.png b/js/prototype-window-1.3/themes/nuncio/bottom_mid.png
new file mode 100755
index 0000000..2f7f121
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/bottom_mid.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/bottom_right.png b/js/prototype-window-1.3/themes/nuncio/bottom_right.png
new file mode 100755
index 0000000..63834cc
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/bottom_right.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/center_left.png b/js/prototype-window-1.3/themes/nuncio/center_left.png
new file mode 100755
index 0000000..c616a95
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/center_left.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/center_right.png b/js/prototype-window-1.3/themes/nuncio/center_right.png
new file mode 100755
index 0000000..63527b9
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/center_right.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/close.png b/js/prototype-window-1.3/themes/nuncio/close.png
new file mode 100755
index 0000000..591ed3d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/close.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/minimize.png b/js/prototype-window-1.3/themes/nuncio/minimize.png
new file mode 100755
index 0000000..62e15be
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/minimize.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/overlay.png b/js/prototype-window-1.3/themes/nuncio/overlay.png
new file mode 100755
index 0000000..1a133ba
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/overlay.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/top_left.png b/js/prototype-window-1.3/themes/nuncio/top_left.png
new file mode 100755
index 0000000..f002fe1
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/top_left.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/top_mid.png b/js/prototype-window-1.3/themes/nuncio/top_mid.png
new file mode 100755
index 0000000..d07616d
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/top_mid.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/nuncio/top_right.png b/js/prototype-window-1.3/themes/nuncio/top_right.png
new file mode 100755
index 0000000..10513a8
--- /dev/null
+++ b/js/prototype-window-1.3/themes/nuncio/top_right.png
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread.css b/js/prototype-window-1.3/themes/spread.css
new file mode 100755
index 0000000..9bda2a6
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread.css
@@ -0,0 +1,108 @@
+.overlay_spread {
+ background-color: #85BBEF;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+.spread_nw {
+ background: transparent url(spread/left-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.spread_n {
+ background: transparent url(spread/top-middle.gif) repeat-x 0 0;
+ height:25px;
+}
+
+.spread_ne {
+ background: transparent url(spread/right-top.gif) no-repeat 0 0;
+ width:10px;
+ height:25px;
+}
+
+.spread_w {
+ background: transparent url(spread/frame-left.gif) repeat-y top left;
+ width:7px;
+}
+
+.spread_e {
+ background: transparent url(spread/frame-right.gif) repeat-y top right;
+ width:7px;
+}
+
+.spread_sw {
+ background: transparent url(spread/bottom-left-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.spread_s {
+ background: transparent url(spread/bottom-middle.gif) repeat-x 0 0;
+ height:7px;
+}
+
+.spread_se, .spread_sizer {
+ background: transparent url(spread/bottom-right-c.gif) no-repeat 0 0;
+ width:7px;
+ height:7px;
+}
+
+.spread_sizer {
+ cursor:se-resize;
+}
+
+.spread_close {
+ width: 23px;
+ height: 23px;
+ background: transparent url(spread/button-close-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:11px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.spread_minimize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(spread/button-min-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:55px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.spread_maximize {
+ width: 23px;
+ height: 23px;
+ background: transparent url(spread/button-max-focus.gif) no-repeat 0 0;
+ position:absolute;
+ top:0px;
+ right:33px;
+ cursor:pointer;
+ z-index:1000;
+}
+
+.spread_title {
+ float:left;
+ height:14px;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size:14px;
+ font-weight:bold;
+ text-align:left;
+ margin-top:2px;
+ width:100%;
+ color:#E47211;
+}
+
+.spread_content {
+ overflow:auto;
+ color: #222;
+ font-family: Tahoma, Arial, sans-serif;
+ font-size: 10px;
+ background:#A9EA00;
+}
+
diff --git a/js/prototype-window-1.3/themes/spread/.gif b/js/prototype-window-1.3/themes/spread/.gif
new file mode 100755
index 0000000..ff73824
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/bottom-left-c.gif b/js/prototype-window-1.3/themes/spread/bottom-left-c.gif
new file mode 100755
index 0000000..7cdf459
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/bottom-left-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/bottom-middle.gif b/js/prototype-window-1.3/themes/spread/bottom-middle.gif
new file mode 100755
index 0000000..b705091
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/bottom-middle.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/bottom-right-c.gif b/js/prototype-window-1.3/themes/spread/bottom-right-c.gif
new file mode 100755
index 0000000..08c44f9
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/bottom-right-c.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/button-close-focus.gif b/js/prototype-window-1.3/themes/spread/button-close-focus.gif
new file mode 100755
index 0000000..99f635c
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/button-close-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/button-max-focus.gif b/js/prototype-window-1.3/themes/spread/button-max-focus.gif
new file mode 100755
index 0000000..1708a1e
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/button-max-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/button-min-focus.gif b/js/prototype-window-1.3/themes/spread/button-min-focus.gif
new file mode 100755
index 0000000..ff69d1b
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/button-min-focus.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/frame-left.gif b/js/prototype-window-1.3/themes/spread/frame-left.gif
new file mode 100755
index 0000000..ad257d3
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/frame-left.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/frame-right.gif b/js/prototype-window-1.3/themes/spread/frame-right.gif
new file mode 100755
index 0000000..708e5fa
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/frame-right.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/left-top.gif b/js/prototype-window-1.3/themes/spread/left-top.gif
new file mode 100755
index 0000000..23581d1
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/left-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/right-top.gif b/js/prototype-window-1.3/themes/spread/right-top.gif
new file mode 100755
index 0000000..e32d1fb
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/right-top.gif
Binary files differ
diff --git a/js/prototype-window-1.3/themes/spread/top-middle.gif b/js/prototype-window-1.3/themes/spread/top-middle.gif
new file mode 100755
index 0000000..53934d4
--- /dev/null
+++ b/js/prototype-window-1.3/themes/spread/top-middle.gif
Binary files differ